diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/CatalogServiceClient.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/CatalogServiceClient.java index 2c4a1254..9135d6b6 100644 --- a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/CatalogServiceClient.java +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/CatalogServiceClient.java @@ -29,6 +29,7 @@ import com.google.cloud.retail.v2.stub.CatalogServiceStub; import com.google.cloud.retail.v2.stub.CatalogServiceStubSettings; import com.google.common.util.concurrent.MoreExecutors; +import com.google.protobuf.Empty; import com.google.protobuf.FieldMask; import java.io.IOException; import java.util.List; @@ -313,9 +314,7 @@ public final UnaryCallable listCatalo *

If the [Catalog][google.cloud.retail.v2.Catalog] to update does not exist, a NOT_FOUND * error is returned. * @param updateMask Indicates which fields in the provided - * [Catalog][google.cloud.retail.v2.Catalog] to update. If not set, will only update the - * [Catalog.product_level_config][google.cloud.retail.v2.Catalog.product_level_config] field, - * which is also the only currently supported field to update. + * [Catalog][google.cloud.retail.v2.Catalog] to update. *

If an unsupported or unknown field is provided, an INVALID_ARGUMENT error is returned. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -372,6 +371,356 @@ public final UnaryCallable updateCatalogCallable( return stub.updateCatalogCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

+ * + *

This feature is only available for users who have Retail Search enabled. Contact Retail + * Support (retail-search-support{@literal @}google.com) if you are interested in using Retail + * Search. + * + *

Sample code: + * + *

{@code
+   * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
+   *   CatalogName catalog = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]");
+   *   catalogServiceClient.setDefaultBranch(catalog);
+   * }
+   * }
+ * + * @param catalog Full resource name of the catalog, such as + * `projects/*/locations/global/catalogs/default_catalog`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void setDefaultBranch(CatalogName catalog) { + SetDefaultBranchRequest request = + SetDefaultBranchRequest.newBuilder() + .setCatalog(catalog == null ? null : catalog.toString()) + .build(); + setDefaultBranch(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

+ * + *

This feature is only available for users who have Retail Search enabled. Contact Retail + * Support (retail-search-support{@literal @}google.com) if you are interested in using Retail + * Search. + * + *

Sample code: + * + *

{@code
+   * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
+   *   String catalog = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString();
+   *   catalogServiceClient.setDefaultBranch(catalog);
+   * }
+   * }
+ * + * @param catalog Full resource name of the catalog, such as + * `projects/*/locations/global/catalogs/default_catalog`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void setDefaultBranch(String catalog) { + SetDefaultBranchRequest request = + SetDefaultBranchRequest.newBuilder().setCatalog(catalog).build(); + setDefaultBranch(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

+ * + *

This feature is only available for users who have Retail Search enabled. Contact Retail + * Support (retail-search-support{@literal @}google.com) if you are interested in using Retail + * Search. + * + *

Sample code: + * + *

{@code
+   * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
+   *   SetDefaultBranchRequest request =
+   *       SetDefaultBranchRequest.newBuilder()
+   *           .setCatalog(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setBranchId(
+   *               BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString())
+   *           .setNote("note3387378")
+   *           .build();
+   *   catalogServiceClient.setDefaultBranch(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void setDefaultBranch(SetDefaultBranchRequest request) { + setDefaultBranchCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

+ * + *

This feature is only available for users who have Retail Search enabled. Contact Retail + * Support (retail-search-support{@literal @}google.com) if you are interested in using Retail + * Search. + * + *

Sample code: + * + *

{@code
+   * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
+   *   SetDefaultBranchRequest request =
+   *       SetDefaultBranchRequest.newBuilder()
+   *           .setCatalog(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setBranchId(
+   *               BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString())
+   *           .setNote("note3387378")
+   *           .build();
+   *   ApiFuture future = catalogServiceClient.setDefaultBranchCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable setDefaultBranchCallable() { + return stub.setDefaultBranchCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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. Contact Retail + * Support (retail-search-support{@literal @}google.com) if you are interested in using Retail + * Search. + * + *

Sample code: + * + *

{@code
+   * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
+   *   CatalogName catalog = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]");
+   *   GetDefaultBranchResponse response = catalogServiceClient.getDefaultBranch(catalog);
+   * }
+   * }
+ * + * @param catalog The parent catalog resource name, such as + * `projects/*/locations/global/catalogs/default_catalog`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final GetDefaultBranchResponse getDefaultBranch(CatalogName catalog) { + GetDefaultBranchRequest request = + GetDefaultBranchRequest.newBuilder() + .setCatalog(catalog == null ? null : catalog.toString()) + .build(); + return getDefaultBranch(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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. Contact Retail + * Support (retail-search-support{@literal @}google.com) if you are interested in using Retail + * Search. + * + *

Sample code: + * + *

{@code
+   * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
+   *   String catalog = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString();
+   *   GetDefaultBranchResponse response = catalogServiceClient.getDefaultBranch(catalog);
+   * }
+   * }
+ * + * @param catalog The parent catalog resource name, such as + * `projects/*/locations/global/catalogs/default_catalog`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final GetDefaultBranchResponse getDefaultBranch(String catalog) { + GetDefaultBranchRequest request = + GetDefaultBranchRequest.newBuilder().setCatalog(catalog).build(); + return getDefaultBranch(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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. Contact Retail + * Support (retail-search-support{@literal @}google.com) if you are interested in using Retail + * Search. + * + *

Sample code: + * + *

{@code
+   * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
+   *   GetDefaultBranchRequest request =
+   *       GetDefaultBranchRequest.newBuilder()
+   *           .setCatalog(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .build();
+   *   GetDefaultBranchResponse response = catalogServiceClient.getDefaultBranch(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final GetDefaultBranchResponse getDefaultBranch(GetDefaultBranchRequest request) { + return getDefaultBranchCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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. Contact Retail + * Support (retail-search-support{@literal @}google.com) if you are interested in using Retail + * Search. + * + *

Sample code: + * + *

{@code
+   * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
+   *   GetDefaultBranchRequest request =
+   *       GetDefaultBranchRequest.newBuilder()
+   *           .setCatalog(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       catalogServiceClient.getDefaultBranchCallable().futureCall(request);
+   *   // Do something.
+   *   GetDefaultBranchResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + getDefaultBranchCallable() { + return stub.getDefaultBranchCallable(); + } + @Override public final void close() { stub.close(); diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/CatalogServiceSettings.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/CatalogServiceSettings.java index 42b63da8..95e1ec68 100644 --- a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/CatalogServiceSettings.java +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/CatalogServiceSettings.java @@ -30,6 +30,7 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.cloud.retail.v2.stub.CatalogServiceStubSettings; +import com.google.protobuf.Empty; import java.io.IOException; import java.util.List; import javax.annotation.Generated; @@ -80,6 +81,17 @@ public UnaryCallSettings updateCatalogSettings() return ((CatalogServiceStubSettings) getStubSettings()).updateCatalogSettings(); } + /** Returns the object with the settings used for calls to setDefaultBranch. */ + public UnaryCallSettings setDefaultBranchSettings() { + return ((CatalogServiceStubSettings) getStubSettings()).setDefaultBranchSettings(); + } + + /** Returns the object with the settings used for calls to getDefaultBranch. */ + public UnaryCallSettings + getDefaultBranchSettings() { + return ((CatalogServiceStubSettings) getStubSettings()).getDefaultBranchSettings(); + } + public static final CatalogServiceSettings create(CatalogServiceStubSettings stub) throws IOException { return new CatalogServiceSettings.Builder(stub.toBuilder()).build(); @@ -190,6 +202,17 @@ public UnaryCallSettings.Builder updateCatalogSet return getStubSettingsBuilder().updateCatalogSettings(); } + /** Returns the builder for the settings used for calls to setDefaultBranch. */ + public UnaryCallSettings.Builder setDefaultBranchSettings() { + return getStubSettingsBuilder().setDefaultBranchSettings(); + } + + /** Returns the builder for the settings used for calls to getDefaultBranch. */ + public UnaryCallSettings.Builder + getDefaultBranchSettings() { + return getStubSettingsBuilder().getDefaultBranchSettings(); + } + @Override public CatalogServiceSettings build() throws IOException { return new CatalogServiceSettings(this); diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/CompletionServiceClient.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/CompletionServiceClient.java new file mode 100644 index 00000000..dc9ba687 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/CompletionServiceClient.java @@ -0,0 +1,365 @@ +/* + * 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 + * + * 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. + */ + +package com.google.cloud.retail.v2; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.retail.v2.stub.CompletionServiceStub; +import com.google.cloud.retail.v2.stub.CompletionServiceStubSettings; +import com.google.longrunning.Operation; +import com.google.longrunning.OperationsClient; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Auto-completion service for retail. + * + *

This feature is only available for users who have Retail Search enabled. Contact Retail + * Support (retail-search-support{@literal @}google.com) if you are interested in using Retail + * Search. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

{@code
+ * try (CompletionServiceClient completionServiceClient = CompletionServiceClient.create()) {
+ *   CompleteQueryRequest request =
+ *       CompleteQueryRequest.newBuilder()
+ *           .setCatalog(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+ *           .setQuery("query107944136")
+ *           .setVisitorId("visitorId1880545833")
+ *           .addAllLanguageCodes(new ArrayList())
+ *           .setDeviceType("deviceType781190832")
+ *           .setDataset("dataset1443214456")
+ *           .setMaxSuggestions(618824852)
+ *           .build();
+ *   CompleteQueryResponse response = completionServiceClient.completeQuery(request);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the CompletionServiceClient object to clean up resources + * such as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of CompletionServiceSettings to + * create(). For example: + * + *

To customize credentials: + * + *

{@code
+ * CompletionServiceSettings completionServiceSettings =
+ *     CompletionServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * CompletionServiceClient completionServiceClient =
+ *     CompletionServiceClient.create(completionServiceSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * CompletionServiceSettings completionServiceSettings =
+ *     CompletionServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * CompletionServiceClient completionServiceClient =
+ *     CompletionServiceClient.create(completionServiceSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class CompletionServiceClient implements BackgroundResource { + private final CompletionServiceSettings settings; + private final CompletionServiceStub stub; + private final OperationsClient operationsClient; + + /** Constructs an instance of CompletionServiceClient with default settings. */ + public static final CompletionServiceClient create() throws IOException { + return create(CompletionServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of CompletionServiceClient, using the given settings. The channels are + * created based on the settings passed in, or defaults for any settings that are not set. + */ + public static final CompletionServiceClient create(CompletionServiceSettings settings) + throws IOException { + return new CompletionServiceClient(settings); + } + + /** + * Constructs an instance of CompletionServiceClient, using the given stub for making calls. This + * is for advanced usage - prefer using create(CompletionServiceSettings). + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final CompletionServiceClient create(CompletionServiceStub stub) { + return new CompletionServiceClient(stub); + } + + /** + * Constructs an instance of CompletionServiceClient, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected CompletionServiceClient(CompletionServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((CompletionServiceStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected CompletionServiceClient(CompletionServiceStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final CompletionServiceSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public CompletionServiceStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final OperationsClient getOperationsClient() { + return operationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Completes the specified prefix with keyword suggestions. + * + *

This feature is only available for users who have Retail Search enabled. Contact Retail + * Support (retail-search-support{@literal @}google.com) if you are interested in using Retail + * Search. + * + *

Sample code: + * + *

{@code
+   * try (CompletionServiceClient completionServiceClient = CompletionServiceClient.create()) {
+   *   CompleteQueryRequest request =
+   *       CompleteQueryRequest.newBuilder()
+   *           .setCatalog(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setQuery("query107944136")
+   *           .setVisitorId("visitorId1880545833")
+   *           .addAllLanguageCodes(new ArrayList())
+   *           .setDeviceType("deviceType781190832")
+   *           .setDataset("dataset1443214456")
+   *           .setMaxSuggestions(618824852)
+   *           .build();
+   *   CompleteQueryResponse response = completionServiceClient.completeQuery(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final CompleteQueryResponse completeQuery(CompleteQueryRequest request) { + return completeQueryCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Completes the specified prefix with keyword suggestions. + * + *

This feature is only available for users who have Retail Search enabled. Contact Retail + * Support (retail-search-support{@literal @}google.com) if you are interested in using Retail + * Search. + * + *

Sample code: + * + *

{@code
+   * try (CompletionServiceClient completionServiceClient = CompletionServiceClient.create()) {
+   *   CompleteQueryRequest request =
+   *       CompleteQueryRequest.newBuilder()
+   *           .setCatalog(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setQuery("query107944136")
+   *           .setVisitorId("visitorId1880545833")
+   *           .addAllLanguageCodes(new ArrayList())
+   *           .setDeviceType("deviceType781190832")
+   *           .setDataset("dataset1443214456")
+   *           .setMaxSuggestions(618824852)
+   *           .build();
+   *   ApiFuture future =
+   *       completionServiceClient.completeQueryCallable().futureCall(request);
+   *   // Do something.
+   *   CompleteQueryResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable completeQueryCallable() { + return stub.completeQueryCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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. Contact Retail + * Support (retail-search-support{@literal @}google.com) if you are interested in using Retail + * Search. + * + *

Sample code: + * + *

{@code
+   * try (CompletionServiceClient completionServiceClient = CompletionServiceClient.create()) {
+   *   ImportCompletionDataRequest request =
+   *       ImportCompletionDataRequest.newBuilder()
+   *           .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setInputConfig(CompletionDataInputConfig.newBuilder().build())
+   *           .setNotificationPubsubTopic("notificationPubsubTopic-1361224991")
+   *           .build();
+   *   ImportCompletionDataResponse response =
+   *       completionServiceClient.importCompletionDataAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + importCompletionDataAsync(ImportCompletionDataRequest request) { + return importCompletionDataOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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. Contact Retail + * Support (retail-search-support{@literal @}google.com) if you are interested in using Retail + * Search. + * + *

Sample code: + * + *

{@code
+   * try (CompletionServiceClient completionServiceClient = CompletionServiceClient.create()) {
+   *   ImportCompletionDataRequest request =
+   *       ImportCompletionDataRequest.newBuilder()
+   *           .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setInputConfig(CompletionDataInputConfig.newBuilder().build())
+   *           .setNotificationPubsubTopic("notificationPubsubTopic-1361224991")
+   *           .build();
+   *   OperationFuture future =
+   *       completionServiceClient.importCompletionDataOperationCallable().futureCall(request);
+   *   // Do something.
+   *   ImportCompletionDataResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + ImportCompletionDataRequest, ImportCompletionDataResponse, ImportMetadata> + importCompletionDataOperationCallable() { + return stub.importCompletionDataOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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. Contact Retail + * Support (retail-search-support{@literal @}google.com) if you are interested in using Retail + * Search. + * + *

Sample code: + * + *

{@code
+   * try (CompletionServiceClient completionServiceClient = CompletionServiceClient.create()) {
+   *   ImportCompletionDataRequest request =
+   *       ImportCompletionDataRequest.newBuilder()
+   *           .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setInputConfig(CompletionDataInputConfig.newBuilder().build())
+   *           .setNotificationPubsubTopic("notificationPubsubTopic-1361224991")
+   *           .build();
+   *   ApiFuture future =
+   *       completionServiceClient.importCompletionDataCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + importCompletionDataCallable() { + return stub.importCompletionDataCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/CompletionServiceSettings.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/CompletionServiceSettings.java new file mode 100644 index 00000000..97e40bed --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/CompletionServiceSettings.java @@ -0,0 +1,211 @@ +/* + * 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 + * + * 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. + */ + +package com.google.cloud.retail.v2; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.retail.v2.stub.CompletionServiceStubSettings; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link CompletionServiceClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (retail.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of completeQuery to 30 seconds: + * + *

{@code
+ * CompletionServiceSettings.Builder completionServiceSettingsBuilder =
+ *     CompletionServiceSettings.newBuilder();
+ * completionServiceSettingsBuilder
+ *     .completeQuerySettings()
+ *     .setRetrySettings(
+ *         completionServiceSettingsBuilder
+ *             .completeQuerySettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * CompletionServiceSettings completionServiceSettings = completionServiceSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class CompletionServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to completeQuery. */ + public UnaryCallSettings completeQuerySettings() { + return ((CompletionServiceStubSettings) getStubSettings()).completeQuerySettings(); + } + + /** Returns the object with the settings used for calls to importCompletionData. */ + public UnaryCallSettings importCompletionDataSettings() { + return ((CompletionServiceStubSettings) getStubSettings()).importCompletionDataSettings(); + } + + /** Returns the object with the settings used for calls to importCompletionData. */ + public OperationCallSettings< + ImportCompletionDataRequest, ImportCompletionDataResponse, ImportMetadata> + importCompletionDataOperationSettings() { + return ((CompletionServiceStubSettings) getStubSettings()) + .importCompletionDataOperationSettings(); + } + + public static final CompletionServiceSettings create(CompletionServiceStubSettings stub) + throws IOException { + return new CompletionServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return CompletionServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return CompletionServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return CompletionServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return CompletionServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return CompletionServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return CompletionServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return CompletionServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected CompletionServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for CompletionServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(CompletionServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(CompletionServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(CompletionServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(CompletionServiceStubSettings.newBuilder()); + } + + public CompletionServiceStubSettings.Builder getStubSettingsBuilder() { + return ((CompletionServiceStubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception'. + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to completeQuery. */ + public UnaryCallSettings.Builder + completeQuerySettings() { + return getStubSettingsBuilder().completeQuerySettings(); + } + + /** Returns the builder for the settings used for calls to importCompletionData. */ + public UnaryCallSettings.Builder + importCompletionDataSettings() { + return getStubSettingsBuilder().importCompletionDataSettings(); + } + + /** Returns the builder for the settings used for calls to importCompletionData. */ + public OperationCallSettings.Builder< + ImportCompletionDataRequest, ImportCompletionDataResponse, ImportMetadata> + importCompletionDataOperationSettings() { + return getStubSettingsBuilder().importCompletionDataOperationSettings(); + } + + @Override + public CompletionServiceSettings build() throws IOException { + return new CompletionServiceSettings(this); + } + } +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/ProductServiceClient.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/ProductServiceClient.java index 6d05330e..707c6dd4 100644 --- a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/ProductServiceClient.java +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/ProductServiceClient.java @@ -16,18 +16,27 @@ package com.google.cloud.retail.v2; +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.retail.v2.stub.ProductServiceStub; import com.google.cloud.retail.v2.stub.ProductServiceStubSettings; +import com.google.common.util.concurrent.MoreExecutors; import com.google.longrunning.Operation; import com.google.longrunning.OperationsClient; import com.google.protobuf.Empty; import com.google.protobuf.FieldMask; import java.io.IOException; +import java.util.List; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -398,6 +407,162 @@ public final UnaryCallable getProductCallable() { return stub.getProductCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a list of [Product][google.cloud.retail.v2.Product]s. + * + *

Sample code: + * + *

{@code
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   BranchName parent = BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]");
+   *   for (Product element : productServiceClient.listProducts(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent branch resource name, such as + * `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use `default_branch` + * as the branch ID, to list products under the default branch. + *

If the caller does not have permission to list + * [Product][google.cloud.retail.v2.Product]s under this branch, regardless of whether or not + * this branch exists, a PERMISSION_DENIED error is returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListProductsPagedResponse listProducts(BranchName parent) { + ListProductsRequest request = + ListProductsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listProducts(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a list of [Product][google.cloud.retail.v2.Product]s. + * + *

Sample code: + * + *

{@code
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   String parent = BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString();
+   *   for (Product element : productServiceClient.listProducts(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent branch resource name, such as + * `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use `default_branch` + * as the branch ID, to list products under the default branch. + *

If the caller does not have permission to list + * [Product][google.cloud.retail.v2.Product]s under this branch, regardless of whether or not + * this branch exists, a PERMISSION_DENIED error is returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListProductsPagedResponse listProducts(String parent) { + ListProductsRequest request = ListProductsRequest.newBuilder().setParent(parent).build(); + return listProducts(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a list of [Product][google.cloud.retail.v2.Product]s. + * + *

Sample code: + * + *

{@code
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   ListProductsRequest request =
+   *       ListProductsRequest.newBuilder()
+   *           .setParent(
+   *               BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setReadMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   for (Product element : productServiceClient.listProducts(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListProductsPagedResponse listProducts(ListProductsRequest request) { + return listProductsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a list of [Product][google.cloud.retail.v2.Product]s. + * + *

Sample code: + * + *

{@code
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   ListProductsRequest request =
+   *       ListProductsRequest.newBuilder()
+   *           .setParent(
+   *               BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setReadMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       productServiceClient.listProductsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Product element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listProductsPagedCallable() { + return stub.listProductsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a list of [Product][google.cloud.retail.v2.Product]s. + * + *

Sample code: + * + *

{@code
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   ListProductsRequest request =
+   *       ListProductsRequest.newBuilder()
+   *           .setParent(
+   *               BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setReadMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   while (true) {
+   *     ListProductsResponse response = productServiceClient.listProductsCallable().call(request);
+   *     for (Product element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listProductsCallable() { + return stub.listProductsCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates a [Product][google.cloud.retail.v2.Product]. @@ -416,8 +581,9 @@ public final UnaryCallable getProductCallable() { *

If the caller does not have permission to update the * [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a * PERMISSION_DENIED error is returned. - *

If the [Product][google.cloud.retail.v2.Product] to update does not exist, a NOT_FOUND - * error is returned. + *

If the [Product][google.cloud.retail.v2.Product] to update does not exist and + * [allow_missing][google.cloud.retail.v2.UpdateProductRequest.allow_missing] is not set, a + * NOT_FOUND error is returned. * @param updateMask Indicates which fields in the provided * [Product][google.cloud.retail.v2.Product] to update. The immutable and output only fields * are NOT supported. If not set, all supported fields (the fields that are neither immutable @@ -443,6 +609,7 @@ public final Product updateProduct(Product product, FieldMask updateMask) { * UpdateProductRequest.newBuilder() * .setProduct(Product.newBuilder().build()) * .setUpdateMask(FieldMask.newBuilder().build()) + * .setAllowMissing(true) * .build(); * Product response = productServiceClient.updateProduct(request); * } @@ -467,6 +634,7 @@ public final Product updateProduct(UpdateProductRequest request) { * UpdateProductRequest.newBuilder() * .setProduct(Product.newBuilder().build()) * .setUpdateMask(FieldMask.newBuilder().build()) + * .setAllowMissing(true) * .build(); * ApiFuture future = productServiceClient.updateProductCallable().futureCall(request); * // Do something. @@ -499,6 +667,15 @@ public final UnaryCallable updateProductCallable( * PERMISSION_DENIED error is returned. *

If the [Product][google.cloud.retail.v2.Product] to delete does not exist, a NOT_FOUND * error is returned. + *

The [Product][google.cloud.retail.v2.Product] to delete can neither be a + * [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION] + * [Product][google.cloud.retail.v2.Product] member nor a + * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] + * [Product][google.cloud.retail.v2.Product] with more than one + * [variants][google.cloud.retail.v2.Product.Type.VARIANT]. Otherwise, an INVALID_ARGUMENT + * error is returned. + *

All inventory information for the named [Product][google.cloud.retail.v2.Product] will + * be deleted. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final void deleteProduct(ProductName name) { @@ -529,6 +706,15 @@ public final void deleteProduct(ProductName name) { * PERMISSION_DENIED error is returned. *

If the [Product][google.cloud.retail.v2.Product] to delete does not exist, a NOT_FOUND * error is returned. + *

The [Product][google.cloud.retail.v2.Product] to delete can neither be a + * [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION] + * [Product][google.cloud.retail.v2.Product] member nor a + * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] + * [Product][google.cloud.retail.v2.Product] with more than one + * [variants][google.cloud.retail.v2.Product.Type.VARIANT]. Otherwise, an INVALID_ARGUMENT + * error is returned. + *

All inventory information for the named [Product][google.cloud.retail.v2.Product] will + * be deleted. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final void deleteProduct(String name) { @@ -601,10 +787,13 @@ public final UnaryCallable deleteProductCallable() * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { * ImportProductsRequest request = * ImportProductsRequest.newBuilder() - * .setParent("parent-995424086") + * .setParent( + * BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString()) + * .setRequestId("requestId693933066") * .setInputConfig(ProductInputConfig.newBuilder().build()) * .setErrorsConfig(ImportErrorsConfig.newBuilder().build()) * .setUpdateMask(FieldMask.newBuilder().build()) + * .setNotificationPubsubTopic("notificationPubsubTopic-1361224991") * .build(); * ImportProductsResponse response = productServiceClient.importProductsAsync(request).get(); * } @@ -634,10 +823,13 @@ public final OperationFuture importProdu * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { * ImportProductsRequest request = * ImportProductsRequest.newBuilder() - * .setParent("parent-995424086") + * .setParent( + * BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString()) + * .setRequestId("requestId693933066") * .setInputConfig(ProductInputConfig.newBuilder().build()) * .setErrorsConfig(ImportErrorsConfig.newBuilder().build()) * .setUpdateMask(FieldMask.newBuilder().build()) + * .setNotificationPubsubTopic("notificationPubsubTopic-1361224991") * .build(); * OperationFuture future = * productServiceClient.importProductsOperationCallable().futureCall(request); @@ -667,10 +859,13 @@ public final OperationFuture importProdu * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { * ImportProductsRequest request = * ImportProductsRequest.newBuilder() - * .setParent("parent-995424086") + * .setParent( + * BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString()) + * .setRequestId("requestId693933066") * .setInputConfig(ProductInputConfig.newBuilder().build()) * .setErrorsConfig(ImportErrorsConfig.newBuilder().build()) * .setUpdateMask(FieldMask.newBuilder().build()) + * .setNotificationPubsubTopic("notificationPubsubTopic-1361224991") * .build(); * ApiFuture future = * productServiceClient.importProductsCallable().futureCall(request); @@ -683,6 +878,723 @@ public final UnaryCallable importProductsCalla return stub.importProductsCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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. Contact Retail + * Support (retail-search-support{@literal @}google.com) if you are interested in using Retail + * Search. + * + *

Sample code: + * + *

{@code
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   Product inventory = Product.newBuilder().build();
+   *   FieldMask setMask = FieldMask.newBuilder().build();
+   *   SetInventoryResponse response =
+   *       productServiceClient.setInventoryAsync(inventory, setMask).get();
+   * }
+   * }
+ * + * @param inventory Required. The inventory information to update. The allowable fields to update + * are: + *
    + *
  • [Product.price_info][google.cloud.retail.v2.Product.price_info] + *
  • [Product.availability][google.cloud.retail.v2.Product.availability] + *
  • [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity] + *
  • [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info] The + * updated inventory fields must be specified in + * [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask]. + *
+ *

If [SetInventoryRequest.inventory.name][] is empty or invalid, an INVALID_ARGUMENT error + * is returned. + *

If the caller does not have permission to update the + * [Product][google.cloud.retail.v2.Product] named in + * [Product.name][google.cloud.retail.v2.Product.name], regardless of whether or not it + * exists, a PERMISSION_DENIED error is returned. + *

If the [Product][google.cloud.retail.v2.Product] to update does not have existing + * inventory information, the provided inventory information will be inserted. + *

If the [Product][google.cloud.retail.v2.Product] to update has existing inventory + * information, the provided inventory information will be merged 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 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] + *
  • [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity] + *
  • [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info] + *
+ *

If a full overwrite of inventory information while ignoring timestamps is needed, + * [UpdateProduct][] should be invoked instead. + * @param setMask 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. + *

If an unsupported or unknown field is provided, an INVALID_ARGUMENT error is returned + * and the entire update will be ignored. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture setInventoryAsync( + Product inventory, FieldMask setMask) { + SetInventoryRequest request = + SetInventoryRequest.newBuilder().setInventory(inventory).setSetMask(setMask).build(); + return setInventoryAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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. Contact Retail + * Support (retail-search-support{@literal @}google.com) if you are interested in using Retail + * Search. + * + *

Sample code: + * + *

{@code
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   SetInventoryRequest request =
+   *       SetInventoryRequest.newBuilder()
+   *           .setInventory(Product.newBuilder().build())
+   *           .setSetMask(FieldMask.newBuilder().build())
+   *           .setSetTime(Timestamp.newBuilder().build())
+   *           .setAllowMissing(true)
+   *           .build();
+   *   SetInventoryResponse response = productServiceClient.setInventoryAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture setInventoryAsync( + SetInventoryRequest request) { + return setInventoryOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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. Contact Retail + * Support (retail-search-support{@literal @}google.com) if you are interested in using Retail + * Search. + * + *

Sample code: + * + *

{@code
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   SetInventoryRequest request =
+   *       SetInventoryRequest.newBuilder()
+   *           .setInventory(Product.newBuilder().build())
+   *           .setSetMask(FieldMask.newBuilder().build())
+   *           .setSetTime(Timestamp.newBuilder().build())
+   *           .setAllowMissing(true)
+   *           .build();
+   *   OperationFuture future =
+   *       productServiceClient.setInventoryOperationCallable().futureCall(request);
+   *   // Do something.
+   *   SetInventoryResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + setInventoryOperationCallable() { + return stub.setInventoryOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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. Contact Retail + * Support (retail-search-support{@literal @}google.com) if you are interested in using Retail + * Search. + * + *

Sample code: + * + *

{@code
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   SetInventoryRequest request =
+   *       SetInventoryRequest.newBuilder()
+   *           .setInventory(Product.newBuilder().build())
+   *           .setSetMask(FieldMask.newBuilder().build())
+   *           .setSetTime(Timestamp.newBuilder().build())
+   *           .setAllowMissing(true)
+   *           .build();
+   *   ApiFuture future = productServiceClient.setInventoryCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable setInventoryCallable() { + return stub.setInventoryCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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. Contact Retail + * Support (retail-search-support{@literal @}google.com) if you are interested in using Retail + * Search. + * + *

Sample code: + * + *

{@code
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   ProductName product =
+   *       ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]");
+   *   AddFulfillmentPlacesResponse response =
+   *       productServiceClient.addFulfillmentPlacesAsync(product).get();
+   * }
+   * }
+ * + * @param product 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. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + addFulfillmentPlacesAsync(ProductName product) { + AddFulfillmentPlacesRequest request = + AddFulfillmentPlacesRequest.newBuilder() + .setProduct(product == null ? null : product.toString()) + .build(); + return addFulfillmentPlacesAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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. Contact Retail + * Support (retail-search-support{@literal @}google.com) if you are interested in using Retail + * Search. + * + *

Sample code: + * + *

{@code
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   String product =
+   *       ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+   *           .toString();
+   *   AddFulfillmentPlacesResponse response =
+   *       productServiceClient.addFulfillmentPlacesAsync(product).get();
+   * }
+   * }
+ * + * @param product 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. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + addFulfillmentPlacesAsync(String product) { + AddFulfillmentPlacesRequest request = + AddFulfillmentPlacesRequest.newBuilder().setProduct(product).build(); + return addFulfillmentPlacesAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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. Contact Retail + * Support (retail-search-support{@literal @}google.com) if you are interested in using Retail + * Search. + * + *

Sample code: + * + *

{@code
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   AddFulfillmentPlacesRequest request =
+   *       AddFulfillmentPlacesRequest.newBuilder()
+   *           .setProduct(
+   *               ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+   *                   .toString())
+   *           .setType("type3575610")
+   *           .addAllPlaceIds(new ArrayList())
+   *           .setAddTime(Timestamp.newBuilder().build())
+   *           .setAllowMissing(true)
+   *           .build();
+   *   AddFulfillmentPlacesResponse response =
+   *       productServiceClient.addFulfillmentPlacesAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + addFulfillmentPlacesAsync(AddFulfillmentPlacesRequest request) { + return addFulfillmentPlacesOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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. Contact Retail + * Support (retail-search-support{@literal @}google.com) if you are interested in using Retail + * Search. + * + *

Sample code: + * + *

{@code
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   AddFulfillmentPlacesRequest request =
+   *       AddFulfillmentPlacesRequest.newBuilder()
+   *           .setProduct(
+   *               ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+   *                   .toString())
+   *           .setType("type3575610")
+   *           .addAllPlaceIds(new ArrayList())
+   *           .setAddTime(Timestamp.newBuilder().build())
+   *           .setAllowMissing(true)
+   *           .build();
+   *   OperationFuture future =
+   *       productServiceClient.addFulfillmentPlacesOperationCallable().futureCall(request);
+   *   // Do something.
+   *   AddFulfillmentPlacesResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + AddFulfillmentPlacesRequest, AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> + addFulfillmentPlacesOperationCallable() { + return stub.addFulfillmentPlacesOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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. Contact Retail + * Support (retail-search-support{@literal @}google.com) if you are interested in using Retail + * Search. + * + *

Sample code: + * + *

{@code
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   AddFulfillmentPlacesRequest request =
+   *       AddFulfillmentPlacesRequest.newBuilder()
+   *           .setProduct(
+   *               ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+   *                   .toString())
+   *           .setType("type3575610")
+   *           .addAllPlaceIds(new ArrayList())
+   *           .setAddTime(Timestamp.newBuilder().build())
+   *           .setAllowMissing(true)
+   *           .build();
+   *   ApiFuture future =
+   *       productServiceClient.addFulfillmentPlacesCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + addFulfillmentPlacesCallable() { + return stub.addFulfillmentPlacesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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. Contact Retail + * Support (retail-search-support{@literal @}google.com) if you are interested in using Retail + * Search. + * + *

Sample code: + * + *

{@code
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   ProductName product =
+   *       ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]");
+   *   RemoveFulfillmentPlacesResponse response =
+   *       productServiceClient.removeFulfillmentPlacesAsync(product).get();
+   * }
+   * }
+ * + * @param product 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. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + removeFulfillmentPlacesAsync(ProductName product) { + RemoveFulfillmentPlacesRequest request = + RemoveFulfillmentPlacesRequest.newBuilder() + .setProduct(product == null ? null : product.toString()) + .build(); + return removeFulfillmentPlacesAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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. Contact Retail + * Support (retail-search-support{@literal @}google.com) if you are interested in using Retail + * Search. + * + *

Sample code: + * + *

{@code
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   String product =
+   *       ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+   *           .toString();
+   *   RemoveFulfillmentPlacesResponse response =
+   *       productServiceClient.removeFulfillmentPlacesAsync(product).get();
+   * }
+   * }
+ * + * @param product 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. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + removeFulfillmentPlacesAsync(String product) { + RemoveFulfillmentPlacesRequest request = + RemoveFulfillmentPlacesRequest.newBuilder().setProduct(product).build(); + return removeFulfillmentPlacesAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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. Contact Retail + * Support (retail-search-support{@literal @}google.com) if you are interested in using Retail + * Search. + * + *

Sample code: + * + *

{@code
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   RemoveFulfillmentPlacesRequest request =
+   *       RemoveFulfillmentPlacesRequest.newBuilder()
+   *           .setProduct(
+   *               ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+   *                   .toString())
+   *           .setType("type3575610")
+   *           .addAllPlaceIds(new ArrayList())
+   *           .setRemoveTime(Timestamp.newBuilder().build())
+   *           .setAllowMissing(true)
+   *           .build();
+   *   RemoveFulfillmentPlacesResponse response =
+   *       productServiceClient.removeFulfillmentPlacesAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + removeFulfillmentPlacesAsync(RemoveFulfillmentPlacesRequest request) { + return removeFulfillmentPlacesOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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. Contact Retail + * Support (retail-search-support{@literal @}google.com) if you are interested in using Retail + * Search. + * + *

Sample code: + * + *

{@code
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   RemoveFulfillmentPlacesRequest request =
+   *       RemoveFulfillmentPlacesRequest.newBuilder()
+   *           .setProduct(
+   *               ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+   *                   .toString())
+   *           .setType("type3575610")
+   *           .addAllPlaceIds(new ArrayList())
+   *           .setRemoveTime(Timestamp.newBuilder().build())
+   *           .setAllowMissing(true)
+   *           .build();
+   *   OperationFuture future =
+   *       productServiceClient.removeFulfillmentPlacesOperationCallable().futureCall(request);
+   *   // Do something.
+   *   RemoveFulfillmentPlacesResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + RemoveFulfillmentPlacesRequest, + RemoveFulfillmentPlacesResponse, + RemoveFulfillmentPlacesMetadata> + removeFulfillmentPlacesOperationCallable() { + return stub.removeFulfillmentPlacesOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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. Contact Retail + * Support (retail-search-support{@literal @}google.com) if you are interested in using Retail + * Search. + * + *

Sample code: + * + *

{@code
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   RemoveFulfillmentPlacesRequest request =
+   *       RemoveFulfillmentPlacesRequest.newBuilder()
+   *           .setProduct(
+   *               ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+   *                   .toString())
+   *           .setType("type3575610")
+   *           .addAllPlaceIds(new ArrayList())
+   *           .setRemoveTime(Timestamp.newBuilder().build())
+   *           .setAllowMissing(true)
+   *           .build();
+   *   ApiFuture future =
+   *       productServiceClient.removeFulfillmentPlacesCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + removeFulfillmentPlacesCallable() { + return stub.removeFulfillmentPlacesCallable(); + } + @Override public final void close() { stub.close(); @@ -712,4 +1624,84 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return stub.awaitTermination(duration, unit); } + + public static class ListProductsPagedResponse + extends AbstractPagedListResponse< + ListProductsRequest, + ListProductsResponse, + Product, + ListProductsPage, + ListProductsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListProductsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListProductsPagedResponse apply(ListProductsPage input) { + return new ListProductsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListProductsPagedResponse(ListProductsPage page) { + super(page, ListProductsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListProductsPage + extends AbstractPage { + + private ListProductsPage( + PageContext context, + ListProductsResponse response) { + super(context, response); + } + + private static ListProductsPage createEmptyPage() { + return new ListProductsPage(null, null); + } + + @Override + protected ListProductsPage createPage( + PageContext context, + ListProductsResponse response) { + return new ListProductsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListProductsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListProductsRequest, + ListProductsResponse, + Product, + ListProductsPage, + ListProductsFixedSizeCollection> { + + private ListProductsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListProductsFixedSizeCollection createEmptyCollection() { + return new ListProductsFixedSizeCollection(null, 0); + } + + @Override + protected ListProductsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListProductsFixedSizeCollection(pages, collectionSize); + } + } } diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/ProductServiceSettings.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/ProductServiceSettings.java index 1d98f3cf..08d591e5 100644 --- a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/ProductServiceSettings.java +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/ProductServiceSettings.java @@ -16,6 +16,8 @@ package com.google.cloud.retail.v2; +import static com.google.cloud.retail.v2.ProductServiceClient.ListProductsPagedResponse; + import com.google.api.core.ApiFunction; import com.google.api.core.BetaApi; import com.google.api.gax.core.GoogleCredentialsProvider; @@ -25,6 +27,7 @@ import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.cloud.retail.v2.stub.ProductServiceStubSettings; @@ -79,6 +82,12 @@ public UnaryCallSettings getProductSettings() { return ((ProductServiceStubSettings) getStubSettings()).getProductSettings(); } + /** Returns the object with the settings used for calls to listProducts. */ + public PagedCallSettings + listProductsSettings() { + return ((ProductServiceStubSettings) getStubSettings()).listProductsSettings(); + } + /** Returns the object with the settings used for calls to updateProduct. */ public UnaryCallSettings updateProductSettings() { return ((ProductServiceStubSettings) getStubSettings()).updateProductSettings(); @@ -100,6 +109,45 @@ public UnaryCallSettings importProductsSetting return ((ProductServiceStubSettings) getStubSettings()).importProductsOperationSettings(); } + /** Returns the object with the settings used for calls to setInventory. */ + public UnaryCallSettings setInventorySettings() { + return ((ProductServiceStubSettings) getStubSettings()).setInventorySettings(); + } + + /** Returns the object with the settings used for calls to setInventory. */ + public OperationCallSettings + setInventoryOperationSettings() { + return ((ProductServiceStubSettings) getStubSettings()).setInventoryOperationSettings(); + } + + /** Returns the object with the settings used for calls to addFulfillmentPlaces. */ + public UnaryCallSettings addFulfillmentPlacesSettings() { + return ((ProductServiceStubSettings) getStubSettings()).addFulfillmentPlacesSettings(); + } + + /** Returns the object with the settings used for calls to addFulfillmentPlaces. */ + public OperationCallSettings< + AddFulfillmentPlacesRequest, AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> + addFulfillmentPlacesOperationSettings() { + return ((ProductServiceStubSettings) getStubSettings()).addFulfillmentPlacesOperationSettings(); + } + + /** Returns the object with the settings used for calls to removeFulfillmentPlaces. */ + public UnaryCallSettings + removeFulfillmentPlacesSettings() { + return ((ProductServiceStubSettings) getStubSettings()).removeFulfillmentPlacesSettings(); + } + + /** Returns the object with the settings used for calls to removeFulfillmentPlaces. */ + public OperationCallSettings< + RemoveFulfillmentPlacesRequest, + RemoveFulfillmentPlacesResponse, + RemoveFulfillmentPlacesMetadata> + removeFulfillmentPlacesOperationSettings() { + return ((ProductServiceStubSettings) getStubSettings()) + .removeFulfillmentPlacesOperationSettings(); + } + public static final ProductServiceSettings create(ProductServiceStubSettings stub) throws IOException { return new ProductServiceSettings.Builder(stub.toBuilder()).build(); @@ -208,6 +256,13 @@ public UnaryCallSettings.Builder getProductSettings( return getStubSettingsBuilder().getProductSettings(); } + /** Returns the builder for the settings used for calls to listProducts. */ + public PagedCallSettings.Builder< + ListProductsRequest, ListProductsResponse, ListProductsPagedResponse> + listProductsSettings() { + return getStubSettingsBuilder().listProductsSettings(); + } + /** Returns the builder for the settings used for calls to updateProduct. */ public UnaryCallSettings.Builder updateProductSettings() { return getStubSettingsBuilder().updateProductSettings(); @@ -230,6 +285,46 @@ public UnaryCallSettings.Builder importProduct return getStubSettingsBuilder().importProductsOperationSettings(); } + /** Returns the builder for the settings used for calls to setInventory. */ + public UnaryCallSettings.Builder setInventorySettings() { + return getStubSettingsBuilder().setInventorySettings(); + } + + /** Returns the builder for the settings used for calls to setInventory. */ + public OperationCallSettings.Builder< + SetInventoryRequest, SetInventoryResponse, SetInventoryMetadata> + setInventoryOperationSettings() { + return getStubSettingsBuilder().setInventoryOperationSettings(); + } + + /** Returns the builder for the settings used for calls to addFulfillmentPlaces. */ + public UnaryCallSettings.Builder + addFulfillmentPlacesSettings() { + return getStubSettingsBuilder().addFulfillmentPlacesSettings(); + } + + /** Returns the builder for the settings used for calls to addFulfillmentPlaces. */ + public OperationCallSettings.Builder< + AddFulfillmentPlacesRequest, AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> + addFulfillmentPlacesOperationSettings() { + return getStubSettingsBuilder().addFulfillmentPlacesOperationSettings(); + } + + /** Returns the builder for the settings used for calls to removeFulfillmentPlaces. */ + public UnaryCallSettings.Builder + removeFulfillmentPlacesSettings() { + return getStubSettingsBuilder().removeFulfillmentPlacesSettings(); + } + + /** Returns the builder for the settings used for calls to removeFulfillmentPlaces. */ + public OperationCallSettings.Builder< + RemoveFulfillmentPlacesRequest, + RemoveFulfillmentPlacesResponse, + RemoveFulfillmentPlacesMetadata> + removeFulfillmentPlacesOperationSettings() { + return getStubSettingsBuilder().removeFulfillmentPlacesOperationSettings(); + } + @Override public ProductServiceSettings build() throws IOException { return new ProductServiceSettings(this); diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/SearchServiceClient.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/SearchServiceClient.java new file mode 100644 index 00000000..d01d5838 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/SearchServiceClient.java @@ -0,0 +1,429 @@ +/* + * 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 + * + * 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. + */ + +package com.google.cloud.retail.v2; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.retail.v2.stub.SearchServiceStub; +import com.google.cloud.retail.v2.stub.SearchServiceStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Service for search. + * + *

This feature is only available for users who have Retail Search enabled. Contact Retail + * Support (retail-search-support{@literal @}google.com) if you are interested in using Retail + * Search. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

{@code
+ * try (SearchServiceClient searchServiceClient = SearchServiceClient.create()) {
+ *   SearchRequest request =
+ *       SearchRequest.newBuilder()
+ *           .setPlacement("placement1792938725")
+ *           .setBranch(
+ *               BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString())
+ *           .setQuery("query107944136")
+ *           .setVisitorId("visitorId1880545833")
+ *           .setUserInfo(UserInfo.newBuilder().build())
+ *           .setPageSize(883849137)
+ *           .setPageToken("pageToken873572522")
+ *           .setOffset(-1019779949)
+ *           .setFilter("filter-1274492040")
+ *           .setCanonicalFilter("canonicalFilter-722283124")
+ *           .setOrderBy("orderBy-1207110587")
+ *           .addAllFacetSpecs(new ArrayList())
+ *           .setDynamicFacetSpec(SearchRequest.DynamicFacetSpec.newBuilder().build())
+ *           .setBoostSpec(SearchRequest.BoostSpec.newBuilder().build())
+ *           .setQueryExpansionSpec(SearchRequest.QueryExpansionSpec.newBuilder().build())
+ *           .addAllVariantRollupKeys(new ArrayList())
+ *           .addAllPageCategories(new ArrayList())
+ *           .build();
+ *   for (SearchResponse.SearchResult element : searchServiceClient.search(request).iterateAll()) {
+ *     // doThingsWith(element);
+ *   }
+ * }
+ * }
+ * + *

Note: close() needs to be called on the SearchServiceClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls close(). + * + *

The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of SearchServiceSettings to + * create(). For example: + * + *

To customize credentials: + * + *

{@code
+ * SearchServiceSettings searchServiceSettings =
+ *     SearchServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * SearchServiceClient searchServiceClient = SearchServiceClient.create(searchServiceSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * SearchServiceSettings searchServiceSettings =
+ *     SearchServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * SearchServiceClient searchServiceClient = SearchServiceClient.create(searchServiceSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class SearchServiceClient implements BackgroundResource { + private final SearchServiceSettings settings; + private final SearchServiceStub stub; + + /** Constructs an instance of SearchServiceClient with default settings. */ + public static final SearchServiceClient create() throws IOException { + return create(SearchServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of SearchServiceClient, using the given settings. The channels are + * created based on the settings passed in, or defaults for any settings that are not set. + */ + public static final SearchServiceClient create(SearchServiceSettings settings) + throws IOException { + return new SearchServiceClient(settings); + } + + /** + * Constructs an instance of SearchServiceClient, using the given stub for making calls. This is + * for advanced usage - prefer using create(SearchServiceSettings). + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final SearchServiceClient create(SearchServiceStub stub) { + return new SearchServiceClient(stub); + } + + /** + * Constructs an instance of SearchServiceClient, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected SearchServiceClient(SearchServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((SearchServiceStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected SearchServiceClient(SearchServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final SearchServiceSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public SearchServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Performs a search. + * + *

This feature is only available for users who have Retail Search enabled. Contact Retail + * Support (retail-search-support{@literal @}google.com) if you are interested in using Retail + * Search. + * + *

Sample code: + * + *

{@code
+   * try (SearchServiceClient searchServiceClient = SearchServiceClient.create()) {
+   *   SearchRequest request =
+   *       SearchRequest.newBuilder()
+   *           .setPlacement("placement1792938725")
+   *           .setBranch(
+   *               BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString())
+   *           .setQuery("query107944136")
+   *           .setVisitorId("visitorId1880545833")
+   *           .setUserInfo(UserInfo.newBuilder().build())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setOffset(-1019779949)
+   *           .setFilter("filter-1274492040")
+   *           .setCanonicalFilter("canonicalFilter-722283124")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .addAllFacetSpecs(new ArrayList())
+   *           .setDynamicFacetSpec(SearchRequest.DynamicFacetSpec.newBuilder().build())
+   *           .setBoostSpec(SearchRequest.BoostSpec.newBuilder().build())
+   *           .setQueryExpansionSpec(SearchRequest.QueryExpansionSpec.newBuilder().build())
+   *           .addAllVariantRollupKeys(new ArrayList())
+   *           .addAllPageCategories(new ArrayList())
+   *           .build();
+   *   for (SearchResponse.SearchResult element : searchServiceClient.search(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SearchPagedResponse search(SearchRequest request) { + return searchPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Performs a search. + * + *

This feature is only available for users who have Retail Search enabled. Contact Retail + * Support (retail-search-support{@literal @}google.com) if you are interested in using Retail + * Search. + * + *

Sample code: + * + *

{@code
+   * try (SearchServiceClient searchServiceClient = SearchServiceClient.create()) {
+   *   SearchRequest request =
+   *       SearchRequest.newBuilder()
+   *           .setPlacement("placement1792938725")
+   *           .setBranch(
+   *               BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString())
+   *           .setQuery("query107944136")
+   *           .setVisitorId("visitorId1880545833")
+   *           .setUserInfo(UserInfo.newBuilder().build())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setOffset(-1019779949)
+   *           .setFilter("filter-1274492040")
+   *           .setCanonicalFilter("canonicalFilter-722283124")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .addAllFacetSpecs(new ArrayList())
+   *           .setDynamicFacetSpec(SearchRequest.DynamicFacetSpec.newBuilder().build())
+   *           .setBoostSpec(SearchRequest.BoostSpec.newBuilder().build())
+   *           .setQueryExpansionSpec(SearchRequest.QueryExpansionSpec.newBuilder().build())
+   *           .addAllVariantRollupKeys(new ArrayList())
+   *           .addAllPageCategories(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       searchServiceClient.searchPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (SearchResponse.SearchResult element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable searchPagedCallable() { + return stub.searchPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Performs a search. + * + *

This feature is only available for users who have Retail Search enabled. Contact Retail + * Support (retail-search-support{@literal @}google.com) if you are interested in using Retail + * Search. + * + *

Sample code: + * + *

{@code
+   * try (SearchServiceClient searchServiceClient = SearchServiceClient.create()) {
+   *   SearchRequest request =
+   *       SearchRequest.newBuilder()
+   *           .setPlacement("placement1792938725")
+   *           .setBranch(
+   *               BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString())
+   *           .setQuery("query107944136")
+   *           .setVisitorId("visitorId1880545833")
+   *           .setUserInfo(UserInfo.newBuilder().build())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setOffset(-1019779949)
+   *           .setFilter("filter-1274492040")
+   *           .setCanonicalFilter("canonicalFilter-722283124")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .addAllFacetSpecs(new ArrayList())
+   *           .setDynamicFacetSpec(SearchRequest.DynamicFacetSpec.newBuilder().build())
+   *           .setBoostSpec(SearchRequest.BoostSpec.newBuilder().build())
+   *           .setQueryExpansionSpec(SearchRequest.QueryExpansionSpec.newBuilder().build())
+   *           .addAllVariantRollupKeys(new ArrayList())
+   *           .addAllPageCategories(new ArrayList())
+   *           .build();
+   *   while (true) {
+   *     SearchResponse response = searchServiceClient.searchCallable().call(request);
+   *     for (SearchResponse.SearchResult element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable searchCallable() { + return stub.searchCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class SearchPagedResponse + extends AbstractPagedListResponse< + SearchRequest, + SearchResponse, + SearchResponse.SearchResult, + SearchPage, + SearchFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + SearchPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public SearchPagedResponse apply(SearchPage input) { + return new SearchPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private SearchPagedResponse(SearchPage page) { + super(page, SearchFixedSizeCollection.createEmptyCollection()); + } + } + + public static class SearchPage + extends AbstractPage { + + private SearchPage( + PageContext context, + SearchResponse response) { + super(context, response); + } + + private static SearchPage createEmptyPage() { + return new SearchPage(null, null); + } + + @Override + protected SearchPage createPage( + PageContext context, + SearchResponse response) { + return new SearchPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class SearchFixedSizeCollection + extends AbstractFixedSizeCollection< + SearchRequest, + SearchResponse, + SearchResponse.SearchResult, + SearchPage, + SearchFixedSizeCollection> { + + private SearchFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static SearchFixedSizeCollection createEmptyCollection() { + return new SearchFixedSizeCollection(null, 0); + } + + @Override + protected SearchFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new SearchFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/SearchServiceSettings.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/SearchServiceSettings.java new file mode 100644 index 00000000..27f1deba --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/SearchServiceSettings.java @@ -0,0 +1,185 @@ +/* + * 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 + * + * 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. + */ + +package com.google.cloud.retail.v2; + +import static com.google.cloud.retail.v2.SearchServiceClient.SearchPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.retail.v2.stub.SearchServiceStubSettings; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link SearchServiceClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (retail.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of search to 30 seconds: + * + *

{@code
+ * SearchServiceSettings.Builder searchServiceSettingsBuilder = SearchServiceSettings.newBuilder();
+ * searchServiceSettingsBuilder
+ *     .searchSettings()
+ *     .setRetrySettings(
+ *         searchServiceSettingsBuilder
+ *             .searchSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * SearchServiceSettings searchServiceSettings = searchServiceSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class SearchServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to search. */ + public PagedCallSettings searchSettings() { + return ((SearchServiceStubSettings) getStubSettings()).searchSettings(); + } + + public static final SearchServiceSettings create(SearchServiceStubSettings stub) + throws IOException { + return new SearchServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return SearchServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return SearchServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return SearchServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return SearchServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return SearchServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return SearchServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SearchServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected SearchServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for SearchServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(SearchServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(SearchServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(SearchServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(SearchServiceStubSettings.newBuilder()); + } + + public SearchServiceStubSettings.Builder getStubSettingsBuilder() { + return ((SearchServiceStubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception'. + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to search. */ + public PagedCallSettings.Builder + searchSettings() { + return getStubSettingsBuilder().searchSettings(); + } + + @Override + public SearchServiceSettings build() throws IOException { + return new SearchServiceSettings(this); + } + } +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/UserEventServiceClient.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/UserEventServiceClient.java index bc10245a..39f211bb 100644 --- a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/UserEventServiceClient.java +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/UserEventServiceClient.java @@ -366,7 +366,7 @@ public final UnaryCallable purgeUserEventsCal * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) { * ImportUserEventsRequest request = * ImportUserEventsRequest.newBuilder() - * .setParent("parent-995424086") + * .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) * .setInputConfig(UserEventInputConfig.newBuilder().build()) * .setErrorsConfig(ImportErrorsConfig.newBuilder().build()) * .build(); @@ -397,7 +397,7 @@ public final OperationFuture importUse * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) { * ImportUserEventsRequest request = * ImportUserEventsRequest.newBuilder() - * .setParent("parent-995424086") + * .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) * .setInputConfig(UserEventInputConfig.newBuilder().build()) * .setErrorsConfig(ImportErrorsConfig.newBuilder().build()) * .build(); @@ -427,7 +427,7 @@ public final OperationFuture importUse * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) { * ImportUserEventsRequest request = * ImportUserEventsRequest.newBuilder() - * .setParent("parent-995424086") + * .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) * .setInputConfig(UserEventInputConfig.newBuilder().build()) * .setErrorsConfig(ImportErrorsConfig.newBuilder().build()) * .build(); diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/gapic_metadata.json b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/gapic_metadata.json index 43d34547..fd9276c8 100644 --- a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/gapic_metadata.json +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/gapic_metadata.json @@ -10,9 +10,15 @@ "grpc": { "libraryClient": "CatalogServiceClient", "rpcs": { + "GetDefaultBranch": { + "methods": ["getDefaultBranch", "getDefaultBranch", "getDefaultBranch", "getDefaultBranchCallable"] + }, "ListCatalogs": { "methods": ["listCatalogs", "listCatalogs", "listCatalogs", "listCatalogsPagedCallable", "listCatalogsCallable"] }, + "SetDefaultBranch": { + "methods": ["setDefaultBranch", "setDefaultBranch", "setDefaultBranch", "setDefaultBranchCallable"] + }, "UpdateCatalog": { "methods": ["updateCatalog", "updateCatalog", "updateCatalogCallable"] } @@ -20,6 +26,21 @@ } } }, + "CompletionService": { + "clients": { + "grpc": { + "libraryClient": "CompletionServiceClient", + "rpcs": { + "CompleteQuery": { + "methods": ["completeQuery", "completeQueryCallable"] + }, + "ImportCompletionData": { + "methods": ["importCompletionDataAsync", "importCompletionDataOperationCallable", "importCompletionDataCallable"] + } + } + } + } + }, "PredictionService": { "clients": { "grpc": { @@ -37,6 +58,9 @@ "grpc": { "libraryClient": "ProductServiceClient", "rpcs": { + "AddFulfillmentPlaces": { + "methods": ["addFulfillmentPlacesAsync", "addFulfillmentPlacesAsync", "addFulfillmentPlacesAsync", "addFulfillmentPlacesOperationCallable", "addFulfillmentPlacesCallable"] + }, "CreateProduct": { "methods": ["createProduct", "createProduct", "createProduct", "createProductCallable"] }, @@ -49,6 +73,15 @@ "ImportProducts": { "methods": ["importProductsAsync", "importProductsOperationCallable", "importProductsCallable"] }, + "ListProducts": { + "methods": ["listProducts", "listProducts", "listProducts", "listProductsPagedCallable", "listProductsCallable"] + }, + "RemoveFulfillmentPlaces": { + "methods": ["removeFulfillmentPlacesAsync", "removeFulfillmentPlacesAsync", "removeFulfillmentPlacesAsync", "removeFulfillmentPlacesOperationCallable", "removeFulfillmentPlacesCallable"] + }, + "SetInventory": { + "methods": ["setInventoryAsync", "setInventoryAsync", "setInventoryOperationCallable", "setInventoryCallable"] + }, "UpdateProduct": { "methods": ["updateProduct", "updateProduct", "updateProductCallable"] } @@ -56,6 +89,18 @@ } } }, + "SearchService": { + "clients": { + "grpc": { + "libraryClient": "SearchServiceClient", + "rpcs": { + "Search": { + "methods": ["search", "searchPagedCallable", "searchCallable"] + } + } + } + } + }, "UserEventService": { "clients": { "grpc": { diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/package-info.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/package-info.java index 4cc91cec..10ff0bb1 100644 --- a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/package-info.java +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/package-info.java @@ -31,6 +31,32 @@ * } * } * + *

======================= CompletionServiceClient ======================= + * + *

Service Description: Auto-completion service for retail. + * + *

This feature is only available for users who have Retail Search enabled. Contact Retail + * Support (retail-search-support{@literal @}google.com) if you are interested in using Retail + * Search. + * + *

Sample for CompletionServiceClient: + * + *

{@code
+ * try (CompletionServiceClient completionServiceClient = CompletionServiceClient.create()) {
+ *   CompleteQueryRequest request =
+ *       CompleteQueryRequest.newBuilder()
+ *           .setCatalog(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+ *           .setQuery("query107944136")
+ *           .setVisitorId("visitorId1880545833")
+ *           .addAllLanguageCodes(new ArrayList())
+ *           .setDeviceType("deviceType781190832")
+ *           .setDataset("dataset1443214456")
+ *           .setMaxSuggestions(618824852)
+ *           .build();
+ *   CompleteQueryResponse response = completionServiceClient.completeQuery(request);
+ * }
+ * }
+ * *

======================= PredictionServiceClient ======================= * *

Service Description: Service for making recommendation prediction. @@ -70,6 +96,45 @@ * } * } * + *

======================= SearchServiceClient ======================= + * + *

Service Description: Service for search. + * + *

This feature is only available for users who have Retail Search enabled. Contact Retail + * Support (retail-search-support{@literal @}google.com) if you are interested in using Retail + * Search. + * + *

Sample for SearchServiceClient: + * + *

{@code
+ * try (SearchServiceClient searchServiceClient = SearchServiceClient.create()) {
+ *   SearchRequest request =
+ *       SearchRequest.newBuilder()
+ *           .setPlacement("placement1792938725")
+ *           .setBranch(
+ *               BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString())
+ *           .setQuery("query107944136")
+ *           .setVisitorId("visitorId1880545833")
+ *           .setUserInfo(UserInfo.newBuilder().build())
+ *           .setPageSize(883849137)
+ *           .setPageToken("pageToken873572522")
+ *           .setOffset(-1019779949)
+ *           .setFilter("filter-1274492040")
+ *           .setCanonicalFilter("canonicalFilter-722283124")
+ *           .setOrderBy("orderBy-1207110587")
+ *           .addAllFacetSpecs(new ArrayList())
+ *           .setDynamicFacetSpec(SearchRequest.DynamicFacetSpec.newBuilder().build())
+ *           .setBoostSpec(SearchRequest.BoostSpec.newBuilder().build())
+ *           .setQueryExpansionSpec(SearchRequest.QueryExpansionSpec.newBuilder().build())
+ *           .addAllVariantRollupKeys(new ArrayList())
+ *           .addAllPageCategories(new ArrayList())
+ *           .build();
+ *   for (SearchResponse.SearchResult element : searchServiceClient.search(request).iterateAll()) {
+ *     // doThingsWith(element);
+ *   }
+ * }
+ * }
+ * *

======================= UserEventServiceClient ======================= * *

Service Description: Service for ingesting end user actions on the customer website. diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/CatalogServiceStub.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/CatalogServiceStub.java index fe949c29..35f9b3ff 100644 --- a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/CatalogServiceStub.java +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/CatalogServiceStub.java @@ -21,9 +21,13 @@ import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.retail.v2.Catalog; +import com.google.cloud.retail.v2.GetDefaultBranchRequest; +import com.google.cloud.retail.v2.GetDefaultBranchResponse; import com.google.cloud.retail.v2.ListCatalogsRequest; import com.google.cloud.retail.v2.ListCatalogsResponse; +import com.google.cloud.retail.v2.SetDefaultBranchRequest; import com.google.cloud.retail.v2.UpdateCatalogRequest; +import com.google.protobuf.Empty; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS. @@ -47,6 +51,15 @@ public UnaryCallable updateCatalogCallable() { throw new UnsupportedOperationException("Not implemented: updateCatalogCallable()"); } + public UnaryCallable setDefaultBranchCallable() { + throw new UnsupportedOperationException("Not implemented: setDefaultBranchCallable()"); + } + + public UnaryCallable + getDefaultBranchCallable() { + throw new UnsupportedOperationException("Not implemented: getDefaultBranchCallable()"); + } + @Override public abstract void close(); } diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/CatalogServiceStubSettings.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/CatalogServiceStubSettings.java index cd8ca047..6030c9c3 100644 --- a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/CatalogServiceStubSettings.java +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/CatalogServiceStubSettings.java @@ -41,13 +41,17 @@ import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.retail.v2.Catalog; +import com.google.cloud.retail.v2.GetDefaultBranchRequest; +import com.google.cloud.retail.v2.GetDefaultBranchResponse; import com.google.cloud.retail.v2.ListCatalogsRequest; import com.google.cloud.retail.v2.ListCatalogsResponse; +import com.google.cloud.retail.v2.SetDefaultBranchRequest; import com.google.cloud.retail.v2.UpdateCatalogRequest; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; +import com.google.protobuf.Empty; import java.io.IOException; import java.util.List; import javax.annotation.Generated; @@ -95,6 +99,9 @@ public class CatalogServiceStubSettings extends StubSettings listCatalogsSettings; private final UnaryCallSettings updateCatalogSettings; + private final UnaryCallSettings setDefaultBranchSettings; + private final UnaryCallSettings + getDefaultBranchSettings; private static final PagedListDescriptor LIST_CATALOGS_PAGE_STR_DESC = @@ -160,6 +167,17 @@ public UnaryCallSettings updateCatalogSettings() return updateCatalogSettings; } + /** Returns the object with the settings used for calls to setDefaultBranch. */ + public UnaryCallSettings setDefaultBranchSettings() { + return setDefaultBranchSettings; + } + + /** Returns the object with the settings used for calls to getDefaultBranch. */ + public UnaryCallSettings + getDefaultBranchSettings() { + return getDefaultBranchSettings; + } + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public CatalogServiceStub createStub() throws IOException { if (getTransportChannelProvider() @@ -236,6 +254,8 @@ protected CatalogServiceStubSettings(Builder settingsBuilder) throws IOException listCatalogsSettings = settingsBuilder.listCatalogsSettings().build(); updateCatalogSettings = settingsBuilder.updateCatalogSettings().build(); + setDefaultBranchSettings = settingsBuilder.setDefaultBranchSettings().build(); + getDefaultBranchSettings = settingsBuilder.getDefaultBranchSettings().build(); } /** Builder for CatalogServiceStubSettings. */ @@ -245,6 +265,10 @@ public static class Builder extends StubSettings.Builder listCatalogsSettings; private final UnaryCallSettings.Builder updateCatalogSettings; + private final UnaryCallSettings.Builder + setDefaultBranchSettings; + private final UnaryCallSettings.Builder + getDefaultBranchSettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -287,10 +311,15 @@ protected Builder(ClientContext clientContext) { listCatalogsSettings = PagedCallSettings.newBuilder(LIST_CATALOGS_PAGE_STR_FACT); updateCatalogSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setDefaultBranchSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getDefaultBranchSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( - listCatalogsSettings, updateCatalogSettings); + listCatalogsSettings, + updateCatalogSettings, + setDefaultBranchSettings, + getDefaultBranchSettings); initDefaults(this); } @@ -299,10 +328,15 @@ protected Builder(CatalogServiceStubSettings settings) { listCatalogsSettings = settings.listCatalogsSettings.toBuilder(); updateCatalogSettings = settings.updateCatalogSettings.toBuilder(); + setDefaultBranchSettings = settings.setDefaultBranchSettings.toBuilder(); + getDefaultBranchSettings = settings.getDefaultBranchSettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( - listCatalogsSettings, updateCatalogSettings); + listCatalogsSettings, + updateCatalogSettings, + setDefaultBranchSettings, + getDefaultBranchSettings); } private static Builder createDefault() { @@ -329,6 +363,16 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + builder + .setDefaultBranchSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getDefaultBranchSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + return builder; } @@ -360,6 +404,17 @@ public UnaryCallSettings.Builder updateCatalogSet return updateCatalogSettings; } + /** Returns the builder for the settings used for calls to setDefaultBranch. */ + public UnaryCallSettings.Builder setDefaultBranchSettings() { + return setDefaultBranchSettings; + } + + /** Returns the builder for the settings used for calls to getDefaultBranch. */ + public UnaryCallSettings.Builder + getDefaultBranchSettings() { + return getDefaultBranchSettings; + } + @Override public CatalogServiceStubSettings build() throws IOException { return new CatalogServiceStubSettings(this); diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/CompletionServiceStub.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/CompletionServiceStub.java new file mode 100644 index 00000000..9f411984 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/CompletionServiceStub.java @@ -0,0 +1,61 @@ +/* + * 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 + * + * 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. + */ + +package com.google.cloud.retail.v2.stub; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.retail.v2.CompleteQueryRequest; +import com.google.cloud.retail.v2.CompleteQueryResponse; +import com.google.cloud.retail.v2.ImportCompletionDataRequest; +import com.google.cloud.retail.v2.ImportCompletionDataResponse; +import com.google.cloud.retail.v2.ImportMetadata; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the CompletionService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class CompletionServiceStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + } + + public UnaryCallable completeQueryCallable() { + throw new UnsupportedOperationException("Not implemented: completeQueryCallable()"); + } + + public OperationCallable< + ImportCompletionDataRequest, ImportCompletionDataResponse, ImportMetadata> + importCompletionDataOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: importCompletionDataOperationCallable()"); + } + + public UnaryCallable importCompletionDataCallable() { + throw new UnsupportedOperationException("Not implemented: importCompletionDataCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/CompletionServiceStubSettings.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/CompletionServiceStubSettings.java new file mode 100644 index 00000000..f69dd85a --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/CompletionServiceStubSettings.java @@ -0,0 +1,364 @@ +/* + * 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 + * + * 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. + */ + +package com.google.cloud.retail.v2.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.retail.v2.CompleteQueryRequest; +import com.google.cloud.retail.v2.CompleteQueryResponse; +import com.google.cloud.retail.v2.ImportCompletionDataRequest; +import com.google.cloud.retail.v2.ImportCompletionDataResponse; +import com.google.cloud.retail.v2.ImportMetadata; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link CompletionServiceStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (retail.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of completeQuery to 30 seconds: + * + *

{@code
+ * CompletionServiceStubSettings.Builder completionServiceSettingsBuilder =
+ *     CompletionServiceStubSettings.newBuilder();
+ * completionServiceSettingsBuilder
+ *     .completeQuerySettings()
+ *     .setRetrySettings(
+ *         completionServiceSettingsBuilder
+ *             .completeQuerySettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * CompletionServiceStubSettings completionServiceSettings =
+ *     completionServiceSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class CompletionServiceStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final UnaryCallSettings + completeQuerySettings; + private final UnaryCallSettings + importCompletionDataSettings; + private final OperationCallSettings< + ImportCompletionDataRequest, ImportCompletionDataResponse, ImportMetadata> + importCompletionDataOperationSettings; + + /** Returns the object with the settings used for calls to completeQuery. */ + public UnaryCallSettings completeQuerySettings() { + return completeQuerySettings; + } + + /** Returns the object with the settings used for calls to importCompletionData. */ + public UnaryCallSettings importCompletionDataSettings() { + return importCompletionDataSettings; + } + + /** Returns the object with the settings used for calls to importCompletionData. */ + public OperationCallSettings< + ImportCompletionDataRequest, ImportCompletionDataResponse, ImportMetadata> + importCompletionDataOperationSettings() { + return importCompletionDataOperationSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public CompletionServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcCompletionServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "retail.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "retail.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(CompletionServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected CompletionServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + completeQuerySettings = settingsBuilder.completeQuerySettings().build(); + importCompletionDataSettings = settingsBuilder.importCompletionDataSettings().build(); + importCompletionDataOperationSettings = + settingsBuilder.importCompletionDataOperationSettings().build(); + } + + /** Builder for CompletionServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder + completeQuerySettings; + private final UnaryCallSettings.Builder + importCompletionDataSettings; + private final OperationCallSettings.Builder< + ImportCompletionDataRequest, ImportCompletionDataResponse, ImportMetadata> + importCompletionDataOperationSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED))); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + completeQuerySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + importCompletionDataSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + importCompletionDataOperationSettings = OperationCallSettings.newBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + completeQuerySettings, importCompletionDataSettings); + initDefaults(this); + } + + protected Builder(CompletionServiceStubSettings settings) { + super(settings); + + completeQuerySettings = settings.completeQuerySettings.toBuilder(); + importCompletionDataSettings = settings.importCompletionDataSettings.toBuilder(); + importCompletionDataOperationSettings = + settings.importCompletionDataOperationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + completeQuerySettings, importCompletionDataSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .completeQuerySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .importCompletionDataSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .importCompletionDataOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create( + ImportCompletionDataResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(ImportMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + return builder; + } + + // NEXT_MAJOR_VER: remove 'throws Exception'. + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to completeQuery. */ + public UnaryCallSettings.Builder + completeQuerySettings() { + return completeQuerySettings; + } + + /** Returns the builder for the settings used for calls to importCompletionData. */ + public UnaryCallSettings.Builder + importCompletionDataSettings() { + return importCompletionDataSettings; + } + + /** Returns the builder for the settings used for calls to importCompletionData. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + ImportCompletionDataRequest, ImportCompletionDataResponse, ImportMetadata> + importCompletionDataOperationSettings() { + return importCompletionDataOperationSettings; + } + + @Override + public CompletionServiceStubSettings build() throws IOException { + return new CompletionServiceStubSettings(this); + } + } +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/GrpcCatalogServiceStub.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/GrpcCatalogServiceStub.java index ac01e3cf..4cffdfe9 100644 --- a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/GrpcCatalogServiceStub.java +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/GrpcCatalogServiceStub.java @@ -26,11 +26,15 @@ import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.retail.v2.Catalog; +import com.google.cloud.retail.v2.GetDefaultBranchRequest; +import com.google.cloud.retail.v2.GetDefaultBranchResponse; import com.google.cloud.retail.v2.ListCatalogsRequest; import com.google.cloud.retail.v2.ListCatalogsResponse; +import com.google.cloud.retail.v2.SetDefaultBranchRequest; import com.google.cloud.retail.v2.UpdateCatalogRequest; import com.google.common.collect.ImmutableMap; import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; import io.grpc.MethodDescriptor; import io.grpc.protobuf.ProtoUtils; import java.io.IOException; @@ -66,10 +70,34 @@ public class GrpcCatalogServiceStub extends CatalogServiceStub { .setResponseMarshaller(ProtoUtils.marshaller(Catalog.getDefaultInstance())) .build(); + private static final MethodDescriptor + setDefaultBranchMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2.CatalogService/SetDefaultBranch") + .setRequestMarshaller( + ProtoUtils.marshaller(SetDefaultBranchRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getDefaultBranchMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2.CatalogService/GetDefaultBranch") + .setRequestMarshaller( + ProtoUtils.marshaller(GetDefaultBranchRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(GetDefaultBranchResponse.getDefaultInstance())) + .build(); + private final UnaryCallable listCatalogsCallable; private final UnaryCallable listCatalogsPagedCallable; private final UnaryCallable updateCatalogCallable; + private final UnaryCallable setDefaultBranchCallable; + private final UnaryCallable + getDefaultBranchCallable; private final BackgroundResource backgroundResources; private final GrpcOperationsStub operationsStub; @@ -141,6 +169,33 @@ public Map extract(UpdateCatalogRequest request) { } }) .build(); + GrpcCallSettings setDefaultBranchTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setDefaultBranchMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(SetDefaultBranchRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("catalog", String.valueOf(request.getCatalog())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + getDefaultBranchTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getDefaultBranchMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetDefaultBranchRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("catalog", String.valueOf(request.getCatalog())); + return params.build(); + } + }) + .build(); this.listCatalogsCallable = callableFactory.createUnaryCallable( @@ -151,6 +206,12 @@ public Map extract(UpdateCatalogRequest request) { this.updateCatalogCallable = callableFactory.createUnaryCallable( updateCatalogTransportSettings, settings.updateCatalogSettings(), clientContext); + this.setDefaultBranchCallable = + callableFactory.createUnaryCallable( + setDefaultBranchTransportSettings, settings.setDefaultBranchSettings(), clientContext); + this.getDefaultBranchCallable = + callableFactory.createUnaryCallable( + getDefaultBranchTransportSettings, settings.getDefaultBranchSettings(), clientContext); this.backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); @@ -175,6 +236,17 @@ public UnaryCallable updateCatalogCallable() { return updateCatalogCallable; } + @Override + public UnaryCallable setDefaultBranchCallable() { + return setDefaultBranchCallable; + } + + @Override + public UnaryCallable + getDefaultBranchCallable() { + return getDefaultBranchCallable; + } + @Override public final void close() { shutdown(); diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/GrpcCompletionServiceCallableFactory.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/GrpcCompletionServiceCallableFactory.java new file mode 100644 index 00000000..80815304 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/GrpcCompletionServiceCallableFactory.java @@ -0,0 +1,113 @@ +/* + * 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 + * + * 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. + */ + +package com.google.cloud.retail.v2.stub; + +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the CompletionService service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcCompletionServiceCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/GrpcCompletionServiceStub.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/GrpcCompletionServiceStub.java new file mode 100644 index 00000000..cc41b778 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/GrpcCompletionServiceStub.java @@ -0,0 +1,217 @@ +/* + * 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 + * + * 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. + */ + +package com.google.cloud.retail.v2.stub; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.retail.v2.CompleteQueryRequest; +import com.google.cloud.retail.v2.CompleteQueryResponse; +import com.google.cloud.retail.v2.ImportCompletionDataRequest; +import com.google.cloud.retail.v2.ImportCompletionDataResponse; +import com.google.cloud.retail.v2.ImportMetadata; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the CompletionService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcCompletionServiceStub extends CompletionServiceStub { + private static final MethodDescriptor + completeQueryMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2.CompletionService/CompleteQuery") + .setRequestMarshaller( + ProtoUtils.marshaller(CompleteQueryRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(CompleteQueryResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + importCompletionDataMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2.CompletionService/ImportCompletionData") + .setRequestMarshaller( + ProtoUtils.marshaller(ImportCompletionDataRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private final UnaryCallable completeQueryCallable; + private final UnaryCallable importCompletionDataCallable; + private final OperationCallable< + ImportCompletionDataRequest, ImportCompletionDataResponse, ImportMetadata> + importCompletionDataOperationCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcCompletionServiceStub create(CompletionServiceStubSettings settings) + throws IOException { + return new GrpcCompletionServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcCompletionServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcCompletionServiceStub( + CompletionServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcCompletionServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcCompletionServiceStub( + CompletionServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcCompletionServiceStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected GrpcCompletionServiceStub( + CompletionServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcCompletionServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcCompletionServiceStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected GrpcCompletionServiceStub( + CompletionServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings completeQueryTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(completeQueryMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CompleteQueryRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("catalog", String.valueOf(request.getCatalog())); + return params.build(); + } + }) + .build(); + GrpcCallSettings importCompletionDataTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(importCompletionDataMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ImportCompletionDataRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + + this.completeQueryCallable = + callableFactory.createUnaryCallable( + completeQueryTransportSettings, settings.completeQuerySettings(), clientContext); + this.importCompletionDataCallable = + callableFactory.createUnaryCallable( + importCompletionDataTransportSettings, + settings.importCompletionDataSettings(), + clientContext); + this.importCompletionDataOperationCallable = + callableFactory.createOperationCallable( + importCompletionDataTransportSettings, + settings.importCompletionDataOperationSettings(), + clientContext, + operationsStub); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable completeQueryCallable() { + return completeQueryCallable; + } + + @Override + public UnaryCallable importCompletionDataCallable() { + return importCompletionDataCallable; + } + + @Override + public OperationCallable< + ImportCompletionDataRequest, ImportCompletionDataResponse, ImportMetadata> + importCompletionDataOperationCallable() { + return importCompletionDataOperationCallable; + } + + @Override + public final void close() { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/GrpcProductServiceStub.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/GrpcProductServiceStub.java index 97595eb9..ae915fe0 100644 --- a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/GrpcProductServiceStub.java +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/GrpcProductServiceStub.java @@ -16,6 +16,8 @@ package com.google.cloud.retail.v2.stub; +import static com.google.cloud.retail.v2.ProductServiceClient.ListProductsPagedResponse; + import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.core.BackgroundResourceAggregation; import com.google.api.gax.grpc.GrpcCallSettings; @@ -24,13 +26,24 @@ import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.retail.v2.AddFulfillmentPlacesMetadata; +import com.google.cloud.retail.v2.AddFulfillmentPlacesRequest; +import com.google.cloud.retail.v2.AddFulfillmentPlacesResponse; import com.google.cloud.retail.v2.CreateProductRequest; import com.google.cloud.retail.v2.DeleteProductRequest; import com.google.cloud.retail.v2.GetProductRequest; import com.google.cloud.retail.v2.ImportMetadata; import com.google.cloud.retail.v2.ImportProductsRequest; import com.google.cloud.retail.v2.ImportProductsResponse; +import com.google.cloud.retail.v2.ListProductsRequest; +import com.google.cloud.retail.v2.ListProductsResponse; import com.google.cloud.retail.v2.Product; +import com.google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata; +import com.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest; +import com.google.cloud.retail.v2.RemoveFulfillmentPlacesResponse; +import com.google.cloud.retail.v2.SetInventoryMetadata; +import com.google.cloud.retail.v2.SetInventoryRequest; +import com.google.cloud.retail.v2.SetInventoryResponse; import com.google.cloud.retail.v2.UpdateProductRequest; import com.google.common.collect.ImmutableMap; import com.google.longrunning.Operation; @@ -69,6 +82,16 @@ public class GrpcProductServiceStub extends ProductServiceStub { .setResponseMarshaller(ProtoUtils.marshaller(Product.getDefaultInstance())) .build(); + private static final MethodDescriptor + listProductsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2.ProductService/ListProducts") + .setRequestMarshaller(ProtoUtils.marshaller(ListProductsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListProductsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor updateProductMethodDescriptor = MethodDescriptor.newBuilder() @@ -97,13 +120,59 @@ public class GrpcProductServiceStub extends ProductServiceStub { .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); + private static final MethodDescriptor + setInventoryMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2.ProductService/SetInventory") + .setRequestMarshaller(ProtoUtils.marshaller(SetInventoryRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + addFulfillmentPlacesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2.ProductService/AddFulfillmentPlaces") + .setRequestMarshaller( + ProtoUtils.marshaller(AddFulfillmentPlacesRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + removeFulfillmentPlacesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2.ProductService/RemoveFulfillmentPlaces") + .setRequestMarshaller( + ProtoUtils.marshaller(RemoveFulfillmentPlacesRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private final UnaryCallable createProductCallable; private final UnaryCallable getProductCallable; + private final UnaryCallable listProductsCallable; + private final UnaryCallable + listProductsPagedCallable; private final UnaryCallable updateProductCallable; private final UnaryCallable deleteProductCallable; private final UnaryCallable importProductsCallable; private final OperationCallable importProductsOperationCallable; + private final UnaryCallable setInventoryCallable; + private final OperationCallable + setInventoryOperationCallable; + private final UnaryCallable addFulfillmentPlacesCallable; + private final OperationCallable< + AddFulfillmentPlacesRequest, AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> + addFulfillmentPlacesOperationCallable; + private final UnaryCallable + removeFulfillmentPlacesCallable; + private final OperationCallable< + RemoveFulfillmentPlacesRequest, + RemoveFulfillmentPlacesResponse, + RemoveFulfillmentPlacesMetadata> + removeFulfillmentPlacesOperationCallable; private final BackgroundResource backgroundResources; private final GrpcOperationsStub operationsStub; @@ -175,6 +244,19 @@ public Map extract(GetProductRequest request) { } }) .build(); + GrpcCallSettings listProductsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listProductsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListProductsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); GrpcCallSettings updateProductTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(updateProductMethodDescriptor) @@ -214,6 +296,46 @@ public Map extract(ImportProductsRequest request) { } }) .build(); + GrpcCallSettings setInventoryTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setInventoryMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(SetInventoryRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("inventory.name", String.valueOf(request.getInventory().getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings addFulfillmentPlacesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(addFulfillmentPlacesMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(AddFulfillmentPlacesRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("product", String.valueOf(request.getProduct())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + removeFulfillmentPlacesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(removeFulfillmentPlacesMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(RemoveFulfillmentPlacesRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("product", String.valueOf(request.getProduct())); + return params.build(); + } + }) + .build(); this.createProductCallable = callableFactory.createUnaryCallable( @@ -221,6 +343,12 @@ public Map extract(ImportProductsRequest request) { this.getProductCallable = callableFactory.createUnaryCallable( getProductTransportSettings, settings.getProductSettings(), clientContext); + this.listProductsCallable = + callableFactory.createUnaryCallable( + listProductsTransportSettings, settings.listProductsSettings(), clientContext); + this.listProductsPagedCallable = + callableFactory.createPagedCallable( + listProductsTransportSettings, settings.listProductsSettings(), clientContext); this.updateProductCallable = callableFactory.createUnaryCallable( updateProductTransportSettings, settings.updateProductSettings(), clientContext); @@ -236,6 +364,37 @@ public Map extract(ImportProductsRequest request) { settings.importProductsOperationSettings(), clientContext, operationsStub); + this.setInventoryCallable = + callableFactory.createUnaryCallable( + setInventoryTransportSettings, settings.setInventorySettings(), clientContext); + this.setInventoryOperationCallable = + callableFactory.createOperationCallable( + setInventoryTransportSettings, + settings.setInventoryOperationSettings(), + clientContext, + operationsStub); + this.addFulfillmentPlacesCallable = + callableFactory.createUnaryCallable( + addFulfillmentPlacesTransportSettings, + settings.addFulfillmentPlacesSettings(), + clientContext); + this.addFulfillmentPlacesOperationCallable = + callableFactory.createOperationCallable( + addFulfillmentPlacesTransportSettings, + settings.addFulfillmentPlacesOperationSettings(), + clientContext, + operationsStub); + this.removeFulfillmentPlacesCallable = + callableFactory.createUnaryCallable( + removeFulfillmentPlacesTransportSettings, + settings.removeFulfillmentPlacesSettings(), + clientContext); + this.removeFulfillmentPlacesOperationCallable = + callableFactory.createOperationCallable( + removeFulfillmentPlacesTransportSettings, + settings.removeFulfillmentPlacesOperationSettings(), + clientContext, + operationsStub); this.backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); @@ -255,6 +414,16 @@ public UnaryCallable getProductCallable() { return getProductCallable; } + @Override + public UnaryCallable listProductsCallable() { + return listProductsCallable; + } + + @Override + public UnaryCallable listProductsPagedCallable() { + return listProductsPagedCallable; + } + @Override public UnaryCallable updateProductCallable() { return updateProductCallable; @@ -276,6 +445,44 @@ public UnaryCallable importProductsCallable() return importProductsOperationCallable; } + @Override + public UnaryCallable setInventoryCallable() { + return setInventoryCallable; + } + + @Override + public OperationCallable + setInventoryOperationCallable() { + return setInventoryOperationCallable; + } + + @Override + public UnaryCallable addFulfillmentPlacesCallable() { + return addFulfillmentPlacesCallable; + } + + @Override + public OperationCallable< + AddFulfillmentPlacesRequest, AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> + addFulfillmentPlacesOperationCallable() { + return addFulfillmentPlacesOperationCallable; + } + + @Override + public UnaryCallable + removeFulfillmentPlacesCallable() { + return removeFulfillmentPlacesCallable; + } + + @Override + public OperationCallable< + RemoveFulfillmentPlacesRequest, + RemoveFulfillmentPlacesResponse, + RemoveFulfillmentPlacesMetadata> + removeFulfillmentPlacesOperationCallable() { + return removeFulfillmentPlacesOperationCallable; + } + @Override public final void close() { shutdown(); diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/GrpcSearchServiceCallableFactory.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/GrpcSearchServiceCallableFactory.java new file mode 100644 index 00000000..f2dc0907 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/GrpcSearchServiceCallableFactory.java @@ -0,0 +1,113 @@ +/* + * 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 + * + * 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. + */ + +package com.google.cloud.retail.v2.stub; + +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the SearchService service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcSearchServiceCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/GrpcSearchServiceStub.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/GrpcSearchServiceStub.java new file mode 100644 index 00000000..8889e511 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/GrpcSearchServiceStub.java @@ -0,0 +1,168 @@ +/* + * 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 + * + * 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. + */ + +package com.google.cloud.retail.v2.stub; + +import static com.google.cloud.retail.v2.SearchServiceClient.SearchPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.retail.v2.SearchRequest; +import com.google.cloud.retail.v2.SearchResponse; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the SearchService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcSearchServiceStub extends SearchServiceStub { + private static final MethodDescriptor searchMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2.SearchService/Search") + .setRequestMarshaller(ProtoUtils.marshaller(SearchRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(SearchResponse.getDefaultInstance())) + .build(); + + private final UnaryCallable searchCallable; + private final UnaryCallable searchPagedCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcSearchServiceStub create(SearchServiceStubSettings settings) + throws IOException { + return new GrpcSearchServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcSearchServiceStub create(ClientContext clientContext) throws IOException { + return new GrpcSearchServiceStub(SearchServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcSearchServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcSearchServiceStub( + SearchServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcSearchServiceStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected GrpcSearchServiceStub(SearchServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcSearchServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcSearchServiceStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected GrpcSearchServiceStub( + SearchServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings searchTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(searchMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(SearchRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("placement", String.valueOf(request.getPlacement())); + return params.build(); + } + }) + .build(); + + this.searchCallable = + callableFactory.createUnaryCallable( + searchTransportSettings, settings.searchSettings(), clientContext); + this.searchPagedCallable = + callableFactory.createPagedCallable( + searchTransportSettings, settings.searchSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable searchCallable() { + return searchCallable; + } + + @Override + public UnaryCallable searchPagedCallable() { + return searchPagedCallable; + } + + @Override + public final void close() { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/ProductServiceStub.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/ProductServiceStub.java index 75c2a975..3dfc1961 100644 --- a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/ProductServiceStub.java +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/ProductServiceStub.java @@ -16,16 +16,29 @@ package com.google.cloud.retail.v2.stub; +import static com.google.cloud.retail.v2.ProductServiceClient.ListProductsPagedResponse; + import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.retail.v2.AddFulfillmentPlacesMetadata; +import com.google.cloud.retail.v2.AddFulfillmentPlacesRequest; +import com.google.cloud.retail.v2.AddFulfillmentPlacesResponse; import com.google.cloud.retail.v2.CreateProductRequest; import com.google.cloud.retail.v2.DeleteProductRequest; import com.google.cloud.retail.v2.GetProductRequest; import com.google.cloud.retail.v2.ImportMetadata; import com.google.cloud.retail.v2.ImportProductsRequest; import com.google.cloud.retail.v2.ImportProductsResponse; +import com.google.cloud.retail.v2.ListProductsRequest; +import com.google.cloud.retail.v2.ListProductsResponse; import com.google.cloud.retail.v2.Product; +import com.google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata; +import com.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest; +import com.google.cloud.retail.v2.RemoveFulfillmentPlacesResponse; +import com.google.cloud.retail.v2.SetInventoryMetadata; +import com.google.cloud.retail.v2.SetInventoryRequest; +import com.google.cloud.retail.v2.SetInventoryResponse; import com.google.cloud.retail.v2.UpdateProductRequest; import com.google.longrunning.Operation; import com.google.longrunning.stub.OperationsStub; @@ -53,6 +66,14 @@ public UnaryCallable getProductCallable() { throw new UnsupportedOperationException("Not implemented: getProductCallable()"); } + public UnaryCallable listProductsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listProductsPagedCallable()"); + } + + public UnaryCallable listProductsCallable() { + throw new UnsupportedOperationException("Not implemented: listProductsCallable()"); + } + public UnaryCallable updateProductCallable() { throw new UnsupportedOperationException("Not implemented: updateProductCallable()"); } @@ -70,6 +91,40 @@ public UnaryCallable importProductsCallable() throw new UnsupportedOperationException("Not implemented: importProductsCallable()"); } + public OperationCallable + setInventoryOperationCallable() { + throw new UnsupportedOperationException("Not implemented: setInventoryOperationCallable()"); + } + + public UnaryCallable setInventoryCallable() { + throw new UnsupportedOperationException("Not implemented: setInventoryCallable()"); + } + + public OperationCallable< + AddFulfillmentPlacesRequest, AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> + addFulfillmentPlacesOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: addFulfillmentPlacesOperationCallable()"); + } + + public UnaryCallable addFulfillmentPlacesCallable() { + throw new UnsupportedOperationException("Not implemented: addFulfillmentPlacesCallable()"); + } + + public OperationCallable< + RemoveFulfillmentPlacesRequest, + RemoveFulfillmentPlacesResponse, + RemoveFulfillmentPlacesMetadata> + removeFulfillmentPlacesOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: removeFulfillmentPlacesOperationCallable()"); + } + + public UnaryCallable + removeFulfillmentPlacesCallable() { + throw new UnsupportedOperationException("Not implemented: removeFulfillmentPlacesCallable()"); + } + @Override public abstract void close(); } diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/ProductServiceStubSettings.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/ProductServiceStubSettings.java index 62b7b1e3..03024950 100644 --- a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/ProductServiceStubSettings.java +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/ProductServiceStubSettings.java @@ -16,7 +16,10 @@ package com.google.cloud.retail.v2.stub; +import static com.google.cloud.retail.v2.ProductServiceClient.ListProductsPagedResponse; + import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; @@ -28,20 +31,37 @@ import com.google.api.gax.longrunning.OperationSnapshot; import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; import com.google.api.gax.rpc.StatusCode; import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.retail.v2.AddFulfillmentPlacesMetadata; +import com.google.cloud.retail.v2.AddFulfillmentPlacesRequest; +import com.google.cloud.retail.v2.AddFulfillmentPlacesResponse; import com.google.cloud.retail.v2.CreateProductRequest; import com.google.cloud.retail.v2.DeleteProductRequest; import com.google.cloud.retail.v2.GetProductRequest; import com.google.cloud.retail.v2.ImportMetadata; import com.google.cloud.retail.v2.ImportProductsRequest; import com.google.cloud.retail.v2.ImportProductsResponse; +import com.google.cloud.retail.v2.ListProductsRequest; +import com.google.cloud.retail.v2.ListProductsResponse; import com.google.cloud.retail.v2.Product; +import com.google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata; +import com.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest; +import com.google.cloud.retail.v2.RemoveFulfillmentPlacesResponse; +import com.google.cloud.retail.v2.SetInventoryMetadata; +import com.google.cloud.retail.v2.SetInventoryRequest; +import com.google.cloud.retail.v2.SetInventoryResponse; import com.google.cloud.retail.v2.UpdateProductRequest; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; @@ -94,11 +114,83 @@ public class ProductServiceStubSettings extends StubSettings createProductSettings; private final UnaryCallSettings getProductSettings; + private final PagedCallSettings< + ListProductsRequest, ListProductsResponse, ListProductsPagedResponse> + listProductsSettings; private final UnaryCallSettings updateProductSettings; private final UnaryCallSettings deleteProductSettings; private final UnaryCallSettings importProductsSettings; private final OperationCallSettings importProductsOperationSettings; + private final UnaryCallSettings setInventorySettings; + private final OperationCallSettings< + SetInventoryRequest, SetInventoryResponse, SetInventoryMetadata> + setInventoryOperationSettings; + private final UnaryCallSettings + addFulfillmentPlacesSettings; + private final OperationCallSettings< + AddFulfillmentPlacesRequest, AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> + addFulfillmentPlacesOperationSettings; + private final UnaryCallSettings + removeFulfillmentPlacesSettings; + private final OperationCallSettings< + RemoveFulfillmentPlacesRequest, + RemoveFulfillmentPlacesResponse, + RemoveFulfillmentPlacesMetadata> + removeFulfillmentPlacesOperationSettings; + + private static final PagedListDescriptor + LIST_PRODUCTS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListProductsRequest injectToken(ListProductsRequest payload, String token) { + return ListProductsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListProductsRequest injectPageSize(ListProductsRequest payload, int pageSize) { + return ListProductsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListProductsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListProductsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListProductsResponse payload) { + return payload.getProductsList() == null + ? ImmutableList.of() + : payload.getProductsList(); + } + }; + + private static final PagedListResponseFactory< + ListProductsRequest, ListProductsResponse, ListProductsPagedResponse> + LIST_PRODUCTS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListProductsRequest, ListProductsResponse, ListProductsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListProductsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_PRODUCTS_PAGE_STR_DESC, request, context); + return ListProductsPagedResponse.createAsync(pageContext, futureResponse); + } + }; /** Returns the object with the settings used for calls to createProduct. */ public UnaryCallSettings createProductSettings() { @@ -110,6 +202,12 @@ public UnaryCallSettings getProductSettings() { return getProductSettings; } + /** Returns the object with the settings used for calls to listProducts. */ + public PagedCallSettings + listProductsSettings() { + return listProductsSettings; + } + /** Returns the object with the settings used for calls to updateProduct. */ public UnaryCallSettings updateProductSettings() { return updateProductSettings; @@ -131,6 +229,44 @@ public UnaryCallSettings importProductsSetting return importProductsOperationSettings; } + /** Returns the object with the settings used for calls to setInventory. */ + public UnaryCallSettings setInventorySettings() { + return setInventorySettings; + } + + /** Returns the object with the settings used for calls to setInventory. */ + public OperationCallSettings + setInventoryOperationSettings() { + return setInventoryOperationSettings; + } + + /** Returns the object with the settings used for calls to addFulfillmentPlaces. */ + public UnaryCallSettings addFulfillmentPlacesSettings() { + return addFulfillmentPlacesSettings; + } + + /** Returns the object with the settings used for calls to addFulfillmentPlaces. */ + public OperationCallSettings< + AddFulfillmentPlacesRequest, AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> + addFulfillmentPlacesOperationSettings() { + return addFulfillmentPlacesOperationSettings; + } + + /** Returns the object with the settings used for calls to removeFulfillmentPlaces. */ + public UnaryCallSettings + removeFulfillmentPlacesSettings() { + return removeFulfillmentPlacesSettings; + } + + /** Returns the object with the settings used for calls to removeFulfillmentPlaces. */ + public OperationCallSettings< + RemoveFulfillmentPlacesRequest, + RemoveFulfillmentPlacesResponse, + RemoveFulfillmentPlacesMetadata> + removeFulfillmentPlacesOperationSettings() { + return removeFulfillmentPlacesOperationSettings; + } + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public ProductServiceStub createStub() throws IOException { if (getTransportChannelProvider() @@ -207,10 +343,19 @@ protected ProductServiceStubSettings(Builder settingsBuilder) throws IOException createProductSettings = settingsBuilder.createProductSettings().build(); getProductSettings = settingsBuilder.getProductSettings().build(); + listProductsSettings = settingsBuilder.listProductsSettings().build(); updateProductSettings = settingsBuilder.updateProductSettings().build(); deleteProductSettings = settingsBuilder.deleteProductSettings().build(); importProductsSettings = settingsBuilder.importProductsSettings().build(); importProductsOperationSettings = settingsBuilder.importProductsOperationSettings().build(); + setInventorySettings = settingsBuilder.setInventorySettings().build(); + setInventoryOperationSettings = settingsBuilder.setInventoryOperationSettings().build(); + addFulfillmentPlacesSettings = settingsBuilder.addFulfillmentPlacesSettings().build(); + addFulfillmentPlacesOperationSettings = + settingsBuilder.addFulfillmentPlacesOperationSettings().build(); + removeFulfillmentPlacesSettings = settingsBuilder.removeFulfillmentPlacesSettings().build(); + removeFulfillmentPlacesOperationSettings = + settingsBuilder.removeFulfillmentPlacesOperationSettings().build(); } /** Builder for ProductServiceStubSettings. */ @@ -218,6 +363,9 @@ public static class Builder extends StubSettings.Builder> unaryMethodSettingsBuilders; private final UnaryCallSettings.Builder createProductSettings; private final UnaryCallSettings.Builder getProductSettings; + private final PagedCallSettings.Builder< + ListProductsRequest, ListProductsResponse, ListProductsPagedResponse> + listProductsSettings; private final UnaryCallSettings.Builder updateProductSettings; private final UnaryCallSettings.Builder deleteProductSettings; private final UnaryCallSettings.Builder @@ -225,6 +373,22 @@ public static class Builder extends StubSettings.Builder importProductsOperationSettings; + private final UnaryCallSettings.Builder setInventorySettings; + private final OperationCallSettings.Builder< + SetInventoryRequest, SetInventoryResponse, SetInventoryMetadata> + setInventoryOperationSettings; + private final UnaryCallSettings.Builder + addFulfillmentPlacesSettings; + private final OperationCallSettings.Builder< + AddFulfillmentPlacesRequest, AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> + addFulfillmentPlacesOperationSettings; + private final UnaryCallSettings.Builder + removeFulfillmentPlacesSettings; + private final OperationCallSettings.Builder< + RemoveFulfillmentPlacesRequest, + RemoveFulfillmentPlacesResponse, + RemoveFulfillmentPlacesMetadata> + removeFulfillmentPlacesOperationSettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -267,18 +431,29 @@ protected Builder(ClientContext clientContext) { createProductSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); getProductSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listProductsSettings = PagedCallSettings.newBuilder(LIST_PRODUCTS_PAGE_STR_FACT); updateProductSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); deleteProductSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); importProductsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); importProductsOperationSettings = OperationCallSettings.newBuilder(); + setInventorySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setInventoryOperationSettings = OperationCallSettings.newBuilder(); + addFulfillmentPlacesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + addFulfillmentPlacesOperationSettings = OperationCallSettings.newBuilder(); + removeFulfillmentPlacesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + removeFulfillmentPlacesOperationSettings = OperationCallSettings.newBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( createProductSettings, getProductSettings, + listProductsSettings, updateProductSettings, deleteProductSettings, - importProductsSettings); + importProductsSettings, + setInventorySettings, + addFulfillmentPlacesSettings, + removeFulfillmentPlacesSettings); initDefaults(this); } @@ -287,18 +462,31 @@ protected Builder(ProductServiceStubSettings settings) { createProductSettings = settings.createProductSettings.toBuilder(); getProductSettings = settings.getProductSettings.toBuilder(); + listProductsSettings = settings.listProductsSettings.toBuilder(); updateProductSettings = settings.updateProductSettings.toBuilder(); deleteProductSettings = settings.deleteProductSettings.toBuilder(); importProductsSettings = settings.importProductsSettings.toBuilder(); importProductsOperationSettings = settings.importProductsOperationSettings.toBuilder(); + setInventorySettings = settings.setInventorySettings.toBuilder(); + setInventoryOperationSettings = settings.setInventoryOperationSettings.toBuilder(); + addFulfillmentPlacesSettings = settings.addFulfillmentPlacesSettings.toBuilder(); + addFulfillmentPlacesOperationSettings = + settings.addFulfillmentPlacesOperationSettings.toBuilder(); + removeFulfillmentPlacesSettings = settings.removeFulfillmentPlacesSettings.toBuilder(); + removeFulfillmentPlacesOperationSettings = + settings.removeFulfillmentPlacesOperationSettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( createProductSettings, getProductSettings, + listProductsSettings, updateProductSettings, deleteProductSettings, - importProductsSettings); + importProductsSettings, + setInventorySettings, + addFulfillmentPlacesSettings, + removeFulfillmentPlacesSettings); } private static Builder createDefault() { @@ -325,6 +513,11 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + builder + .listProductsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + builder .updateProductSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) @@ -340,6 +533,21 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + builder + .setInventorySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .addFulfillmentPlacesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .removeFulfillmentPlacesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + builder .importProductsOperationSettings() .setInitialCallSettings( @@ -364,6 +572,82 @@ private static Builder initDefaults(Builder builder) { .setTotalTimeout(Duration.ofMillis(300000L)) .build())); + builder + .setInventoryOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(SetInventoryResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(SetInventoryMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .addFulfillmentPlacesOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create( + AddFulfillmentPlacesResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create( + AddFulfillmentPlacesMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .removeFulfillmentPlacesOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create( + RemoveFulfillmentPlacesResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create( + RemoveFulfillmentPlacesMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + return builder; } @@ -393,6 +677,13 @@ public UnaryCallSettings.Builder getProductSettings( return getProductSettings; } + /** Returns the builder for the settings used for calls to listProducts. */ + public PagedCallSettings.Builder< + ListProductsRequest, ListProductsResponse, ListProductsPagedResponse> + listProductsSettings() { + return listProductsSettings; + } + /** Returns the builder for the settings used for calls to updateProduct. */ public UnaryCallSettings.Builder updateProductSettings() { return updateProductSettings; @@ -417,6 +708,52 @@ public UnaryCallSettings.Builder importProduct return importProductsOperationSettings; } + /** Returns the builder for the settings used for calls to setInventory. */ + public UnaryCallSettings.Builder setInventorySettings() { + return setInventorySettings; + } + + /** Returns the builder for the settings used for calls to setInventory. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + SetInventoryRequest, SetInventoryResponse, SetInventoryMetadata> + setInventoryOperationSettings() { + return setInventoryOperationSettings; + } + + /** Returns the builder for the settings used for calls to addFulfillmentPlaces. */ + public UnaryCallSettings.Builder + addFulfillmentPlacesSettings() { + return addFulfillmentPlacesSettings; + } + + /** Returns the builder for the settings used for calls to addFulfillmentPlaces. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + AddFulfillmentPlacesRequest, AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> + addFulfillmentPlacesOperationSettings() { + return addFulfillmentPlacesOperationSettings; + } + + /** Returns the builder for the settings used for calls to removeFulfillmentPlaces. */ + public UnaryCallSettings.Builder + removeFulfillmentPlacesSettings() { + return removeFulfillmentPlacesSettings; + } + + /** Returns the builder for the settings used for calls to removeFulfillmentPlaces. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + RemoveFulfillmentPlacesRequest, + RemoveFulfillmentPlacesResponse, + RemoveFulfillmentPlacesMetadata> + removeFulfillmentPlacesOperationSettings() { + return removeFulfillmentPlacesOperationSettings; + } + @Override public ProductServiceStubSettings build() throws IOException { return new ProductServiceStubSettings(this); diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/SearchServiceStub.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/SearchServiceStub.java new file mode 100644 index 00000000..5a73622b --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/SearchServiceStub.java @@ -0,0 +1,46 @@ +/* + * 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 + * + * 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. + */ + +package com.google.cloud.retail.v2.stub; + +import static com.google.cloud.retail.v2.SearchServiceClient.SearchPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.retail.v2.SearchRequest; +import com.google.cloud.retail.v2.SearchResponse; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the SearchService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class SearchServiceStub implements BackgroundResource { + + public UnaryCallable searchPagedCallable() { + throw new UnsupportedOperationException("Not implemented: searchPagedCallable()"); + } + + public UnaryCallable searchCallable() { + throw new UnsupportedOperationException("Not implemented: searchCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/SearchServiceStubSettings.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/SearchServiceStubSettings.java new file mode 100644 index 00000000..3bcd6106 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/SearchServiceStubSettings.java @@ -0,0 +1,339 @@ +/* + * 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 + * + * 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. + */ + +package com.google.cloud.retail.v2.stub; + +import static com.google.cloud.retail.v2.SearchServiceClient.SearchPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.retail.v2.SearchRequest; +import com.google.cloud.retail.v2.SearchResponse; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link SearchServiceStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (retail.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of search to 30 seconds: + * + *

{@code
+ * SearchServiceStubSettings.Builder searchServiceSettingsBuilder =
+ *     SearchServiceStubSettings.newBuilder();
+ * searchServiceSettingsBuilder
+ *     .searchSettings()
+ *     .setRetrySettings(
+ *         searchServiceSettingsBuilder
+ *             .searchSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * SearchServiceStubSettings searchServiceSettings = searchServiceSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class SearchServiceStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final PagedCallSettings + searchSettings; + + private static final PagedListDescriptor< + SearchRequest, SearchResponse, SearchResponse.SearchResult> + SEARCH_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public SearchRequest injectToken(SearchRequest payload, String token) { + return SearchRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public SearchRequest injectPageSize(SearchRequest payload, int pageSize) { + return SearchRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(SearchRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(SearchResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(SearchResponse payload) { + return payload.getResultsList() == null + ? ImmutableList.of() + : payload.getResultsList(); + } + }; + + private static final PagedListResponseFactory + SEARCH_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + SearchRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, SEARCH_PAGE_STR_DESC, request, context); + return SearchPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to search. */ + public PagedCallSettings searchSettings() { + return searchSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public SearchServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcSearchServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "retail.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "retail.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SearchServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected SearchServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + searchSettings = settingsBuilder.searchSettings().build(); + } + + /** Builder for SearchServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final PagedCallSettings.Builder + searchSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED))); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + searchSettings = PagedCallSettings.newBuilder(SEARCH_PAGE_STR_FACT); + + unaryMethodSettingsBuilders = + ImmutableList.>of(searchSettings); + initDefaults(this); + } + + protected Builder(SearchServiceStubSettings settings) { + super(settings); + + searchSettings = settings.searchSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of(searchSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .searchSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + return builder; + } + + // NEXT_MAJOR_VER: remove 'throws Exception'. + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to search. */ + public PagedCallSettings.Builder + searchSettings() { + return searchSettings; + } + + @Override + public SearchServiceStubSettings build() throws IOException { + return new SearchServiceStubSettings(this); + } + } +} diff --git a/google-cloud-retail/src/test/java/com/google/cloud/retail/v2/CatalogServiceClientTest.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2/CatalogServiceClientTest.java index b67a7552..865a391c 100644 --- a/google-cloud-retail/src/test/java/com/google/cloud/retail/v2/CatalogServiceClientTest.java +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2/CatalogServiceClientTest.java @@ -27,7 +27,9 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.common.collect.Lists; import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; import io.grpc.StatusRuntimeException; import java.io.IOException; import java.util.Arrays; @@ -209,4 +211,152 @@ public void updateCatalogExceptionTest() throws Exception { // Expected exception. } } + + @Test + public void setDefaultBranchTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockCatalogService.addResponse(expectedResponse); + + CatalogName catalog = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]"); + + client.setDefaultBranch(catalog); + + List actualRequests = mockCatalogService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetDefaultBranchRequest actualRequest = ((SetDefaultBranchRequest) actualRequests.get(0)); + + Assert.assertEquals(catalog.toString(), actualRequest.getCatalog()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setDefaultBranchExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCatalogService.addException(exception); + + try { + CatalogName catalog = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]"); + client.setDefaultBranch(catalog); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setDefaultBranchTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockCatalogService.addResponse(expectedResponse); + + String catalog = "catalog555704345"; + + client.setDefaultBranch(catalog); + + List actualRequests = mockCatalogService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetDefaultBranchRequest actualRequest = ((SetDefaultBranchRequest) actualRequests.get(0)); + + Assert.assertEquals(catalog, actualRequest.getCatalog()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setDefaultBranchExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCatalogService.addException(exception); + + try { + String catalog = "catalog555704345"; + client.setDefaultBranch(catalog); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getDefaultBranchTest() throws Exception { + GetDefaultBranchResponse expectedResponse = + GetDefaultBranchResponse.newBuilder() + .setBranch(BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString()) + .setSetTime(Timestamp.newBuilder().build()) + .setNote("note3387378") + .build(); + mockCatalogService.addResponse(expectedResponse); + + CatalogName catalog = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]"); + + GetDefaultBranchResponse actualResponse = client.getDefaultBranch(catalog); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCatalogService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetDefaultBranchRequest actualRequest = ((GetDefaultBranchRequest) actualRequests.get(0)); + + Assert.assertEquals(catalog.toString(), actualRequest.getCatalog()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getDefaultBranchExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCatalogService.addException(exception); + + try { + CatalogName catalog = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]"); + client.getDefaultBranch(catalog); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getDefaultBranchTest2() throws Exception { + GetDefaultBranchResponse expectedResponse = + GetDefaultBranchResponse.newBuilder() + .setBranch(BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString()) + .setSetTime(Timestamp.newBuilder().build()) + .setNote("note3387378") + .build(); + mockCatalogService.addResponse(expectedResponse); + + String catalog = "catalog555704345"; + + GetDefaultBranchResponse actualResponse = client.getDefaultBranch(catalog); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCatalogService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetDefaultBranchRequest actualRequest = ((GetDefaultBranchRequest) actualRequests.get(0)); + + Assert.assertEquals(catalog, actualRequest.getCatalog()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getDefaultBranchExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCatalogService.addException(exception); + + try { + String catalog = "catalog555704345"; + client.getDefaultBranch(catalog); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } } diff --git a/google-cloud-retail/src/test/java/com/google/cloud/retail/v2/CompletionServiceClientTest.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2/CompletionServiceClientTest.java new file mode 100644 index 00000000..89ce1a46 --- /dev/null +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2/CompletionServiceClientTest.java @@ -0,0 +1,207 @@ +/* + * 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 + * + * 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. + */ + +package com.google.cloud.retail.v2; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.rpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class CompletionServiceClientTest { + private static MockCompletionService mockCompletionService; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private CompletionServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockCompletionService = new MockCompletionService(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockCompletionService)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + CompletionServiceSettings settings = + CompletionServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = CompletionServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void completeQueryTest() throws Exception { + CompleteQueryResponse expectedResponse = + CompleteQueryResponse.newBuilder() + .addAllCompletionResults(new ArrayList()) + .setAttributionToken("attributionToken104706234") + .addAllRecentSearchResults(new ArrayList()) + .build(); + mockCompletionService.addResponse(expectedResponse); + + CompleteQueryRequest request = + CompleteQueryRequest.newBuilder() + .setCatalog(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + .setQuery("query107944136") + .setVisitorId("visitorId1880545833") + .addAllLanguageCodes(new ArrayList()) + .setDeviceType("deviceType781190832") + .setDataset("dataset1443214456") + .setMaxSuggestions(618824852) + .build(); + + CompleteQueryResponse actualResponse = client.completeQuery(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCompletionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CompleteQueryRequest actualRequest = ((CompleteQueryRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getCatalog(), actualRequest.getCatalog()); + Assert.assertEquals(request.getQuery(), actualRequest.getQuery()); + Assert.assertEquals(request.getVisitorId(), actualRequest.getVisitorId()); + Assert.assertEquals(request.getLanguageCodesList(), actualRequest.getLanguageCodesList()); + Assert.assertEquals(request.getDeviceType(), actualRequest.getDeviceType()); + Assert.assertEquals(request.getDataset(), actualRequest.getDataset()); + Assert.assertEquals(request.getMaxSuggestions(), actualRequest.getMaxSuggestions()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void completeQueryExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCompletionService.addException(exception); + + try { + CompleteQueryRequest request = + CompleteQueryRequest.newBuilder() + .setCatalog(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + .setQuery("query107944136") + .setVisitorId("visitorId1880545833") + .addAllLanguageCodes(new ArrayList()) + .setDeviceType("deviceType781190832") + .setDataset("dataset1443214456") + .setMaxSuggestions(618824852) + .build(); + client.completeQuery(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void importCompletionDataTest() throws Exception { + ImportCompletionDataResponse expectedResponse = + ImportCompletionDataResponse.newBuilder() + .addAllErrorSamples(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("importCompletionDataTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockCompletionService.addResponse(resultOperation); + + ImportCompletionDataRequest request = + ImportCompletionDataRequest.newBuilder() + .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + .setInputConfig(CompletionDataInputConfig.newBuilder().build()) + .setNotificationPubsubTopic("notificationPubsubTopic-1361224991") + .build(); + + ImportCompletionDataResponse actualResponse = client.importCompletionDataAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCompletionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ImportCompletionDataRequest actualRequest = + ((ImportCompletionDataRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertEquals(request.getInputConfig(), actualRequest.getInputConfig()); + Assert.assertEquals( + request.getNotificationPubsubTopic(), actualRequest.getNotificationPubsubTopic()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void importCompletionDataExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCompletionService.addException(exception); + + try { + ImportCompletionDataRequest request = + ImportCompletionDataRequest.newBuilder() + .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + .setInputConfig(CompletionDataInputConfig.newBuilder().build()) + .setNotificationPubsubTopic("notificationPubsubTopic-1361224991") + .build(); + client.importCompletionDataAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } +} diff --git a/google-cloud-retail/src/test/java/com/google/cloud/retail/v2/MockCatalogServiceImpl.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2/MockCatalogServiceImpl.java index 25e85db0..852ba620 100644 --- a/google-cloud-retail/src/test/java/com/google/cloud/retail/v2/MockCatalogServiceImpl.java +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2/MockCatalogServiceImpl.java @@ -19,6 +19,7 @@ import com.google.api.core.BetaApi; import com.google.cloud.retail.v2.CatalogServiceGrpc.CatalogServiceImplBase; import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; import io.grpc.stub.StreamObserver; import java.util.ArrayList; import java.util.LinkedList; @@ -99,4 +100,46 @@ public void updateCatalog( Exception.class.getName()))); } } + + @Override + public void setDefaultBranch( + SetDefaultBranchRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method SetDefaultBranch, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getDefaultBranch( + GetDefaultBranchRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof GetDefaultBranchResponse) { + requests.add(request); + responseObserver.onNext(((GetDefaultBranchResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetDefaultBranch, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + GetDefaultBranchResponse.class.getName(), + Exception.class.getName()))); + } + } } diff --git a/google-cloud-retail/src/test/java/com/google/cloud/retail/v2/MockCompletionService.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2/MockCompletionService.java new file mode 100644 index 00000000..010ed930 --- /dev/null +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2/MockCompletionService.java @@ -0,0 +1,59 @@ +/* + * 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 + * + * 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. + */ + +package com.google.cloud.retail.v2; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockCompletionService implements MockGrpcService { + private final MockCompletionServiceImpl serviceImpl; + + public MockCompletionService() { + serviceImpl = new MockCompletionServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/google-cloud-retail/src/test/java/com/google/cloud/retail/v2/MockCompletionServiceImpl.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2/MockCompletionServiceImpl.java new file mode 100644 index 00000000..4375a5bd --- /dev/null +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2/MockCompletionServiceImpl.java @@ -0,0 +1,103 @@ +/* + * 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 + * + * 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. + */ + +package com.google.cloud.retail.v2; + +import com.google.api.core.BetaApi; +import com.google.cloud.retail.v2.CompletionServiceGrpc.CompletionServiceImplBase; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockCompletionServiceImpl extends CompletionServiceImplBase { + private List requests; + private Queue responses; + + public MockCompletionServiceImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void completeQuery( + CompleteQueryRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof CompleteQueryResponse) { + requests.add(request); + responseObserver.onNext(((CompleteQueryResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CompleteQuery, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + CompleteQueryResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void importCompletionData( + ImportCompletionDataRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ImportCompletionData, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/google-cloud-retail/src/test/java/com/google/cloud/retail/v2/MockProductServiceImpl.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2/MockProductServiceImpl.java index 0bdc697d..9666afac 100644 --- a/google-cloud-retail/src/test/java/com/google/cloud/retail/v2/MockProductServiceImpl.java +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2/MockProductServiceImpl.java @@ -101,6 +101,27 @@ public void getProduct(GetProductRequest request, StreamObserver respon } } + @Override + public void listProducts( + ListProductsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListProductsResponse) { + requests.add(request); + responseObserver.onNext(((ListProductsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListProducts, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListProductsResponse.class.getName(), + Exception.class.getName()))); + } + } + @Override public void updateProduct( UpdateProductRequest request, StreamObserver responseObserver) { @@ -162,4 +183,67 @@ public void importProducts( Exception.class.getName()))); } } + + @Override + public void setInventory( + SetInventoryRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method SetInventory, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void addFulfillmentPlaces( + AddFulfillmentPlacesRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method AddFulfillmentPlaces, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void removeFulfillmentPlaces( + RemoveFulfillmentPlacesRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method RemoveFulfillmentPlaces, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } } diff --git a/google-cloud-retail/src/test/java/com/google/cloud/retail/v2/MockSearchService.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2/MockSearchService.java new file mode 100644 index 00000000..134759f9 --- /dev/null +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2/MockSearchService.java @@ -0,0 +1,59 @@ +/* + * 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 + * + * 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. + */ + +package com.google.cloud.retail.v2; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSearchService implements MockGrpcService { + private final MockSearchServiceImpl serviceImpl; + + public MockSearchService() { + serviceImpl = new MockSearchServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/google-cloud-retail/src/test/java/com/google/cloud/retail/v2/MockSearchServiceImpl.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2/MockSearchServiceImpl.java new file mode 100644 index 00000000..98f22bf9 --- /dev/null +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2/MockSearchServiceImpl.java @@ -0,0 +1,80 @@ +/* + * 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 + * + * 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. + */ + +package com.google.cloud.retail.v2; + +import com.google.api.core.BetaApi; +import com.google.cloud.retail.v2.SearchServiceGrpc.SearchServiceImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSearchServiceImpl extends SearchServiceImplBase { + private List requests; + private Queue responses; + + public MockSearchServiceImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void search(SearchRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof SearchResponse) { + requests.add(request); + responseObserver.onNext(((SearchResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Search, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + SearchResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/google-cloud-retail/src/test/java/com/google/cloud/retail/v2/ProductServiceClientTest.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2/ProductServiceClientTest.java index 20889f76..9bf6c2ee 100644 --- a/google-cloud-retail/src/test/java/com/google/cloud/retail/v2/ProductServiceClientTest.java +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2/ProductServiceClientTest.java @@ -16,6 +16,8 @@ package com.google.cloud.retail.v2; +import static com.google.cloud.retail.v2.ProductServiceClient.ListProductsPagedResponse; + import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.grpc.GaxGrpcProperties; import com.google.api.gax.grpc.testing.LocalChannelProvider; @@ -24,6 +26,7 @@ import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode; +import com.google.common.collect.Lists; import com.google.longrunning.Operation; import com.google.protobuf.AbstractMessage; import com.google.protobuf.Any; @@ -95,16 +98,32 @@ public void createProductTest() throws Exception { .toString()) .setId("id3355") .setPrimaryProductId("primaryProductId-857339256") + .addAllCollectionMemberIds(new ArrayList()) + .setGtin("gtin3183314") .addAllCategories(new ArrayList()) .setTitle("title110371416") + .addAllBrands(new ArrayList()) .setDescription("description-1724546052") + .setLanguageCode("languageCode-2092349083") .putAllAttributes(new HashMap()) .addAllTags(new ArrayList()) .setPriceInfo(PriceInfo.newBuilder().build()) + .setRating(Rating.newBuilder().build()) .setAvailableTime(Timestamp.newBuilder().build()) .setAvailableQuantity(Int32Value.newBuilder().build()) + .addAllFulfillmentInfo(new ArrayList()) .setUri("uri116076") .addAllImages(new ArrayList()) + .setAudience(Audience.newBuilder().build()) + .setColorInfo(ColorInfo.newBuilder().build()) + .addAllSizes(new ArrayList()) + .addAllMaterials(new ArrayList()) + .addAllPatterns(new ArrayList()) + .addAllConditions(new ArrayList()) + .addAllPromotions(new ArrayList()) + .setPublishTime(Timestamp.newBuilder().build()) + .setRetrievableFields(FieldMask.newBuilder().build()) + .addAllVariants(new ArrayList()) .build(); mockProductService.addResponse(expectedResponse); @@ -153,16 +172,32 @@ public void createProductTest2() throws Exception { .toString()) .setId("id3355") .setPrimaryProductId("primaryProductId-857339256") + .addAllCollectionMemberIds(new ArrayList()) + .setGtin("gtin3183314") .addAllCategories(new ArrayList()) .setTitle("title110371416") + .addAllBrands(new ArrayList()) .setDescription("description-1724546052") + .setLanguageCode("languageCode-2092349083") .putAllAttributes(new HashMap()) .addAllTags(new ArrayList()) .setPriceInfo(PriceInfo.newBuilder().build()) + .setRating(Rating.newBuilder().build()) .setAvailableTime(Timestamp.newBuilder().build()) .setAvailableQuantity(Int32Value.newBuilder().build()) + .addAllFulfillmentInfo(new ArrayList()) .setUri("uri116076") .addAllImages(new ArrayList()) + .setAudience(Audience.newBuilder().build()) + .setColorInfo(ColorInfo.newBuilder().build()) + .addAllSizes(new ArrayList()) + .addAllMaterials(new ArrayList()) + .addAllPatterns(new ArrayList()) + .addAllConditions(new ArrayList()) + .addAllPromotions(new ArrayList()) + .setPublishTime(Timestamp.newBuilder().build()) + .setRetrievableFields(FieldMask.newBuilder().build()) + .addAllVariants(new ArrayList()) .build(); mockProductService.addResponse(expectedResponse); @@ -211,16 +246,32 @@ public void getProductTest() throws Exception { .toString()) .setId("id3355") .setPrimaryProductId("primaryProductId-857339256") + .addAllCollectionMemberIds(new ArrayList()) + .setGtin("gtin3183314") .addAllCategories(new ArrayList()) .setTitle("title110371416") + .addAllBrands(new ArrayList()) .setDescription("description-1724546052") + .setLanguageCode("languageCode-2092349083") .putAllAttributes(new HashMap()) .addAllTags(new ArrayList()) .setPriceInfo(PriceInfo.newBuilder().build()) + .setRating(Rating.newBuilder().build()) .setAvailableTime(Timestamp.newBuilder().build()) .setAvailableQuantity(Int32Value.newBuilder().build()) + .addAllFulfillmentInfo(new ArrayList()) .setUri("uri116076") .addAllImages(new ArrayList()) + .setAudience(Audience.newBuilder().build()) + .setColorInfo(ColorInfo.newBuilder().build()) + .addAllSizes(new ArrayList()) + .addAllMaterials(new ArrayList()) + .addAllPatterns(new ArrayList()) + .addAllConditions(new ArrayList()) + .addAllPromotions(new ArrayList()) + .setPublishTime(Timestamp.newBuilder().build()) + .setRetrievableFields(FieldMask.newBuilder().build()) + .addAllVariants(new ArrayList()) .build(); mockProductService.addResponse(expectedResponse); @@ -265,16 +316,32 @@ public void getProductTest2() throws Exception { .toString()) .setId("id3355") .setPrimaryProductId("primaryProductId-857339256") + .addAllCollectionMemberIds(new ArrayList()) + .setGtin("gtin3183314") .addAllCategories(new ArrayList()) .setTitle("title110371416") + .addAllBrands(new ArrayList()) .setDescription("description-1724546052") + .setLanguageCode("languageCode-2092349083") .putAllAttributes(new HashMap()) .addAllTags(new ArrayList()) .setPriceInfo(PriceInfo.newBuilder().build()) + .setRating(Rating.newBuilder().build()) .setAvailableTime(Timestamp.newBuilder().build()) .setAvailableQuantity(Int32Value.newBuilder().build()) + .addAllFulfillmentInfo(new ArrayList()) .setUri("uri116076") .addAllImages(new ArrayList()) + .setAudience(Audience.newBuilder().build()) + .setColorInfo(ColorInfo.newBuilder().build()) + .addAllSizes(new ArrayList()) + .addAllMaterials(new ArrayList()) + .addAllPatterns(new ArrayList()) + .addAllConditions(new ArrayList()) + .addAllPromotions(new ArrayList()) + .setPublishTime(Timestamp.newBuilder().build()) + .setRetrievableFields(FieldMask.newBuilder().build()) + .addAllVariants(new ArrayList()) .build(); mockProductService.addResponse(expectedResponse); @@ -308,6 +375,94 @@ public void getProductExceptionTest2() throws Exception { } } + @Test + public void listProductsTest() throws Exception { + Product responsesElement = Product.newBuilder().build(); + ListProductsResponse expectedResponse = + ListProductsResponse.newBuilder() + .setNextPageToken("") + .addAllProducts(Arrays.asList(responsesElement)) + .build(); + mockProductService.addResponse(expectedResponse); + + BranchName parent = BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]"); + + ListProductsPagedResponse pagedListResponse = client.listProducts(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getProductsList().get(0), resources.get(0)); + + List actualRequests = mockProductService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListProductsRequest actualRequest = ((ListProductsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listProductsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProductService.addException(exception); + + try { + BranchName parent = BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]"); + client.listProducts(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listProductsTest2() throws Exception { + Product responsesElement = Product.newBuilder().build(); + ListProductsResponse expectedResponse = + ListProductsResponse.newBuilder() + .setNextPageToken("") + .addAllProducts(Arrays.asList(responsesElement)) + .build(); + mockProductService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListProductsPagedResponse pagedListResponse = client.listProducts(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getProductsList().get(0), resources.get(0)); + + List actualRequests = mockProductService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListProductsRequest actualRequest = ((ListProductsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listProductsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProductService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listProducts(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + @Test public void updateProductTest() throws Exception { Product expectedResponse = @@ -317,16 +472,32 @@ public void updateProductTest() throws Exception { .toString()) .setId("id3355") .setPrimaryProductId("primaryProductId-857339256") + .addAllCollectionMemberIds(new ArrayList()) + .setGtin("gtin3183314") .addAllCategories(new ArrayList()) .setTitle("title110371416") + .addAllBrands(new ArrayList()) .setDescription("description-1724546052") + .setLanguageCode("languageCode-2092349083") .putAllAttributes(new HashMap()) .addAllTags(new ArrayList()) .setPriceInfo(PriceInfo.newBuilder().build()) + .setRating(Rating.newBuilder().build()) .setAvailableTime(Timestamp.newBuilder().build()) .setAvailableQuantity(Int32Value.newBuilder().build()) + .addAllFulfillmentInfo(new ArrayList()) .setUri("uri116076") .addAllImages(new ArrayList()) + .setAudience(Audience.newBuilder().build()) + .setColorInfo(ColorInfo.newBuilder().build()) + .addAllSizes(new ArrayList()) + .addAllMaterials(new ArrayList()) + .addAllPatterns(new ArrayList()) + .addAllConditions(new ArrayList()) + .addAllPromotions(new ArrayList()) + .setPublishTime(Timestamp.newBuilder().build()) + .setRetrievableFields(FieldMask.newBuilder().build()) + .addAllVariants(new ArrayList()) .build(); mockProductService.addResponse(expectedResponse); @@ -450,10 +621,12 @@ public void importProductsTest() throws Exception { ImportProductsRequest request = ImportProductsRequest.newBuilder() - .setParent("parent-995424086") + .setParent(BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString()) + .setRequestId("requestId693933066") .setInputConfig(ProductInputConfig.newBuilder().build()) .setErrorsConfig(ImportErrorsConfig.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) + .setNotificationPubsubTopic("notificationPubsubTopic-1361224991") .build(); ImportProductsResponse actualResponse = client.importProductsAsync(request).get(); @@ -464,9 +637,13 @@ public void importProductsTest() throws Exception { ImportProductsRequest actualRequest = ((ImportProductsRequest) actualRequests.get(0)); Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertEquals(request.getRequestId(), actualRequest.getRequestId()); Assert.assertEquals(request.getInputConfig(), actualRequest.getInputConfig()); Assert.assertEquals(request.getErrorsConfig(), actualRequest.getErrorsConfig()); Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertEquals(request.getReconciliationMode(), actualRequest.getReconciliationMode()); + Assert.assertEquals( + request.getNotificationPubsubTopic(), actualRequest.getNotificationPubsubTopic()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -481,10 +658,13 @@ public void importProductsExceptionTest() throws Exception { try { ImportProductsRequest request = ImportProductsRequest.newBuilder() - .setParent("parent-995424086") + .setParent( + BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString()) + .setRequestId("requestId693933066") .setInputConfig(ProductInputConfig.newBuilder().build()) .setErrorsConfig(ImportErrorsConfig.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) + .setNotificationPubsubTopic("notificationPubsubTopic-1361224991") .build(); client.importProductsAsync(request).get(); Assert.fail("No exception raised"); @@ -494,4 +674,236 @@ public void importProductsExceptionTest() throws Exception { Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); } } + + @Test + public void setInventoryTest() throws Exception { + SetInventoryResponse expectedResponse = SetInventoryResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("setInventoryTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockProductService.addResponse(resultOperation); + + Product inventory = Product.newBuilder().build(); + FieldMask setMask = FieldMask.newBuilder().build(); + + SetInventoryResponse actualResponse = client.setInventoryAsync(inventory, setMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProductService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetInventoryRequest actualRequest = ((SetInventoryRequest) actualRequests.get(0)); + + Assert.assertEquals(inventory, actualRequest.getInventory()); + Assert.assertEquals(setMask, actualRequest.getSetMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setInventoryExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProductService.addException(exception); + + try { + Product inventory = Product.newBuilder().build(); + FieldMask setMask = FieldMask.newBuilder().build(); + client.setInventoryAsync(inventory, setMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void addFulfillmentPlacesTest() throws Exception { + AddFulfillmentPlacesResponse expectedResponse = + AddFulfillmentPlacesResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("addFulfillmentPlacesTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockProductService.addResponse(resultOperation); + + ProductName product = + ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"); + + AddFulfillmentPlacesResponse actualResponse = client.addFulfillmentPlacesAsync(product).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProductService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + AddFulfillmentPlacesRequest actualRequest = + ((AddFulfillmentPlacesRequest) actualRequests.get(0)); + + Assert.assertEquals(product.toString(), actualRequest.getProduct()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void addFulfillmentPlacesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProductService.addException(exception); + + try { + ProductName product = + ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"); + client.addFulfillmentPlacesAsync(product).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void addFulfillmentPlacesTest2() throws Exception { + AddFulfillmentPlacesResponse expectedResponse = + AddFulfillmentPlacesResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("addFulfillmentPlacesTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockProductService.addResponse(resultOperation); + + String product = "product-309474065"; + + AddFulfillmentPlacesResponse actualResponse = client.addFulfillmentPlacesAsync(product).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProductService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + AddFulfillmentPlacesRequest actualRequest = + ((AddFulfillmentPlacesRequest) actualRequests.get(0)); + + Assert.assertEquals(product, actualRequest.getProduct()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void addFulfillmentPlacesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProductService.addException(exception); + + try { + String product = "product-309474065"; + client.addFulfillmentPlacesAsync(product).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void removeFulfillmentPlacesTest() throws Exception { + RemoveFulfillmentPlacesResponse expectedResponse = + RemoveFulfillmentPlacesResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("removeFulfillmentPlacesTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockProductService.addResponse(resultOperation); + + ProductName product = + ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"); + + RemoveFulfillmentPlacesResponse actualResponse = + client.removeFulfillmentPlacesAsync(product).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProductService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RemoveFulfillmentPlacesRequest actualRequest = + ((RemoveFulfillmentPlacesRequest) actualRequests.get(0)); + + Assert.assertEquals(product.toString(), actualRequest.getProduct()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void removeFulfillmentPlacesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProductService.addException(exception); + + try { + ProductName product = + ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"); + client.removeFulfillmentPlacesAsync(product).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void removeFulfillmentPlacesTest2() throws Exception { + RemoveFulfillmentPlacesResponse expectedResponse = + RemoveFulfillmentPlacesResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("removeFulfillmentPlacesTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockProductService.addResponse(resultOperation); + + String product = "product-309474065"; + + RemoveFulfillmentPlacesResponse actualResponse = + client.removeFulfillmentPlacesAsync(product).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProductService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RemoveFulfillmentPlacesRequest actualRequest = + ((RemoveFulfillmentPlacesRequest) actualRequests.get(0)); + + Assert.assertEquals(product, actualRequest.getProduct()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void removeFulfillmentPlacesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProductService.addException(exception); + + try { + String product = "product-309474065"; + client.removeFulfillmentPlacesAsync(product).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } } diff --git a/google-cloud-retail/src/test/java/com/google/cloud/retail/v2/SearchServiceClientTest.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2/SearchServiceClientTest.java new file mode 100644 index 00000000..87739a2c --- /dev/null +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2/SearchServiceClientTest.java @@ -0,0 +1,182 @@ +/* + * 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 + * + * 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. + */ + +package com.google.cloud.retail.v2; + +import static com.google.cloud.retail.v2.SearchServiceClient.SearchPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.common.collect.Lists; +import com.google.protobuf.AbstractMessage; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class SearchServiceClientTest { + private static MockSearchService mockSearchService; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private SearchServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockSearchService = new MockSearchService(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockSearchService)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + SearchServiceSettings settings = + SearchServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SearchServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void searchTest() throws Exception { + SearchResponse.SearchResult responsesElement = SearchResponse.SearchResult.newBuilder().build(); + SearchResponse expectedResponse = + SearchResponse.newBuilder() + .setNextPageToken("") + .addAllResults(Arrays.asList(responsesElement)) + .build(); + mockSearchService.addResponse(expectedResponse); + + SearchRequest request = + SearchRequest.newBuilder() + .setPlacement("placement1792938725") + .setBranch(BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString()) + .setQuery("query107944136") + .setVisitorId("visitorId1880545833") + .setUserInfo(UserInfo.newBuilder().build()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setOffset(-1019779949) + .setFilter("filter-1274492040") + .setCanonicalFilter("canonicalFilter-722283124") + .setOrderBy("orderBy-1207110587") + .addAllFacetSpecs(new ArrayList()) + .setDynamicFacetSpec(SearchRequest.DynamicFacetSpec.newBuilder().build()) + .setBoostSpec(SearchRequest.BoostSpec.newBuilder().build()) + .setQueryExpansionSpec(SearchRequest.QueryExpansionSpec.newBuilder().build()) + .addAllVariantRollupKeys(new ArrayList()) + .addAllPageCategories(new ArrayList()) + .build(); + + SearchPagedResponse pagedListResponse = client.search(request); + + List resources = + Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getResultsList().get(0), resources.get(0)); + + List actualRequests = mockSearchService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SearchRequest actualRequest = ((SearchRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getPlacement(), actualRequest.getPlacement()); + Assert.assertEquals(request.getBranch(), actualRequest.getBranch()); + Assert.assertEquals(request.getQuery(), actualRequest.getQuery()); + Assert.assertEquals(request.getVisitorId(), actualRequest.getVisitorId()); + Assert.assertEquals(request.getUserInfo(), actualRequest.getUserInfo()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertEquals(request.getOffset(), actualRequest.getOffset()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getCanonicalFilter(), actualRequest.getCanonicalFilter()); + Assert.assertEquals(request.getOrderBy(), actualRequest.getOrderBy()); + Assert.assertEquals(request.getFacetSpecsList(), actualRequest.getFacetSpecsList()); + Assert.assertEquals(request.getDynamicFacetSpec(), actualRequest.getDynamicFacetSpec()); + Assert.assertEquals(request.getBoostSpec(), actualRequest.getBoostSpec()); + Assert.assertEquals(request.getQueryExpansionSpec(), actualRequest.getQueryExpansionSpec()); + Assert.assertEquals( + request.getVariantRollupKeysList(), actualRequest.getVariantRollupKeysList()); + Assert.assertEquals(request.getPageCategoriesList(), actualRequest.getPageCategoriesList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void searchExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSearchService.addException(exception); + + try { + SearchRequest request = + SearchRequest.newBuilder() + .setPlacement("placement1792938725") + .setBranch( + BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString()) + .setQuery("query107944136") + .setVisitorId("visitorId1880545833") + .setUserInfo(UserInfo.newBuilder().build()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setOffset(-1019779949) + .setFilter("filter-1274492040") + .setCanonicalFilter("canonicalFilter-722283124") + .setOrderBy("orderBy-1207110587") + .addAllFacetSpecs(new ArrayList()) + .setDynamicFacetSpec(SearchRequest.DynamicFacetSpec.newBuilder().build()) + .setBoostSpec(SearchRequest.BoostSpec.newBuilder().build()) + .setQueryExpansionSpec(SearchRequest.QueryExpansionSpec.newBuilder().build()) + .addAllVariantRollupKeys(new ArrayList()) + .addAllPageCategories(new ArrayList()) + .build(); + client.search(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/google-cloud-retail/src/test/java/com/google/cloud/retail/v2/UserEventServiceClientTest.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2/UserEventServiceClientTest.java index 597991f6..69012193 100644 --- a/google-cloud-retail/src/test/java/com/google/cloud/retail/v2/UserEventServiceClientTest.java +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2/UserEventServiceClientTest.java @@ -91,14 +91,19 @@ public void writeUserEventTest() throws Exception { UserEvent.newBuilder() .setEventType("eventType31430900") .setVisitorId("visitorId1880545833") + .setSessionId("sessionId607796817") .setEventTime(Timestamp.newBuilder().build()) .addAllExperimentIds(new ArrayList()) .setAttributionToken("attributionToken104706234") .addAllProductDetails(new ArrayList()) + .setCompletionDetail(CompletionDetail.newBuilder().build()) .putAllAttributes(new HashMap()) .setCartId("cartId-1367589797") .setPurchaseTransaction(PurchaseTransaction.newBuilder().build()) .setSearchQuery("searchQuery-552137728") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .setOffset(-1019779949) .addAllPageCategories(new ArrayList()) .setUserInfo(UserInfo.newBuilder().build()) .setUri("uri116076") @@ -275,7 +280,7 @@ public void importUserEventsTest() throws Exception { ImportUserEventsRequest request = ImportUserEventsRequest.newBuilder() - .setParent("parent-995424086") + .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) .setInputConfig(UserEventInputConfig.newBuilder().build()) .setErrorsConfig(ImportErrorsConfig.newBuilder().build()) .build(); @@ -304,7 +309,7 @@ public void importUserEventsExceptionTest() throws Exception { try { ImportUserEventsRequest request = ImportUserEventsRequest.newBuilder() - .setParent("parent-995424086") + .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) .setInputConfig(UserEventInputConfig.newBuilder().build()) .setErrorsConfig(ImportErrorsConfig.newBuilder().build()) .build(); diff --git a/grpc-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CatalogServiceGrpc.java b/grpc-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CatalogServiceGrpc.java index d4242190..cdcf37d2 100644 --- a/grpc-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CatalogServiceGrpc.java +++ b/grpc-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CatalogServiceGrpc.java @@ -121,6 +121,96 @@ private CatalogServiceGrpc() {} return getUpdateCatalogMethod; } + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2.SetDefaultBranchRequest, com.google.protobuf.Empty> + getSetDefaultBranchMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SetDefaultBranch", + requestType = com.google.cloud.retail.v2.SetDefaultBranchRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2.SetDefaultBranchRequest, com.google.protobuf.Empty> + getSetDefaultBranchMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2.SetDefaultBranchRequest, com.google.protobuf.Empty> + getSetDefaultBranchMethod; + if ((getSetDefaultBranchMethod = CatalogServiceGrpc.getSetDefaultBranchMethod) == null) { + synchronized (CatalogServiceGrpc.class) { + if ((getSetDefaultBranchMethod = CatalogServiceGrpc.getSetDefaultBranchMethod) == null) { + CatalogServiceGrpc.getSetDefaultBranchMethod = + getSetDefaultBranchMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SetDefaultBranch")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2.SetDefaultBranchRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new CatalogServiceMethodDescriptorSupplier("SetDefaultBranch")) + .build(); + } + } + } + return getSetDefaultBranchMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2.GetDefaultBranchRequest, + com.google.cloud.retail.v2.GetDefaultBranchResponse> + getGetDefaultBranchMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetDefaultBranch", + requestType = com.google.cloud.retail.v2.GetDefaultBranchRequest.class, + responseType = com.google.cloud.retail.v2.GetDefaultBranchResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2.GetDefaultBranchRequest, + com.google.cloud.retail.v2.GetDefaultBranchResponse> + getGetDefaultBranchMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2.GetDefaultBranchRequest, + com.google.cloud.retail.v2.GetDefaultBranchResponse> + getGetDefaultBranchMethod; + if ((getGetDefaultBranchMethod = CatalogServiceGrpc.getGetDefaultBranchMethod) == null) { + synchronized (CatalogServiceGrpc.class) { + if ((getGetDefaultBranchMethod = CatalogServiceGrpc.getGetDefaultBranchMethod) == null) { + CatalogServiceGrpc.getGetDefaultBranchMethod = + getGetDefaultBranchMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetDefaultBranch")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2.GetDefaultBranchRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2.GetDefaultBranchResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new CatalogServiceMethodDescriptorSupplier("GetDefaultBranch")) + .build(); + } + } + } + return getGetDefaultBranchMethod; + } + /** Creates a new async stub that supports all call types for the service */ public static CatalogServiceStub newStub(io.grpc.Channel channel) { io.grpc.stub.AbstractStub.StubFactory factory = @@ -201,6 +291,70 @@ public void updateCatalog( getUpdateCatalogMethod(), responseObserver); } + /** + * + * + *
+     * 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.
+     * Contact Retail Support (retail-search-support@google.com) if you are
+     * interested in using Retail Search.
+     * 
+ */ + public void setDefaultBranch( + com.google.cloud.retail.v2.SetDefaultBranchRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getSetDefaultBranchMethod(), responseObserver); + } + + /** + * + * + *
+     * 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.
+     * Contact Retail Support (retail-search-support@google.com) if you are
+     * interested in using Retail Search.
+     * 
+ */ + public void getDefaultBranch( + com.google.cloud.retail.v2.GetDefaultBranchRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetDefaultBranchMethod(), responseObserver); + } + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) @@ -217,6 +371,19 @@ public final io.grpc.ServerServiceDefinition bindService() { new MethodHandlers< com.google.cloud.retail.v2.UpdateCatalogRequest, com.google.cloud.retail.v2.Catalog>(this, METHODID_UPDATE_CATALOG))) + .addMethod( + getSetDefaultBranchMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2.SetDefaultBranchRequest, + com.google.protobuf.Empty>(this, METHODID_SET_DEFAULT_BRANCH))) + .addMethod( + getGetDefaultBranchMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2.GetDefaultBranchRequest, + com.google.cloud.retail.v2.GetDefaultBranchResponse>( + this, METHODID_GET_DEFAULT_BRANCH))) .build(); } } @@ -272,6 +439,74 @@ public void updateCatalog( request, responseObserver); } + + /** + * + * + *
+     * 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.
+     * Contact Retail Support (retail-search-support@google.com) if you are
+     * interested in using Retail Search.
+     * 
+ */ + public void setDefaultBranch( + com.google.cloud.retail.v2.SetDefaultBranchRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSetDefaultBranchMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * 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.
+     * Contact Retail Support (retail-search-support@google.com) if you are
+     * interested in using Retail Search.
+     * 
+ */ + public void getDefaultBranch( + com.google.cloud.retail.v2.GetDefaultBranchRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetDefaultBranchMethod(), getCallOptions()), + request, + responseObserver); + } } /** @@ -319,6 +554,67 @@ public com.google.cloud.retail.v2.Catalog updateCatalog( return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getUpdateCatalogMethod(), getCallOptions(), request); } + + /** + * + * + *
+     * 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.
+     * Contact Retail Support (retail-search-support@google.com) if you are
+     * interested in using Retail Search.
+     * 
+ */ + public com.google.protobuf.Empty setDefaultBranch( + com.google.cloud.retail.v2.SetDefaultBranchRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSetDefaultBranchMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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.
+     * Contact Retail Support (retail-search-support@google.com) if you are
+     * interested in using Retail Search.
+     * 
+ */ + public com.google.cloud.retail.v2.GetDefaultBranchResponse getDefaultBranch( + com.google.cloud.retail.v2.GetDefaultBranchRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetDefaultBranchMethod(), getCallOptions(), request); + } } /** @@ -367,10 +663,74 @@ protected CatalogServiceFutureStub build( return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getUpdateCatalogMethod(), getCallOptions()), request); } + + /** + * + * + *
+     * 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.
+     * Contact Retail Support (retail-search-support@google.com) if you are
+     * interested in using Retail Search.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + setDefaultBranch(com.google.cloud.retail.v2.SetDefaultBranchRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSetDefaultBranchMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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.
+     * Contact Retail Support (retail-search-support@google.com) if you are
+     * interested in using Retail Search.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2.GetDefaultBranchResponse> + getDefaultBranch(com.google.cloud.retail.v2.GetDefaultBranchRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetDefaultBranchMethod(), getCallOptions()), request); + } } private static final int METHODID_LIST_CATALOGS = 0; private static final int METHODID_UPDATE_CATALOG = 1; + private static final int METHODID_SET_DEFAULT_BRANCH = 2; + private static final int METHODID_GET_DEFAULT_BRANCH = 3; private static final class MethodHandlers implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -400,6 +760,17 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv (com.google.cloud.retail.v2.UpdateCatalogRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_SET_DEFAULT_BRANCH: + serviceImpl.setDefaultBranch( + (com.google.cloud.retail.v2.SetDefaultBranchRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_DEFAULT_BRANCH: + serviceImpl.getDefaultBranch( + (com.google.cloud.retail.v2.GetDefaultBranchRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; default: throw new AssertionError(); } @@ -466,6 +837,8 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .setSchemaDescriptor(new CatalogServiceFileDescriptorSupplier()) .addMethod(getListCatalogsMethod()) .addMethod(getUpdateCatalogMethod()) + .addMethod(getSetDefaultBranchMethod()) + .addMethod(getGetDefaultBranchMethod()) .build(); } } diff --git a/grpc-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CompletionServiceGrpc.java b/grpc-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CompletionServiceGrpc.java new file mode 100644 index 00000000..c328621e --- /dev/null +++ b/grpc-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CompletionServiceGrpc.java @@ -0,0 +1,522 @@ +/* + * Copyright 2020 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. + */ +package com.google.cloud.retail.v2; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Auto-completion service for retail.
+ * This feature is only available for users who have Retail Search enabled.
+ * Contact Retail Support (retail-search-support@google.com) if you are
+ * interested in using Retail Search.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/retail/v2/completion_service.proto") +public final class CompletionServiceGrpc { + + private CompletionServiceGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.retail.v2.CompletionService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2.CompleteQueryRequest, + com.google.cloud.retail.v2.CompleteQueryResponse> + getCompleteQueryMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CompleteQuery", + requestType = com.google.cloud.retail.v2.CompleteQueryRequest.class, + responseType = com.google.cloud.retail.v2.CompleteQueryResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2.CompleteQueryRequest, + com.google.cloud.retail.v2.CompleteQueryResponse> + getCompleteQueryMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2.CompleteQueryRequest, + com.google.cloud.retail.v2.CompleteQueryResponse> + getCompleteQueryMethod; + if ((getCompleteQueryMethod = CompletionServiceGrpc.getCompleteQueryMethod) == null) { + synchronized (CompletionServiceGrpc.class) { + if ((getCompleteQueryMethod = CompletionServiceGrpc.getCompleteQueryMethod) == null) { + CompletionServiceGrpc.getCompleteQueryMethod = + getCompleteQueryMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CompleteQuery")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2.CompleteQueryRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2.CompleteQueryResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new CompletionServiceMethodDescriptorSupplier("CompleteQuery")) + .build(); + } + } + } + return getCompleteQueryMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2.ImportCompletionDataRequest, com.google.longrunning.Operation> + getImportCompletionDataMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ImportCompletionData", + requestType = com.google.cloud.retail.v2.ImportCompletionDataRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2.ImportCompletionDataRequest, com.google.longrunning.Operation> + getImportCompletionDataMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2.ImportCompletionDataRequest, + com.google.longrunning.Operation> + getImportCompletionDataMethod; + if ((getImportCompletionDataMethod = CompletionServiceGrpc.getImportCompletionDataMethod) + == null) { + synchronized (CompletionServiceGrpc.class) { + if ((getImportCompletionDataMethod = CompletionServiceGrpc.getImportCompletionDataMethod) + == null) { + CompletionServiceGrpc.getImportCompletionDataMethod = + getImportCompletionDataMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ImportCompletionData")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2.ImportCompletionDataRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new CompletionServiceMethodDescriptorSupplier("ImportCompletionData")) + .build(); + } + } + } + return getImportCompletionDataMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static CompletionServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CompletionServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CompletionServiceStub(channel, callOptions); + } + }; + return CompletionServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static CompletionServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CompletionServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CompletionServiceBlockingStub(channel, callOptions); + } + }; + return CompletionServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static CompletionServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CompletionServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CompletionServiceFutureStub(channel, callOptions); + } + }; + return CompletionServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Auto-completion service for retail.
+   * This feature is only available for users who have Retail Search enabled.
+   * Contact Retail Support (retail-search-support@google.com) if you are
+   * interested in using Retail Search.
+   * 
+ */ + public abstract static class CompletionServiceImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Completes the specified prefix with keyword suggestions.
+     * This feature is only available for users who have Retail Search enabled.
+     * Contact Retail Support (retail-search-support@google.com) if you are
+     * interested in using Retail Search.
+     * 
+ */ + public void completeQuery( + com.google.cloud.retail.v2.CompleteQueryRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCompleteQueryMethod(), responseObserver); + } + + /** + * + * + *
+     * 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.
+     * Contact Retail Support (retail-search-support@google.com) if you are
+     * interested in using Retail Search.
+     * 
+ */ + public void importCompletionData( + com.google.cloud.retail.v2.ImportCompletionDataRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getImportCompletionDataMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCompleteQueryMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2.CompleteQueryRequest, + com.google.cloud.retail.v2.CompleteQueryResponse>( + this, METHODID_COMPLETE_QUERY))) + .addMethod( + getImportCompletionDataMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2.ImportCompletionDataRequest, + com.google.longrunning.Operation>(this, METHODID_IMPORT_COMPLETION_DATA))) + .build(); + } + } + + /** + * + * + *
+   * Auto-completion service for retail.
+   * This feature is only available for users who have Retail Search enabled.
+   * Contact Retail Support (retail-search-support@google.com) if you are
+   * interested in using Retail Search.
+   * 
+ */ + public static final class CompletionServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private CompletionServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CompletionServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CompletionServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Completes the specified prefix with keyword suggestions.
+     * This feature is only available for users who have Retail Search enabled.
+     * Contact Retail Support (retail-search-support@google.com) if you are
+     * interested in using Retail Search.
+     * 
+ */ + public void completeQuery( + com.google.cloud.retail.v2.CompleteQueryRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCompleteQueryMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * 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.
+     * Contact Retail Support (retail-search-support@google.com) if you are
+     * interested in using Retail Search.
+     * 
+ */ + public void importCompletionData( + com.google.cloud.retail.v2.ImportCompletionDataRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getImportCompletionDataMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Auto-completion service for retail.
+   * This feature is only available for users who have Retail Search enabled.
+   * Contact Retail Support (retail-search-support@google.com) if you are
+   * interested in using Retail Search.
+   * 
+ */ + public static final class CompletionServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private CompletionServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CompletionServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CompletionServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Completes the specified prefix with keyword suggestions.
+     * This feature is only available for users who have Retail Search enabled.
+     * Contact Retail Support (retail-search-support@google.com) if you are
+     * interested in using Retail Search.
+     * 
+ */ + public com.google.cloud.retail.v2.CompleteQueryResponse completeQuery( + com.google.cloud.retail.v2.CompleteQueryRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCompleteQueryMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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.
+     * Contact Retail Support (retail-search-support@google.com) if you are
+     * interested in using Retail Search.
+     * 
+ */ + public com.google.longrunning.Operation importCompletionData( + com.google.cloud.retail.v2.ImportCompletionDataRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getImportCompletionDataMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Auto-completion service for retail.
+   * This feature is only available for users who have Retail Search enabled.
+   * Contact Retail Support (retail-search-support@google.com) if you are
+   * interested in using Retail Search.
+   * 
+ */ + public static final class CompletionServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private CompletionServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CompletionServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CompletionServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Completes the specified prefix with keyword suggestions.
+     * This feature is only available for users who have Retail Search enabled.
+     * Contact Retail Support (retail-search-support@google.com) if you are
+     * interested in using Retail Search.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2.CompleteQueryResponse> + completeQuery(com.google.cloud.retail.v2.CompleteQueryRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCompleteQueryMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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.
+     * Contact Retail Support (retail-search-support@google.com) if you are
+     * interested in using Retail Search.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + importCompletionData(com.google.cloud.retail.v2.ImportCompletionDataRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getImportCompletionDataMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_COMPLETE_QUERY = 0; + private static final int METHODID_IMPORT_COMPLETION_DATA = 1; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final CompletionServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(CompletionServiceImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_COMPLETE_QUERY: + serviceImpl.completeQuery( + (com.google.cloud.retail.v2.CompleteQueryRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_IMPORT_COMPLETION_DATA: + serviceImpl.importCompletionData( + (com.google.cloud.retail.v2.ImportCompletionDataRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private abstract static class CompletionServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + CompletionServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.retail.v2.CompletionServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("CompletionService"); + } + } + + private static final class CompletionServiceFileDescriptorSupplier + extends CompletionServiceBaseDescriptorSupplier { + CompletionServiceFileDescriptorSupplier() {} + } + + private static final class CompletionServiceMethodDescriptorSupplier + extends CompletionServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + CompletionServiceMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (CompletionServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new CompletionServiceFileDescriptorSupplier()) + .addMethod(getCompleteQueryMethod()) + .addMethod(getImportCompletionDataMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/grpc-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ProductServiceGrpc.java b/grpc-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ProductServiceGrpc.java index 005a74f1..d13641d6 100644 --- a/grpc-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ProductServiceGrpc.java +++ b/grpc-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ProductServiceGrpc.java @@ -118,6 +118,51 @@ private ProductServiceGrpc() {} return getGetProductMethod; } + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2.ListProductsRequest, + com.google.cloud.retail.v2.ListProductsResponse> + getListProductsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListProducts", + requestType = com.google.cloud.retail.v2.ListProductsRequest.class, + responseType = com.google.cloud.retail.v2.ListProductsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2.ListProductsRequest, + com.google.cloud.retail.v2.ListProductsResponse> + getListProductsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2.ListProductsRequest, + com.google.cloud.retail.v2.ListProductsResponse> + getListProductsMethod; + if ((getListProductsMethod = ProductServiceGrpc.getListProductsMethod) == null) { + synchronized (ProductServiceGrpc.class) { + if ((getListProductsMethod = ProductServiceGrpc.getListProductsMethod) == null) { + ProductServiceGrpc.getListProductsMethod = + getListProductsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListProducts")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2.ListProductsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2.ListProductsResponse.getDefaultInstance())) + .setSchemaDescriptor( + new ProductServiceMethodDescriptorSupplier("ListProducts")) + .build(); + } + } + } + return getListProductsMethod; + } + private static volatile io.grpc.MethodDescriptor< com.google.cloud.retail.v2.UpdateProductRequest, com.google.cloud.retail.v2.Product> getUpdateProductMethod; @@ -244,6 +289,144 @@ private ProductServiceGrpc() {} return getImportProductsMethod; } + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2.SetInventoryRequest, com.google.longrunning.Operation> + getSetInventoryMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SetInventory", + requestType = com.google.cloud.retail.v2.SetInventoryRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2.SetInventoryRequest, com.google.longrunning.Operation> + getSetInventoryMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2.SetInventoryRequest, com.google.longrunning.Operation> + getSetInventoryMethod; + if ((getSetInventoryMethod = ProductServiceGrpc.getSetInventoryMethod) == null) { + synchronized (ProductServiceGrpc.class) { + if ((getSetInventoryMethod = ProductServiceGrpc.getSetInventoryMethod) == null) { + ProductServiceGrpc.getSetInventoryMethod = + getSetInventoryMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SetInventory")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2.SetInventoryRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new ProductServiceMethodDescriptorSupplier("SetInventory")) + .build(); + } + } + } + return getSetInventoryMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2.AddFulfillmentPlacesRequest, com.google.longrunning.Operation> + getAddFulfillmentPlacesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "AddFulfillmentPlaces", + requestType = com.google.cloud.retail.v2.AddFulfillmentPlacesRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2.AddFulfillmentPlacesRequest, com.google.longrunning.Operation> + getAddFulfillmentPlacesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2.AddFulfillmentPlacesRequest, + com.google.longrunning.Operation> + getAddFulfillmentPlacesMethod; + if ((getAddFulfillmentPlacesMethod = ProductServiceGrpc.getAddFulfillmentPlacesMethod) + == null) { + synchronized (ProductServiceGrpc.class) { + if ((getAddFulfillmentPlacesMethod = ProductServiceGrpc.getAddFulfillmentPlacesMethod) + == null) { + ProductServiceGrpc.getAddFulfillmentPlacesMethod = + getAddFulfillmentPlacesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "AddFulfillmentPlaces")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2.AddFulfillmentPlacesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new ProductServiceMethodDescriptorSupplier("AddFulfillmentPlaces")) + .build(); + } + } + } + return getAddFulfillmentPlacesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest, + com.google.longrunning.Operation> + getRemoveFulfillmentPlacesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RemoveFulfillmentPlaces", + requestType = com.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest, + com.google.longrunning.Operation> + getRemoveFulfillmentPlacesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest, + com.google.longrunning.Operation> + getRemoveFulfillmentPlacesMethod; + if ((getRemoveFulfillmentPlacesMethod = ProductServiceGrpc.getRemoveFulfillmentPlacesMethod) + == null) { + synchronized (ProductServiceGrpc.class) { + if ((getRemoveFulfillmentPlacesMethod = ProductServiceGrpc.getRemoveFulfillmentPlacesMethod) + == null) { + ProductServiceGrpc.getRemoveFulfillmentPlacesMethod = + getRemoveFulfillmentPlacesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "RemoveFulfillmentPlaces")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new ProductServiceMethodDescriptorSupplier("RemoveFulfillmentPlaces")) + .build(); + } + } + } + return getRemoveFulfillmentPlacesMethod; + } + /** Creates a new async stub that supports all call types for the service */ public static ProductServiceStub newStub(io.grpc.Channel channel) { io.grpc.stub.AbstractStub.StubFactory factory = @@ -322,6 +505,21 @@ public void getProduct( io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetProductMethod(), responseObserver); } + /** + * + * + *
+     * Gets a list of [Product][google.cloud.retail.v2.Product]s.
+     * 
+ */ + public void listProducts( + com.google.cloud.retail.v2.ListProductsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListProductsMethod(), responseObserver); + } + /** * * @@ -368,6 +566,105 @@ public void importProducts( getImportProductsMethod(), responseObserver); } + /** + * + * + *
+     * 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.
+     * Contact Retail Support (retail-search-support@google.com) if you are
+     * interested in using Retail Search.
+     * 
+ */ + public void setInventory( + com.google.cloud.retail.v2.SetInventoryRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getSetInventoryMethod(), responseObserver); + } + + /** + * + * + *
+     * 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.
+     * Contact Retail Support (retail-search-support@google.com) if you are
+     * interested in using Retail Search.
+     * 
+ */ + public void addFulfillmentPlaces( + com.google.cloud.retail.v2.AddFulfillmentPlacesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getAddFulfillmentPlacesMethod(), responseObserver); + } + + /** + * + * + *
+     * 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.
+     * Contact Retail Support (retail-search-support@google.com) if you are
+     * interested in using Retail Search.
+     * 
+ */ + public void removeFulfillmentPlaces( + com.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRemoveFulfillmentPlacesMethod(), responseObserver); + } + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) @@ -383,6 +680,13 @@ public final io.grpc.ServerServiceDefinition bindService() { new MethodHandlers< com.google.cloud.retail.v2.GetProductRequest, com.google.cloud.retail.v2.Product>(this, METHODID_GET_PRODUCT))) + .addMethod( + getListProductsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2.ListProductsRequest, + com.google.cloud.retail.v2.ListProductsResponse>( + this, METHODID_LIST_PRODUCTS))) .addMethod( getUpdateProductMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( @@ -401,6 +705,24 @@ public final io.grpc.ServerServiceDefinition bindService() { new MethodHandlers< com.google.cloud.retail.v2.ImportProductsRequest, com.google.longrunning.Operation>(this, METHODID_IMPORT_PRODUCTS))) + .addMethod( + getSetInventoryMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2.SetInventoryRequest, + com.google.longrunning.Operation>(this, METHODID_SET_INVENTORY))) + .addMethod( + getAddFulfillmentPlacesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2.AddFulfillmentPlacesRequest, + com.google.longrunning.Operation>(this, METHODID_ADD_FULFILLMENT_PLACES))) + .addMethod( + getRemoveFulfillmentPlacesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest, + com.google.longrunning.Operation>(this, METHODID_REMOVE_FULFILLMENT_PLACES))) .build(); } } @@ -454,6 +776,23 @@ public void getProduct( getChannel().newCall(getGetProductMethod(), getCallOptions()), request, responseObserver); } + /** + * + * + *
+     * Gets a list of [Product][google.cloud.retail.v2.Product]s.
+     * 
+ */ + public void listProducts( + com.google.cloud.retail.v2.ListProductsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListProductsMethod(), getCallOptions()), + request, + responseObserver); + } + /** * * @@ -505,6 +844,111 @@ public void importProducts( request, responseObserver); } + + /** + * + * + *
+     * 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.
+     * Contact Retail Support (retail-search-support@google.com) if you are
+     * interested in using Retail Search.
+     * 
+ */ + public void setInventory( + com.google.cloud.retail.v2.SetInventoryRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSetInventoryMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * 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.
+     * Contact Retail Support (retail-search-support@google.com) if you are
+     * interested in using Retail Search.
+     * 
+ */ + public void addFulfillmentPlaces( + com.google.cloud.retail.v2.AddFulfillmentPlacesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getAddFulfillmentPlacesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * 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.
+     * Contact Retail Support (retail-search-support@google.com) if you are
+     * interested in using Retail Search.
+     * 
+ */ + public void removeFulfillmentPlaces( + com.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRemoveFulfillmentPlacesMethod(), getCallOptions()), + request, + responseObserver); + } } /** @@ -553,6 +997,19 @@ public com.google.cloud.retail.v2.Product getProduct( getChannel(), getGetProductMethod(), getCallOptions(), request); } + /** + * + * + *
+     * Gets a list of [Product][google.cloud.retail.v2.Product]s.
+     * 
+ */ + public com.google.cloud.retail.v2.ListProductsResponse listProducts( + com.google.cloud.retail.v2.ListProductsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListProductsMethod(), getCallOptions(), request); + } + /** * * @@ -595,6 +1052,102 @@ public com.google.longrunning.Operation importProducts( return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getImportProductsMethod(), getCallOptions(), request); } + + /** + * + * + *
+     * 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.
+     * Contact Retail Support (retail-search-support@google.com) if you are
+     * interested in using Retail Search.
+     * 
+ */ + public com.google.longrunning.Operation setInventory( + com.google.cloud.retail.v2.SetInventoryRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSetInventoryMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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.
+     * Contact Retail Support (retail-search-support@google.com) if you are
+     * interested in using Retail Search.
+     * 
+ */ + public com.google.longrunning.Operation addFulfillmentPlaces( + com.google.cloud.retail.v2.AddFulfillmentPlacesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getAddFulfillmentPlacesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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.
+     * Contact Retail Support (retail-search-support@google.com) if you are
+     * interested in using Retail Search.
+     * 
+ */ + public com.google.longrunning.Operation removeFulfillmentPlaces( + com.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRemoveFulfillmentPlacesMethod(), getCallOptions(), request); + } } /** @@ -643,6 +1196,20 @@ protected ProductServiceFutureStub build( getChannel().newCall(getGetProductMethod(), getCallOptions()), request); } + /** + * + * + *
+     * Gets a list of [Product][google.cloud.retail.v2.Product]s.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2.ListProductsResponse> + listProducts(com.google.cloud.retail.v2.ListProductsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListProductsMethod(), getCallOptions()), request); + } + /** * * @@ -685,13 +1252,113 @@ protected ProductServiceFutureStub build( return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getImportProductsMethod(), getCallOptions()), request); } + + /** + * + * + *
+     * 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.
+     * Contact Retail Support (retail-search-support@google.com) if you are
+     * interested in using Retail Search.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + setInventory(com.google.cloud.retail.v2.SetInventoryRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSetInventoryMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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.
+     * Contact Retail Support (retail-search-support@google.com) if you are
+     * interested in using Retail Search.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + addFulfillmentPlaces(com.google.cloud.retail.v2.AddFulfillmentPlacesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getAddFulfillmentPlacesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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.
+     * Contact Retail Support (retail-search-support@google.com) if you are
+     * interested in using Retail Search.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + removeFulfillmentPlaces(com.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRemoveFulfillmentPlacesMethod(), getCallOptions()), request); + } } private static final int METHODID_CREATE_PRODUCT = 0; private static final int METHODID_GET_PRODUCT = 1; - private static final int METHODID_UPDATE_PRODUCT = 2; - private static final int METHODID_DELETE_PRODUCT = 3; - private static final int METHODID_IMPORT_PRODUCTS = 4; + private static final int METHODID_LIST_PRODUCTS = 2; + private static final int METHODID_UPDATE_PRODUCT = 3; + private static final int METHODID_DELETE_PRODUCT = 4; + private static final int METHODID_IMPORT_PRODUCTS = 5; + private static final int METHODID_SET_INVENTORY = 6; + private static final int METHODID_ADD_FULFILLMENT_PLACES = 7; + private static final int METHODID_REMOVE_FULFILLMENT_PLACES = 8; private static final class MethodHandlers implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -720,6 +1387,12 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv (com.google.cloud.retail.v2.GetProductRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_LIST_PRODUCTS: + serviceImpl.listProducts( + (com.google.cloud.retail.v2.ListProductsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; case METHODID_UPDATE_PRODUCT: serviceImpl.updateProduct( (com.google.cloud.retail.v2.UpdateProductRequest) request, @@ -735,6 +1408,21 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv (com.google.cloud.retail.v2.ImportProductsRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_SET_INVENTORY: + serviceImpl.setInventory( + (com.google.cloud.retail.v2.SetInventoryRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_ADD_FULFILLMENT_PLACES: + serviceImpl.addFulfillmentPlaces( + (com.google.cloud.retail.v2.AddFulfillmentPlacesRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_REMOVE_FULFILLMENT_PLACES: + serviceImpl.removeFulfillmentPlaces( + (com.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; default: throw new AssertionError(); } @@ -801,9 +1489,13 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .setSchemaDescriptor(new ProductServiceFileDescriptorSupplier()) .addMethod(getCreateProductMethod()) .addMethod(getGetProductMethod()) + .addMethod(getListProductsMethod()) .addMethod(getUpdateProductMethod()) .addMethod(getDeleteProductMethod()) .addMethod(getImportProductsMethod()) + .addMethod(getSetInventoryMethod()) + .addMethod(getAddFulfillmentPlacesMethod()) + .addMethod(getRemoveFulfillmentPlacesMethod()) .build(); } } diff --git a/grpc-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/SearchServiceGrpc.java b/grpc-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/SearchServiceGrpc.java new file mode 100644 index 00000000..dc941d6d --- /dev/null +++ b/grpc-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/SearchServiceGrpc.java @@ -0,0 +1,377 @@ +/* + * Copyright 2020 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. + */ +package com.google.cloud.retail.v2; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service for search.
+ * This feature is only available for users who have Retail Search enabled.
+ * Contact Retail Support (retail-search-support@google.com) if you are
+ * interested in using Retail Search.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/retail/v2/search_service.proto") +public final class SearchServiceGrpc { + + private SearchServiceGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.retail.v2.SearchService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2.SearchRequest, com.google.cloud.retail.v2.SearchResponse> + getSearchMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Search", + requestType = com.google.cloud.retail.v2.SearchRequest.class, + responseType = com.google.cloud.retail.v2.SearchResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2.SearchRequest, com.google.cloud.retail.v2.SearchResponse> + getSearchMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2.SearchRequest, com.google.cloud.retail.v2.SearchResponse> + getSearchMethod; + if ((getSearchMethod = SearchServiceGrpc.getSearchMethod) == null) { + synchronized (SearchServiceGrpc.class) { + if ((getSearchMethod = SearchServiceGrpc.getSearchMethod) == null) { + SearchServiceGrpc.getSearchMethod = + getSearchMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Search")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2.SearchRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2.SearchResponse.getDefaultInstance())) + .setSchemaDescriptor(new SearchServiceMethodDescriptorSupplier("Search")) + .build(); + } + } + } + return getSearchMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static SearchServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SearchServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SearchServiceStub(channel, callOptions); + } + }; + return SearchServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static SearchServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SearchServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SearchServiceBlockingStub(channel, callOptions); + } + }; + return SearchServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static SearchServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SearchServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SearchServiceFutureStub(channel, callOptions); + } + }; + return SearchServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service for search.
+   * This feature is only available for users who have Retail Search enabled.
+   * Contact Retail Support (retail-search-support@google.com) if you are
+   * interested in using Retail Search.
+   * 
+ */ + public abstract static class SearchServiceImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Performs a search.
+     * This feature is only available for users who have Retail Search enabled.
+     * Contact Retail Support (retail-search-support@google.com) if you are
+     * interested in using Retail Search.
+     * 
+ */ + public void search( + com.google.cloud.retail.v2.SearchRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSearchMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getSearchMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2.SearchRequest, + com.google.cloud.retail.v2.SearchResponse>(this, METHODID_SEARCH))) + .build(); + } + } + + /** + * + * + *
+   * Service for search.
+   * This feature is only available for users who have Retail Search enabled.
+   * Contact Retail Support (retail-search-support@google.com) if you are
+   * interested in using Retail Search.
+   * 
+ */ + public static final class SearchServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private SearchServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SearchServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SearchServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Performs a search.
+     * This feature is only available for users who have Retail Search enabled.
+     * Contact Retail Support (retail-search-support@google.com) if you are
+     * interested in using Retail Search.
+     * 
+ */ + public void search( + com.google.cloud.retail.v2.SearchRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSearchMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + * + * + *
+   * Service for search.
+   * This feature is only available for users who have Retail Search enabled.
+   * Contact Retail Support (retail-search-support@google.com) if you are
+   * interested in using Retail Search.
+   * 
+ */ + public static final class SearchServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private SearchServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SearchServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SearchServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Performs a search.
+     * This feature is only available for users who have Retail Search enabled.
+     * Contact Retail Support (retail-search-support@google.com) if you are
+     * interested in using Retail Search.
+     * 
+ */ + public com.google.cloud.retail.v2.SearchResponse search( + com.google.cloud.retail.v2.SearchRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSearchMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Service for search.
+   * This feature is only available for users who have Retail Search enabled.
+   * Contact Retail Support (retail-search-support@google.com) if you are
+   * interested in using Retail Search.
+   * 
+ */ + public static final class SearchServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private SearchServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SearchServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SearchServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Performs a search.
+     * This feature is only available for users who have Retail Search enabled.
+     * Contact Retail Support (retail-search-support@google.com) if you are
+     * interested in using Retail Search.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2.SearchResponse> + search(com.google.cloud.retail.v2.SearchRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSearchMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_SEARCH = 0; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final SearchServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(SearchServiceImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_SEARCH: + serviceImpl.search( + (com.google.cloud.retail.v2.SearchRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private abstract static class SearchServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + SearchServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.retail.v2.SearchServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("SearchService"); + } + } + + private static final class SearchServiceFileDescriptorSupplier + extends SearchServiceBaseDescriptorSupplier { + SearchServiceFileDescriptorSupplier() {} + } + + private static final class SearchServiceMethodDescriptorSupplier + extends SearchServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + SearchServiceMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (SearchServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new SearchServiceFileDescriptorSupplier()) + .addMethod(getSearchMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/proto-google-cloud-retail-v2/clirr-ignored-differences.xml b/proto-google-cloud-retail-v2/clirr-ignored-differences.xml index 8fe89da8..2522ab05 100644 --- a/proto-google-cloud-retail-v2/clirr-ignored-differences.xml +++ b/proto-google-cloud-retail-v2/clirr-ignored-differences.xml @@ -4,6 +4,16 @@ 7012 com/google/cloud/retail/v2/*OrBuilder - * has*(*) + * get*(*) - \ No newline at end of file + + 7012 + com/google/cloud/retail/v2/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/retail/v2/*OrBuilder + boolean has*(*) + + diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/AddFulfillmentPlacesMetadata.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/AddFulfillmentPlacesMetadata.java new file mode 100644 index 00000000..dc8e91de --- /dev/null +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/AddFulfillmentPlacesMetadata.java @@ -0,0 +1,461 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2/product_service.proto + +package com.google.cloud.retail.v2; + +/** + * + * + *
+ * Metadata related to the progress of the AddFulfillmentPlaces operation.
+ * Currently empty because there is no meaningful metadata populated from the
+ * [AddFulfillmentPlaces][] method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2.AddFulfillmentPlacesMetadata} + */ +public final class AddFulfillmentPlacesMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.AddFulfillmentPlacesMetadata) + AddFulfillmentPlacesMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use AddFulfillmentPlacesMetadata.newBuilder() to construct. + private AddFulfillmentPlacesMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AddFulfillmentPlacesMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AddFulfillmentPlacesMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AddFulfillmentPlacesMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.ProductServiceProto + .internal_static_google_cloud_retail_v2_AddFulfillmentPlacesMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.ProductServiceProto + .internal_static_google_cloud_retail_v2_AddFulfillmentPlacesMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.AddFulfillmentPlacesMetadata.class, + com.google.cloud.retail.v2.AddFulfillmentPlacesMetadata.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.retail.v2.AddFulfillmentPlacesMetadata)) { + return super.equals(obj); + } + com.google.cloud.retail.v2.AddFulfillmentPlacesMetadata other = + (com.google.cloud.retail.v2.AddFulfillmentPlacesMetadata) obj; + + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2.AddFulfillmentPlacesMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.AddFulfillmentPlacesMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.AddFulfillmentPlacesMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.AddFulfillmentPlacesMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.AddFulfillmentPlacesMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.AddFulfillmentPlacesMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.AddFulfillmentPlacesMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.AddFulfillmentPlacesMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.AddFulfillmentPlacesMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.AddFulfillmentPlacesMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.AddFulfillmentPlacesMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.AddFulfillmentPlacesMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2.AddFulfillmentPlacesMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Metadata related to the progress of the AddFulfillmentPlaces operation.
+   * Currently empty because there is no meaningful metadata populated from the
+   * [AddFulfillmentPlaces][] method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2.AddFulfillmentPlacesMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.AddFulfillmentPlacesMetadata) + com.google.cloud.retail.v2.AddFulfillmentPlacesMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.ProductServiceProto + .internal_static_google_cloud_retail_v2_AddFulfillmentPlacesMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.ProductServiceProto + .internal_static_google_cloud_retail_v2_AddFulfillmentPlacesMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.AddFulfillmentPlacesMetadata.class, + com.google.cloud.retail.v2.AddFulfillmentPlacesMetadata.Builder.class); + } + + // Construct using com.google.cloud.retail.v2.AddFulfillmentPlacesMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2.ProductServiceProto + .internal_static_google_cloud_retail_v2_AddFulfillmentPlacesMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2.AddFulfillmentPlacesMetadata getDefaultInstanceForType() { + return com.google.cloud.retail.v2.AddFulfillmentPlacesMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2.AddFulfillmentPlacesMetadata build() { + com.google.cloud.retail.v2.AddFulfillmentPlacesMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2.AddFulfillmentPlacesMetadata buildPartial() { + com.google.cloud.retail.v2.AddFulfillmentPlacesMetadata result = + new com.google.cloud.retail.v2.AddFulfillmentPlacesMetadata(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.retail.v2.AddFulfillmentPlacesMetadata) { + return mergeFrom((com.google.cloud.retail.v2.AddFulfillmentPlacesMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2.AddFulfillmentPlacesMetadata other) { + if (other == com.google.cloud.retail.v2.AddFulfillmentPlacesMetadata.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.retail.v2.AddFulfillmentPlacesMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2.AddFulfillmentPlacesMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.AddFulfillmentPlacesMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.AddFulfillmentPlacesMetadata) + private static final com.google.cloud.retail.v2.AddFulfillmentPlacesMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2.AddFulfillmentPlacesMetadata(); + } + + public static com.google.cloud.retail.v2.AddFulfillmentPlacesMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AddFulfillmentPlacesMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AddFulfillmentPlacesMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.retail.v2.AddFulfillmentPlacesMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/AddFulfillmentPlacesMetadataOrBuilder.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/AddFulfillmentPlacesMetadataOrBuilder.java new file mode 100644 index 00000000..89b76938 --- /dev/null +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/AddFulfillmentPlacesMetadataOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2/product_service.proto + +package com.google.cloud.retail.v2; + +public interface AddFulfillmentPlacesMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2.AddFulfillmentPlacesMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/AddFulfillmentPlacesRequest.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/AddFulfillmentPlacesRequest.java new file mode 100644 index 00000000..bad53b88 --- /dev/null +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/AddFulfillmentPlacesRequest.java @@ -0,0 +1,1801 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2/product_service.proto + +package com.google.cloud.retail.v2; + +/** + * + * + *
+ * Request message for [AddFulfillmentPlaces][] method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2.AddFulfillmentPlacesRequest} + */ +public final class AddFulfillmentPlacesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.AddFulfillmentPlacesRequest) + AddFulfillmentPlacesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use AddFulfillmentPlacesRequest.newBuilder() to construct. + private AddFulfillmentPlacesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AddFulfillmentPlacesRequest() { + product_ = ""; + type_ = ""; + placeIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AddFulfillmentPlacesRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AddFulfillmentPlacesRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + product_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + type_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + placeIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + placeIds_.add(s); + break; + } + case 34: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (addTime_ != null) { + subBuilder = addTime_.toBuilder(); + } + addTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(addTime_); + addTime_ = subBuilder.buildPartial(); + } + + break; + } + case 40: + { + allowMissing_ = input.readBool(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + placeIds_ = placeIds_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.ProductServiceProto + .internal_static_google_cloud_retail_v2_AddFulfillmentPlacesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.ProductServiceProto + .internal_static_google_cloud_retail_v2_AddFulfillmentPlacesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.AddFulfillmentPlacesRequest.class, + com.google.cloud.retail.v2.AddFulfillmentPlacesRequest.Builder.class); + } + + public static final int PRODUCT_FIELD_NUMBER = 1; + private volatile java.lang.Object product_; + /** + * + * + *
+   * 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) = { ... } + * + * + * @return The product. + */ + @java.lang.Override + public java.lang.String getProduct() { + java.lang.Object ref = product_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + product_ = s; + return s; + } + } + /** + * + * + *
+   * 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) = { ... } + * + * + * @return The bytes for product. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProductBytes() { + java.lang.Object ref = product_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + product_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TYPE_FIELD_NUMBER = 2; + private volatile java.lang.Object type_; + /** + * + * + *
+   * Required. The fulfillment type, including commonly used types (such as
+   * pickup in store and same day delivery), and custom types.
+   * 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.
+   * This field directly corresponds to [Product.fulfillment_info.type][].
+   * 
+ * + * string type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The type. + */ + @java.lang.Override + public java.lang.String getType() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The fulfillment type, including commonly used types (such as
+   * pickup in store and same day delivery), and custom types.
+   * 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.
+   * This field directly corresponds to [Product.fulfillment_info.type][].
+   * 
+ * + * string type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for type. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PLACE_IDS_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList placeIds_; + /** + * + * + *
+   * Required. The IDs for this
+   * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type], such as
+   * the store IDs for "pickup-in-store" or the region IDs for
+   * "same-day-delivery" to be added for this
+   * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type]. Duplicate
+   * IDs will be automatically ignored.
+   * At least 1 value is required, and a maximum of 2000 values are allowed.
+   * Each value must be a string with a length limit of 10 characters, matching
+   * the pattern [a-zA-Z0-9_-]+, such as "store1" or "REGION-2". Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * If the total number of place IDs exceeds 2000 for this
+   * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type] after
+   * adding, then the update will be rejected.
+   * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the placeIds. + */ + public com.google.protobuf.ProtocolStringList getPlaceIdsList() { + return placeIds_; + } + /** + * + * + *
+   * Required. The IDs for this
+   * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type], such as
+   * the store IDs for "pickup-in-store" or the region IDs for
+   * "same-day-delivery" to be added for this
+   * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type]. Duplicate
+   * IDs will be automatically ignored.
+   * At least 1 value is required, and a maximum of 2000 values are allowed.
+   * Each value must be a string with a length limit of 10 characters, matching
+   * the pattern [a-zA-Z0-9_-]+, such as "store1" or "REGION-2". Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * If the total number of place IDs exceeds 2000 for this
+   * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type] after
+   * adding, then the update will be rejected.
+   * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of placeIds. + */ + public int getPlaceIdsCount() { + return placeIds_.size(); + } + /** + * + * + *
+   * Required. The IDs for this
+   * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type], such as
+   * the store IDs for "pickup-in-store" or the region IDs for
+   * "same-day-delivery" to be added for this
+   * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type]. Duplicate
+   * IDs will be automatically ignored.
+   * At least 1 value is required, and a maximum of 2000 values are allowed.
+   * Each value must be a string with a length limit of 10 characters, matching
+   * the pattern [a-zA-Z0-9_-]+, such as "store1" or "REGION-2". Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * If the total number of place IDs exceeds 2000 for this
+   * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type] after
+   * adding, then the update will be rejected.
+   * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The placeIds at the given index. + */ + public java.lang.String getPlaceIds(int index) { + return placeIds_.get(index); + } + /** + * + * + *
+   * Required. The IDs for this
+   * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type], such as
+   * the store IDs for "pickup-in-store" or the region IDs for
+   * "same-day-delivery" to be added for this
+   * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type]. Duplicate
+   * IDs will be automatically ignored.
+   * At least 1 value is required, and a maximum of 2000 values are allowed.
+   * Each value must be a string with a length limit of 10 characters, matching
+   * the pattern [a-zA-Z0-9_-]+, such as "store1" or "REGION-2". Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * If the total number of place IDs exceeds 2000 for this
+   * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type] after
+   * adding, then the update will be rejected.
+   * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the placeIds at the given index. + */ + public com.google.protobuf.ByteString getPlaceIdsBytes(int index) { + return placeIds_.getByteString(index); + } + + public static final int ADD_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp addTime_; + /** + * + * + *
+   * The time when the fulfillment updates are issued, used to prevent
+   * out-of-order updates on fulfillment information. If not provided, the
+   * internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp add_time = 4; + * + * @return Whether the addTime field is set. + */ + @java.lang.Override + public boolean hasAddTime() { + return addTime_ != null; + } + /** + * + * + *
+   * The time when the fulfillment updates are issued, used to prevent
+   * out-of-order updates on fulfillment information. If not provided, the
+   * internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp add_time = 4; + * + * @return The addTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getAddTime() { + return addTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : addTime_; + } + /** + * + * + *
+   * The time when the fulfillment updates are issued, used to prevent
+   * out-of-order updates on fulfillment information. If not provided, the
+   * internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp add_time = 4; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getAddTimeOrBuilder() { + return getAddTime(); + } + + public static final int ALLOW_MISSING_FIELD_NUMBER = 5; + private boolean allowMissing_; + /** + * + * + *
+   * If set to true, and the [Product][google.cloud.retail.v2.Product] is not
+   * found, the fulfillment information 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, an
+   * INVALID_ARGUMENT error is returned if the
+   * [Product][google.cloud.retail.v2.Product] is not found.
+   * 
+ * + * bool allow_missing = 5; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getProductBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, product_); + } + if (!getTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, type_); + } + for (int i = 0; i < placeIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, placeIds_.getRaw(i)); + } + if (addTime_ != null) { + output.writeMessage(4, getAddTime()); + } + if (allowMissing_ != false) { + output.writeBool(5, allowMissing_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getProductBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, product_); + } + if (!getTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, type_); + } + { + int dataSize = 0; + for (int i = 0; i < placeIds_.size(); i++) { + dataSize += computeStringSizeNoTag(placeIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getPlaceIdsList().size(); + } + if (addTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getAddTime()); + } + if (allowMissing_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, allowMissing_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.retail.v2.AddFulfillmentPlacesRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2.AddFulfillmentPlacesRequest other = + (com.google.cloud.retail.v2.AddFulfillmentPlacesRequest) obj; + + if (!getProduct().equals(other.getProduct())) return false; + if (!getType().equals(other.getType())) return false; + if (!getPlaceIdsList().equals(other.getPlaceIdsList())) return false; + if (hasAddTime() != other.hasAddTime()) return false; + if (hasAddTime()) { + if (!getAddTime().equals(other.getAddTime())) return false; + } + if (getAllowMissing() != other.getAllowMissing()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PRODUCT_FIELD_NUMBER; + hash = (53 * hash) + getProduct().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + if (getPlaceIdsCount() > 0) { + hash = (37 * hash) + PLACE_IDS_FIELD_NUMBER; + hash = (53 * hash) + getPlaceIdsList().hashCode(); + } + if (hasAddTime()) { + hash = (37 * hash) + ADD_TIME_FIELD_NUMBER; + hash = (53 * hash) + getAddTime().hashCode(); + } + hash = (37 * hash) + ALLOW_MISSING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowMissing()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2.AddFulfillmentPlacesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.AddFulfillmentPlacesRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.AddFulfillmentPlacesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.AddFulfillmentPlacesRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.AddFulfillmentPlacesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.AddFulfillmentPlacesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.AddFulfillmentPlacesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.AddFulfillmentPlacesRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.AddFulfillmentPlacesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.AddFulfillmentPlacesRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.AddFulfillmentPlacesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.AddFulfillmentPlacesRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2.AddFulfillmentPlacesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for [AddFulfillmentPlaces][] method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2.AddFulfillmentPlacesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.AddFulfillmentPlacesRequest) + com.google.cloud.retail.v2.AddFulfillmentPlacesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.ProductServiceProto + .internal_static_google_cloud_retail_v2_AddFulfillmentPlacesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.ProductServiceProto + .internal_static_google_cloud_retail_v2_AddFulfillmentPlacesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.AddFulfillmentPlacesRequest.class, + com.google.cloud.retail.v2.AddFulfillmentPlacesRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2.AddFulfillmentPlacesRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + product_ = ""; + + type_ = ""; + + placeIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + if (addTimeBuilder_ == null) { + addTime_ = null; + } else { + addTime_ = null; + addTimeBuilder_ = null; + } + allowMissing_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2.ProductServiceProto + .internal_static_google_cloud_retail_v2_AddFulfillmentPlacesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2.AddFulfillmentPlacesRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2.AddFulfillmentPlacesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2.AddFulfillmentPlacesRequest build() { + com.google.cloud.retail.v2.AddFulfillmentPlacesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2.AddFulfillmentPlacesRequest buildPartial() { + com.google.cloud.retail.v2.AddFulfillmentPlacesRequest result = + new com.google.cloud.retail.v2.AddFulfillmentPlacesRequest(this); + int from_bitField0_ = bitField0_; + result.product_ = product_; + result.type_ = type_; + if (((bitField0_ & 0x00000001) != 0)) { + placeIds_ = placeIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.placeIds_ = placeIds_; + if (addTimeBuilder_ == null) { + result.addTime_ = addTime_; + } else { + result.addTime_ = addTimeBuilder_.build(); + } + result.allowMissing_ = allowMissing_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.retail.v2.AddFulfillmentPlacesRequest) { + return mergeFrom((com.google.cloud.retail.v2.AddFulfillmentPlacesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2.AddFulfillmentPlacesRequest other) { + if (other == com.google.cloud.retail.v2.AddFulfillmentPlacesRequest.getDefaultInstance()) + return this; + if (!other.getProduct().isEmpty()) { + product_ = other.product_; + onChanged(); + } + if (!other.getType().isEmpty()) { + type_ = other.type_; + onChanged(); + } + if (!other.placeIds_.isEmpty()) { + if (placeIds_.isEmpty()) { + placeIds_ = other.placeIds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePlaceIdsIsMutable(); + placeIds_.addAll(other.placeIds_); + } + onChanged(); + } + if (other.hasAddTime()) { + mergeAddTime(other.getAddTime()); + } + if (other.getAllowMissing() != false) { + setAllowMissing(other.getAllowMissing()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.retail.v2.AddFulfillmentPlacesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2.AddFulfillmentPlacesRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object product_ = ""; + /** + * + * + *
+     * 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) = { ... } + * + * + * @return The product. + */ + public java.lang.String getProduct() { + java.lang.Object ref = product_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + product_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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) = { ... } + * + * + * @return The bytes for product. + */ + public com.google.protobuf.ByteString getProductBytes() { + java.lang.Object ref = product_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + product_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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) = { ... } + * + * + * @param value The product to set. + * @return This builder for chaining. + */ + public Builder setProduct(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + product_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 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) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearProduct() { + + product_ = getDefaultInstance().getProduct(); + onChanged(); + return this; + } + /** + * + * + *
+     * 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) = { ... } + * + * + * @param value The bytes for product to set. + * @return This builder for chaining. + */ + public Builder setProductBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + product_ = value; + onChanged(); + return this; + } + + private java.lang.Object type_ = ""; + /** + * + * + *
+     * Required. The fulfillment type, including commonly used types (such as
+     * pickup in store and same day delivery), and custom types.
+     * 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.
+     * This field directly corresponds to [Product.fulfillment_info.type][].
+     * 
+ * + * string type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The type. + */ + public java.lang.String getType() { + java.lang.Object ref = type_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The fulfillment type, including commonly used types (such as
+     * pickup in store and same day delivery), and custom types.
+     * 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.
+     * This field directly corresponds to [Product.fulfillment_info.type][].
+     * 
+ * + * string type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for type. + */ + public com.google.protobuf.ByteString getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The fulfillment type, including commonly used types (such as
+     * pickup in store and same day delivery), and custom types.
+     * 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.
+     * This field directly corresponds to [Product.fulfillment_info.type][].
+     * 
+ * + * string type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + type_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The fulfillment type, including commonly used types (such as
+     * pickup in store and same day delivery), and custom types.
+     * 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.
+     * This field directly corresponds to [Product.fulfillment_info.type][].
+     * 
+ * + * string type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearType() { + + type_ = getDefaultInstance().getType(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The fulfillment type, including commonly used types (such as
+     * pickup in store and same day delivery), and custom types.
+     * 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.
+     * This field directly corresponds to [Product.fulfillment_info.type][].
+     * 
+ * + * string type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for type to set. + * @return This builder for chaining. + */ + public Builder setTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + type_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList placeIds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensurePlaceIdsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + placeIds_ = new com.google.protobuf.LazyStringArrayList(placeIds_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * Required. The IDs for this
+     * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type], such as
+     * the store IDs for "pickup-in-store" or the region IDs for
+     * "same-day-delivery" to be added for this
+     * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type]. Duplicate
+     * IDs will be automatically ignored.
+     * At least 1 value is required, and a maximum of 2000 values are allowed.
+     * Each value must be a string with a length limit of 10 characters, matching
+     * the pattern [a-zA-Z0-9_-]+, such as "store1" or "REGION-2". Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * If the total number of place IDs exceeds 2000 for this
+     * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type] after
+     * adding, then the update will be rejected.
+     * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the placeIds. + */ + public com.google.protobuf.ProtocolStringList getPlaceIdsList() { + return placeIds_.getUnmodifiableView(); + } + /** + * + * + *
+     * Required. The IDs for this
+     * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type], such as
+     * the store IDs for "pickup-in-store" or the region IDs for
+     * "same-day-delivery" to be added for this
+     * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type]. Duplicate
+     * IDs will be automatically ignored.
+     * At least 1 value is required, and a maximum of 2000 values are allowed.
+     * Each value must be a string with a length limit of 10 characters, matching
+     * the pattern [a-zA-Z0-9_-]+, such as "store1" or "REGION-2". Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * If the total number of place IDs exceeds 2000 for this
+     * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type] after
+     * adding, then the update will be rejected.
+     * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of placeIds. + */ + public int getPlaceIdsCount() { + return placeIds_.size(); + } + /** + * + * + *
+     * Required. The IDs for this
+     * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type], such as
+     * the store IDs for "pickup-in-store" or the region IDs for
+     * "same-day-delivery" to be added for this
+     * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type]. Duplicate
+     * IDs will be automatically ignored.
+     * At least 1 value is required, and a maximum of 2000 values are allowed.
+     * Each value must be a string with a length limit of 10 characters, matching
+     * the pattern [a-zA-Z0-9_-]+, such as "store1" or "REGION-2". Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * If the total number of place IDs exceeds 2000 for this
+     * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type] after
+     * adding, then the update will be rejected.
+     * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The placeIds at the given index. + */ + public java.lang.String getPlaceIds(int index) { + return placeIds_.get(index); + } + /** + * + * + *
+     * Required. The IDs for this
+     * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type], such as
+     * the store IDs for "pickup-in-store" or the region IDs for
+     * "same-day-delivery" to be added for this
+     * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type]. Duplicate
+     * IDs will be automatically ignored.
+     * At least 1 value is required, and a maximum of 2000 values are allowed.
+     * Each value must be a string with a length limit of 10 characters, matching
+     * the pattern [a-zA-Z0-9_-]+, such as "store1" or "REGION-2". Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * If the total number of place IDs exceeds 2000 for this
+     * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type] after
+     * adding, then the update will be rejected.
+     * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the placeIds at the given index. + */ + public com.google.protobuf.ByteString getPlaceIdsBytes(int index) { + return placeIds_.getByteString(index); + } + /** + * + * + *
+     * Required. The IDs for this
+     * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type], such as
+     * the store IDs for "pickup-in-store" or the region IDs for
+     * "same-day-delivery" to be added for this
+     * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type]. Duplicate
+     * IDs will be automatically ignored.
+     * At least 1 value is required, and a maximum of 2000 values are allowed.
+     * Each value must be a string with a length limit of 10 characters, matching
+     * the pattern [a-zA-Z0-9_-]+, such as "store1" or "REGION-2". Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * If the total number of place IDs exceeds 2000 for this
+     * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type] after
+     * adding, then the update will be rejected.
+     * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index to set the value at. + * @param value The placeIds to set. + * @return This builder for chaining. + */ + public Builder setPlaceIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePlaceIdsIsMutable(); + placeIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The IDs for this
+     * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type], such as
+     * the store IDs for "pickup-in-store" or the region IDs for
+     * "same-day-delivery" to be added for this
+     * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type]. Duplicate
+     * IDs will be automatically ignored.
+     * At least 1 value is required, and a maximum of 2000 values are allowed.
+     * Each value must be a string with a length limit of 10 characters, matching
+     * the pattern [a-zA-Z0-9_-]+, such as "store1" or "REGION-2". Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * If the total number of place IDs exceeds 2000 for this
+     * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type] after
+     * adding, then the update will be rejected.
+     * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The placeIds to add. + * @return This builder for chaining. + */ + public Builder addPlaceIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePlaceIdsIsMutable(); + placeIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The IDs for this
+     * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type], such as
+     * the store IDs for "pickup-in-store" or the region IDs for
+     * "same-day-delivery" to be added for this
+     * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type]. Duplicate
+     * IDs will be automatically ignored.
+     * At least 1 value is required, and a maximum of 2000 values are allowed.
+     * Each value must be a string with a length limit of 10 characters, matching
+     * the pattern [a-zA-Z0-9_-]+, such as "store1" or "REGION-2". Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * If the total number of place IDs exceeds 2000 for this
+     * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type] after
+     * adding, then the update will be rejected.
+     * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param values The placeIds to add. + * @return This builder for chaining. + */ + public Builder addAllPlaceIds(java.lang.Iterable values) { + ensurePlaceIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, placeIds_); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The IDs for this
+     * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type], such as
+     * the store IDs for "pickup-in-store" or the region IDs for
+     * "same-day-delivery" to be added for this
+     * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type]. Duplicate
+     * IDs will be automatically ignored.
+     * At least 1 value is required, and a maximum of 2000 values are allowed.
+     * Each value must be a string with a length limit of 10 characters, matching
+     * the pattern [a-zA-Z0-9_-]+, such as "store1" or "REGION-2". Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * If the total number of place IDs exceeds 2000 for this
+     * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type] after
+     * adding, then the update will be rejected.
+     * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearPlaceIds() { + placeIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The IDs for this
+     * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type], such as
+     * the store IDs for "pickup-in-store" or the region IDs for
+     * "same-day-delivery" to be added for this
+     * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type]. Duplicate
+     * IDs will be automatically ignored.
+     * At least 1 value is required, and a maximum of 2000 values are allowed.
+     * Each value must be a string with a length limit of 10 characters, matching
+     * the pattern [a-zA-Z0-9_-]+, such as "store1" or "REGION-2". Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * If the total number of place IDs exceeds 2000 for this
+     * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type] after
+     * adding, then the update will be rejected.
+     * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes of the placeIds to add. + * @return This builder for chaining. + */ + public Builder addPlaceIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensurePlaceIdsIsMutable(); + placeIds_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp addTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + addTimeBuilder_; + /** + * + * + *
+     * The time when the fulfillment updates are issued, used to prevent
+     * out-of-order updates on fulfillment information. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp add_time = 4; + * + * @return Whether the addTime field is set. + */ + public boolean hasAddTime() { + return addTimeBuilder_ != null || addTime_ != null; + } + /** + * + * + *
+     * The time when the fulfillment updates are issued, used to prevent
+     * out-of-order updates on fulfillment information. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp add_time = 4; + * + * @return The addTime. + */ + public com.google.protobuf.Timestamp getAddTime() { + if (addTimeBuilder_ == null) { + return addTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : addTime_; + } else { + return addTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time when the fulfillment updates are issued, used to prevent
+     * out-of-order updates on fulfillment information. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp add_time = 4; + */ + public Builder setAddTime(com.google.protobuf.Timestamp value) { + if (addTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + addTime_ = value; + onChanged(); + } else { + addTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The time when the fulfillment updates are issued, used to prevent
+     * out-of-order updates on fulfillment information. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp add_time = 4; + */ + public Builder setAddTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (addTimeBuilder_ == null) { + addTime_ = builderForValue.build(); + onChanged(); + } else { + addTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time when the fulfillment updates are issued, used to prevent
+     * out-of-order updates on fulfillment information. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp add_time = 4; + */ + public Builder mergeAddTime(com.google.protobuf.Timestamp value) { + if (addTimeBuilder_ == null) { + if (addTime_ != null) { + addTime_ = + com.google.protobuf.Timestamp.newBuilder(addTime_).mergeFrom(value).buildPartial(); + } else { + addTime_ = value; + } + onChanged(); + } else { + addTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The time when the fulfillment updates are issued, used to prevent
+     * out-of-order updates on fulfillment information. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp add_time = 4; + */ + public Builder clearAddTime() { + if (addTimeBuilder_ == null) { + addTime_ = null; + onChanged(); + } else { + addTime_ = null; + addTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time when the fulfillment updates are issued, used to prevent
+     * out-of-order updates on fulfillment information. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp add_time = 4; + */ + public com.google.protobuf.Timestamp.Builder getAddTimeBuilder() { + + onChanged(); + return getAddTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time when the fulfillment updates are issued, used to prevent
+     * out-of-order updates on fulfillment information. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp add_time = 4; + */ + public com.google.protobuf.TimestampOrBuilder getAddTimeOrBuilder() { + if (addTimeBuilder_ != null) { + return addTimeBuilder_.getMessageOrBuilder(); + } else { + return addTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : addTime_; + } + } + /** + * + * + *
+     * The time when the fulfillment updates are issued, used to prevent
+     * out-of-order updates on fulfillment information. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp add_time = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getAddTimeFieldBuilder() { + if (addTimeBuilder_ == null) { + addTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getAddTime(), getParentForChildren(), isClean()); + addTime_ = null; + } + return addTimeBuilder_; + } + + private boolean allowMissing_; + /** + * + * + *
+     * If set to true, and the [Product][google.cloud.retail.v2.Product] is not
+     * found, the fulfillment information 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, an
+     * INVALID_ARGUMENT error is returned if the
+     * [Product][google.cloud.retail.v2.Product] is not found.
+     * 
+ * + * bool allow_missing = 5; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + /** + * + * + *
+     * If set to true, and the [Product][google.cloud.retail.v2.Product] is not
+     * found, the fulfillment information 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, an
+     * INVALID_ARGUMENT error is returned if the
+     * [Product][google.cloud.retail.v2.Product] is not found.
+     * 
+ * + * bool allow_missing = 5; + * + * @param value The allowMissing to set. + * @return This builder for chaining. + */ + public Builder setAllowMissing(boolean value) { + + allowMissing_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If set to true, and the [Product][google.cloud.retail.v2.Product] is not
+     * found, the fulfillment information 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, an
+     * INVALID_ARGUMENT error is returned if the
+     * [Product][google.cloud.retail.v2.Product] is not found.
+     * 
+ * + * bool allow_missing = 5; + * + * @return This builder for chaining. + */ + public Builder clearAllowMissing() { + + allowMissing_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.AddFulfillmentPlacesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.AddFulfillmentPlacesRequest) + private static final com.google.cloud.retail.v2.AddFulfillmentPlacesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2.AddFulfillmentPlacesRequest(); + } + + public static com.google.cloud.retail.v2.AddFulfillmentPlacesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AddFulfillmentPlacesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AddFulfillmentPlacesRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.retail.v2.AddFulfillmentPlacesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/AddFulfillmentPlacesRequestOrBuilder.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/AddFulfillmentPlacesRequestOrBuilder.java new file mode 100644 index 00000000..bc81d56d --- /dev/null +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/AddFulfillmentPlacesRequestOrBuilder.java @@ -0,0 +1,275 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2/product_service.proto + +package com.google.cloud.retail.v2; + +public interface AddFulfillmentPlacesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2.AddFulfillmentPlacesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * 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) = { ... } + * + * + * @return The product. + */ + java.lang.String getProduct(); + /** + * + * + *
+   * 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) = { ... } + * + * + * @return The bytes for product. + */ + com.google.protobuf.ByteString getProductBytes(); + + /** + * + * + *
+   * Required. The fulfillment type, including commonly used types (such as
+   * pickup in store and same day delivery), and custom types.
+   * 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.
+   * This field directly corresponds to [Product.fulfillment_info.type][].
+   * 
+ * + * string type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The type. + */ + java.lang.String getType(); + /** + * + * + *
+   * Required. The fulfillment type, including commonly used types (such as
+   * pickup in store and same day delivery), and custom types.
+   * 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.
+   * This field directly corresponds to [Product.fulfillment_info.type][].
+   * 
+ * + * string type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for type. + */ + com.google.protobuf.ByteString getTypeBytes(); + + /** + * + * + *
+   * Required. The IDs for this
+   * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type], such as
+   * the store IDs for "pickup-in-store" or the region IDs for
+   * "same-day-delivery" to be added for this
+   * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type]. Duplicate
+   * IDs will be automatically ignored.
+   * At least 1 value is required, and a maximum of 2000 values are allowed.
+   * Each value must be a string with a length limit of 10 characters, matching
+   * the pattern [a-zA-Z0-9_-]+, such as "store1" or "REGION-2". Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * If the total number of place IDs exceeds 2000 for this
+   * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type] after
+   * adding, then the update will be rejected.
+   * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the placeIds. + */ + java.util.List getPlaceIdsList(); + /** + * + * + *
+   * Required. The IDs for this
+   * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type], such as
+   * the store IDs for "pickup-in-store" or the region IDs for
+   * "same-day-delivery" to be added for this
+   * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type]. Duplicate
+   * IDs will be automatically ignored.
+   * At least 1 value is required, and a maximum of 2000 values are allowed.
+   * Each value must be a string with a length limit of 10 characters, matching
+   * the pattern [a-zA-Z0-9_-]+, such as "store1" or "REGION-2". Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * If the total number of place IDs exceeds 2000 for this
+   * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type] after
+   * adding, then the update will be rejected.
+   * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of placeIds. + */ + int getPlaceIdsCount(); + /** + * + * + *
+   * Required. The IDs for this
+   * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type], such as
+   * the store IDs for "pickup-in-store" or the region IDs for
+   * "same-day-delivery" to be added for this
+   * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type]. Duplicate
+   * IDs will be automatically ignored.
+   * At least 1 value is required, and a maximum of 2000 values are allowed.
+   * Each value must be a string with a length limit of 10 characters, matching
+   * the pattern [a-zA-Z0-9_-]+, such as "store1" or "REGION-2". Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * If the total number of place IDs exceeds 2000 for this
+   * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type] after
+   * adding, then the update will be rejected.
+   * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The placeIds at the given index. + */ + java.lang.String getPlaceIds(int index); + /** + * + * + *
+   * Required. The IDs for this
+   * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type], such as
+   * the store IDs for "pickup-in-store" or the region IDs for
+   * "same-day-delivery" to be added for this
+   * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type]. Duplicate
+   * IDs will be automatically ignored.
+   * At least 1 value is required, and a maximum of 2000 values are allowed.
+   * Each value must be a string with a length limit of 10 characters, matching
+   * the pattern [a-zA-Z0-9_-]+, such as "store1" or "REGION-2". Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * If the total number of place IDs exceeds 2000 for this
+   * [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type] after
+   * adding, then the update will be rejected.
+   * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the placeIds at the given index. + */ + com.google.protobuf.ByteString getPlaceIdsBytes(int index); + + /** + * + * + *
+   * The time when the fulfillment updates are issued, used to prevent
+   * out-of-order updates on fulfillment information. If not provided, the
+   * internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp add_time = 4; + * + * @return Whether the addTime field is set. + */ + boolean hasAddTime(); + /** + * + * + *
+   * The time when the fulfillment updates are issued, used to prevent
+   * out-of-order updates on fulfillment information. If not provided, the
+   * internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp add_time = 4; + * + * @return The addTime. + */ + com.google.protobuf.Timestamp getAddTime(); + /** + * + * + *
+   * The time when the fulfillment updates are issued, used to prevent
+   * out-of-order updates on fulfillment information. If not provided, the
+   * internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp add_time = 4; + */ + com.google.protobuf.TimestampOrBuilder getAddTimeOrBuilder(); + + /** + * + * + *
+   * If set to true, and the [Product][google.cloud.retail.v2.Product] is not
+   * found, the fulfillment information 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, an
+   * INVALID_ARGUMENT error is returned if the
+   * [Product][google.cloud.retail.v2.Product] is not found.
+   * 
+ * + * bool allow_missing = 5; + * + * @return The allowMissing. + */ + boolean getAllowMissing(); +} diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/AddFulfillmentPlacesResponse.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/AddFulfillmentPlacesResponse.java new file mode 100644 index 00000000..13fb9b75 --- /dev/null +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/AddFulfillmentPlacesResponse.java @@ -0,0 +1,461 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2/product_service.proto + +package com.google.cloud.retail.v2; + +/** + * + * + *
+ * Response of the RemoveFulfillmentPlacesRequest.  Currently empty because
+ * there is no meaningful response populated from the [AddFulfillmentPlaces][]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2.AddFulfillmentPlacesResponse} + */ +public final class AddFulfillmentPlacesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.AddFulfillmentPlacesResponse) + AddFulfillmentPlacesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use AddFulfillmentPlacesResponse.newBuilder() to construct. + private AddFulfillmentPlacesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AddFulfillmentPlacesResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AddFulfillmentPlacesResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AddFulfillmentPlacesResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.ProductServiceProto + .internal_static_google_cloud_retail_v2_AddFulfillmentPlacesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.ProductServiceProto + .internal_static_google_cloud_retail_v2_AddFulfillmentPlacesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.AddFulfillmentPlacesResponse.class, + com.google.cloud.retail.v2.AddFulfillmentPlacesResponse.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.retail.v2.AddFulfillmentPlacesResponse)) { + return super.equals(obj); + } + com.google.cloud.retail.v2.AddFulfillmentPlacesResponse other = + (com.google.cloud.retail.v2.AddFulfillmentPlacesResponse) obj; + + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2.AddFulfillmentPlacesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.AddFulfillmentPlacesResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.AddFulfillmentPlacesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.AddFulfillmentPlacesResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.AddFulfillmentPlacesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.AddFulfillmentPlacesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.AddFulfillmentPlacesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.AddFulfillmentPlacesResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.AddFulfillmentPlacesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.AddFulfillmentPlacesResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.AddFulfillmentPlacesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.AddFulfillmentPlacesResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2.AddFulfillmentPlacesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response of the RemoveFulfillmentPlacesRequest.  Currently empty because
+   * there is no meaningful response populated from the [AddFulfillmentPlaces][]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2.AddFulfillmentPlacesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.AddFulfillmentPlacesResponse) + com.google.cloud.retail.v2.AddFulfillmentPlacesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.ProductServiceProto + .internal_static_google_cloud_retail_v2_AddFulfillmentPlacesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.ProductServiceProto + .internal_static_google_cloud_retail_v2_AddFulfillmentPlacesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.AddFulfillmentPlacesResponse.class, + com.google.cloud.retail.v2.AddFulfillmentPlacesResponse.Builder.class); + } + + // Construct using com.google.cloud.retail.v2.AddFulfillmentPlacesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2.ProductServiceProto + .internal_static_google_cloud_retail_v2_AddFulfillmentPlacesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2.AddFulfillmentPlacesResponse getDefaultInstanceForType() { + return com.google.cloud.retail.v2.AddFulfillmentPlacesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2.AddFulfillmentPlacesResponse build() { + com.google.cloud.retail.v2.AddFulfillmentPlacesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2.AddFulfillmentPlacesResponse buildPartial() { + com.google.cloud.retail.v2.AddFulfillmentPlacesResponse result = + new com.google.cloud.retail.v2.AddFulfillmentPlacesResponse(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.retail.v2.AddFulfillmentPlacesResponse) { + return mergeFrom((com.google.cloud.retail.v2.AddFulfillmentPlacesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2.AddFulfillmentPlacesResponse other) { + if (other == com.google.cloud.retail.v2.AddFulfillmentPlacesResponse.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.retail.v2.AddFulfillmentPlacesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2.AddFulfillmentPlacesResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.AddFulfillmentPlacesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.AddFulfillmentPlacesResponse) + private static final com.google.cloud.retail.v2.AddFulfillmentPlacesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2.AddFulfillmentPlacesResponse(); + } + + public static com.google.cloud.retail.v2.AddFulfillmentPlacesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AddFulfillmentPlacesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AddFulfillmentPlacesResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.retail.v2.AddFulfillmentPlacesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/AddFulfillmentPlacesResponseOrBuilder.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/AddFulfillmentPlacesResponseOrBuilder.java new file mode 100644 index 00000000..c3dc60d6 --- /dev/null +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/AddFulfillmentPlacesResponseOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2/product_service.proto + +package com.google.cloud.retail.v2; + +public interface AddFulfillmentPlacesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2.AddFulfillmentPlacesResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/Audience.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/Audience.java new file mode 100644 index 00000000..0d475c3b --- /dev/null +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/Audience.java @@ -0,0 +1,1257 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2/common.proto + +package com.google.cloud.retail.v2; + +/** + * + * + *
+ * An intended audience of the [Product][google.cloud.retail.v2.Product] for
+ * whom it's sold.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2.Audience} + */ +public final class Audience extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.Audience) + AudienceOrBuilder { + private static final long serialVersionUID = 0L; + // Use Audience.newBuilder() to construct. + private Audience(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Audience() { + genders_ = com.google.protobuf.LazyStringArrayList.EMPTY; + ageGroups_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Audience(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Audience( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + genders_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + genders_.add(s); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + ageGroups_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + ageGroups_.add(s); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + genders_ = genders_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + ageGroups_ = ageGroups_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.CommonProto + .internal_static_google_cloud_retail_v2_Audience_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.CommonProto + .internal_static_google_cloud_retail_v2_Audience_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.Audience.class, + com.google.cloud.retail.v2.Audience.Builder.class); + } + + public static final int GENDERS_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList genders_; + /** + * + * + *
+   * The genders of the audience. Strongly encouraged to use the standard
+   * values: "male", "female", "unisex".
+   * At most 5 values are allowed. 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
+   * [gender](https://support.google.com/merchants/answer/6324479). Schema.org
+   * property
+   * [Product.audience.suggestedGender](https://schema.org/suggestedGender).
+   * 
+ * + * repeated string genders = 1; + * + * @return A list containing the genders. + */ + public com.google.protobuf.ProtocolStringList getGendersList() { + return genders_; + } + /** + * + * + *
+   * The genders of the audience. Strongly encouraged to use the standard
+   * values: "male", "female", "unisex".
+   * At most 5 values are allowed. 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
+   * [gender](https://support.google.com/merchants/answer/6324479). Schema.org
+   * property
+   * [Product.audience.suggestedGender](https://schema.org/suggestedGender).
+   * 
+ * + * repeated string genders = 1; + * + * @return The count of genders. + */ + public int getGendersCount() { + return genders_.size(); + } + /** + * + * + *
+   * The genders of the audience. Strongly encouraged to use the standard
+   * values: "male", "female", "unisex".
+   * At most 5 values are allowed. 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
+   * [gender](https://support.google.com/merchants/answer/6324479). Schema.org
+   * property
+   * [Product.audience.suggestedGender](https://schema.org/suggestedGender).
+   * 
+ * + * repeated string genders = 1; + * + * @param index The index of the element to return. + * @return The genders at the given index. + */ + public java.lang.String getGenders(int index) { + return genders_.get(index); + } + /** + * + * + *
+   * The genders of the audience. Strongly encouraged to use the standard
+   * values: "male", "female", "unisex".
+   * At most 5 values are allowed. 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
+   * [gender](https://support.google.com/merchants/answer/6324479). Schema.org
+   * property
+   * [Product.audience.suggestedGender](https://schema.org/suggestedGender).
+   * 
+ * + * repeated string genders = 1; + * + * @param index The index of the value to return. + * @return The bytes of the genders at the given index. + */ + public com.google.protobuf.ByteString getGendersBytes(int index) { + return genders_.getByteString(index); + } + + public static final int AGE_GROUPS_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList ageGroups_; + /** + * + * + *
+   * The age groups of the audience. Strongly encouraged to use the standard
+   * values: "newborn" (up to 3 months old), "infant" (3–12 months old),
+   * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
+   * teens or older).
+   * At most 5 values are allowed. 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
+   * [age_group](https://support.google.com/merchants/answer/6324463).
+   * Schema.org property
+   * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
+   * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
+   * 
+ * + * repeated string age_groups = 2; + * + * @return A list containing the ageGroups. + */ + public com.google.protobuf.ProtocolStringList getAgeGroupsList() { + return ageGroups_; + } + /** + * + * + *
+   * The age groups of the audience. Strongly encouraged to use the standard
+   * values: "newborn" (up to 3 months old), "infant" (3–12 months old),
+   * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
+   * teens or older).
+   * At most 5 values are allowed. 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
+   * [age_group](https://support.google.com/merchants/answer/6324463).
+   * Schema.org property
+   * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
+   * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
+   * 
+ * + * repeated string age_groups = 2; + * + * @return The count of ageGroups. + */ + public int getAgeGroupsCount() { + return ageGroups_.size(); + } + /** + * + * + *
+   * The age groups of the audience. Strongly encouraged to use the standard
+   * values: "newborn" (up to 3 months old), "infant" (3–12 months old),
+   * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
+   * teens or older).
+   * At most 5 values are allowed. 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
+   * [age_group](https://support.google.com/merchants/answer/6324463).
+   * Schema.org property
+   * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
+   * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
+   * 
+ * + * repeated string age_groups = 2; + * + * @param index The index of the element to return. + * @return The ageGroups at the given index. + */ + public java.lang.String getAgeGroups(int index) { + return ageGroups_.get(index); + } + /** + * + * + *
+   * The age groups of the audience. Strongly encouraged to use the standard
+   * values: "newborn" (up to 3 months old), "infant" (3–12 months old),
+   * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
+   * teens or older).
+   * At most 5 values are allowed. 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
+   * [age_group](https://support.google.com/merchants/answer/6324463).
+   * Schema.org property
+   * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
+   * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
+   * 
+ * + * repeated string age_groups = 2; + * + * @param index The index of the value to return. + * @return The bytes of the ageGroups at the given index. + */ + public com.google.protobuf.ByteString getAgeGroupsBytes(int index) { + return ageGroups_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < genders_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, genders_.getRaw(i)); + } + for (int i = 0; i < ageGroups_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, ageGroups_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < genders_.size(); i++) { + dataSize += computeStringSizeNoTag(genders_.getRaw(i)); + } + size += dataSize; + size += 1 * getGendersList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < ageGroups_.size(); i++) { + dataSize += computeStringSizeNoTag(ageGroups_.getRaw(i)); + } + size += dataSize; + size += 1 * getAgeGroupsList().size(); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.retail.v2.Audience)) { + return super.equals(obj); + } + com.google.cloud.retail.v2.Audience other = (com.google.cloud.retail.v2.Audience) obj; + + if (!getGendersList().equals(other.getGendersList())) return false; + if (!getAgeGroupsList().equals(other.getAgeGroupsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getGendersCount() > 0) { + hash = (37 * hash) + GENDERS_FIELD_NUMBER; + hash = (53 * hash) + getGendersList().hashCode(); + } + if (getAgeGroupsCount() > 0) { + hash = (37 * hash) + AGE_GROUPS_FIELD_NUMBER; + hash = (53 * hash) + getAgeGroupsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2.Audience parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.Audience parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.Audience parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.Audience parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.Audience parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.Audience parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.Audience parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.Audience parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.Audience parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.Audience parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.Audience parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.Audience parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2.Audience prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * An intended audience of the [Product][google.cloud.retail.v2.Product] for
+   * whom it's sold.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2.Audience} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.Audience) + com.google.cloud.retail.v2.AudienceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.CommonProto + .internal_static_google_cloud_retail_v2_Audience_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.CommonProto + .internal_static_google_cloud_retail_v2_Audience_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.Audience.class, + com.google.cloud.retail.v2.Audience.Builder.class); + } + + // Construct using com.google.cloud.retail.v2.Audience.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + genders_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + ageGroups_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2.CommonProto + .internal_static_google_cloud_retail_v2_Audience_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2.Audience getDefaultInstanceForType() { + return com.google.cloud.retail.v2.Audience.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2.Audience build() { + com.google.cloud.retail.v2.Audience result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2.Audience buildPartial() { + com.google.cloud.retail.v2.Audience result = new com.google.cloud.retail.v2.Audience(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + genders_ = genders_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.genders_ = genders_; + if (((bitField0_ & 0x00000002) != 0)) { + ageGroups_ = ageGroups_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.ageGroups_ = ageGroups_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.retail.v2.Audience) { + return mergeFrom((com.google.cloud.retail.v2.Audience) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2.Audience other) { + if (other == com.google.cloud.retail.v2.Audience.getDefaultInstance()) return this; + if (!other.genders_.isEmpty()) { + if (genders_.isEmpty()) { + genders_ = other.genders_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureGendersIsMutable(); + genders_.addAll(other.genders_); + } + onChanged(); + } + if (!other.ageGroups_.isEmpty()) { + if (ageGroups_.isEmpty()) { + ageGroups_ = other.ageGroups_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureAgeGroupsIsMutable(); + ageGroups_.addAll(other.ageGroups_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.retail.v2.Audience parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2.Audience) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList genders_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureGendersIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + genders_ = new com.google.protobuf.LazyStringArrayList(genders_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * The genders of the audience. Strongly encouraged to use the standard
+     * values: "male", "female", "unisex".
+     * At most 5 values are allowed. 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
+     * [gender](https://support.google.com/merchants/answer/6324479). Schema.org
+     * property
+     * [Product.audience.suggestedGender](https://schema.org/suggestedGender).
+     * 
+ * + * repeated string genders = 1; + * + * @return A list containing the genders. + */ + public com.google.protobuf.ProtocolStringList getGendersList() { + return genders_.getUnmodifiableView(); + } + /** + * + * + *
+     * The genders of the audience. Strongly encouraged to use the standard
+     * values: "male", "female", "unisex".
+     * At most 5 values are allowed. 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
+     * [gender](https://support.google.com/merchants/answer/6324479). Schema.org
+     * property
+     * [Product.audience.suggestedGender](https://schema.org/suggestedGender).
+     * 
+ * + * repeated string genders = 1; + * + * @return The count of genders. + */ + public int getGendersCount() { + return genders_.size(); + } + /** + * + * + *
+     * The genders of the audience. Strongly encouraged to use the standard
+     * values: "male", "female", "unisex".
+     * At most 5 values are allowed. 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
+     * [gender](https://support.google.com/merchants/answer/6324479). Schema.org
+     * property
+     * [Product.audience.suggestedGender](https://schema.org/suggestedGender).
+     * 
+ * + * repeated string genders = 1; + * + * @param index The index of the element to return. + * @return The genders at the given index. + */ + public java.lang.String getGenders(int index) { + return genders_.get(index); + } + /** + * + * + *
+     * The genders of the audience. Strongly encouraged to use the standard
+     * values: "male", "female", "unisex".
+     * At most 5 values are allowed. 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
+     * [gender](https://support.google.com/merchants/answer/6324479). Schema.org
+     * property
+     * [Product.audience.suggestedGender](https://schema.org/suggestedGender).
+     * 
+ * + * repeated string genders = 1; + * + * @param index The index of the value to return. + * @return The bytes of the genders at the given index. + */ + public com.google.protobuf.ByteString getGendersBytes(int index) { + return genders_.getByteString(index); + } + /** + * + * + *
+     * The genders of the audience. Strongly encouraged to use the standard
+     * values: "male", "female", "unisex".
+     * At most 5 values are allowed. 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
+     * [gender](https://support.google.com/merchants/answer/6324479). Schema.org
+     * property
+     * [Product.audience.suggestedGender](https://schema.org/suggestedGender).
+     * 
+ * + * repeated string genders = 1; + * + * @param index The index to set the value at. + * @param value The genders to set. + * @return This builder for chaining. + */ + public Builder setGenders(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureGendersIsMutable(); + genders_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The genders of the audience. Strongly encouraged to use the standard
+     * values: "male", "female", "unisex".
+     * At most 5 values are allowed. 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
+     * [gender](https://support.google.com/merchants/answer/6324479). Schema.org
+     * property
+     * [Product.audience.suggestedGender](https://schema.org/suggestedGender).
+     * 
+ * + * repeated string genders = 1; + * + * @param value The genders to add. + * @return This builder for chaining. + */ + public Builder addGenders(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureGendersIsMutable(); + genders_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The genders of the audience. Strongly encouraged to use the standard
+     * values: "male", "female", "unisex".
+     * At most 5 values are allowed. 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
+     * [gender](https://support.google.com/merchants/answer/6324479). Schema.org
+     * property
+     * [Product.audience.suggestedGender](https://schema.org/suggestedGender).
+     * 
+ * + * repeated string genders = 1; + * + * @param values The genders to add. + * @return This builder for chaining. + */ + public Builder addAllGenders(java.lang.Iterable values) { + ensureGendersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, genders_); + onChanged(); + return this; + } + /** + * + * + *
+     * The genders of the audience. Strongly encouraged to use the standard
+     * values: "male", "female", "unisex".
+     * At most 5 values are allowed. 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
+     * [gender](https://support.google.com/merchants/answer/6324479). Schema.org
+     * property
+     * [Product.audience.suggestedGender](https://schema.org/suggestedGender).
+     * 
+ * + * repeated string genders = 1; + * + * @return This builder for chaining. + */ + public Builder clearGenders() { + genders_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The genders of the audience. Strongly encouraged to use the standard
+     * values: "male", "female", "unisex".
+     * At most 5 values are allowed. 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
+     * [gender](https://support.google.com/merchants/answer/6324479). Schema.org
+     * property
+     * [Product.audience.suggestedGender](https://schema.org/suggestedGender).
+     * 
+ * + * repeated string genders = 1; + * + * @param value The bytes of the genders to add. + * @return This builder for chaining. + */ + public Builder addGendersBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureGendersIsMutable(); + genders_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList ageGroups_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureAgeGroupsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + ageGroups_ = new com.google.protobuf.LazyStringArrayList(ageGroups_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * The age groups of the audience. Strongly encouraged to use the standard
+     * values: "newborn" (up to 3 months old), "infant" (3–12 months old),
+     * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
+     * teens or older).
+     * At most 5 values are allowed. 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
+     * [age_group](https://support.google.com/merchants/answer/6324463).
+     * Schema.org property
+     * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
+     * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
+     * 
+ * + * repeated string age_groups = 2; + * + * @return A list containing the ageGroups. + */ + public com.google.protobuf.ProtocolStringList getAgeGroupsList() { + return ageGroups_.getUnmodifiableView(); + } + /** + * + * + *
+     * The age groups of the audience. Strongly encouraged to use the standard
+     * values: "newborn" (up to 3 months old), "infant" (3–12 months old),
+     * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
+     * teens or older).
+     * At most 5 values are allowed. 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
+     * [age_group](https://support.google.com/merchants/answer/6324463).
+     * Schema.org property
+     * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
+     * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
+     * 
+ * + * repeated string age_groups = 2; + * + * @return The count of ageGroups. + */ + public int getAgeGroupsCount() { + return ageGroups_.size(); + } + /** + * + * + *
+     * The age groups of the audience. Strongly encouraged to use the standard
+     * values: "newborn" (up to 3 months old), "infant" (3–12 months old),
+     * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
+     * teens or older).
+     * At most 5 values are allowed. 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
+     * [age_group](https://support.google.com/merchants/answer/6324463).
+     * Schema.org property
+     * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
+     * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
+     * 
+ * + * repeated string age_groups = 2; + * + * @param index The index of the element to return. + * @return The ageGroups at the given index. + */ + public java.lang.String getAgeGroups(int index) { + return ageGroups_.get(index); + } + /** + * + * + *
+     * The age groups of the audience. Strongly encouraged to use the standard
+     * values: "newborn" (up to 3 months old), "infant" (3–12 months old),
+     * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
+     * teens or older).
+     * At most 5 values are allowed. 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
+     * [age_group](https://support.google.com/merchants/answer/6324463).
+     * Schema.org property
+     * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
+     * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
+     * 
+ * + * repeated string age_groups = 2; + * + * @param index The index of the value to return. + * @return The bytes of the ageGroups at the given index. + */ + public com.google.protobuf.ByteString getAgeGroupsBytes(int index) { + return ageGroups_.getByteString(index); + } + /** + * + * + *
+     * The age groups of the audience. Strongly encouraged to use the standard
+     * values: "newborn" (up to 3 months old), "infant" (3–12 months old),
+     * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
+     * teens or older).
+     * At most 5 values are allowed. 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
+     * [age_group](https://support.google.com/merchants/answer/6324463).
+     * Schema.org property
+     * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
+     * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
+     * 
+ * + * repeated string age_groups = 2; + * + * @param index The index to set the value at. + * @param value The ageGroups to set. + * @return This builder for chaining. + */ + public Builder setAgeGroups(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAgeGroupsIsMutable(); + ageGroups_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The age groups of the audience. Strongly encouraged to use the standard
+     * values: "newborn" (up to 3 months old), "infant" (3–12 months old),
+     * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
+     * teens or older).
+     * At most 5 values are allowed. 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
+     * [age_group](https://support.google.com/merchants/answer/6324463).
+     * Schema.org property
+     * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
+     * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
+     * 
+ * + * repeated string age_groups = 2; + * + * @param value The ageGroups to add. + * @return This builder for chaining. + */ + public Builder addAgeGroups(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAgeGroupsIsMutable(); + ageGroups_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The age groups of the audience. Strongly encouraged to use the standard
+     * values: "newborn" (up to 3 months old), "infant" (3–12 months old),
+     * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
+     * teens or older).
+     * At most 5 values are allowed. 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
+     * [age_group](https://support.google.com/merchants/answer/6324463).
+     * Schema.org property
+     * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
+     * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
+     * 
+ * + * repeated string age_groups = 2; + * + * @param values The ageGroups to add. + * @return This builder for chaining. + */ + public Builder addAllAgeGroups(java.lang.Iterable values) { + ensureAgeGroupsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, ageGroups_); + onChanged(); + return this; + } + /** + * + * + *
+     * The age groups of the audience. Strongly encouraged to use the standard
+     * values: "newborn" (up to 3 months old), "infant" (3–12 months old),
+     * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
+     * teens or older).
+     * At most 5 values are allowed. 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
+     * [age_group](https://support.google.com/merchants/answer/6324463).
+     * Schema.org property
+     * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
+     * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
+     * 
+ * + * repeated string age_groups = 2; + * + * @return This builder for chaining. + */ + public Builder clearAgeGroups() { + ageGroups_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The age groups of the audience. Strongly encouraged to use the standard
+     * values: "newborn" (up to 3 months old), "infant" (3–12 months old),
+     * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
+     * teens or older).
+     * At most 5 values are allowed. 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
+     * [age_group](https://support.google.com/merchants/answer/6324463).
+     * Schema.org property
+     * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
+     * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
+     * 
+ * + * repeated string age_groups = 2; + * + * @param value The bytes of the ageGroups to add. + * @return This builder for chaining. + */ + public Builder addAgeGroupsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureAgeGroupsIsMutable(); + ageGroups_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.Audience) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.Audience) + private static final com.google.cloud.retail.v2.Audience DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2.Audience(); + } + + public static com.google.cloud.retail.v2.Audience getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Audience parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Audience(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.retail.v2.Audience getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/AudienceOrBuilder.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/AudienceOrBuilder.java new file mode 100644 index 00000000..f1fd966d --- /dev/null +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/AudienceOrBuilder.java @@ -0,0 +1,203 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2/common.proto + +package com.google.cloud.retail.v2; + +public interface AudienceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2.Audience) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The genders of the audience. Strongly encouraged to use the standard
+   * values: "male", "female", "unisex".
+   * At most 5 values are allowed. 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
+   * [gender](https://support.google.com/merchants/answer/6324479). Schema.org
+   * property
+   * [Product.audience.suggestedGender](https://schema.org/suggestedGender).
+   * 
+ * + * repeated string genders = 1; + * + * @return A list containing the genders. + */ + java.util.List getGendersList(); + /** + * + * + *
+   * The genders of the audience. Strongly encouraged to use the standard
+   * values: "male", "female", "unisex".
+   * At most 5 values are allowed. 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
+   * [gender](https://support.google.com/merchants/answer/6324479). Schema.org
+   * property
+   * [Product.audience.suggestedGender](https://schema.org/suggestedGender).
+   * 
+ * + * repeated string genders = 1; + * + * @return The count of genders. + */ + int getGendersCount(); + /** + * + * + *
+   * The genders of the audience. Strongly encouraged to use the standard
+   * values: "male", "female", "unisex".
+   * At most 5 values are allowed. 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
+   * [gender](https://support.google.com/merchants/answer/6324479). Schema.org
+   * property
+   * [Product.audience.suggestedGender](https://schema.org/suggestedGender).
+   * 
+ * + * repeated string genders = 1; + * + * @param index The index of the element to return. + * @return The genders at the given index. + */ + java.lang.String getGenders(int index); + /** + * + * + *
+   * The genders of the audience. Strongly encouraged to use the standard
+   * values: "male", "female", "unisex".
+   * At most 5 values are allowed. 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
+   * [gender](https://support.google.com/merchants/answer/6324479). Schema.org
+   * property
+   * [Product.audience.suggestedGender](https://schema.org/suggestedGender).
+   * 
+ * + * repeated string genders = 1; + * + * @param index The index of the value to return. + * @return The bytes of the genders at the given index. + */ + com.google.protobuf.ByteString getGendersBytes(int index); + + /** + * + * + *
+   * The age groups of the audience. Strongly encouraged to use the standard
+   * values: "newborn" (up to 3 months old), "infant" (3–12 months old),
+   * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
+   * teens or older).
+   * At most 5 values are allowed. 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
+   * [age_group](https://support.google.com/merchants/answer/6324463).
+   * Schema.org property
+   * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
+   * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
+   * 
+ * + * repeated string age_groups = 2; + * + * @return A list containing the ageGroups. + */ + java.util.List getAgeGroupsList(); + /** + * + * + *
+   * The age groups of the audience. Strongly encouraged to use the standard
+   * values: "newborn" (up to 3 months old), "infant" (3–12 months old),
+   * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
+   * teens or older).
+   * At most 5 values are allowed. 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
+   * [age_group](https://support.google.com/merchants/answer/6324463).
+   * Schema.org property
+   * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
+   * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
+   * 
+ * + * repeated string age_groups = 2; + * + * @return The count of ageGroups. + */ + int getAgeGroupsCount(); + /** + * + * + *
+   * The age groups of the audience. Strongly encouraged to use the standard
+   * values: "newborn" (up to 3 months old), "infant" (3–12 months old),
+   * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
+   * teens or older).
+   * At most 5 values are allowed. 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
+   * [age_group](https://support.google.com/merchants/answer/6324463).
+   * Schema.org property
+   * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
+   * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
+   * 
+ * + * repeated string age_groups = 2; + * + * @param index The index of the element to return. + * @return The ageGroups at the given index. + */ + java.lang.String getAgeGroups(int index); + /** + * + * + *
+   * The age groups of the audience. Strongly encouraged to use the standard
+   * values: "newborn" (up to 3 months old), "infant" (3–12 months old),
+   * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
+   * teens or older).
+   * At most 5 values are allowed. 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
+   * [age_group](https://support.google.com/merchants/answer/6324463).
+   * Schema.org property
+   * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
+   * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
+   * 
+ * + * repeated string age_groups = 2; + * + * @param index The index of the value to return. + * @return The bytes of the ageGroups at the given index. + */ + com.google.protobuf.ByteString getAgeGroupsBytes(int index); +} diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/BigQuerySource.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/BigQuerySource.java index 822cbd9a..3e387307 100644 --- a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/BigQuerySource.java +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/BigQuerySource.java @@ -109,6 +109,20 @@ private BigQuerySource( projectId_ = s; break; } + case 50: + { + com.google.type.Date.Builder subBuilder = null; + if (partitionCase_ == 6) { + subBuilder = ((com.google.type.Date) partition_).toBuilder(); + } + partition_ = input.readMessage(com.google.type.Date.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.type.Date) partition_); + partition_ = subBuilder.buildPartial(); + } + partitionCase_ = 6; + break; + } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -143,15 +157,119 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.cloud.retail.v2.BigQuerySource.Builder.class); } + private int partitionCase_ = 0; + private java.lang.Object partition_; + + public enum PartitionCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + PARTITION_DATE(6), + PARTITION_NOT_SET(0); + private final int value; + + private PartitionCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static PartitionCase valueOf(int value) { + return forNumber(value); + } + + public static PartitionCase forNumber(int value) { + switch (value) { + case 6: + return PARTITION_DATE; + case 0: + return PARTITION_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public PartitionCase getPartitionCase() { + return PartitionCase.forNumber(partitionCase_); + } + + public static final int PARTITION_DATE_FIELD_NUMBER = 6; + /** + * + * + *
+   * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
+   * Only supported when
+   * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2.ImportProductsRequest.reconciliation_mode]
+   * is set to `FULL`.
+   * 
+ * + * .google.type.Date partition_date = 6; + * + * @return Whether the partitionDate field is set. + */ + @java.lang.Override + public boolean hasPartitionDate() { + return partitionCase_ == 6; + } + /** + * + * + *
+   * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
+   * Only supported when
+   * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2.ImportProductsRequest.reconciliation_mode]
+   * is set to `FULL`.
+   * 
+ * + * .google.type.Date partition_date = 6; + * + * @return The partitionDate. + */ + @java.lang.Override + public com.google.type.Date getPartitionDate() { + if (partitionCase_ == 6) { + return (com.google.type.Date) partition_; + } + return com.google.type.Date.getDefaultInstance(); + } + /** + * + * + *
+   * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
+   * Only supported when
+   * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2.ImportProductsRequest.reconciliation_mode]
+   * is set to `FULL`.
+   * 
+ * + * .google.type.Date partition_date = 6; + */ + @java.lang.Override + public com.google.type.DateOrBuilder getPartitionDateOrBuilder() { + if (partitionCase_ == 6) { + return (com.google.type.Date) partition_; + } + return com.google.type.Date.getDefaultInstance(); + } + public static final int PROJECT_ID_FIELD_NUMBER = 5; private volatile java.lang.Object projectId_; /** * * *
-   * The project id (can be project # or id) that the BigQuery source is in with
+   * The project ID (can be project # or ID) that the BigQuery source is in with
    * a length limit of 128 characters. If not specified, inherits the project
-   * id from the parent request.
+   * ID from the parent request.
    * 
* * string project_id = 5; @@ -174,9 +292,9 @@ public java.lang.String getProjectId() { * * *
-   * The project id (can be project # or id) that the BigQuery source is in with
+   * The project ID (can be project # or ID) that the BigQuery source is in with
    * a length limit of 128 characters. If not specified, inherits the project
-   * id from the parent request.
+   * ID from the parent request.
    * 
* * string project_id = 5; @@ -368,7 +486,7 @@ public com.google.protobuf.ByteString getGcsStagingDirBytes() { * * `user_event` (default): One JSON * [UserEvent][google.cloud.retail.v2.UserEvent] per line. * * `user_event_ga360`: Using - * https://support.google.com/analytics/answer/3437719?hl=en. + * https://support.google.com/analytics/answer/3437719. * * * string data_schema = 4; @@ -402,7 +520,7 @@ public java.lang.String getDataSchema() { * * `user_event` (default): One JSON * [UserEvent][google.cloud.retail.v2.UserEvent] per line. * * `user_event_ga360`: Using - * https://support.google.com/analytics/answer/3437719?hl=en. + * https://support.google.com/analytics/answer/3437719. * * * string data_schema = 4; @@ -451,6 +569,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!getProjectIdBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 5, projectId_); } + if (partitionCase_ == 6) { + output.writeMessage(6, (com.google.type.Date) partition_); + } unknownFields.writeTo(output); } @@ -475,6 +596,11 @@ public int getSerializedSize() { if (!getProjectIdBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, projectId_); } + if (partitionCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, (com.google.type.Date) partition_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -496,6 +622,14 @@ public boolean equals(final java.lang.Object obj) { if (!getTableId().equals(other.getTableId())) return false; if (!getGcsStagingDir().equals(other.getGcsStagingDir())) return false; if (!getDataSchema().equals(other.getDataSchema())) return false; + if (!getPartitionCase().equals(other.getPartitionCase())) return false; + switch (partitionCase_) { + case 6: + if (!getPartitionDate().equals(other.getPartitionDate())) return false; + break; + case 0: + default: + } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -517,6 +651,14 @@ public int hashCode() { hash = (53 * hash) + getGcsStagingDir().hashCode(); hash = (37 * hash) + DATA_SCHEMA_FIELD_NUMBER; hash = (53 * hash) + getDataSchema().hashCode(); + switch (partitionCase_) { + case 6: + hash = (37 * hash) + PARTITION_DATE_FIELD_NUMBER; + hash = (53 * hash) + getPartitionDate().hashCode(); + break; + case 0: + default: + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -672,6 +814,8 @@ public Builder clear() { dataSchema_ = ""; + partitionCase_ = 0; + partition_ = null; return this; } @@ -699,11 +843,19 @@ public com.google.cloud.retail.v2.BigQuerySource build() { public com.google.cloud.retail.v2.BigQuerySource buildPartial() { com.google.cloud.retail.v2.BigQuerySource result = new com.google.cloud.retail.v2.BigQuerySource(this); + if (partitionCase_ == 6) { + if (partitionDateBuilder_ == null) { + result.partition_ = partition_; + } else { + result.partition_ = partitionDateBuilder_.build(); + } + } result.projectId_ = projectId_; result.datasetId_ = datasetId_; result.tableId_ = tableId_; result.gcsStagingDir_ = gcsStagingDir_; result.dataSchema_ = dataSchema_; + result.partitionCase_ = partitionCase_; onBuilt(); return result; } @@ -773,6 +925,17 @@ public Builder mergeFrom(com.google.cloud.retail.v2.BigQuerySource other) { dataSchema_ = other.dataSchema_; onChanged(); } + switch (other.getPartitionCase()) { + case PARTITION_DATE: + { + mergePartitionDate(other.getPartitionDate()); + break; + } + case PARTITION_NOT_SET: + { + break; + } + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -802,14 +965,253 @@ public Builder mergeFrom( return this; } + private int partitionCase_ = 0; + private java.lang.Object partition_; + + public PartitionCase getPartitionCase() { + return PartitionCase.forNumber(partitionCase_); + } + + public Builder clearPartition() { + partitionCase_ = 0; + partition_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Date, com.google.type.Date.Builder, com.google.type.DateOrBuilder> + partitionDateBuilder_; + /** + * + * + *
+     * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
+     * Only supported when
+     * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2.ImportProductsRequest.reconciliation_mode]
+     * is set to `FULL`.
+     * 
+ * + * .google.type.Date partition_date = 6; + * + * @return Whether the partitionDate field is set. + */ + @java.lang.Override + public boolean hasPartitionDate() { + return partitionCase_ == 6; + } + /** + * + * + *
+     * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
+     * Only supported when
+     * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2.ImportProductsRequest.reconciliation_mode]
+     * is set to `FULL`.
+     * 
+ * + * .google.type.Date partition_date = 6; + * + * @return The partitionDate. + */ + @java.lang.Override + public com.google.type.Date getPartitionDate() { + if (partitionDateBuilder_ == null) { + if (partitionCase_ == 6) { + return (com.google.type.Date) partition_; + } + return com.google.type.Date.getDefaultInstance(); + } else { + if (partitionCase_ == 6) { + return partitionDateBuilder_.getMessage(); + } + return com.google.type.Date.getDefaultInstance(); + } + } + /** + * + * + *
+     * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
+     * Only supported when
+     * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2.ImportProductsRequest.reconciliation_mode]
+     * is set to `FULL`.
+     * 
+ * + * .google.type.Date partition_date = 6; + */ + public Builder setPartitionDate(com.google.type.Date value) { + if (partitionDateBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + partition_ = value; + onChanged(); + } else { + partitionDateBuilder_.setMessage(value); + } + partitionCase_ = 6; + return this; + } + /** + * + * + *
+     * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
+     * Only supported when
+     * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2.ImportProductsRequest.reconciliation_mode]
+     * is set to `FULL`.
+     * 
+ * + * .google.type.Date partition_date = 6; + */ + public Builder setPartitionDate(com.google.type.Date.Builder builderForValue) { + if (partitionDateBuilder_ == null) { + partition_ = builderForValue.build(); + onChanged(); + } else { + partitionDateBuilder_.setMessage(builderForValue.build()); + } + partitionCase_ = 6; + return this; + } + /** + * + * + *
+     * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
+     * Only supported when
+     * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2.ImportProductsRequest.reconciliation_mode]
+     * is set to `FULL`.
+     * 
+ * + * .google.type.Date partition_date = 6; + */ + public Builder mergePartitionDate(com.google.type.Date value) { + if (partitionDateBuilder_ == null) { + if (partitionCase_ == 6 && partition_ != com.google.type.Date.getDefaultInstance()) { + partition_ = + com.google.type.Date.newBuilder((com.google.type.Date) partition_) + .mergeFrom(value) + .buildPartial(); + } else { + partition_ = value; + } + onChanged(); + } else { + if (partitionCase_ == 6) { + partitionDateBuilder_.mergeFrom(value); + } + partitionDateBuilder_.setMessage(value); + } + partitionCase_ = 6; + return this; + } + /** + * + * + *
+     * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
+     * Only supported when
+     * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2.ImportProductsRequest.reconciliation_mode]
+     * is set to `FULL`.
+     * 
+ * + * .google.type.Date partition_date = 6; + */ + public Builder clearPartitionDate() { + if (partitionDateBuilder_ == null) { + if (partitionCase_ == 6) { + partitionCase_ = 0; + partition_ = null; + onChanged(); + } + } else { + if (partitionCase_ == 6) { + partitionCase_ = 0; + partition_ = null; + } + partitionDateBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
+     * Only supported when
+     * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2.ImportProductsRequest.reconciliation_mode]
+     * is set to `FULL`.
+     * 
+ * + * .google.type.Date partition_date = 6; + */ + public com.google.type.Date.Builder getPartitionDateBuilder() { + return getPartitionDateFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
+     * Only supported when
+     * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2.ImportProductsRequest.reconciliation_mode]
+     * is set to `FULL`.
+     * 
+ * + * .google.type.Date partition_date = 6; + */ + @java.lang.Override + public com.google.type.DateOrBuilder getPartitionDateOrBuilder() { + if ((partitionCase_ == 6) && (partitionDateBuilder_ != null)) { + return partitionDateBuilder_.getMessageOrBuilder(); + } else { + if (partitionCase_ == 6) { + return (com.google.type.Date) partition_; + } + return com.google.type.Date.getDefaultInstance(); + } + } + /** + * + * + *
+     * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
+     * Only supported when
+     * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2.ImportProductsRequest.reconciliation_mode]
+     * is set to `FULL`.
+     * 
+ * + * .google.type.Date partition_date = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Date, com.google.type.Date.Builder, com.google.type.DateOrBuilder> + getPartitionDateFieldBuilder() { + if (partitionDateBuilder_ == null) { + if (!(partitionCase_ == 6)) { + partition_ = com.google.type.Date.getDefaultInstance(); + } + partitionDateBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Date, com.google.type.Date.Builder, com.google.type.DateOrBuilder>( + (com.google.type.Date) partition_, getParentForChildren(), isClean()); + partition_ = null; + } + partitionCase_ = 6; + onChanged(); + ; + return partitionDateBuilder_; + } + private java.lang.Object projectId_ = ""; /** * * *
-     * The project id (can be project # or id) that the BigQuery source is in with
+     * The project ID (can be project # or ID) that the BigQuery source is in with
      * a length limit of 128 characters. If not specified, inherits the project
-     * id from the parent request.
+     * ID from the parent request.
      * 
* * string project_id = 5; @@ -831,9 +1233,9 @@ public java.lang.String getProjectId() { * * *
-     * The project id (can be project # or id) that the BigQuery source is in with
+     * The project ID (can be project # or ID) that the BigQuery source is in with
      * a length limit of 128 characters. If not specified, inherits the project
-     * id from the parent request.
+     * ID from the parent request.
      * 
* * string project_id = 5; @@ -855,9 +1257,9 @@ public com.google.protobuf.ByteString getProjectIdBytes() { * * *
-     * The project id (can be project # or id) that the BigQuery source is in with
+     * The project ID (can be project # or ID) that the BigQuery source is in with
      * a length limit of 128 characters. If not specified, inherits the project
-     * id from the parent request.
+     * ID from the parent request.
      * 
* * string project_id = 5; @@ -878,9 +1280,9 @@ public Builder setProjectId(java.lang.String value) { * * *
-     * The project id (can be project # or id) that the BigQuery source is in with
+     * The project ID (can be project # or ID) that the BigQuery source is in with
      * a length limit of 128 characters. If not specified, inherits the project
-     * id from the parent request.
+     * ID from the parent request.
      * 
* * string project_id = 5; @@ -897,9 +1299,9 @@ public Builder clearProjectId() { * * *
-     * The project id (can be project # or id) that the BigQuery source is in with
+     * The project ID (can be project # or ID) that the BigQuery source is in with
      * a length limit of 128 characters. If not specified, inherits the project
-     * id from the parent request.
+     * ID from the parent request.
      * 
* * string project_id = 5; @@ -1272,7 +1674,7 @@ public Builder setGcsStagingDirBytes(com.google.protobuf.ByteString value) { * * `user_event` (default): One JSON * [UserEvent][google.cloud.retail.v2.UserEvent] per line. * * `user_event_ga360`: Using - * https://support.google.com/analytics/answer/3437719?hl=en. + * https://support.google.com/analytics/answer/3437719. * * * string data_schema = 4; @@ -1305,7 +1707,7 @@ public java.lang.String getDataSchema() { * * `user_event` (default): One JSON * [UserEvent][google.cloud.retail.v2.UserEvent] per line. * * `user_event_ga360`: Using - * https://support.google.com/analytics/answer/3437719?hl=en. + * https://support.google.com/analytics/answer/3437719. * * * string data_schema = 4; @@ -1338,7 +1740,7 @@ public com.google.protobuf.ByteString getDataSchemaBytes() { * * `user_event` (default): One JSON * [UserEvent][google.cloud.retail.v2.UserEvent] per line. * * `user_event_ga360`: Using - * https://support.google.com/analytics/answer/3437719?hl=en. + * https://support.google.com/analytics/answer/3437719. * * * string data_schema = 4; @@ -1370,7 +1772,7 @@ public Builder setDataSchema(java.lang.String value) { * * `user_event` (default): One JSON * [UserEvent][google.cloud.retail.v2.UserEvent] per line. * * `user_event_ga360`: Using - * https://support.google.com/analytics/answer/3437719?hl=en. + * https://support.google.com/analytics/answer/3437719. * * * string data_schema = 4; @@ -1398,7 +1800,7 @@ public Builder clearDataSchema() { * * `user_event` (default): One JSON * [UserEvent][google.cloud.retail.v2.UserEvent] per line. * * `user_event_ga360`: Using - * https://support.google.com/analytics/answer/3437719?hl=en. + * https://support.google.com/analytics/answer/3437719. * * * string data_schema = 4; diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/BigQuerySourceOrBuilder.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/BigQuerySourceOrBuilder.java index 818651ba..8a9aa432 100644 --- a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/BigQuerySourceOrBuilder.java +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/BigQuerySourceOrBuilder.java @@ -27,9 +27,53 @@ public interface BigQuerySourceOrBuilder * * *
-   * The project id (can be project # or id) that the BigQuery source is in with
+   * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
+   * Only supported when
+   * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2.ImportProductsRequest.reconciliation_mode]
+   * is set to `FULL`.
+   * 
+ * + * .google.type.Date partition_date = 6; + * + * @return Whether the partitionDate field is set. + */ + boolean hasPartitionDate(); + /** + * + * + *
+   * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
+   * Only supported when
+   * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2.ImportProductsRequest.reconciliation_mode]
+   * is set to `FULL`.
+   * 
+ * + * .google.type.Date partition_date = 6; + * + * @return The partitionDate. + */ + com.google.type.Date getPartitionDate(); + /** + * + * + *
+   * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
+   * Only supported when
+   * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2.ImportProductsRequest.reconciliation_mode]
+   * is set to `FULL`.
+   * 
+ * + * .google.type.Date partition_date = 6; + */ + com.google.type.DateOrBuilder getPartitionDateOrBuilder(); + + /** + * + * + *
+   * The project ID (can be project # or ID) that the BigQuery source is in with
    * a length limit of 128 characters. If not specified, inherits the project
-   * id from the parent request.
+   * ID from the parent request.
    * 
* * string project_id = 5; @@ -41,9 +85,9 @@ public interface BigQuerySourceOrBuilder * * *
-   * The project id (can be project # or id) that the BigQuery source is in with
+   * The project ID (can be project # or ID) that the BigQuery source is in with
    * a length limit of 128 characters. If not specified, inherits the project
-   * id from the parent request.
+   * ID from the parent request.
    * 
* * string project_id = 5; @@ -150,7 +194,7 @@ public interface BigQuerySourceOrBuilder * * `user_event` (default): One JSON * [UserEvent][google.cloud.retail.v2.UserEvent] per line. * * `user_event_ga360`: Using - * https://support.google.com/analytics/answer/3437719?hl=en. + * https://support.google.com/analytics/answer/3437719. * * * string data_schema = 4; @@ -173,7 +217,7 @@ public interface BigQuerySourceOrBuilder * * `user_event` (default): One JSON * [UserEvent][google.cloud.retail.v2.UserEvent] per line. * * `user_event_ga360`: Using - * https://support.google.com/analytics/answer/3437719?hl=en. + * https://support.google.com/analytics/answer/3437719. * * * string data_schema = 4; @@ -181,4 +225,6 @@ public interface BigQuerySourceOrBuilder * @return The bytes for dataSchema. */ com.google.protobuf.ByteString getDataSchemaBytes(); + + public com.google.cloud.retail.v2.BigQuerySource.PartitionCase getPartitionCase(); } diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CatalogProto.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CatalogProto.java index 92a1c3fb..a10d4153 100644 --- a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CatalogProto.java +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CatalogProto.java @@ -47,21 +47,23 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "\n$google/cloud/retail/v2/catalog.proto\022\026" + "google.cloud.retail.v2\032\034google/api/annot" + "ations.proto\032\037google/api/field_behavior." - + "proto\032\031google/api/resource.proto\"^\n\022Prod" - + "uctLevelConfig\022\036\n\026ingestion_product_type" - + "\030\001 \001(\t\022(\n merchant_center_product_id_fie" - + "ld\030\002 \001(\t\"\354\001\n\007Catalog\022\024\n\004name\030\001 \001(\tB\006\340A\002\340" - + "A\005\022\034\n\014display_name\030\002 \001(\tB\006\340A\002\340A\005\022M\n\024prod" - + "uct_level_config\030\004 \001(\0132*.google.cloud.re" - + "tail.v2.ProductLevelConfigB\003\340A\002:^\352A[\n\035re" - + "tail.googleapis.com/Catalog\022:projects/{p" - + "roject}/locations/{location}/catalogs/{c" - + "atalog}B\301\001\n\032com.google.cloud.retail.v2B\014" - + "CatalogProtoP\001Z + * The color information of a [Product][google.cloud.retail.v2.Product]. + * + * + * Protobuf type {@code google.cloud.retail.v2.ColorInfo} + */ +public final class ColorInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.ColorInfo) + ColorInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use ColorInfo.newBuilder() to construct. + private ColorInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ColorInfo() { + colorFamilies_ = com.google.protobuf.LazyStringArrayList.EMPTY; + colors_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ColorInfo(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ColorInfo( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + colorFamilies_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + colorFamilies_.add(s); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + colors_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + colors_.add(s); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + colorFamilies_ = colorFamilies_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + colors_ = colors_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.CommonProto + .internal_static_google_cloud_retail_v2_ColorInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.CommonProto + .internal_static_google_cloud_retail_v2_ColorInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.ColorInfo.class, + com.google.cloud.retail.v2.ColorInfo.Builder.class); + } + + public static final int COLOR_FAMILIES_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList colorFamilies_; + /** + * + * + *
+   * The standard color families. Strongly recommended to use the following
+   * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple",
+   * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and
+   * "Mixed". Normally it is expected to have only 1 color family. May consider
+   * using single "Mixed" instead of multiple values.
+   * A maximum of 5 values are allowed. 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
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * repeated string color_families = 1; + * + * @return A list containing the colorFamilies. + */ + public com.google.protobuf.ProtocolStringList getColorFamiliesList() { + return colorFamilies_; + } + /** + * + * + *
+   * The standard color families. Strongly recommended to use the following
+   * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple",
+   * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and
+   * "Mixed". Normally it is expected to have only 1 color family. May consider
+   * using single "Mixed" instead of multiple values.
+   * A maximum of 5 values are allowed. 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
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * repeated string color_families = 1; + * + * @return The count of colorFamilies. + */ + public int getColorFamiliesCount() { + return colorFamilies_.size(); + } + /** + * + * + *
+   * The standard color families. Strongly recommended to use the following
+   * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple",
+   * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and
+   * "Mixed". Normally it is expected to have only 1 color family. May consider
+   * using single "Mixed" instead of multiple values.
+   * A maximum of 5 values are allowed. 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
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * repeated string color_families = 1; + * + * @param index The index of the element to return. + * @return The colorFamilies at the given index. + */ + public java.lang.String getColorFamilies(int index) { + return colorFamilies_.get(index); + } + /** + * + * + *
+   * The standard color families. Strongly recommended to use the following
+   * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple",
+   * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and
+   * "Mixed". Normally it is expected to have only 1 color family. May consider
+   * using single "Mixed" instead of multiple values.
+   * A maximum of 5 values are allowed. 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
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * repeated string color_families = 1; + * + * @param index The index of the value to return. + * @return The bytes of the colorFamilies at the given index. + */ + public com.google.protobuf.ByteString getColorFamiliesBytes(int index) { + return colorFamilies_.getByteString(index); + } + + public static final int COLORS_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList colors_; + /** + * + * + *
+   * The color display names, which may be different from standard color family
+   * names, such as the color aliases used in the website frontend. Normally
+   * it is expected to have only 1 color. May consider using single "Mixed"
+   * instead of multiple values.
+   * A maximum of 5 colors are allowed. 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
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * repeated string colors = 2; + * + * @return A list containing the colors. + */ + public com.google.protobuf.ProtocolStringList getColorsList() { + return colors_; + } + /** + * + * + *
+   * The color display names, which may be different from standard color family
+   * names, such as the color aliases used in the website frontend. Normally
+   * it is expected to have only 1 color. May consider using single "Mixed"
+   * instead of multiple values.
+   * A maximum of 5 colors are allowed. 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
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * repeated string colors = 2; + * + * @return The count of colors. + */ + public int getColorsCount() { + return colors_.size(); + } + /** + * + * + *
+   * The color display names, which may be different from standard color family
+   * names, such as the color aliases used in the website frontend. Normally
+   * it is expected to have only 1 color. May consider using single "Mixed"
+   * instead of multiple values.
+   * A maximum of 5 colors are allowed. 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
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * repeated string colors = 2; + * + * @param index The index of the element to return. + * @return The colors at the given index. + */ + public java.lang.String getColors(int index) { + return colors_.get(index); + } + /** + * + * + *
+   * The color display names, which may be different from standard color family
+   * names, such as the color aliases used in the website frontend. Normally
+   * it is expected to have only 1 color. May consider using single "Mixed"
+   * instead of multiple values.
+   * A maximum of 5 colors are allowed. 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
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * repeated string colors = 2; + * + * @param index The index of the value to return. + * @return The bytes of the colors at the given index. + */ + public com.google.protobuf.ByteString getColorsBytes(int index) { + return colors_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < colorFamilies_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, colorFamilies_.getRaw(i)); + } + for (int i = 0; i < colors_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, colors_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < colorFamilies_.size(); i++) { + dataSize += computeStringSizeNoTag(colorFamilies_.getRaw(i)); + } + size += dataSize; + size += 1 * getColorFamiliesList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < colors_.size(); i++) { + dataSize += computeStringSizeNoTag(colors_.getRaw(i)); + } + size += dataSize; + size += 1 * getColorsList().size(); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.retail.v2.ColorInfo)) { + return super.equals(obj); + } + com.google.cloud.retail.v2.ColorInfo other = (com.google.cloud.retail.v2.ColorInfo) obj; + + if (!getColorFamiliesList().equals(other.getColorFamiliesList())) return false; + if (!getColorsList().equals(other.getColorsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getColorFamiliesCount() > 0) { + hash = (37 * hash) + COLOR_FAMILIES_FIELD_NUMBER; + hash = (53 * hash) + getColorFamiliesList().hashCode(); + } + if (getColorsCount() > 0) { + hash = (37 * hash) + COLORS_FIELD_NUMBER; + hash = (53 * hash) + getColorsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2.ColorInfo parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.ColorInfo parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.ColorInfo parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.ColorInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.ColorInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.ColorInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.ColorInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.ColorInfo parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.ColorInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.ColorInfo parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.ColorInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.ColorInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2.ColorInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The color information of a [Product][google.cloud.retail.v2.Product].
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2.ColorInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.ColorInfo) + com.google.cloud.retail.v2.ColorInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.CommonProto + .internal_static_google_cloud_retail_v2_ColorInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.CommonProto + .internal_static_google_cloud_retail_v2_ColorInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.ColorInfo.class, + com.google.cloud.retail.v2.ColorInfo.Builder.class); + } + + // Construct using com.google.cloud.retail.v2.ColorInfo.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + colorFamilies_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + colors_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2.CommonProto + .internal_static_google_cloud_retail_v2_ColorInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2.ColorInfo getDefaultInstanceForType() { + return com.google.cloud.retail.v2.ColorInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2.ColorInfo build() { + com.google.cloud.retail.v2.ColorInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2.ColorInfo buildPartial() { + com.google.cloud.retail.v2.ColorInfo result = new com.google.cloud.retail.v2.ColorInfo(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + colorFamilies_ = colorFamilies_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.colorFamilies_ = colorFamilies_; + if (((bitField0_ & 0x00000002) != 0)) { + colors_ = colors_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.colors_ = colors_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.retail.v2.ColorInfo) { + return mergeFrom((com.google.cloud.retail.v2.ColorInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2.ColorInfo other) { + if (other == com.google.cloud.retail.v2.ColorInfo.getDefaultInstance()) return this; + if (!other.colorFamilies_.isEmpty()) { + if (colorFamilies_.isEmpty()) { + colorFamilies_ = other.colorFamilies_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureColorFamiliesIsMutable(); + colorFamilies_.addAll(other.colorFamilies_); + } + onChanged(); + } + if (!other.colors_.isEmpty()) { + if (colors_.isEmpty()) { + colors_ = other.colors_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureColorsIsMutable(); + colors_.addAll(other.colors_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.retail.v2.ColorInfo parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2.ColorInfo) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList colorFamilies_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureColorFamiliesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + colorFamilies_ = new com.google.protobuf.LazyStringArrayList(colorFamilies_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * The standard color families. Strongly recommended to use the following
+     * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple",
+     * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and
+     * "Mixed". Normally it is expected to have only 1 color family. May consider
+     * using single "Mixed" instead of multiple values.
+     * A maximum of 5 values are allowed. 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
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * repeated string color_families = 1; + * + * @return A list containing the colorFamilies. + */ + public com.google.protobuf.ProtocolStringList getColorFamiliesList() { + return colorFamilies_.getUnmodifiableView(); + } + /** + * + * + *
+     * The standard color families. Strongly recommended to use the following
+     * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple",
+     * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and
+     * "Mixed". Normally it is expected to have only 1 color family. May consider
+     * using single "Mixed" instead of multiple values.
+     * A maximum of 5 values are allowed. 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
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * repeated string color_families = 1; + * + * @return The count of colorFamilies. + */ + public int getColorFamiliesCount() { + return colorFamilies_.size(); + } + /** + * + * + *
+     * The standard color families. Strongly recommended to use the following
+     * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple",
+     * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and
+     * "Mixed". Normally it is expected to have only 1 color family. May consider
+     * using single "Mixed" instead of multiple values.
+     * A maximum of 5 values are allowed. 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
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * repeated string color_families = 1; + * + * @param index The index of the element to return. + * @return The colorFamilies at the given index. + */ + public java.lang.String getColorFamilies(int index) { + return colorFamilies_.get(index); + } + /** + * + * + *
+     * The standard color families. Strongly recommended to use the following
+     * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple",
+     * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and
+     * "Mixed". Normally it is expected to have only 1 color family. May consider
+     * using single "Mixed" instead of multiple values.
+     * A maximum of 5 values are allowed. 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
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * repeated string color_families = 1; + * + * @param index The index of the value to return. + * @return The bytes of the colorFamilies at the given index. + */ + public com.google.protobuf.ByteString getColorFamiliesBytes(int index) { + return colorFamilies_.getByteString(index); + } + /** + * + * + *
+     * The standard color families. Strongly recommended to use the following
+     * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple",
+     * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and
+     * "Mixed". Normally it is expected to have only 1 color family. May consider
+     * using single "Mixed" instead of multiple values.
+     * A maximum of 5 values are allowed. 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
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * repeated string color_families = 1; + * + * @param index The index to set the value at. + * @param value The colorFamilies to set. + * @return This builder for chaining. + */ + public Builder setColorFamilies(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureColorFamiliesIsMutable(); + colorFamilies_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The standard color families. Strongly recommended to use the following
+     * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple",
+     * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and
+     * "Mixed". Normally it is expected to have only 1 color family. May consider
+     * using single "Mixed" instead of multiple values.
+     * A maximum of 5 values are allowed. 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
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * repeated string color_families = 1; + * + * @param value The colorFamilies to add. + * @return This builder for chaining. + */ + public Builder addColorFamilies(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureColorFamiliesIsMutable(); + colorFamilies_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The standard color families. Strongly recommended to use the following
+     * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple",
+     * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and
+     * "Mixed". Normally it is expected to have only 1 color family. May consider
+     * using single "Mixed" instead of multiple values.
+     * A maximum of 5 values are allowed. 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
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * repeated string color_families = 1; + * + * @param values The colorFamilies to add. + * @return This builder for chaining. + */ + public Builder addAllColorFamilies(java.lang.Iterable values) { + ensureColorFamiliesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, colorFamilies_); + onChanged(); + return this; + } + /** + * + * + *
+     * The standard color families. Strongly recommended to use the following
+     * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple",
+     * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and
+     * "Mixed". Normally it is expected to have only 1 color family. May consider
+     * using single "Mixed" instead of multiple values.
+     * A maximum of 5 values are allowed. 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
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * repeated string color_families = 1; + * + * @return This builder for chaining. + */ + public Builder clearColorFamilies() { + colorFamilies_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The standard color families. Strongly recommended to use the following
+     * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple",
+     * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and
+     * "Mixed". Normally it is expected to have only 1 color family. May consider
+     * using single "Mixed" instead of multiple values.
+     * A maximum of 5 values are allowed. 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
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * repeated string color_families = 1; + * + * @param value The bytes of the colorFamilies to add. + * @return This builder for chaining. + */ + public Builder addColorFamiliesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureColorFamiliesIsMutable(); + colorFamilies_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList colors_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureColorsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + colors_ = new com.google.protobuf.LazyStringArrayList(colors_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * The color display names, which may be different from standard color family
+     * names, such as the color aliases used in the website frontend. Normally
+     * it is expected to have only 1 color. May consider using single "Mixed"
+     * instead of multiple values.
+     * A maximum of 5 colors are allowed. 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
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * repeated string colors = 2; + * + * @return A list containing the colors. + */ + public com.google.protobuf.ProtocolStringList getColorsList() { + return colors_.getUnmodifiableView(); + } + /** + * + * + *
+     * The color display names, which may be different from standard color family
+     * names, such as the color aliases used in the website frontend. Normally
+     * it is expected to have only 1 color. May consider using single "Mixed"
+     * instead of multiple values.
+     * A maximum of 5 colors are allowed. 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
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * repeated string colors = 2; + * + * @return The count of colors. + */ + public int getColorsCount() { + return colors_.size(); + } + /** + * + * + *
+     * The color display names, which may be different from standard color family
+     * names, such as the color aliases used in the website frontend. Normally
+     * it is expected to have only 1 color. May consider using single "Mixed"
+     * instead of multiple values.
+     * A maximum of 5 colors are allowed. 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
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * repeated string colors = 2; + * + * @param index The index of the element to return. + * @return The colors at the given index. + */ + public java.lang.String getColors(int index) { + return colors_.get(index); + } + /** + * + * + *
+     * The color display names, which may be different from standard color family
+     * names, such as the color aliases used in the website frontend. Normally
+     * it is expected to have only 1 color. May consider using single "Mixed"
+     * instead of multiple values.
+     * A maximum of 5 colors are allowed. 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
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * repeated string colors = 2; + * + * @param index The index of the value to return. + * @return The bytes of the colors at the given index. + */ + public com.google.protobuf.ByteString getColorsBytes(int index) { + return colors_.getByteString(index); + } + /** + * + * + *
+     * The color display names, which may be different from standard color family
+     * names, such as the color aliases used in the website frontend. Normally
+     * it is expected to have only 1 color. May consider using single "Mixed"
+     * instead of multiple values.
+     * A maximum of 5 colors are allowed. 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
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * repeated string colors = 2; + * + * @param index The index to set the value at. + * @param value The colors to set. + * @return This builder for chaining. + */ + public Builder setColors(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureColorsIsMutable(); + colors_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The color display names, which may be different from standard color family
+     * names, such as the color aliases used in the website frontend. Normally
+     * it is expected to have only 1 color. May consider using single "Mixed"
+     * instead of multiple values.
+     * A maximum of 5 colors are allowed. 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
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * repeated string colors = 2; + * + * @param value The colors to add. + * @return This builder for chaining. + */ + public Builder addColors(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureColorsIsMutable(); + colors_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The color display names, which may be different from standard color family
+     * names, such as the color aliases used in the website frontend. Normally
+     * it is expected to have only 1 color. May consider using single "Mixed"
+     * instead of multiple values.
+     * A maximum of 5 colors are allowed. 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
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * repeated string colors = 2; + * + * @param values The colors to add. + * @return This builder for chaining. + */ + public Builder addAllColors(java.lang.Iterable values) { + ensureColorsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, colors_); + onChanged(); + return this; + } + /** + * + * + *
+     * The color display names, which may be different from standard color family
+     * names, such as the color aliases used in the website frontend. Normally
+     * it is expected to have only 1 color. May consider using single "Mixed"
+     * instead of multiple values.
+     * A maximum of 5 colors are allowed. 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
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * repeated string colors = 2; + * + * @return This builder for chaining. + */ + public Builder clearColors() { + colors_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The color display names, which may be different from standard color family
+     * names, such as the color aliases used in the website frontend. Normally
+     * it is expected to have only 1 color. May consider using single "Mixed"
+     * instead of multiple values.
+     * A maximum of 5 colors are allowed. 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
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * repeated string colors = 2; + * + * @param value The bytes of the colors to add. + * @return This builder for chaining. + */ + public Builder addColorsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureColorsIsMutable(); + colors_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.ColorInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.ColorInfo) + private static final com.google.cloud.retail.v2.ColorInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2.ColorInfo(); + } + + public static com.google.cloud.retail.v2.ColorInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ColorInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ColorInfo(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.retail.v2.ColorInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ColorInfoOrBuilder.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ColorInfoOrBuilder.java new file mode 100644 index 00000000..e9ba65f0 --- /dev/null +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ColorInfoOrBuilder.java @@ -0,0 +1,203 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2/common.proto + +package com.google.cloud.retail.v2; + +public interface ColorInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2.ColorInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The standard color families. Strongly recommended to use the following
+   * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple",
+   * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and
+   * "Mixed". Normally it is expected to have only 1 color family. May consider
+   * using single "Mixed" instead of multiple values.
+   * A maximum of 5 values are allowed. 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
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * repeated string color_families = 1; + * + * @return A list containing the colorFamilies. + */ + java.util.List getColorFamiliesList(); + /** + * + * + *
+   * The standard color families. Strongly recommended to use the following
+   * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple",
+   * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and
+   * "Mixed". Normally it is expected to have only 1 color family. May consider
+   * using single "Mixed" instead of multiple values.
+   * A maximum of 5 values are allowed. 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
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * repeated string color_families = 1; + * + * @return The count of colorFamilies. + */ + int getColorFamiliesCount(); + /** + * + * + *
+   * The standard color families. Strongly recommended to use the following
+   * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple",
+   * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and
+   * "Mixed". Normally it is expected to have only 1 color family. May consider
+   * using single "Mixed" instead of multiple values.
+   * A maximum of 5 values are allowed. 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
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * repeated string color_families = 1; + * + * @param index The index of the element to return. + * @return The colorFamilies at the given index. + */ + java.lang.String getColorFamilies(int index); + /** + * + * + *
+   * The standard color families. Strongly recommended to use the following
+   * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple",
+   * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and
+   * "Mixed". Normally it is expected to have only 1 color family. May consider
+   * using single "Mixed" instead of multiple values.
+   * A maximum of 5 values are allowed. 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
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * repeated string color_families = 1; + * + * @param index The index of the value to return. + * @return The bytes of the colorFamilies at the given index. + */ + com.google.protobuf.ByteString getColorFamiliesBytes(int index); + + /** + * + * + *
+   * The color display names, which may be different from standard color family
+   * names, such as the color aliases used in the website frontend. Normally
+   * it is expected to have only 1 color. May consider using single "Mixed"
+   * instead of multiple values.
+   * A maximum of 5 colors are allowed. 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
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * repeated string colors = 2; + * + * @return A list containing the colors. + */ + java.util.List getColorsList(); + /** + * + * + *
+   * The color display names, which may be different from standard color family
+   * names, such as the color aliases used in the website frontend. Normally
+   * it is expected to have only 1 color. May consider using single "Mixed"
+   * instead of multiple values.
+   * A maximum of 5 colors are allowed. 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
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * repeated string colors = 2; + * + * @return The count of colors. + */ + int getColorsCount(); + /** + * + * + *
+   * The color display names, which may be different from standard color family
+   * names, such as the color aliases used in the website frontend. Normally
+   * it is expected to have only 1 color. May consider using single "Mixed"
+   * instead of multiple values.
+   * A maximum of 5 colors are allowed. 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
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * repeated string colors = 2; + * + * @param index The index of the element to return. + * @return The colors at the given index. + */ + java.lang.String getColors(int index); + /** + * + * + *
+   * The color display names, which may be different from standard color family
+   * names, such as the color aliases used in the website frontend. Normally
+   * it is expected to have only 1 color. May consider using single "Mixed"
+   * instead of multiple values.
+   * A maximum of 5 colors are allowed. 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
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * repeated string colors = 2; + * + * @param index The index of the value to return. + * @return The bytes of the colors at the given index. + */ + com.google.protobuf.ByteString getColorsBytes(int index); +} diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CommonProto.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CommonProto.java index f6634f99..7a343b89 100644 --- a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CommonProto.java +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CommonProto.java @@ -27,22 +27,50 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2_Audience_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2_Audience_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2_ColorInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2_ColorInfo_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_retail_v2_CustomAttribute_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_retail_v2_CustomAttribute_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2_FulfillmentInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2_FulfillmentInfo_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_retail_v2_Image_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_retail_v2_Image_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2_Interval_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2_Interval_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_retail_v2_PriceInfo_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_retail_v2_PriceInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2_PriceInfo_PriceRange_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2_PriceInfo_PriceRange_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2_Rating_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2_Rating_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_retail_v2_UserInfo_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_retail_v2_UserInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2_Promotion_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2_Promotion_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -55,20 +83,39 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "\n#google/cloud/retail/v2/common.proto\022\026g" + "oogle.cloud.retail.v2\032\034google/api/annota" + "tions.proto\032\037google/api/field_behavior.p" - + "roto\032\037google/protobuf/timestamp.proto\"0\n" - + "\017CustomAttribute\022\014\n\004text\030\001 \003(\t\022\017\n\007number" - + "s\030\002 \003(\001\"8\n\005Image\022\020\n\003uri\030\001 \001(\tB\003\340A\002\022\016\n\006he" - + "ight\030\002 \001(\005\022\r\n\005width\030\003 \001(\005\"W\n\tPriceInfo\022\025" - + "\n\rcurrency_code\030\001 \001(\t\022\r\n\005price\030\002 \001(\002\022\026\n\016" - + "original_price\030\003 \001(\002\022\014\n\004cost\030\004 \001(\002\"`\n\010Us" - + "erInfo\022\017\n\007user_id\030\001 \001(\t\022\022\n\nip_address\030\002 " - + "\001(\t\022\022\n\nuser_agent\030\003 \001(\t\022\033\n\023direct_user_r" - + "equest\030\004 \001(\010B\300\001\n\032com.google.cloud.retail" - + ".v2B\013CommonProtoP\001Z + * Auto-complete parameters. + * + * + * Protobuf type {@code google.cloud.retail.v2.CompleteQueryRequest} + */ +public final class CompleteQueryRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.CompleteQueryRequest) + CompleteQueryRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CompleteQueryRequest.newBuilder() to construct. + private CompleteQueryRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CompleteQueryRequest() { + catalog_ = ""; + query_ = ""; + visitorId_ = ""; + languageCodes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + deviceType_ = ""; + dataset_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CompleteQueryRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CompleteQueryRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + catalog_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + query_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + languageCodes_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + languageCodes_.add(s); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + deviceType_ = s; + break; + } + case 40: + { + maxSuggestions_ = input.readInt32(); + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + dataset_ = s; + break; + } + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + + visitorId_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + languageCodes_ = languageCodes_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.CompletionServiceProto + .internal_static_google_cloud_retail_v2_CompleteQueryRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.CompletionServiceProto + .internal_static_google_cloud_retail_v2_CompleteQueryRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.CompleteQueryRequest.class, + com.google.cloud.retail.v2.CompleteQueryRequest.Builder.class); + } + + public static final int CATALOG_FIELD_NUMBER = 1; + private volatile java.lang.Object catalog_; + /** + * + * + *
+   * Required. Catalog for which the completion is performed.
+   * Full resource name of catalog, such as
+   * `projects/*/locations/global/catalogs/default_catalog`.
+   * 
+ * + * + * string catalog = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The catalog. + */ + @java.lang.Override + public java.lang.String getCatalog() { + java.lang.Object ref = catalog_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + catalog_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Catalog for which the completion is performed.
+   * Full resource name of catalog, such as
+   * `projects/*/locations/global/catalogs/default_catalog`.
+   * 
+ * + * + * string catalog = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for catalog. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCatalogBytes() { + java.lang.Object ref = catalog_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + catalog_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int QUERY_FIELD_NUMBER = 2; + private volatile java.lang.Object query_; + /** + * + * + *
+   * Required. The query used to generate suggestions.
+   * The maximum number of allowed characters is 255.
+   * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The query. + */ + @java.lang.Override + public java.lang.String getQuery() { + java.lang.Object ref = query_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + query_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The query used to generate suggestions.
+   * The maximum number of allowed characters is 255.
+   * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for query. + */ + @java.lang.Override + public com.google.protobuf.ByteString getQueryBytes() { + java.lang.Object ref = query_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + query_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VISITOR_ID_FIELD_NUMBER = 7; + private volatile java.lang.Object 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.
+   * 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; + * + * @return The visitorId. + */ + @java.lang.Override + public java.lang.String getVisitorId() { + java.lang.Object ref = visitorId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + visitorId_ = s; + return s; + } + } + /** + * + * + *
+   * 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; + * + * @return The bytes for visitorId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVisitorIdBytes() { + java.lang.Object ref = visitorId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + visitorId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LANGUAGE_CODES_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList 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.
+   * 
+ * + * repeated string language_codes = 3; + * + * @return A list containing the languageCodes. + */ + public com.google.protobuf.ProtocolStringList getLanguageCodesList() { + return 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.
+   * 
+ * + * repeated string language_codes = 3; + * + * @return The count of languageCodes. + */ + public int getLanguageCodesCount() { + return languageCodes_.size(); + } + /** + * + * + *
+   * 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.
+   * 
+ * + * repeated string language_codes = 3; + * + * @param index The index of the element to return. + * @return The languageCodes at the given index. + */ + public java.lang.String getLanguageCodes(int index) { + return languageCodes_.get(index); + } + /** + * + * + *
+   * 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.
+   * 
+ * + * repeated string language_codes = 3; + * + * @param index The index of the value to return. + * @return The bytes of the languageCodes at the given index. + */ + public com.google.protobuf.ByteString getLanguageCodesBytes(int index) { + return languageCodes_.getByteString(index); + } + + public static final int DEVICE_TYPE_FIELD_NUMBER = 4; + private volatile java.lang.Object deviceType_; + /** + * + * + *
+   * The device type context for completion suggestions.
+   * It is useful to apply different suggestions on different device types, e.g.
+   * DESKTOP, MOBILE. If it is empty, the suggestions are across all device
+   * types.
+   * Supported formats:
+   * * UNKNOWN_DEVICE_TYPE
+   * * DESKTOP
+   * * MOBILE
+   * * A customized string starts with OTHER_, e.g. OTHER_IPHONE.
+   * 
+ * + * string device_type = 4; + * + * @return The deviceType. + */ + @java.lang.Override + public java.lang.String getDeviceType() { + java.lang.Object ref = deviceType_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + deviceType_ = s; + return s; + } + } + /** + * + * + *
+   * The device type context for completion suggestions.
+   * It is useful to apply different suggestions on different device types, e.g.
+   * DESKTOP, MOBILE. If it is empty, the suggestions are across all device
+   * types.
+   * Supported formats:
+   * * UNKNOWN_DEVICE_TYPE
+   * * DESKTOP
+   * * MOBILE
+   * * A customized string starts with OTHER_, e.g. OTHER_IPHONE.
+   * 
+ * + * string device_type = 4; + * + * @return The bytes for deviceType. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDeviceTypeBytes() { + java.lang.Object ref = deviceType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + deviceType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DATASET_FIELD_NUMBER = 6; + private volatile java.lang.Object dataset_; + /** + * + * + *
+   * Determines which dataset to use for fetching completion. "user-data" will
+   * use the imported dataset through
+   * [CompletionService.ImportCompletionData][google.cloud.retail.v2.CompletionService.ImportCompletionData].
+   * "cloud-retail" will use the dataset generated by cloud retail based on user
+   * events. If leave empty, it will use the "user-data".
+   * Current supported values:
+   * * user-data
+   * * cloud-retail
+   *   This option is not automatically enabled. Before using cloud-retail,
+   *   contact retail-search-support@google.com first.
+   * 
+ * + * string dataset = 6; + * + * @return The dataset. + */ + @java.lang.Override + public java.lang.String getDataset() { + java.lang.Object ref = dataset_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dataset_ = s; + return s; + } + } + /** + * + * + *
+   * Determines which dataset to use for fetching completion. "user-data" will
+   * use the imported dataset through
+   * [CompletionService.ImportCompletionData][google.cloud.retail.v2.CompletionService.ImportCompletionData].
+   * "cloud-retail" will use the dataset generated by cloud retail based on user
+   * events. If leave empty, it will use the "user-data".
+   * Current supported values:
+   * * user-data
+   * * cloud-retail
+   *   This option is not automatically enabled. Before using cloud-retail,
+   *   contact retail-search-support@google.com first.
+   * 
+ * + * string dataset = 6; + * + * @return The bytes for dataset. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDatasetBytes() { + java.lang.Object ref = dataset_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dataset_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MAX_SUGGESTIONS_FIELD_NUMBER = 5; + private int maxSuggestions_; + /** + * + * + *
+   * Completion max suggestions.
+   * The maximum allowed max suggestions is 20. The default value is 20.
+   * 
+ * + * int32 max_suggestions = 5; + * + * @return The maxSuggestions. + */ + @java.lang.Override + public int getMaxSuggestions() { + return maxSuggestions_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getCatalogBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, catalog_); + } + if (!getQueryBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, query_); + } + for (int i = 0; i < languageCodes_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, languageCodes_.getRaw(i)); + } + if (!getDeviceTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, deviceType_); + } + if (maxSuggestions_ != 0) { + output.writeInt32(5, maxSuggestions_); + } + if (!getDatasetBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, dataset_); + } + if (!getVisitorIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, visitorId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getCatalogBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, catalog_); + } + if (!getQueryBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, query_); + } + { + int dataSize = 0; + for (int i = 0; i < languageCodes_.size(); i++) { + dataSize += computeStringSizeNoTag(languageCodes_.getRaw(i)); + } + size += dataSize; + size += 1 * getLanguageCodesList().size(); + } + if (!getDeviceTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, deviceType_); + } + if (maxSuggestions_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(5, maxSuggestions_); + } + if (!getDatasetBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, dataset_); + } + if (!getVisitorIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, visitorId_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.retail.v2.CompleteQueryRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2.CompleteQueryRequest other = + (com.google.cloud.retail.v2.CompleteQueryRequest) obj; + + if (!getCatalog().equals(other.getCatalog())) return false; + if (!getQuery().equals(other.getQuery())) return false; + if (!getVisitorId().equals(other.getVisitorId())) return false; + if (!getLanguageCodesList().equals(other.getLanguageCodesList())) return false; + if (!getDeviceType().equals(other.getDeviceType())) return false; + if (!getDataset().equals(other.getDataset())) return false; + if (getMaxSuggestions() != other.getMaxSuggestions()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CATALOG_FIELD_NUMBER; + hash = (53 * hash) + getCatalog().hashCode(); + hash = (37 * hash) + QUERY_FIELD_NUMBER; + hash = (53 * hash) + getQuery().hashCode(); + hash = (37 * hash) + VISITOR_ID_FIELD_NUMBER; + hash = (53 * hash) + getVisitorId().hashCode(); + if (getLanguageCodesCount() > 0) { + hash = (37 * hash) + LANGUAGE_CODES_FIELD_NUMBER; + hash = (53 * hash) + getLanguageCodesList().hashCode(); + } + hash = (37 * hash) + DEVICE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getDeviceType().hashCode(); + hash = (37 * hash) + DATASET_FIELD_NUMBER; + hash = (53 * hash) + getDataset().hashCode(); + hash = (37 * hash) + MAX_SUGGESTIONS_FIELD_NUMBER; + hash = (53 * hash) + getMaxSuggestions(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2.CompleteQueryRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.CompleteQueryRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.CompleteQueryRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.CompleteQueryRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.CompleteQueryRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.CompleteQueryRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.CompleteQueryRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.CompleteQueryRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.CompleteQueryRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.CompleteQueryRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.CompleteQueryRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.CompleteQueryRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2.CompleteQueryRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Auto-complete parameters.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2.CompleteQueryRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.CompleteQueryRequest) + com.google.cloud.retail.v2.CompleteQueryRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.CompletionServiceProto + .internal_static_google_cloud_retail_v2_CompleteQueryRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.CompletionServiceProto + .internal_static_google_cloud_retail_v2_CompleteQueryRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.CompleteQueryRequest.class, + com.google.cloud.retail.v2.CompleteQueryRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2.CompleteQueryRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + catalog_ = ""; + + query_ = ""; + + visitorId_ = ""; + + languageCodes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + deviceType_ = ""; + + dataset_ = ""; + + maxSuggestions_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2.CompletionServiceProto + .internal_static_google_cloud_retail_v2_CompleteQueryRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2.CompleteQueryRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2.CompleteQueryRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2.CompleteQueryRequest build() { + com.google.cloud.retail.v2.CompleteQueryRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2.CompleteQueryRequest buildPartial() { + com.google.cloud.retail.v2.CompleteQueryRequest result = + new com.google.cloud.retail.v2.CompleteQueryRequest(this); + int from_bitField0_ = bitField0_; + result.catalog_ = catalog_; + result.query_ = query_; + result.visitorId_ = visitorId_; + if (((bitField0_ & 0x00000001) != 0)) { + languageCodes_ = languageCodes_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.languageCodes_ = languageCodes_; + result.deviceType_ = deviceType_; + result.dataset_ = dataset_; + result.maxSuggestions_ = maxSuggestions_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.retail.v2.CompleteQueryRequest) { + return mergeFrom((com.google.cloud.retail.v2.CompleteQueryRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2.CompleteQueryRequest other) { + if (other == com.google.cloud.retail.v2.CompleteQueryRequest.getDefaultInstance()) + return this; + if (!other.getCatalog().isEmpty()) { + catalog_ = other.catalog_; + onChanged(); + } + if (!other.getQuery().isEmpty()) { + query_ = other.query_; + onChanged(); + } + if (!other.getVisitorId().isEmpty()) { + visitorId_ = other.visitorId_; + onChanged(); + } + if (!other.languageCodes_.isEmpty()) { + if (languageCodes_.isEmpty()) { + languageCodes_ = other.languageCodes_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureLanguageCodesIsMutable(); + languageCodes_.addAll(other.languageCodes_); + } + onChanged(); + } + if (!other.getDeviceType().isEmpty()) { + deviceType_ = other.deviceType_; + onChanged(); + } + if (!other.getDataset().isEmpty()) { + dataset_ = other.dataset_; + onChanged(); + } + if (other.getMaxSuggestions() != 0) { + setMaxSuggestions(other.getMaxSuggestions()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.retail.v2.CompleteQueryRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2.CompleteQueryRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object catalog_ = ""; + /** + * + * + *
+     * Required. Catalog for which the completion is performed.
+     * Full resource name of catalog, such as
+     * `projects/*/locations/global/catalogs/default_catalog`.
+     * 
+ * + * + * string catalog = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The catalog. + */ + public java.lang.String getCatalog() { + java.lang.Object ref = catalog_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + catalog_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Catalog for which the completion is performed.
+     * Full resource name of catalog, such as
+     * `projects/*/locations/global/catalogs/default_catalog`.
+     * 
+ * + * + * string catalog = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for catalog. + */ + public com.google.protobuf.ByteString getCatalogBytes() { + java.lang.Object ref = catalog_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + catalog_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Catalog for which the completion is performed.
+     * Full resource name of catalog, such as
+     * `projects/*/locations/global/catalogs/default_catalog`.
+     * 
+ * + * + * string catalog = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The catalog to set. + * @return This builder for chaining. + */ + public Builder setCatalog(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + catalog_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Catalog for which the completion is performed.
+     * Full resource name of catalog, such as
+     * `projects/*/locations/global/catalogs/default_catalog`.
+     * 
+ * + * + * string catalog = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearCatalog() { + + catalog_ = getDefaultInstance().getCatalog(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Catalog for which the completion is performed.
+     * Full resource name of catalog, such as
+     * `projects/*/locations/global/catalogs/default_catalog`.
+     * 
+ * + * + * string catalog = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for catalog to set. + * @return This builder for chaining. + */ + public Builder setCatalogBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + catalog_ = value; + onChanged(); + return this; + } + + private java.lang.Object query_ = ""; + /** + * + * + *
+     * Required. The query used to generate suggestions.
+     * The maximum number of allowed characters is 255.
+     * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The query. + */ + public java.lang.String getQuery() { + java.lang.Object ref = query_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + query_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The query used to generate suggestions.
+     * The maximum number of allowed characters is 255.
+     * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for query. + */ + public com.google.protobuf.ByteString getQueryBytes() { + java.lang.Object ref = query_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + query_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The query used to generate suggestions.
+     * The maximum number of allowed characters is 255.
+     * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The query to set. + * @return This builder for chaining. + */ + public Builder setQuery(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + query_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The query used to generate suggestions.
+     * The maximum number of allowed characters is 255.
+     * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearQuery() { + + query_ = getDefaultInstance().getQuery(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The query used to generate suggestions.
+     * The maximum number of allowed characters is 255.
+     * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for query to set. + * @return This builder for chaining. + */ + public Builder setQueryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + query_ = value; + onChanged(); + return this; + } + + private java.lang.Object 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.
+     * 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; + * + * @return The visitorId. + */ + public java.lang.String getVisitorId() { + java.lang.Object ref = visitorId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + visitorId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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; + * + * @return The bytes for visitorId. + */ + public com.google.protobuf.ByteString getVisitorIdBytes() { + java.lang.Object ref = visitorId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + visitorId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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; + * + * @param value The visitorId to set. + * @return This builder for chaining. + */ + public Builder setVisitorId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + visitorId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 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; + * + * @return This builder for chaining. + */ + public Builder clearVisitorId() { + + visitorId_ = getDefaultInstance().getVisitorId(); + onChanged(); + return this; + } + /** + * + * + *
+     * 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; + * + * @param value The bytes for visitorId to set. + * @return This builder for chaining. + */ + public Builder setVisitorIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + visitorId_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList languageCodes_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureLanguageCodesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + languageCodes_ = new com.google.protobuf.LazyStringArrayList(languageCodes_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * repeated string language_codes = 3; + * + * @return A list containing the languageCodes. + */ + public com.google.protobuf.ProtocolStringList getLanguageCodesList() { + return languageCodes_.getUnmodifiableView(); + } + /** + * + * + *
+     * 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.
+     * 
+ * + * repeated string language_codes = 3; + * + * @return The count of languageCodes. + */ + public int getLanguageCodesCount() { + return languageCodes_.size(); + } + /** + * + * + *
+     * 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.
+     * 
+ * + * repeated string language_codes = 3; + * + * @param index The index of the element to return. + * @return The languageCodes at the given index. + */ + public java.lang.String getLanguageCodes(int index) { + return languageCodes_.get(index); + } + /** + * + * + *
+     * 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.
+     * 
+ * + * repeated string language_codes = 3; + * + * @param index The index of the value to return. + * @return The bytes of the languageCodes at the given index. + */ + public com.google.protobuf.ByteString getLanguageCodesBytes(int index) { + return languageCodes_.getByteString(index); + } + /** + * + * + *
+     * 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.
+     * 
+ * + * repeated string language_codes = 3; + * + * @param index The index to set the value at. + * @param value The languageCodes to set. + * @return This builder for chaining. + */ + public Builder setLanguageCodes(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureLanguageCodesIsMutable(); + languageCodes_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * repeated string language_codes = 3; + * + * @param value The languageCodes to add. + * @return This builder for chaining. + */ + public Builder addLanguageCodes(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureLanguageCodesIsMutable(); + languageCodes_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * repeated string language_codes = 3; + * + * @param values The languageCodes to add. + * @return This builder for chaining. + */ + public Builder addAllLanguageCodes(java.lang.Iterable values) { + ensureLanguageCodesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, languageCodes_); + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * repeated string language_codes = 3; + * + * @return This builder for chaining. + */ + public Builder clearLanguageCodes() { + languageCodes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * repeated string language_codes = 3; + * + * @param value The bytes of the languageCodes to add. + * @return This builder for chaining. + */ + public Builder addLanguageCodesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureLanguageCodesIsMutable(); + languageCodes_.add(value); + onChanged(); + return this; + } + + private java.lang.Object deviceType_ = ""; + /** + * + * + *
+     * The device type context for completion suggestions.
+     * It is useful to apply different suggestions on different device types, e.g.
+     * DESKTOP, MOBILE. If it is empty, the suggestions are across all device
+     * types.
+     * Supported formats:
+     * * UNKNOWN_DEVICE_TYPE
+     * * DESKTOP
+     * * MOBILE
+     * * A customized string starts with OTHER_, e.g. OTHER_IPHONE.
+     * 
+ * + * string device_type = 4; + * + * @return The deviceType. + */ + public java.lang.String getDeviceType() { + java.lang.Object ref = deviceType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + deviceType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The device type context for completion suggestions.
+     * It is useful to apply different suggestions on different device types, e.g.
+     * DESKTOP, MOBILE. If it is empty, the suggestions are across all device
+     * types.
+     * Supported formats:
+     * * UNKNOWN_DEVICE_TYPE
+     * * DESKTOP
+     * * MOBILE
+     * * A customized string starts with OTHER_, e.g. OTHER_IPHONE.
+     * 
+ * + * string device_type = 4; + * + * @return The bytes for deviceType. + */ + public com.google.protobuf.ByteString getDeviceTypeBytes() { + java.lang.Object ref = deviceType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + deviceType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The device type context for completion suggestions.
+     * It is useful to apply different suggestions on different device types, e.g.
+     * DESKTOP, MOBILE. If it is empty, the suggestions are across all device
+     * types.
+     * Supported formats:
+     * * UNKNOWN_DEVICE_TYPE
+     * * DESKTOP
+     * * MOBILE
+     * * A customized string starts with OTHER_, e.g. OTHER_IPHONE.
+     * 
+ * + * string device_type = 4; + * + * @param value The deviceType to set. + * @return This builder for chaining. + */ + public Builder setDeviceType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + deviceType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The device type context for completion suggestions.
+     * It is useful to apply different suggestions on different device types, e.g.
+     * DESKTOP, MOBILE. If it is empty, the suggestions are across all device
+     * types.
+     * Supported formats:
+     * * UNKNOWN_DEVICE_TYPE
+     * * DESKTOP
+     * * MOBILE
+     * * A customized string starts with OTHER_, e.g. OTHER_IPHONE.
+     * 
+ * + * string device_type = 4; + * + * @return This builder for chaining. + */ + public Builder clearDeviceType() { + + deviceType_ = getDefaultInstance().getDeviceType(); + onChanged(); + return this; + } + /** + * + * + *
+     * The device type context for completion suggestions.
+     * It is useful to apply different suggestions on different device types, e.g.
+     * DESKTOP, MOBILE. If it is empty, the suggestions are across all device
+     * types.
+     * Supported formats:
+     * * UNKNOWN_DEVICE_TYPE
+     * * DESKTOP
+     * * MOBILE
+     * * A customized string starts with OTHER_, e.g. OTHER_IPHONE.
+     * 
+ * + * string device_type = 4; + * + * @param value The bytes for deviceType to set. + * @return This builder for chaining. + */ + public Builder setDeviceTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + deviceType_ = value; + onChanged(); + return this; + } + + private java.lang.Object dataset_ = ""; + /** + * + * + *
+     * Determines which dataset to use for fetching completion. "user-data" will
+     * use the imported dataset through
+     * [CompletionService.ImportCompletionData][google.cloud.retail.v2.CompletionService.ImportCompletionData].
+     * "cloud-retail" will use the dataset generated by cloud retail based on user
+     * events. If leave empty, it will use the "user-data".
+     * Current supported values:
+     * * user-data
+     * * cloud-retail
+     *   This option is not automatically enabled. Before using cloud-retail,
+     *   contact retail-search-support@google.com first.
+     * 
+ * + * string dataset = 6; + * + * @return The dataset. + */ + public java.lang.String getDataset() { + java.lang.Object ref = dataset_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dataset_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Determines which dataset to use for fetching completion. "user-data" will
+     * use the imported dataset through
+     * [CompletionService.ImportCompletionData][google.cloud.retail.v2.CompletionService.ImportCompletionData].
+     * "cloud-retail" will use the dataset generated by cloud retail based on user
+     * events. If leave empty, it will use the "user-data".
+     * Current supported values:
+     * * user-data
+     * * cloud-retail
+     *   This option is not automatically enabled. Before using cloud-retail,
+     *   contact retail-search-support@google.com first.
+     * 
+ * + * string dataset = 6; + * + * @return The bytes for dataset. + */ + public com.google.protobuf.ByteString getDatasetBytes() { + java.lang.Object ref = dataset_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dataset_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Determines which dataset to use for fetching completion. "user-data" will
+     * use the imported dataset through
+     * [CompletionService.ImportCompletionData][google.cloud.retail.v2.CompletionService.ImportCompletionData].
+     * "cloud-retail" will use the dataset generated by cloud retail based on user
+     * events. If leave empty, it will use the "user-data".
+     * Current supported values:
+     * * user-data
+     * * cloud-retail
+     *   This option is not automatically enabled. Before using cloud-retail,
+     *   contact retail-search-support@google.com first.
+     * 
+ * + * string dataset = 6; + * + * @param value The dataset to set. + * @return This builder for chaining. + */ + public Builder setDataset(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + dataset_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Determines which dataset to use for fetching completion. "user-data" will
+     * use the imported dataset through
+     * [CompletionService.ImportCompletionData][google.cloud.retail.v2.CompletionService.ImportCompletionData].
+     * "cloud-retail" will use the dataset generated by cloud retail based on user
+     * events. If leave empty, it will use the "user-data".
+     * Current supported values:
+     * * user-data
+     * * cloud-retail
+     *   This option is not automatically enabled. Before using cloud-retail,
+     *   contact retail-search-support@google.com first.
+     * 
+ * + * string dataset = 6; + * + * @return This builder for chaining. + */ + public Builder clearDataset() { + + dataset_ = getDefaultInstance().getDataset(); + onChanged(); + return this; + } + /** + * + * + *
+     * Determines which dataset to use for fetching completion. "user-data" will
+     * use the imported dataset through
+     * [CompletionService.ImportCompletionData][google.cloud.retail.v2.CompletionService.ImportCompletionData].
+     * "cloud-retail" will use the dataset generated by cloud retail based on user
+     * events. If leave empty, it will use the "user-data".
+     * Current supported values:
+     * * user-data
+     * * cloud-retail
+     *   This option is not automatically enabled. Before using cloud-retail,
+     *   contact retail-search-support@google.com first.
+     * 
+ * + * string dataset = 6; + * + * @param value The bytes for dataset to set. + * @return This builder for chaining. + */ + public Builder setDatasetBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + dataset_ = value; + onChanged(); + return this; + } + + private int maxSuggestions_; + /** + * + * + *
+     * Completion max suggestions.
+     * The maximum allowed max suggestions is 20. The default value is 20.
+     * 
+ * + * int32 max_suggestions = 5; + * + * @return The maxSuggestions. + */ + @java.lang.Override + public int getMaxSuggestions() { + return maxSuggestions_; + } + /** + * + * + *
+     * Completion max suggestions.
+     * The maximum allowed max suggestions is 20. The default value is 20.
+     * 
+ * + * int32 max_suggestions = 5; + * + * @param value The maxSuggestions to set. + * @return This builder for chaining. + */ + public Builder setMaxSuggestions(int value) { + + maxSuggestions_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Completion max suggestions.
+     * The maximum allowed max suggestions is 20. The default value is 20.
+     * 
+ * + * int32 max_suggestions = 5; + * + * @return This builder for chaining. + */ + public Builder clearMaxSuggestions() { + + maxSuggestions_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.CompleteQueryRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.CompleteQueryRequest) + private static final com.google.cloud.retail.v2.CompleteQueryRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2.CompleteQueryRequest(); + } + + public static com.google.cloud.retail.v2.CompleteQueryRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CompleteQueryRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CompleteQueryRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.retail.v2.CompleteQueryRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CompleteQueryRequestOrBuilder.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CompleteQueryRequestOrBuilder.java new file mode 100644 index 00000000..a40e5ed7 --- /dev/null +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CompleteQueryRequestOrBuilder.java @@ -0,0 +1,289 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2/completion_service.proto + +package com.google.cloud.retail.v2; + +public interface CompleteQueryRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2.CompleteQueryRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Catalog for which the completion is performed.
+   * Full resource name of catalog, such as
+   * `projects/*/locations/global/catalogs/default_catalog`.
+   * 
+ * + * + * string catalog = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The catalog. + */ + java.lang.String getCatalog(); + /** + * + * + *
+   * Required. Catalog for which the completion is performed.
+   * Full resource name of catalog, such as
+   * `projects/*/locations/global/catalogs/default_catalog`.
+   * 
+ * + * + * string catalog = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for catalog. + */ + com.google.protobuf.ByteString getCatalogBytes(); + + /** + * + * + *
+   * Required. The query used to generate suggestions.
+   * The maximum number of allowed characters is 255.
+   * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The query. + */ + java.lang.String getQuery(); + /** + * + * + *
+   * Required. The query used to generate suggestions.
+   * The maximum number of allowed characters is 255.
+   * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for query. + */ + com.google.protobuf.ByteString getQueryBytes(); + + /** + * + * + *
+   * 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; + * + * @return The visitorId. + */ + java.lang.String getVisitorId(); + /** + * + * + *
+   * 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; + * + * @return The bytes for visitorId. + */ + com.google.protobuf.ByteString getVisitorIdBytes(); + + /** + * + * + *
+   * 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.
+   * 
+ * + * repeated string language_codes = 3; + * + * @return A list containing the languageCodes. + */ + java.util.List getLanguageCodesList(); + /** + * + * + *
+   * 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.
+   * 
+ * + * repeated string language_codes = 3; + * + * @return The count of languageCodes. + */ + int getLanguageCodesCount(); + /** + * + * + *
+   * 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.
+   * 
+ * + * repeated string language_codes = 3; + * + * @param index The index of the element to return. + * @return The languageCodes at the given index. + */ + java.lang.String getLanguageCodes(int index); + /** + * + * + *
+   * 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.
+   * 
+ * + * repeated string language_codes = 3; + * + * @param index The index of the value to return. + * @return The bytes of the languageCodes at the given index. + */ + com.google.protobuf.ByteString getLanguageCodesBytes(int index); + + /** + * + * + *
+   * The device type context for completion suggestions.
+   * It is useful to apply different suggestions on different device types, e.g.
+   * DESKTOP, MOBILE. If it is empty, the suggestions are across all device
+   * types.
+   * Supported formats:
+   * * UNKNOWN_DEVICE_TYPE
+   * * DESKTOP
+   * * MOBILE
+   * * A customized string starts with OTHER_, e.g. OTHER_IPHONE.
+   * 
+ * + * string device_type = 4; + * + * @return The deviceType. + */ + java.lang.String getDeviceType(); + /** + * + * + *
+   * The device type context for completion suggestions.
+   * It is useful to apply different suggestions on different device types, e.g.
+   * DESKTOP, MOBILE. If it is empty, the suggestions are across all device
+   * types.
+   * Supported formats:
+   * * UNKNOWN_DEVICE_TYPE
+   * * DESKTOP
+   * * MOBILE
+   * * A customized string starts with OTHER_, e.g. OTHER_IPHONE.
+   * 
+ * + * string device_type = 4; + * + * @return The bytes for deviceType. + */ + com.google.protobuf.ByteString getDeviceTypeBytes(); + + /** + * + * + *
+   * Determines which dataset to use for fetching completion. "user-data" will
+   * use the imported dataset through
+   * [CompletionService.ImportCompletionData][google.cloud.retail.v2.CompletionService.ImportCompletionData].
+   * "cloud-retail" will use the dataset generated by cloud retail based on user
+   * events. If leave empty, it will use the "user-data".
+   * Current supported values:
+   * * user-data
+   * * cloud-retail
+   *   This option is not automatically enabled. Before using cloud-retail,
+   *   contact retail-search-support@google.com first.
+   * 
+ * + * string dataset = 6; + * + * @return The dataset. + */ + java.lang.String getDataset(); + /** + * + * + *
+   * Determines which dataset to use for fetching completion. "user-data" will
+   * use the imported dataset through
+   * [CompletionService.ImportCompletionData][google.cloud.retail.v2.CompletionService.ImportCompletionData].
+   * "cloud-retail" will use the dataset generated by cloud retail based on user
+   * events. If leave empty, it will use the "user-data".
+   * Current supported values:
+   * * user-data
+   * * cloud-retail
+   *   This option is not automatically enabled. Before using cloud-retail,
+   *   contact retail-search-support@google.com first.
+   * 
+ * + * string dataset = 6; + * + * @return The bytes for dataset. + */ + com.google.protobuf.ByteString getDatasetBytes(); + + /** + * + * + *
+   * Completion max suggestions.
+   * The maximum allowed max suggestions is 20. The default value is 20.
+   * 
+ * + * int32 max_suggestions = 5; + * + * @return The maxSuggestions. + */ + int getMaxSuggestions(); +} diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CompleteQueryResponse.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CompleteQueryResponse.java new file mode 100644 index 00000000..5a6d4656 --- /dev/null +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CompleteQueryResponse.java @@ -0,0 +1,3885 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2/completion_service.proto + +package com.google.cloud.retail.v2; + +/** + * + * + *
+ * Response of the auto-complete query.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2.CompleteQueryResponse} + */ +public final class CompleteQueryResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.CompleteQueryResponse) + CompleteQueryResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use CompleteQueryResponse.newBuilder() to construct. + private CompleteQueryResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CompleteQueryResponse() { + completionResults_ = java.util.Collections.emptyList(); + attributionToken_ = ""; + recentSearchResults_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CompleteQueryResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CompleteQueryResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + completionResults_ = + new java.util.ArrayList< + com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult>(); + mutable_bitField0_ |= 0x00000001; + } + completionResults_.add( + input.readMessage( + com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult.parser(), + extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + attributionToken_ = s; + break; + } + case 26: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + recentSearchResults_ = + new java.util.ArrayList< + com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult>(); + mutable_bitField0_ |= 0x00000002; + } + recentSearchResults_.add( + input.readMessage( + com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult.parser(), + extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + completionResults_ = java.util.Collections.unmodifiableList(completionResults_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + recentSearchResults_ = java.util.Collections.unmodifiableList(recentSearchResults_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.CompletionServiceProto + .internal_static_google_cloud_retail_v2_CompleteQueryResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.CompletionServiceProto + .internal_static_google_cloud_retail_v2_CompleteQueryResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.CompleteQueryResponse.class, + com.google.cloud.retail.v2.CompleteQueryResponse.Builder.class); + } + + public interface CompletionResultOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2.CompleteQueryResponse.CompletionResult) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The suggestion for the query.
+     * 
+ * + * string suggestion = 1; + * + * @return The suggestion. + */ + java.lang.String getSuggestion(); + /** + * + * + *
+     * The suggestion for the query.
+     * 
+ * + * string suggestion = 1; + * + * @return The bytes for suggestion. + */ + com.google.protobuf.ByteString getSuggestionBytes(); + + /** + * + * + *
+     * Additional custom attributes ingested through BigQuery.
+     * 
+ * + * map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 2; + */ + int getAttributesCount(); + /** + * + * + *
+     * Additional custom attributes ingested through BigQuery.
+     * 
+ * + * map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 2; + */ + boolean containsAttributes(java.lang.String key); + /** Use {@link #getAttributesMap()} instead. */ + @java.lang.Deprecated + java.util.Map getAttributes(); + /** + * + * + *
+     * Additional custom attributes ingested through BigQuery.
+     * 
+ * + * map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 2; + */ + java.util.Map getAttributesMap(); + /** + * + * + *
+     * Additional custom attributes ingested through BigQuery.
+     * 
+ * + * map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 2; + */ + com.google.cloud.retail.v2.CustomAttribute getAttributesOrDefault( + java.lang.String key, com.google.cloud.retail.v2.CustomAttribute defaultValue); + /** + * + * + *
+     * Additional custom attributes ingested through BigQuery.
+     * 
+ * + * map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 2; + */ + com.google.cloud.retail.v2.CustomAttribute getAttributesOrThrow(java.lang.String key); + } + /** + * + * + *
+   * Resource that represents completion results.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2.CompleteQueryResponse.CompletionResult} + */ + public static final class CompletionResult extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.CompleteQueryResponse.CompletionResult) + CompletionResultOrBuilder { + private static final long serialVersionUID = 0L; + // Use CompletionResult.newBuilder() to construct. + private CompletionResult(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CompletionResult() { + suggestion_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CompletionResult(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CompletionResult( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + suggestion_ = s; + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + attributes_ = + com.google.protobuf.MapField.newMapField( + AttributesDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.retail.v2.CustomAttribute> + attributes__ = + input.readMessage( + AttributesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + attributes_.getMutableMap().put(attributes__.getKey(), attributes__.getValue()); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.CompletionServiceProto + .internal_static_google_cloud_retail_v2_CompleteQueryResponse_CompletionResult_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.CompletionServiceProto + .internal_static_google_cloud_retail_v2_CompleteQueryResponse_CompletionResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult.class, + com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult.Builder.class); + } + + public static final int SUGGESTION_FIELD_NUMBER = 1; + private volatile java.lang.Object suggestion_; + /** + * + * + *
+     * The suggestion for the query.
+     * 
+ * + * string suggestion = 1; + * + * @return The suggestion. + */ + @java.lang.Override + public java.lang.String getSuggestion() { + java.lang.Object ref = suggestion_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + suggestion_ = s; + return s; + } + } + /** + * + * + *
+     * The suggestion for the query.
+     * 
+ * + * string suggestion = 1; + * + * @return The bytes for suggestion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSuggestionBytes() { + java.lang.Object ref = suggestion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + suggestion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ATTRIBUTES_FIELD_NUMBER = 2; + + private static final class AttributesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.retail.v2.CustomAttribute> + defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.cloud.retail.v2.CompletionServiceProto + .internal_static_google_cloud_retail_v2_CompleteQueryResponse_CompletionResult_AttributesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.cloud.retail.v2.CustomAttribute.getDefaultInstance()); + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2.CustomAttribute> + attributes_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2.CustomAttribute> + internalGetAttributes() { + if (attributes_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AttributesDefaultEntryHolder.defaultEntry); + } + return attributes_; + } + + public int getAttributesCount() { + return internalGetAttributes().getMap().size(); + } + /** + * + * + *
+     * Additional custom attributes ingested through BigQuery.
+     * 
+ * + * map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 2; + */ + @java.lang.Override + public boolean containsAttributes(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetAttributes().getMap().containsKey(key); + } + /** Use {@link #getAttributesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getAttributes() { + return getAttributesMap(); + } + /** + * + * + *
+     * Additional custom attributes ingested through BigQuery.
+     * 
+ * + * map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 2; + */ + @java.lang.Override + public java.util.Map + getAttributesMap() { + return internalGetAttributes().getMap(); + } + /** + * + * + *
+     * Additional custom attributes ingested through BigQuery.
+     * 
+ * + * map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2.CustomAttribute getAttributesOrDefault( + java.lang.String key, com.google.cloud.retail.v2.CustomAttribute defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetAttributes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Additional custom attributes ingested through BigQuery.
+     * 
+ * + * map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2.CustomAttribute getAttributesOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetAttributes().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getSuggestionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, suggestion_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetAttributes(), AttributesDefaultEntryHolder.defaultEntry, 2); + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getSuggestionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, suggestion_); + } + for (java.util.Map.Entry entry : + internalGetAttributes().getMap().entrySet()) { + com.google.protobuf.MapEntry + attributes__ = + AttributesDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, attributes__); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult)) { + return super.equals(obj); + } + com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult other = + (com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult) obj; + + if (!getSuggestion().equals(other.getSuggestion())) return false; + if (!internalGetAttributes().equals(other.internalGetAttributes())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SUGGESTION_FIELD_NUMBER; + hash = (53 * hash) + getSuggestion().hashCode(); + if (!internalGetAttributes().getMap().isEmpty()) { + hash = (37 * hash) + ATTRIBUTES_FIELD_NUMBER; + hash = (53 * hash) + internalGetAttributes().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Resource that represents completion results.
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2.CompleteQueryResponse.CompletionResult} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.CompleteQueryResponse.CompletionResult) + com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.CompletionServiceProto + .internal_static_google_cloud_retail_v2_CompleteQueryResponse_CompletionResult_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 2: + return internalGetMutableAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.CompletionServiceProto + .internal_static_google_cloud_retail_v2_CompleteQueryResponse_CompletionResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult.class, + com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult.Builder.class); + } + + // Construct using + // com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + suggestion_ = ""; + + internalGetMutableAttributes().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2.CompletionServiceProto + .internal_static_google_cloud_retail_v2_CompleteQueryResponse_CompletionResult_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult + getDefaultInstanceForType() { + return com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult build() { + com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult buildPartial() { + com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult result = + new com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult(this); + int from_bitField0_ = bitField0_; + result.suggestion_ = suggestion_; + result.attributes_ = internalGetAttributes(); + result.attributes_.makeImmutable(); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult) { + return mergeFrom( + (com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult other) { + if (other + == com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult + .getDefaultInstance()) return this; + if (!other.getSuggestion().isEmpty()) { + suggestion_ = other.suggestion_; + onChanged(); + } + internalGetMutableAttributes().mergeFrom(other.internalGetAttributes()); + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object suggestion_ = ""; + /** + * + * + *
+       * The suggestion for the query.
+       * 
+ * + * string suggestion = 1; + * + * @return The suggestion. + */ + public java.lang.String getSuggestion() { + java.lang.Object ref = suggestion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + suggestion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The suggestion for the query.
+       * 
+ * + * string suggestion = 1; + * + * @return The bytes for suggestion. + */ + public com.google.protobuf.ByteString getSuggestionBytes() { + java.lang.Object ref = suggestion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + suggestion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The suggestion for the query.
+       * 
+ * + * string suggestion = 1; + * + * @param value The suggestion to set. + * @return This builder for chaining. + */ + public Builder setSuggestion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + suggestion_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The suggestion for the query.
+       * 
+ * + * string suggestion = 1; + * + * @return This builder for chaining. + */ + public Builder clearSuggestion() { + + suggestion_ = getDefaultInstance().getSuggestion(); + onChanged(); + return this; + } + /** + * + * + *
+       * The suggestion for the query.
+       * 
+ * + * string suggestion = 1; + * + * @param value The bytes for suggestion to set. + * @return This builder for chaining. + */ + public Builder setSuggestionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + suggestion_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2.CustomAttribute> + attributes_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2.CustomAttribute> + internalGetAttributes() { + if (attributes_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AttributesDefaultEntryHolder.defaultEntry); + } + return attributes_; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2.CustomAttribute> + internalGetMutableAttributes() { + onChanged(); + ; + if (attributes_ == null) { + attributes_ = + com.google.protobuf.MapField.newMapField(AttributesDefaultEntryHolder.defaultEntry); + } + if (!attributes_.isMutable()) { + attributes_ = attributes_.copy(); + } + return attributes_; + } + + public int getAttributesCount() { + return internalGetAttributes().getMap().size(); + } + /** + * + * + *
+       * Additional custom attributes ingested through BigQuery.
+       * 
+ * + * map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 2; + */ + @java.lang.Override + public boolean containsAttributes(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetAttributes().getMap().containsKey(key); + } + /** Use {@link #getAttributesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getAttributes() { + return getAttributesMap(); + } + /** + * + * + *
+       * Additional custom attributes ingested through BigQuery.
+       * 
+ * + * map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 2; + */ + @java.lang.Override + public java.util.Map + getAttributesMap() { + return internalGetAttributes().getMap(); + } + /** + * + * + *
+       * Additional custom attributes ingested through BigQuery.
+       * 
+ * + * map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2.CustomAttribute getAttributesOrDefault( + java.lang.String key, com.google.cloud.retail.v2.CustomAttribute defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetAttributes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+       * Additional custom attributes ingested through BigQuery.
+       * 
+ * + * map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2.CustomAttribute getAttributesOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetAttributes().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearAttributes() { + internalGetMutableAttributes().getMutableMap().clear(); + return this; + } + /** + * + * + *
+       * Additional custom attributes ingested through BigQuery.
+       * 
+ * + * map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 2; + */ + public Builder removeAttributes(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableAttributes().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableAttributes() { + return internalGetMutableAttributes().getMutableMap(); + } + /** + * + * + *
+       * Additional custom attributes ingested through BigQuery.
+       * 
+ * + * map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 2; + */ + public Builder putAttributes( + java.lang.String key, com.google.cloud.retail.v2.CustomAttribute value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableAttributes().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+       * Additional custom attributes ingested through BigQuery.
+       * 
+ * + * map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 2; + */ + public Builder putAllAttributes( + java.util.Map values) { + internalGetMutableAttributes().getMutableMap().putAll(values); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.CompleteQueryResponse.CompletionResult) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.CompleteQueryResponse.CompletionResult) + private static final com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult(); + } + + public static com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CompletionResult parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CompletionResult(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface RecentSearchResultOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The recent search query.
+     * 
+ * + * string recent_search = 1; + * + * @return The recentSearch. + */ + java.lang.String getRecentSearch(); + /** + * + * + *
+     * The recent search query.
+     * 
+ * + * string recent_search = 1; + * + * @return The bytes for recentSearch. + */ + com.google.protobuf.ByteString getRecentSearchBytes(); + } + /** + * + * + *
+   * Recent search of this user.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult} + */ + public static final class RecentSearchResult extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult) + RecentSearchResultOrBuilder { + private static final long serialVersionUID = 0L; + // Use RecentSearchResult.newBuilder() to construct. + private RecentSearchResult(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RecentSearchResult() { + recentSearch_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RecentSearchResult(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RecentSearchResult( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + recentSearch_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.CompletionServiceProto + .internal_static_google_cloud_retail_v2_CompleteQueryResponse_RecentSearchResult_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.CompletionServiceProto + .internal_static_google_cloud_retail_v2_CompleteQueryResponse_RecentSearchResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult.class, + com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult.Builder.class); + } + + public static final int RECENT_SEARCH_FIELD_NUMBER = 1; + private volatile java.lang.Object recentSearch_; + /** + * + * + *
+     * The recent search query.
+     * 
+ * + * string recent_search = 1; + * + * @return The recentSearch. + */ + @java.lang.Override + public java.lang.String getRecentSearch() { + java.lang.Object ref = recentSearch_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + recentSearch_ = s; + return s; + } + } + /** + * + * + *
+     * The recent search query.
+     * 
+ * + * string recent_search = 1; + * + * @return The bytes for recentSearch. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRecentSearchBytes() { + java.lang.Object ref = recentSearch_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + recentSearch_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getRecentSearchBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, recentSearch_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getRecentSearchBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, recentSearch_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult)) { + return super.equals(obj); + } + com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult other = + (com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult) obj; + + if (!getRecentSearch().equals(other.getRecentSearch())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + RECENT_SEARCH_FIELD_NUMBER; + hash = (53 * hash) + getRecentSearch().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Recent search of this user.
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult) + com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.CompletionServiceProto + .internal_static_google_cloud_retail_v2_CompleteQueryResponse_RecentSearchResult_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.CompletionServiceProto + .internal_static_google_cloud_retail_v2_CompleteQueryResponse_RecentSearchResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult.class, + com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult.Builder.class); + } + + // Construct using + // com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + recentSearch_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2.CompletionServiceProto + .internal_static_google_cloud_retail_v2_CompleteQueryResponse_RecentSearchResult_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult + getDefaultInstanceForType() { + return com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult build() { + com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult buildPartial() { + com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult result = + new com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult(this); + result.recentSearch_ = recentSearch_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult) { + return mergeFrom( + (com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult other) { + if (other + == com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult + .getDefaultInstance()) return this; + if (!other.getRecentSearch().isEmpty()) { + recentSearch_ = other.recentSearch_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object recentSearch_ = ""; + /** + * + * + *
+       * The recent search query.
+       * 
+ * + * string recent_search = 1; + * + * @return The recentSearch. + */ + public java.lang.String getRecentSearch() { + java.lang.Object ref = recentSearch_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + recentSearch_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The recent search query.
+       * 
+ * + * string recent_search = 1; + * + * @return The bytes for recentSearch. + */ + public com.google.protobuf.ByteString getRecentSearchBytes() { + java.lang.Object ref = recentSearch_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + recentSearch_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The recent search query.
+       * 
+ * + * string recent_search = 1; + * + * @param value The recentSearch to set. + * @return This builder for chaining. + */ + public Builder setRecentSearch(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + recentSearch_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The recent search query.
+       * 
+ * + * string recent_search = 1; + * + * @return This builder for chaining. + */ + public Builder clearRecentSearch() { + + recentSearch_ = getDefaultInstance().getRecentSearch(); + onChanged(); + return this; + } + /** + * + * + *
+       * The recent search query.
+       * 
+ * + * string recent_search = 1; + * + * @param value The bytes for recentSearch to set. + * @return This builder for chaining. + */ + public Builder setRecentSearchBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + recentSearch_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult) + private static final com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult(); + } + + public static com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RecentSearchResult parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RecentSearchResult(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int COMPLETION_RESULTS_FIELD_NUMBER = 1; + private java.util.List + completionResults_; + /** + * + * + *
+   * Results of the matching suggestions. The result list is ordered and the
+   * first result is top suggestion.
+   * 
+ * + * + * repeated .google.cloud.retail.v2.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + @java.lang.Override + public java.util.List + getCompletionResultsList() { + return completionResults_; + } + /** + * + * + *
+   * Results of the matching suggestions. The result list is ordered and the
+   * first result is top suggestion.
+   * 
+ * + * + * repeated .google.cloud.retail.v2.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResultOrBuilder> + getCompletionResultsOrBuilderList() { + return completionResults_; + } + /** + * + * + *
+   * Results of the matching suggestions. The result list is ordered and the
+   * first result is top suggestion.
+   * 
+ * + * + * repeated .google.cloud.retail.v2.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + @java.lang.Override + public int getCompletionResultsCount() { + return completionResults_.size(); + } + /** + * + * + *
+   * Results of the matching suggestions. The result list is ordered and the
+   * first result is top suggestion.
+   * 
+ * + * + * repeated .google.cloud.retail.v2.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult getCompletionResults( + int index) { + return completionResults_.get(index); + } + /** + * + * + *
+   * Results of the matching suggestions. The result list is ordered and the
+   * first result is top suggestion.
+   * 
+ * + * + * repeated .google.cloud.retail.v2.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResultOrBuilder + getCompletionResultsOrBuilder(int index) { + return completionResults_.get(index); + } + + public static final int ATTRIBUTION_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object attributionToken_; + /** + * + * + *
+   * 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.
+   * 
+ * + * string attribution_token = 2; + * + * @return The attributionToken. + */ + @java.lang.Override + public java.lang.String getAttributionToken() { + java.lang.Object ref = attributionToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + attributionToken_ = s; + return s; + } + } + /** + * + * + *
+   * 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.
+   * 
+ * + * string attribution_token = 2; + * + * @return The bytes for attributionToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAttributionTokenBytes() { + java.lang.Object ref = attributionToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + attributionToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RECENT_SEARCH_RESULTS_FIELD_NUMBER = 3; + private java.util.List + recentSearchResults_; + /** + * + * + *
+   * Matched recent searches of this user. This field is a restricted feature.
+   * Contact Retail Support (retail-search-support@google.com) if you are
+   * interested in enabling it.
+   * This feature is only available when
+   * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2.CompleteQueryRequest.visitor_id]
+   * field is set and [UserEvent][google.cloud.retail.v2.UserEvent] is imported.
+   * The recent searches satisfy the follow rules:
+   *  * They are ordered from latest to oldest.
+   *  * They are matched with
+   *  [CompleteQueryRequest.query][google.cloud.retail.v2.CompleteQueryRequest.query]
+   *  case insensitively.
+   *  * They are transformed to lower cases.
+   *  * They are UTF-8 safe.
+   * Recent searches are deduplicated. More recent searches will be reserved
+   * when duplication happens.
+   * 
+ * + * + * repeated .google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + @java.lang.Override + public java.util.List + getRecentSearchResultsList() { + return recentSearchResults_; + } + /** + * + * + *
+   * Matched recent searches of this user. This field is a restricted feature.
+   * Contact Retail Support (retail-search-support@google.com) if you are
+   * interested in enabling it.
+   * This feature is only available when
+   * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2.CompleteQueryRequest.visitor_id]
+   * field is set and [UserEvent][google.cloud.retail.v2.UserEvent] is imported.
+   * The recent searches satisfy the follow rules:
+   *  * They are ordered from latest to oldest.
+   *  * They are matched with
+   *  [CompleteQueryRequest.query][google.cloud.retail.v2.CompleteQueryRequest.query]
+   *  case insensitively.
+   *  * They are transformed to lower cases.
+   *  * They are UTF-8 safe.
+   * Recent searches are deduplicated. More recent searches will be reserved
+   * when duplication happens.
+   * 
+ * + * + * repeated .google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResultOrBuilder> + getRecentSearchResultsOrBuilderList() { + return recentSearchResults_; + } + /** + * + * + *
+   * Matched recent searches of this user. This field is a restricted feature.
+   * Contact Retail Support (retail-search-support@google.com) if you are
+   * interested in enabling it.
+   * This feature is only available when
+   * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2.CompleteQueryRequest.visitor_id]
+   * field is set and [UserEvent][google.cloud.retail.v2.UserEvent] is imported.
+   * The recent searches satisfy the follow rules:
+   *  * They are ordered from latest to oldest.
+   *  * They are matched with
+   *  [CompleteQueryRequest.query][google.cloud.retail.v2.CompleteQueryRequest.query]
+   *  case insensitively.
+   *  * They are transformed to lower cases.
+   *  * They are UTF-8 safe.
+   * Recent searches are deduplicated. More recent searches will be reserved
+   * when duplication happens.
+   * 
+ * + * + * repeated .google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + @java.lang.Override + public int getRecentSearchResultsCount() { + return recentSearchResults_.size(); + } + /** + * + * + *
+   * Matched recent searches of this user. This field is a restricted feature.
+   * Contact Retail Support (retail-search-support@google.com) if you are
+   * interested in enabling it.
+   * This feature is only available when
+   * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2.CompleteQueryRequest.visitor_id]
+   * field is set and [UserEvent][google.cloud.retail.v2.UserEvent] is imported.
+   * The recent searches satisfy the follow rules:
+   *  * They are ordered from latest to oldest.
+   *  * They are matched with
+   *  [CompleteQueryRequest.query][google.cloud.retail.v2.CompleteQueryRequest.query]
+   *  case insensitively.
+   *  * They are transformed to lower cases.
+   *  * They are UTF-8 safe.
+   * Recent searches are deduplicated. More recent searches will be reserved
+   * when duplication happens.
+   * 
+ * + * + * repeated .google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult getRecentSearchResults( + int index) { + return recentSearchResults_.get(index); + } + /** + * + * + *
+   * Matched recent searches of this user. This field is a restricted feature.
+   * Contact Retail Support (retail-search-support@google.com) if you are
+   * interested in enabling it.
+   * This feature is only available when
+   * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2.CompleteQueryRequest.visitor_id]
+   * field is set and [UserEvent][google.cloud.retail.v2.UserEvent] is imported.
+   * The recent searches satisfy the follow rules:
+   *  * They are ordered from latest to oldest.
+   *  * They are matched with
+   *  [CompleteQueryRequest.query][google.cloud.retail.v2.CompleteQueryRequest.query]
+   *  case insensitively.
+   *  * They are transformed to lower cases.
+   *  * They are UTF-8 safe.
+   * Recent searches are deduplicated. More recent searches will be reserved
+   * when duplication happens.
+   * 
+ * + * + * repeated .google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResultOrBuilder + getRecentSearchResultsOrBuilder(int index) { + return recentSearchResults_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < completionResults_.size(); i++) { + output.writeMessage(1, completionResults_.get(i)); + } + if (!getAttributionTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, attributionToken_); + } + for (int i = 0; i < recentSearchResults_.size(); i++) { + output.writeMessage(3, recentSearchResults_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < completionResults_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(1, completionResults_.get(i)); + } + if (!getAttributionTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, attributionToken_); + } + for (int i = 0; i < recentSearchResults_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(3, recentSearchResults_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.retail.v2.CompleteQueryResponse)) { + return super.equals(obj); + } + com.google.cloud.retail.v2.CompleteQueryResponse other = + (com.google.cloud.retail.v2.CompleteQueryResponse) obj; + + if (!getCompletionResultsList().equals(other.getCompletionResultsList())) return false; + if (!getAttributionToken().equals(other.getAttributionToken())) return false; + if (!getRecentSearchResultsList().equals(other.getRecentSearchResultsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getCompletionResultsCount() > 0) { + hash = (37 * hash) + COMPLETION_RESULTS_FIELD_NUMBER; + hash = (53 * hash) + getCompletionResultsList().hashCode(); + } + hash = (37 * hash) + ATTRIBUTION_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getAttributionToken().hashCode(); + if (getRecentSearchResultsCount() > 0) { + hash = (37 * hash) + RECENT_SEARCH_RESULTS_FIELD_NUMBER; + hash = (53 * hash) + getRecentSearchResultsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2.CompleteQueryResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.CompleteQueryResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.CompleteQueryResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.CompleteQueryResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.CompleteQueryResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.CompleteQueryResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.CompleteQueryResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.CompleteQueryResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.CompleteQueryResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.CompleteQueryResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.CompleteQueryResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.CompleteQueryResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2.CompleteQueryResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response of the auto-complete query.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2.CompleteQueryResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.CompleteQueryResponse) + com.google.cloud.retail.v2.CompleteQueryResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.CompletionServiceProto + .internal_static_google_cloud_retail_v2_CompleteQueryResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.CompletionServiceProto + .internal_static_google_cloud_retail_v2_CompleteQueryResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.CompleteQueryResponse.class, + com.google.cloud.retail.v2.CompleteQueryResponse.Builder.class); + } + + // Construct using com.google.cloud.retail.v2.CompleteQueryResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getCompletionResultsFieldBuilder(); + getRecentSearchResultsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (completionResultsBuilder_ == null) { + completionResults_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + completionResultsBuilder_.clear(); + } + attributionToken_ = ""; + + if (recentSearchResultsBuilder_ == null) { + recentSearchResults_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + recentSearchResultsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2.CompletionServiceProto + .internal_static_google_cloud_retail_v2_CompleteQueryResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2.CompleteQueryResponse getDefaultInstanceForType() { + return com.google.cloud.retail.v2.CompleteQueryResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2.CompleteQueryResponse build() { + com.google.cloud.retail.v2.CompleteQueryResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2.CompleteQueryResponse buildPartial() { + com.google.cloud.retail.v2.CompleteQueryResponse result = + new com.google.cloud.retail.v2.CompleteQueryResponse(this); + int from_bitField0_ = bitField0_; + if (completionResultsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + completionResults_ = java.util.Collections.unmodifiableList(completionResults_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.completionResults_ = completionResults_; + } else { + result.completionResults_ = completionResultsBuilder_.build(); + } + result.attributionToken_ = attributionToken_; + if (recentSearchResultsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + recentSearchResults_ = java.util.Collections.unmodifiableList(recentSearchResults_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.recentSearchResults_ = recentSearchResults_; + } else { + result.recentSearchResults_ = recentSearchResultsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.retail.v2.CompleteQueryResponse) { + return mergeFrom((com.google.cloud.retail.v2.CompleteQueryResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2.CompleteQueryResponse other) { + if (other == com.google.cloud.retail.v2.CompleteQueryResponse.getDefaultInstance()) + return this; + if (completionResultsBuilder_ == null) { + if (!other.completionResults_.isEmpty()) { + if (completionResults_.isEmpty()) { + completionResults_ = other.completionResults_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureCompletionResultsIsMutable(); + completionResults_.addAll(other.completionResults_); + } + onChanged(); + } + } else { + if (!other.completionResults_.isEmpty()) { + if (completionResultsBuilder_.isEmpty()) { + completionResultsBuilder_.dispose(); + completionResultsBuilder_ = null; + completionResults_ = other.completionResults_; + bitField0_ = (bitField0_ & ~0x00000001); + completionResultsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getCompletionResultsFieldBuilder() + : null; + } else { + completionResultsBuilder_.addAllMessages(other.completionResults_); + } + } + } + if (!other.getAttributionToken().isEmpty()) { + attributionToken_ = other.attributionToken_; + onChanged(); + } + if (recentSearchResultsBuilder_ == null) { + if (!other.recentSearchResults_.isEmpty()) { + if (recentSearchResults_.isEmpty()) { + recentSearchResults_ = other.recentSearchResults_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureRecentSearchResultsIsMutable(); + recentSearchResults_.addAll(other.recentSearchResults_); + } + onChanged(); + } + } else { + if (!other.recentSearchResults_.isEmpty()) { + if (recentSearchResultsBuilder_.isEmpty()) { + recentSearchResultsBuilder_.dispose(); + recentSearchResultsBuilder_ = null; + recentSearchResults_ = other.recentSearchResults_; + bitField0_ = (bitField0_ & ~0x00000002); + recentSearchResultsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getRecentSearchResultsFieldBuilder() + : null; + } else { + recentSearchResultsBuilder_.addAllMessages(other.recentSearchResults_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.retail.v2.CompleteQueryResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2.CompleteQueryResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List + completionResults_ = java.util.Collections.emptyList(); + + private void ensureCompletionResultsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + completionResults_ = + new java.util.ArrayList< + com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult>( + completionResults_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult, + com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult.Builder, + com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResultOrBuilder> + completionResultsBuilder_; + + /** + * + * + *
+     * Results of the matching suggestions. The result list is ordered and the
+     * first result is top suggestion.
+     * 
+ * + * + * repeated .google.cloud.retail.v2.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + public java.util.List + getCompletionResultsList() { + if (completionResultsBuilder_ == null) { + return java.util.Collections.unmodifiableList(completionResults_); + } else { + return completionResultsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Results of the matching suggestions. The result list is ordered and the
+     * first result is top suggestion.
+     * 
+ * + * + * repeated .google.cloud.retail.v2.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + public int getCompletionResultsCount() { + if (completionResultsBuilder_ == null) { + return completionResults_.size(); + } else { + return completionResultsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Results of the matching suggestions. The result list is ordered and the
+     * first result is top suggestion.
+     * 
+ * + * + * repeated .google.cloud.retail.v2.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + public com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult getCompletionResults( + int index) { + if (completionResultsBuilder_ == null) { + return completionResults_.get(index); + } else { + return completionResultsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Results of the matching suggestions. The result list is ordered and the
+     * first result is top suggestion.
+     * 
+ * + * + * repeated .google.cloud.retail.v2.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + public Builder setCompletionResults( + int index, com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult value) { + if (completionResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCompletionResultsIsMutable(); + completionResults_.set(index, value); + onChanged(); + } else { + completionResultsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Results of the matching suggestions. The result list is ordered and the
+     * first result is top suggestion.
+     * 
+ * + * + * repeated .google.cloud.retail.v2.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + public Builder setCompletionResults( + int index, + com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult.Builder builderForValue) { + if (completionResultsBuilder_ == null) { + ensureCompletionResultsIsMutable(); + completionResults_.set(index, builderForValue.build()); + onChanged(); + } else { + completionResultsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Results of the matching suggestions. The result list is ordered and the
+     * first result is top suggestion.
+     * 
+ * + * + * repeated .google.cloud.retail.v2.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + public Builder addCompletionResults( + com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult value) { + if (completionResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCompletionResultsIsMutable(); + completionResults_.add(value); + onChanged(); + } else { + completionResultsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Results of the matching suggestions. The result list is ordered and the
+     * first result is top suggestion.
+     * 
+ * + * + * repeated .google.cloud.retail.v2.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + public Builder addCompletionResults( + int index, com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult value) { + if (completionResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCompletionResultsIsMutable(); + completionResults_.add(index, value); + onChanged(); + } else { + completionResultsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Results of the matching suggestions. The result list is ordered and the
+     * first result is top suggestion.
+     * 
+ * + * + * repeated .google.cloud.retail.v2.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + public Builder addCompletionResults( + com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult.Builder builderForValue) { + if (completionResultsBuilder_ == null) { + ensureCompletionResultsIsMutable(); + completionResults_.add(builderForValue.build()); + onChanged(); + } else { + completionResultsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Results of the matching suggestions. The result list is ordered and the
+     * first result is top suggestion.
+     * 
+ * + * + * repeated .google.cloud.retail.v2.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + public Builder addCompletionResults( + int index, + com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult.Builder builderForValue) { + if (completionResultsBuilder_ == null) { + ensureCompletionResultsIsMutable(); + completionResults_.add(index, builderForValue.build()); + onChanged(); + } else { + completionResultsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Results of the matching suggestions. The result list is ordered and the
+     * first result is top suggestion.
+     * 
+ * + * + * repeated .google.cloud.retail.v2.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + public Builder addAllCompletionResults( + java.lang.Iterable< + ? extends com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult> + values) { + if (completionResultsBuilder_ == null) { + ensureCompletionResultsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, completionResults_); + onChanged(); + } else { + completionResultsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Results of the matching suggestions. The result list is ordered and the
+     * first result is top suggestion.
+     * 
+ * + * + * repeated .google.cloud.retail.v2.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + public Builder clearCompletionResults() { + if (completionResultsBuilder_ == null) { + completionResults_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + completionResultsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Results of the matching suggestions. The result list is ordered and the
+     * first result is top suggestion.
+     * 
+ * + * + * repeated .google.cloud.retail.v2.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + public Builder removeCompletionResults(int index) { + if (completionResultsBuilder_ == null) { + ensureCompletionResultsIsMutable(); + completionResults_.remove(index); + onChanged(); + } else { + completionResultsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Results of the matching suggestions. The result list is ordered and the
+     * first result is top suggestion.
+     * 
+ * + * + * repeated .google.cloud.retail.v2.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + public com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult.Builder + getCompletionResultsBuilder(int index) { + return getCompletionResultsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Results of the matching suggestions. The result list is ordered and the
+     * first result is top suggestion.
+     * 
+ * + * + * repeated .google.cloud.retail.v2.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + public com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResultOrBuilder + getCompletionResultsOrBuilder(int index) { + if (completionResultsBuilder_ == null) { + return completionResults_.get(index); + } else { + return completionResultsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Results of the matching suggestions. The result list is ordered and the
+     * first result is top suggestion.
+     * 
+ * + * + * repeated .google.cloud.retail.v2.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + public java.util.List< + ? extends com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResultOrBuilder> + getCompletionResultsOrBuilderList() { + if (completionResultsBuilder_ != null) { + return completionResultsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(completionResults_); + } + } + /** + * + * + *
+     * Results of the matching suggestions. The result list is ordered and the
+     * first result is top suggestion.
+     * 
+ * + * + * repeated .google.cloud.retail.v2.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + public com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult.Builder + addCompletionResultsBuilder() { + return getCompletionResultsFieldBuilder() + .addBuilder( + com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult + .getDefaultInstance()); + } + /** + * + * + *
+     * Results of the matching suggestions. The result list is ordered and the
+     * first result is top suggestion.
+     * 
+ * + * + * repeated .google.cloud.retail.v2.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + public com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult.Builder + addCompletionResultsBuilder(int index) { + return getCompletionResultsFieldBuilder() + .addBuilder( + index, + com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult + .getDefaultInstance()); + } + /** + * + * + *
+     * Results of the matching suggestions. The result list is ordered and the
+     * first result is top suggestion.
+     * 
+ * + * + * repeated .google.cloud.retail.v2.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + public java.util.List + getCompletionResultsBuilderList() { + return getCompletionResultsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult, + com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult.Builder, + com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResultOrBuilder> + getCompletionResultsFieldBuilder() { + if (completionResultsBuilder_ == null) { + completionResultsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult, + com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult.Builder, + com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResultOrBuilder>( + completionResults_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + completionResults_ = null; + } + return completionResultsBuilder_; + } + + private java.lang.Object attributionToken_ = ""; + /** + * + * + *
+     * 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.
+     * 
+ * + * string attribution_token = 2; + * + * @return The attributionToken. + */ + public java.lang.String getAttributionToken() { + java.lang.Object ref = attributionToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + attributionToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * string attribution_token = 2; + * + * @return The bytes for attributionToken. + */ + public com.google.protobuf.ByteString getAttributionTokenBytes() { + java.lang.Object ref = attributionToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + attributionToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * string attribution_token = 2; + * + * @param value The attributionToken to set. + * @return This builder for chaining. + */ + public Builder setAttributionToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + attributionToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * string attribution_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearAttributionToken() { + + attributionToken_ = getDefaultInstance().getAttributionToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * string attribution_token = 2; + * + * @param value The bytes for attributionToken to set. + * @return This builder for chaining. + */ + public Builder setAttributionTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + attributionToken_ = value; + onChanged(); + return this; + } + + private java.util.List + recentSearchResults_ = java.util.Collections.emptyList(); + + private void ensureRecentSearchResultsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + recentSearchResults_ = + new java.util.ArrayList< + com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult>( + recentSearchResults_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult, + com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult.Builder, + com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResultOrBuilder> + recentSearchResultsBuilder_; + + /** + * + * + *
+     * Matched recent searches of this user. This field is a restricted feature.
+     * Contact Retail Support (retail-search-support@google.com) if you are
+     * interested in enabling it.
+     * This feature is only available when
+     * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2.CompleteQueryRequest.visitor_id]
+     * field is set and [UserEvent][google.cloud.retail.v2.UserEvent] is imported.
+     * The recent searches satisfy the follow rules:
+     *  * They are ordered from latest to oldest.
+     *  * They are matched with
+     *  [CompleteQueryRequest.query][google.cloud.retail.v2.CompleteQueryRequest.query]
+     *  case insensitively.
+     *  * They are transformed to lower cases.
+     *  * They are UTF-8 safe.
+     * Recent searches are deduplicated. More recent searches will be reserved
+     * when duplication happens.
+     * 
+ * + * + * repeated .google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + public java.util.List + getRecentSearchResultsList() { + if (recentSearchResultsBuilder_ == null) { + return java.util.Collections.unmodifiableList(recentSearchResults_); + } else { + return recentSearchResultsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Matched recent searches of this user. This field is a restricted feature.
+     * Contact Retail Support (retail-search-support@google.com) if you are
+     * interested in enabling it.
+     * This feature is only available when
+     * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2.CompleteQueryRequest.visitor_id]
+     * field is set and [UserEvent][google.cloud.retail.v2.UserEvent] is imported.
+     * The recent searches satisfy the follow rules:
+     *  * They are ordered from latest to oldest.
+     *  * They are matched with
+     *  [CompleteQueryRequest.query][google.cloud.retail.v2.CompleteQueryRequest.query]
+     *  case insensitively.
+     *  * They are transformed to lower cases.
+     *  * They are UTF-8 safe.
+     * Recent searches are deduplicated. More recent searches will be reserved
+     * when duplication happens.
+     * 
+ * + * + * repeated .google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + public int getRecentSearchResultsCount() { + if (recentSearchResultsBuilder_ == null) { + return recentSearchResults_.size(); + } else { + return recentSearchResultsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Matched recent searches of this user. This field is a restricted feature.
+     * Contact Retail Support (retail-search-support@google.com) if you are
+     * interested in enabling it.
+     * This feature is only available when
+     * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2.CompleteQueryRequest.visitor_id]
+     * field is set and [UserEvent][google.cloud.retail.v2.UserEvent] is imported.
+     * The recent searches satisfy the follow rules:
+     *  * They are ordered from latest to oldest.
+     *  * They are matched with
+     *  [CompleteQueryRequest.query][google.cloud.retail.v2.CompleteQueryRequest.query]
+     *  case insensitively.
+     *  * They are transformed to lower cases.
+     *  * They are UTF-8 safe.
+     * Recent searches are deduplicated. More recent searches will be reserved
+     * when duplication happens.
+     * 
+ * + * + * repeated .google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + public com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult + getRecentSearchResults(int index) { + if (recentSearchResultsBuilder_ == null) { + return recentSearchResults_.get(index); + } else { + return recentSearchResultsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Matched recent searches of this user. This field is a restricted feature.
+     * Contact Retail Support (retail-search-support@google.com) if you are
+     * interested in enabling it.
+     * This feature is only available when
+     * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2.CompleteQueryRequest.visitor_id]
+     * field is set and [UserEvent][google.cloud.retail.v2.UserEvent] is imported.
+     * The recent searches satisfy the follow rules:
+     *  * They are ordered from latest to oldest.
+     *  * They are matched with
+     *  [CompleteQueryRequest.query][google.cloud.retail.v2.CompleteQueryRequest.query]
+     *  case insensitively.
+     *  * They are transformed to lower cases.
+     *  * They are UTF-8 safe.
+     * Recent searches are deduplicated. More recent searches will be reserved
+     * when duplication happens.
+     * 
+ * + * + * repeated .google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + public Builder setRecentSearchResults( + int index, com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult value) { + if (recentSearchResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRecentSearchResultsIsMutable(); + recentSearchResults_.set(index, value); + onChanged(); + } else { + recentSearchResultsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Matched recent searches of this user. This field is a restricted feature.
+     * Contact Retail Support (retail-search-support@google.com) if you are
+     * interested in enabling it.
+     * This feature is only available when
+     * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2.CompleteQueryRequest.visitor_id]
+     * field is set and [UserEvent][google.cloud.retail.v2.UserEvent] is imported.
+     * The recent searches satisfy the follow rules:
+     *  * They are ordered from latest to oldest.
+     *  * They are matched with
+     *  [CompleteQueryRequest.query][google.cloud.retail.v2.CompleteQueryRequest.query]
+     *  case insensitively.
+     *  * They are transformed to lower cases.
+     *  * They are UTF-8 safe.
+     * Recent searches are deduplicated. More recent searches will be reserved
+     * when duplication happens.
+     * 
+ * + * + * repeated .google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + public Builder setRecentSearchResults( + int index, + com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult.Builder + builderForValue) { + if (recentSearchResultsBuilder_ == null) { + ensureRecentSearchResultsIsMutable(); + recentSearchResults_.set(index, builderForValue.build()); + onChanged(); + } else { + recentSearchResultsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Matched recent searches of this user. This field is a restricted feature.
+     * Contact Retail Support (retail-search-support@google.com) if you are
+     * interested in enabling it.
+     * This feature is only available when
+     * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2.CompleteQueryRequest.visitor_id]
+     * field is set and [UserEvent][google.cloud.retail.v2.UserEvent] is imported.
+     * The recent searches satisfy the follow rules:
+     *  * They are ordered from latest to oldest.
+     *  * They are matched with
+     *  [CompleteQueryRequest.query][google.cloud.retail.v2.CompleteQueryRequest.query]
+     *  case insensitively.
+     *  * They are transformed to lower cases.
+     *  * They are UTF-8 safe.
+     * Recent searches are deduplicated. More recent searches will be reserved
+     * when duplication happens.
+     * 
+ * + * + * repeated .google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + public Builder addRecentSearchResults( + com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult value) { + if (recentSearchResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRecentSearchResultsIsMutable(); + recentSearchResults_.add(value); + onChanged(); + } else { + recentSearchResultsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Matched recent searches of this user. This field is a restricted feature.
+     * Contact Retail Support (retail-search-support@google.com) if you are
+     * interested in enabling it.
+     * This feature is only available when
+     * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2.CompleteQueryRequest.visitor_id]
+     * field is set and [UserEvent][google.cloud.retail.v2.UserEvent] is imported.
+     * The recent searches satisfy the follow rules:
+     *  * They are ordered from latest to oldest.
+     *  * They are matched with
+     *  [CompleteQueryRequest.query][google.cloud.retail.v2.CompleteQueryRequest.query]
+     *  case insensitively.
+     *  * They are transformed to lower cases.
+     *  * They are UTF-8 safe.
+     * Recent searches are deduplicated. More recent searches will be reserved
+     * when duplication happens.
+     * 
+ * + * + * repeated .google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + public Builder addRecentSearchResults( + int index, com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult value) { + if (recentSearchResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRecentSearchResultsIsMutable(); + recentSearchResults_.add(index, value); + onChanged(); + } else { + recentSearchResultsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Matched recent searches of this user. This field is a restricted feature.
+     * Contact Retail Support (retail-search-support@google.com) if you are
+     * interested in enabling it.
+     * This feature is only available when
+     * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2.CompleteQueryRequest.visitor_id]
+     * field is set and [UserEvent][google.cloud.retail.v2.UserEvent] is imported.
+     * The recent searches satisfy the follow rules:
+     *  * They are ordered from latest to oldest.
+     *  * They are matched with
+     *  [CompleteQueryRequest.query][google.cloud.retail.v2.CompleteQueryRequest.query]
+     *  case insensitively.
+     *  * They are transformed to lower cases.
+     *  * They are UTF-8 safe.
+     * Recent searches are deduplicated. More recent searches will be reserved
+     * when duplication happens.
+     * 
+ * + * + * repeated .google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + public Builder addRecentSearchResults( + com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult.Builder + builderForValue) { + if (recentSearchResultsBuilder_ == null) { + ensureRecentSearchResultsIsMutable(); + recentSearchResults_.add(builderForValue.build()); + onChanged(); + } else { + recentSearchResultsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Matched recent searches of this user. This field is a restricted feature.
+     * Contact Retail Support (retail-search-support@google.com) if you are
+     * interested in enabling it.
+     * This feature is only available when
+     * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2.CompleteQueryRequest.visitor_id]
+     * field is set and [UserEvent][google.cloud.retail.v2.UserEvent] is imported.
+     * The recent searches satisfy the follow rules:
+     *  * They are ordered from latest to oldest.
+     *  * They are matched with
+     *  [CompleteQueryRequest.query][google.cloud.retail.v2.CompleteQueryRequest.query]
+     *  case insensitively.
+     *  * They are transformed to lower cases.
+     *  * They are UTF-8 safe.
+     * Recent searches are deduplicated. More recent searches will be reserved
+     * when duplication happens.
+     * 
+ * + * + * repeated .google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + public Builder addRecentSearchResults( + int index, + com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult.Builder + builderForValue) { + if (recentSearchResultsBuilder_ == null) { + ensureRecentSearchResultsIsMutable(); + recentSearchResults_.add(index, builderForValue.build()); + onChanged(); + } else { + recentSearchResultsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Matched recent searches of this user. This field is a restricted feature.
+     * Contact Retail Support (retail-search-support@google.com) if you are
+     * interested in enabling it.
+     * This feature is only available when
+     * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2.CompleteQueryRequest.visitor_id]
+     * field is set and [UserEvent][google.cloud.retail.v2.UserEvent] is imported.
+     * The recent searches satisfy the follow rules:
+     *  * They are ordered from latest to oldest.
+     *  * They are matched with
+     *  [CompleteQueryRequest.query][google.cloud.retail.v2.CompleteQueryRequest.query]
+     *  case insensitively.
+     *  * They are transformed to lower cases.
+     *  * They are UTF-8 safe.
+     * Recent searches are deduplicated. More recent searches will be reserved
+     * when duplication happens.
+     * 
+ * + * + * repeated .google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + public Builder addAllRecentSearchResults( + java.lang.Iterable< + ? extends com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult> + values) { + if (recentSearchResultsBuilder_ == null) { + ensureRecentSearchResultsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, recentSearchResults_); + onChanged(); + } else { + recentSearchResultsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Matched recent searches of this user. This field is a restricted feature.
+     * Contact Retail Support (retail-search-support@google.com) if you are
+     * interested in enabling it.
+     * This feature is only available when
+     * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2.CompleteQueryRequest.visitor_id]
+     * field is set and [UserEvent][google.cloud.retail.v2.UserEvent] is imported.
+     * The recent searches satisfy the follow rules:
+     *  * They are ordered from latest to oldest.
+     *  * They are matched with
+     *  [CompleteQueryRequest.query][google.cloud.retail.v2.CompleteQueryRequest.query]
+     *  case insensitively.
+     *  * They are transformed to lower cases.
+     *  * They are UTF-8 safe.
+     * Recent searches are deduplicated. More recent searches will be reserved
+     * when duplication happens.
+     * 
+ * + * + * repeated .google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + public Builder clearRecentSearchResults() { + if (recentSearchResultsBuilder_ == null) { + recentSearchResults_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + recentSearchResultsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Matched recent searches of this user. This field is a restricted feature.
+     * Contact Retail Support (retail-search-support@google.com) if you are
+     * interested in enabling it.
+     * This feature is only available when
+     * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2.CompleteQueryRequest.visitor_id]
+     * field is set and [UserEvent][google.cloud.retail.v2.UserEvent] is imported.
+     * The recent searches satisfy the follow rules:
+     *  * They are ordered from latest to oldest.
+     *  * They are matched with
+     *  [CompleteQueryRequest.query][google.cloud.retail.v2.CompleteQueryRequest.query]
+     *  case insensitively.
+     *  * They are transformed to lower cases.
+     *  * They are UTF-8 safe.
+     * Recent searches are deduplicated. More recent searches will be reserved
+     * when duplication happens.
+     * 
+ * + * + * repeated .google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + public Builder removeRecentSearchResults(int index) { + if (recentSearchResultsBuilder_ == null) { + ensureRecentSearchResultsIsMutable(); + recentSearchResults_.remove(index); + onChanged(); + } else { + recentSearchResultsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Matched recent searches of this user. This field is a restricted feature.
+     * Contact Retail Support (retail-search-support@google.com) if you are
+     * interested in enabling it.
+     * This feature is only available when
+     * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2.CompleteQueryRequest.visitor_id]
+     * field is set and [UserEvent][google.cloud.retail.v2.UserEvent] is imported.
+     * The recent searches satisfy the follow rules:
+     *  * They are ordered from latest to oldest.
+     *  * They are matched with
+     *  [CompleteQueryRequest.query][google.cloud.retail.v2.CompleteQueryRequest.query]
+     *  case insensitively.
+     *  * They are transformed to lower cases.
+     *  * They are UTF-8 safe.
+     * Recent searches are deduplicated. More recent searches will be reserved
+     * when duplication happens.
+     * 
+ * + * + * repeated .google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + public com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult.Builder + getRecentSearchResultsBuilder(int index) { + return getRecentSearchResultsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Matched recent searches of this user. This field is a restricted feature.
+     * Contact Retail Support (retail-search-support@google.com) if you are
+     * interested in enabling it.
+     * This feature is only available when
+     * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2.CompleteQueryRequest.visitor_id]
+     * field is set and [UserEvent][google.cloud.retail.v2.UserEvent] is imported.
+     * The recent searches satisfy the follow rules:
+     *  * They are ordered from latest to oldest.
+     *  * They are matched with
+     *  [CompleteQueryRequest.query][google.cloud.retail.v2.CompleteQueryRequest.query]
+     *  case insensitively.
+     *  * They are transformed to lower cases.
+     *  * They are UTF-8 safe.
+     * Recent searches are deduplicated. More recent searches will be reserved
+     * when duplication happens.
+     * 
+ * + * + * repeated .google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + public com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResultOrBuilder + getRecentSearchResultsOrBuilder(int index) { + if (recentSearchResultsBuilder_ == null) { + return recentSearchResults_.get(index); + } else { + return recentSearchResultsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Matched recent searches of this user. This field is a restricted feature.
+     * Contact Retail Support (retail-search-support@google.com) if you are
+     * interested in enabling it.
+     * This feature is only available when
+     * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2.CompleteQueryRequest.visitor_id]
+     * field is set and [UserEvent][google.cloud.retail.v2.UserEvent] is imported.
+     * The recent searches satisfy the follow rules:
+     *  * They are ordered from latest to oldest.
+     *  * They are matched with
+     *  [CompleteQueryRequest.query][google.cloud.retail.v2.CompleteQueryRequest.query]
+     *  case insensitively.
+     *  * They are transformed to lower cases.
+     *  * They are UTF-8 safe.
+     * Recent searches are deduplicated. More recent searches will be reserved
+     * when duplication happens.
+     * 
+ * + * + * repeated .google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + public java.util.List< + ? extends com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResultOrBuilder> + getRecentSearchResultsOrBuilderList() { + if (recentSearchResultsBuilder_ != null) { + return recentSearchResultsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(recentSearchResults_); + } + } + /** + * + * + *
+     * Matched recent searches of this user. This field is a restricted feature.
+     * Contact Retail Support (retail-search-support@google.com) if you are
+     * interested in enabling it.
+     * This feature is only available when
+     * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2.CompleteQueryRequest.visitor_id]
+     * field is set and [UserEvent][google.cloud.retail.v2.UserEvent] is imported.
+     * The recent searches satisfy the follow rules:
+     *  * They are ordered from latest to oldest.
+     *  * They are matched with
+     *  [CompleteQueryRequest.query][google.cloud.retail.v2.CompleteQueryRequest.query]
+     *  case insensitively.
+     *  * They are transformed to lower cases.
+     *  * They are UTF-8 safe.
+     * Recent searches are deduplicated. More recent searches will be reserved
+     * when duplication happens.
+     * 
+ * + * + * repeated .google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + public com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult.Builder + addRecentSearchResultsBuilder() { + return getRecentSearchResultsFieldBuilder() + .addBuilder( + com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult + .getDefaultInstance()); + } + /** + * + * + *
+     * Matched recent searches of this user. This field is a restricted feature.
+     * Contact Retail Support (retail-search-support@google.com) if you are
+     * interested in enabling it.
+     * This feature is only available when
+     * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2.CompleteQueryRequest.visitor_id]
+     * field is set and [UserEvent][google.cloud.retail.v2.UserEvent] is imported.
+     * The recent searches satisfy the follow rules:
+     *  * They are ordered from latest to oldest.
+     *  * They are matched with
+     *  [CompleteQueryRequest.query][google.cloud.retail.v2.CompleteQueryRequest.query]
+     *  case insensitively.
+     *  * They are transformed to lower cases.
+     *  * They are UTF-8 safe.
+     * Recent searches are deduplicated. More recent searches will be reserved
+     * when duplication happens.
+     * 
+ * + * + * repeated .google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + public com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult.Builder + addRecentSearchResultsBuilder(int index) { + return getRecentSearchResultsFieldBuilder() + .addBuilder( + index, + com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult + .getDefaultInstance()); + } + /** + * + * + *
+     * Matched recent searches of this user. This field is a restricted feature.
+     * Contact Retail Support (retail-search-support@google.com) if you are
+     * interested in enabling it.
+     * This feature is only available when
+     * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2.CompleteQueryRequest.visitor_id]
+     * field is set and [UserEvent][google.cloud.retail.v2.UserEvent] is imported.
+     * The recent searches satisfy the follow rules:
+     *  * They are ordered from latest to oldest.
+     *  * They are matched with
+     *  [CompleteQueryRequest.query][google.cloud.retail.v2.CompleteQueryRequest.query]
+     *  case insensitively.
+     *  * They are transformed to lower cases.
+     *  * They are UTF-8 safe.
+     * Recent searches are deduplicated. More recent searches will be reserved
+     * when duplication happens.
+     * 
+ * + * + * repeated .google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + public java.util.List< + com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult.Builder> + getRecentSearchResultsBuilderList() { + return getRecentSearchResultsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult, + com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult.Builder, + com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResultOrBuilder> + getRecentSearchResultsFieldBuilder() { + if (recentSearchResultsBuilder_ == null) { + recentSearchResultsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult, + com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult.Builder, + com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResultOrBuilder>( + recentSearchResults_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + recentSearchResults_ = null; + } + return recentSearchResultsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.CompleteQueryResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.CompleteQueryResponse) + private static final com.google.cloud.retail.v2.CompleteQueryResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2.CompleteQueryResponse(); + } + + public static com.google.cloud.retail.v2.CompleteQueryResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CompleteQueryResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CompleteQueryResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.retail.v2.CompleteQueryResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CompleteQueryResponseOrBuilder.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CompleteQueryResponseOrBuilder.java new file mode 100644 index 00000000..31fc2c53 --- /dev/null +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CompleteQueryResponseOrBuilder.java @@ -0,0 +1,262 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2/completion_service.proto + +package com.google.cloud.retail.v2; + +public interface CompleteQueryResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2.CompleteQueryResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Results of the matching suggestions. The result list is ordered and the
+   * first result is top suggestion.
+   * 
+ * + * + * repeated .google.cloud.retail.v2.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + java.util.List + getCompletionResultsList(); + /** + * + * + *
+   * Results of the matching suggestions. The result list is ordered and the
+   * first result is top suggestion.
+   * 
+ * + * + * repeated .google.cloud.retail.v2.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult getCompletionResults(int index); + /** + * + * + *
+   * Results of the matching suggestions. The result list is ordered and the
+   * first result is top suggestion.
+   * 
+ * + * + * repeated .google.cloud.retail.v2.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + int getCompletionResultsCount(); + /** + * + * + *
+   * Results of the matching suggestions. The result list is ordered and the
+   * first result is top suggestion.
+   * 
+ * + * + * repeated .google.cloud.retail.v2.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + java.util.List< + ? extends com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResultOrBuilder> + getCompletionResultsOrBuilderList(); + /** + * + * + *
+   * Results of the matching suggestions. The result list is ordered and the
+   * first result is top suggestion.
+   * 
+ * + * + * repeated .google.cloud.retail.v2.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + com.google.cloud.retail.v2.CompleteQueryResponse.CompletionResultOrBuilder + getCompletionResultsOrBuilder(int index); + + /** + * + * + *
+   * 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.
+   * 
+ * + * string attribution_token = 2; + * + * @return The attributionToken. + */ + java.lang.String getAttributionToken(); + /** + * + * + *
+   * 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.
+   * 
+ * + * string attribution_token = 2; + * + * @return The bytes for attributionToken. + */ + com.google.protobuf.ByteString getAttributionTokenBytes(); + + /** + * + * + *
+   * Matched recent searches of this user. This field is a restricted feature.
+   * Contact Retail Support (retail-search-support@google.com) if you are
+   * interested in enabling it.
+   * This feature is only available when
+   * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2.CompleteQueryRequest.visitor_id]
+   * field is set and [UserEvent][google.cloud.retail.v2.UserEvent] is imported.
+   * The recent searches satisfy the follow rules:
+   *  * They are ordered from latest to oldest.
+   *  * They are matched with
+   *  [CompleteQueryRequest.query][google.cloud.retail.v2.CompleteQueryRequest.query]
+   *  case insensitively.
+   *  * They are transformed to lower cases.
+   *  * They are UTF-8 safe.
+   * Recent searches are deduplicated. More recent searches will be reserved
+   * when duplication happens.
+   * 
+ * + * + * repeated .google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + java.util.List + getRecentSearchResultsList(); + /** + * + * + *
+   * Matched recent searches of this user. This field is a restricted feature.
+   * Contact Retail Support (retail-search-support@google.com) if you are
+   * interested in enabling it.
+   * This feature is only available when
+   * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2.CompleteQueryRequest.visitor_id]
+   * field is set and [UserEvent][google.cloud.retail.v2.UserEvent] is imported.
+   * The recent searches satisfy the follow rules:
+   *  * They are ordered from latest to oldest.
+   *  * They are matched with
+   *  [CompleteQueryRequest.query][google.cloud.retail.v2.CompleteQueryRequest.query]
+   *  case insensitively.
+   *  * They are transformed to lower cases.
+   *  * They are UTF-8 safe.
+   * Recent searches are deduplicated. More recent searches will be reserved
+   * when duplication happens.
+   * 
+ * + * + * repeated .google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult getRecentSearchResults( + int index); + /** + * + * + *
+   * Matched recent searches of this user. This field is a restricted feature.
+   * Contact Retail Support (retail-search-support@google.com) if you are
+   * interested in enabling it.
+   * This feature is only available when
+   * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2.CompleteQueryRequest.visitor_id]
+   * field is set and [UserEvent][google.cloud.retail.v2.UserEvent] is imported.
+   * The recent searches satisfy the follow rules:
+   *  * They are ordered from latest to oldest.
+   *  * They are matched with
+   *  [CompleteQueryRequest.query][google.cloud.retail.v2.CompleteQueryRequest.query]
+   *  case insensitively.
+   *  * They are transformed to lower cases.
+   *  * They are UTF-8 safe.
+   * Recent searches are deduplicated. More recent searches will be reserved
+   * when duplication happens.
+   * 
+ * + * + * repeated .google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + int getRecentSearchResultsCount(); + /** + * + * + *
+   * Matched recent searches of this user. This field is a restricted feature.
+   * Contact Retail Support (retail-search-support@google.com) if you are
+   * interested in enabling it.
+   * This feature is only available when
+   * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2.CompleteQueryRequest.visitor_id]
+   * field is set and [UserEvent][google.cloud.retail.v2.UserEvent] is imported.
+   * The recent searches satisfy the follow rules:
+   *  * They are ordered from latest to oldest.
+   *  * They are matched with
+   *  [CompleteQueryRequest.query][google.cloud.retail.v2.CompleteQueryRequest.query]
+   *  case insensitively.
+   *  * They are transformed to lower cases.
+   *  * They are UTF-8 safe.
+   * Recent searches are deduplicated. More recent searches will be reserved
+   * when duplication happens.
+   * 
+ * + * + * repeated .google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + java.util.List< + ? extends com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResultOrBuilder> + getRecentSearchResultsOrBuilderList(); + /** + * + * + *
+   * Matched recent searches of this user. This field is a restricted feature.
+   * Contact Retail Support (retail-search-support@google.com) if you are
+   * interested in enabling it.
+   * This feature is only available when
+   * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2.CompleteQueryRequest.visitor_id]
+   * field is set and [UserEvent][google.cloud.retail.v2.UserEvent] is imported.
+   * The recent searches satisfy the follow rules:
+   *  * They are ordered from latest to oldest.
+   *  * They are matched with
+   *  [CompleteQueryRequest.query][google.cloud.retail.v2.CompleteQueryRequest.query]
+   *  case insensitively.
+   *  * They are transformed to lower cases.
+   *  * They are UTF-8 safe.
+   * Recent searches are deduplicated. More recent searches will be reserved
+   * when duplication happens.
+   * 
+ * + * + * repeated .google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + com.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResultOrBuilder + getRecentSearchResultsOrBuilder(int index); +} diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CompletionDataInputConfig.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CompletionDataInputConfig.java new file mode 100644 index 00000000..f051064f --- /dev/null +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CompletionDataInputConfig.java @@ -0,0 +1,895 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2/import_config.proto + +package com.google.cloud.retail.v2; + +/** + * + * + *
+ * The input config source for completion data.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2.CompletionDataInputConfig} + */ +public final class CompletionDataInputConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.CompletionDataInputConfig) + CompletionDataInputConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use CompletionDataInputConfig.newBuilder() to construct. + private CompletionDataInputConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CompletionDataInputConfig() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CompletionDataInputConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CompletionDataInputConfig( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.retail.v2.BigQuerySource.Builder subBuilder = null; + if (sourceCase_ == 1) { + subBuilder = ((com.google.cloud.retail.v2.BigQuerySource) source_).toBuilder(); + } + source_ = + input.readMessage( + com.google.cloud.retail.v2.BigQuerySource.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.retail.v2.BigQuerySource) source_); + source_ = subBuilder.buildPartial(); + } + sourceCase_ = 1; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.ImportConfigProto + .internal_static_google_cloud_retail_v2_CompletionDataInputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.ImportConfigProto + .internal_static_google_cloud_retail_v2_CompletionDataInputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.CompletionDataInputConfig.class, + com.google.cloud.retail.v2.CompletionDataInputConfig.Builder.class); + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + + public enum SourceCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + BIG_QUERY_SOURCE(1), + SOURCE_NOT_SET(0); + private final int value; + + private SourceCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SourceCase valueOf(int value) { + return forNumber(value); + } + + public static SourceCase forNumber(int value) { + switch (value) { + case 1: + return BIG_QUERY_SOURCE; + case 0: + return SOURCE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public static final int BIG_QUERY_SOURCE_FIELD_NUMBER = 1; + /** + * + * + *
+   * Required. BigQuery input source.
+   * 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.
+   * 
+ * + * + * .google.cloud.retail.v2.BigQuerySource big_query_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the bigQuerySource field is set. + */ + @java.lang.Override + public boolean hasBigQuerySource() { + return sourceCase_ == 1; + } + /** + * + * + *
+   * Required. BigQuery input source.
+   * 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.
+   * 
+ * + * + * .google.cloud.retail.v2.BigQuerySource big_query_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The bigQuerySource. + */ + @java.lang.Override + public com.google.cloud.retail.v2.BigQuerySource getBigQuerySource() { + if (sourceCase_ == 1) { + return (com.google.cloud.retail.v2.BigQuerySource) source_; + } + return com.google.cloud.retail.v2.BigQuerySource.getDefaultInstance(); + } + /** + * + * + *
+   * Required. BigQuery input source.
+   * 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.
+   * 
+ * + * + * .google.cloud.retail.v2.BigQuerySource big_query_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2.BigQuerySourceOrBuilder getBigQuerySourceOrBuilder() { + if (sourceCase_ == 1) { + return (com.google.cloud.retail.v2.BigQuerySource) source_; + } + return com.google.cloud.retail.v2.BigQuerySource.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (sourceCase_ == 1) { + output.writeMessage(1, (com.google.cloud.retail.v2.BigQuerySource) source_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (sourceCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.cloud.retail.v2.BigQuerySource) source_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.retail.v2.CompletionDataInputConfig)) { + return super.equals(obj); + } + com.google.cloud.retail.v2.CompletionDataInputConfig other = + (com.google.cloud.retail.v2.CompletionDataInputConfig) obj; + + if (!getSourceCase().equals(other.getSourceCase())) return false; + switch (sourceCase_) { + case 1: + if (!getBigQuerySource().equals(other.getBigQuerySource())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (sourceCase_) { + case 1: + hash = (37 * hash) + BIG_QUERY_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getBigQuerySource().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2.CompletionDataInputConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.CompletionDataInputConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.CompletionDataInputConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.CompletionDataInputConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.CompletionDataInputConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.CompletionDataInputConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.CompletionDataInputConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.CompletionDataInputConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.CompletionDataInputConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.CompletionDataInputConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.CompletionDataInputConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.CompletionDataInputConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2.CompletionDataInputConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The input config source for completion data.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2.CompletionDataInputConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.CompletionDataInputConfig) + com.google.cloud.retail.v2.CompletionDataInputConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.ImportConfigProto + .internal_static_google_cloud_retail_v2_CompletionDataInputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.ImportConfigProto + .internal_static_google_cloud_retail_v2_CompletionDataInputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.CompletionDataInputConfig.class, + com.google.cloud.retail.v2.CompletionDataInputConfig.Builder.class); + } + + // Construct using com.google.cloud.retail.v2.CompletionDataInputConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + sourceCase_ = 0; + source_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2.ImportConfigProto + .internal_static_google_cloud_retail_v2_CompletionDataInputConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2.CompletionDataInputConfig getDefaultInstanceForType() { + return com.google.cloud.retail.v2.CompletionDataInputConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2.CompletionDataInputConfig build() { + com.google.cloud.retail.v2.CompletionDataInputConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2.CompletionDataInputConfig buildPartial() { + com.google.cloud.retail.v2.CompletionDataInputConfig result = + new com.google.cloud.retail.v2.CompletionDataInputConfig(this); + if (sourceCase_ == 1) { + if (bigQuerySourceBuilder_ == null) { + result.source_ = source_; + } else { + result.source_ = bigQuerySourceBuilder_.build(); + } + } + result.sourceCase_ = sourceCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.retail.v2.CompletionDataInputConfig) { + return mergeFrom((com.google.cloud.retail.v2.CompletionDataInputConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2.CompletionDataInputConfig other) { + if (other == com.google.cloud.retail.v2.CompletionDataInputConfig.getDefaultInstance()) + return this; + switch (other.getSourceCase()) { + case BIG_QUERY_SOURCE: + { + mergeBigQuerySource(other.getBigQuerySource()); + break; + } + case SOURCE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.retail.v2.CompletionDataInputConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2.CompletionDataInputConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public Builder clearSource() { + sourceCase_ = 0; + source_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2.BigQuerySource, + com.google.cloud.retail.v2.BigQuerySource.Builder, + com.google.cloud.retail.v2.BigQuerySourceOrBuilder> + bigQuerySourceBuilder_; + /** + * + * + *
+     * Required. BigQuery input source.
+     * 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.
+     * 
+ * + * + * .google.cloud.retail.v2.BigQuerySource big_query_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the bigQuerySource field is set. + */ + @java.lang.Override + public boolean hasBigQuerySource() { + return sourceCase_ == 1; + } + /** + * + * + *
+     * Required. BigQuery input source.
+     * 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.
+     * 
+ * + * + * .google.cloud.retail.v2.BigQuerySource big_query_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The bigQuerySource. + */ + @java.lang.Override + public com.google.cloud.retail.v2.BigQuerySource getBigQuerySource() { + if (bigQuerySourceBuilder_ == null) { + if (sourceCase_ == 1) { + return (com.google.cloud.retail.v2.BigQuerySource) source_; + } + return com.google.cloud.retail.v2.BigQuerySource.getDefaultInstance(); + } else { + if (sourceCase_ == 1) { + return bigQuerySourceBuilder_.getMessage(); + } + return com.google.cloud.retail.v2.BigQuerySource.getDefaultInstance(); + } + } + /** + * + * + *
+     * Required. BigQuery input source.
+     * 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.
+     * 
+ * + * + * .google.cloud.retail.v2.BigQuerySource big_query_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBigQuerySource(com.google.cloud.retail.v2.BigQuerySource value) { + if (bigQuerySourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + bigQuerySourceBuilder_.setMessage(value); + } + sourceCase_ = 1; + return this; + } + /** + * + * + *
+     * Required. BigQuery input source.
+     * 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.
+     * 
+ * + * + * .google.cloud.retail.v2.BigQuerySource big_query_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBigQuerySource( + com.google.cloud.retail.v2.BigQuerySource.Builder builderForValue) { + if (bigQuerySourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + bigQuerySourceBuilder_.setMessage(builderForValue.build()); + } + sourceCase_ = 1; + return this; + } + /** + * + * + *
+     * Required. BigQuery input source.
+     * 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.
+     * 
+ * + * + * .google.cloud.retail.v2.BigQuerySource big_query_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeBigQuerySource(com.google.cloud.retail.v2.BigQuerySource value) { + if (bigQuerySourceBuilder_ == null) { + if (sourceCase_ == 1 + && source_ != com.google.cloud.retail.v2.BigQuerySource.getDefaultInstance()) { + source_ = + com.google.cloud.retail.v2.BigQuerySource.newBuilder( + (com.google.cloud.retail.v2.BigQuerySource) source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + if (sourceCase_ == 1) { + bigQuerySourceBuilder_.mergeFrom(value); + } + bigQuerySourceBuilder_.setMessage(value); + } + sourceCase_ = 1; + return this; + } + /** + * + * + *
+     * Required. BigQuery input source.
+     * 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.
+     * 
+ * + * + * .google.cloud.retail.v2.BigQuerySource big_query_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearBigQuerySource() { + if (bigQuerySourceBuilder_ == null) { + if (sourceCase_ == 1) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + } else { + if (sourceCase_ == 1) { + sourceCase_ = 0; + source_ = null; + } + bigQuerySourceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Required. BigQuery input source.
+     * 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.
+     * 
+ * + * + * .google.cloud.retail.v2.BigQuerySource big_query_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2.BigQuerySource.Builder getBigQuerySourceBuilder() { + return getBigQuerySourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. BigQuery input source.
+     * 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.
+     * 
+ * + * + * .google.cloud.retail.v2.BigQuerySource big_query_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2.BigQuerySourceOrBuilder getBigQuerySourceOrBuilder() { + if ((sourceCase_ == 1) && (bigQuerySourceBuilder_ != null)) { + return bigQuerySourceBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 1) { + return (com.google.cloud.retail.v2.BigQuerySource) source_; + } + return com.google.cloud.retail.v2.BigQuerySource.getDefaultInstance(); + } + } + /** + * + * + *
+     * Required. BigQuery input source.
+     * 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.
+     * 
+ * + * + * .google.cloud.retail.v2.BigQuerySource big_query_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2.BigQuerySource, + com.google.cloud.retail.v2.BigQuerySource.Builder, + com.google.cloud.retail.v2.BigQuerySourceOrBuilder> + getBigQuerySourceFieldBuilder() { + if (bigQuerySourceBuilder_ == null) { + if (!(sourceCase_ == 1)) { + source_ = com.google.cloud.retail.v2.BigQuerySource.getDefaultInstance(); + } + bigQuerySourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2.BigQuerySource, + com.google.cloud.retail.v2.BigQuerySource.Builder, + com.google.cloud.retail.v2.BigQuerySourceOrBuilder>( + (com.google.cloud.retail.v2.BigQuerySource) source_, + getParentForChildren(), + isClean()); + source_ = null; + } + sourceCase_ = 1; + onChanged(); + ; + return bigQuerySourceBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.CompletionDataInputConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.CompletionDataInputConfig) + private static final com.google.cloud.retail.v2.CompletionDataInputConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2.CompletionDataInputConfig(); + } + + public static com.google.cloud.retail.v2.CompletionDataInputConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CompletionDataInputConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CompletionDataInputConfig(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.retail.v2.CompletionDataInputConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CompletionDataInputConfigOrBuilder.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CompletionDataInputConfigOrBuilder.java new file mode 100644 index 00000000..2ce05279 --- /dev/null +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CompletionDataInputConfigOrBuilder.java @@ -0,0 +1,77 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2/import_config.proto + +package com.google.cloud.retail.v2; + +public interface CompletionDataInputConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2.CompletionDataInputConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. BigQuery input source.
+   * 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.
+   * 
+ * + * + * .google.cloud.retail.v2.BigQuerySource big_query_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the bigQuerySource field is set. + */ + boolean hasBigQuerySource(); + /** + * + * + *
+   * Required. BigQuery input source.
+   * 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.
+   * 
+ * + * + * .google.cloud.retail.v2.BigQuerySource big_query_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The bigQuerySource. + */ + com.google.cloud.retail.v2.BigQuerySource getBigQuerySource(); + /** + * + * + *
+   * Required. BigQuery input source.
+   * 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.
+   * 
+ * + * + * .google.cloud.retail.v2.BigQuerySource big_query_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2.BigQuerySourceOrBuilder getBigQuerySourceOrBuilder(); + + public com.google.cloud.retail.v2.CompletionDataInputConfig.SourceCase getSourceCase(); +} diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CompletionDetail.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CompletionDetail.java new file mode 100644 index 00000000..e18ad1ca --- /dev/null +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CompletionDetail.java @@ -0,0 +1,929 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2/user_event.proto + +package com.google.cloud.retail.v2; + +/** + * + * + *
+ * Detailed completion information including completion attribution token and
+ * clicked completion info.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2.CompletionDetail} + */ +public final class CompletionDetail extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.CompletionDetail) + CompletionDetailOrBuilder { + private static final long serialVersionUID = 0L; + // Use CompletionDetail.newBuilder() to construct. + private CompletionDetail(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CompletionDetail() { + completionAttributionToken_ = ""; + selectedSuggestion_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CompletionDetail(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CompletionDetail( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + completionAttributionToken_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + selectedSuggestion_ = s; + break; + } + case 24: + { + selectedPosition_ = input.readInt32(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.UserEventProto + .internal_static_google_cloud_retail_v2_CompletionDetail_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.UserEventProto + .internal_static_google_cloud_retail_v2_CompletionDetail_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.CompletionDetail.class, + com.google.cloud.retail.v2.CompletionDetail.Builder.class); + } + + public static final int COMPLETION_ATTRIBUTION_TOKEN_FIELD_NUMBER = 1; + private volatile java.lang.Object completionAttributionToken_; + /** + * + * + *
+   * Completion attribution token in
+   * [CompleteQueryResponse.attribution_token][google.cloud.retail.v2.CompleteQueryResponse.attribution_token].
+   * 
+ * + * string completion_attribution_token = 1; + * + * @return The completionAttributionToken. + */ + @java.lang.Override + public java.lang.String getCompletionAttributionToken() { + java.lang.Object ref = completionAttributionToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + completionAttributionToken_ = s; + return s; + } + } + /** + * + * + *
+   * Completion attribution token in
+   * [CompleteQueryResponse.attribution_token][google.cloud.retail.v2.CompleteQueryResponse.attribution_token].
+   * 
+ * + * string completion_attribution_token = 1; + * + * @return The bytes for completionAttributionToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCompletionAttributionTokenBytes() { + java.lang.Object ref = completionAttributionToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + completionAttributionToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SELECTED_SUGGESTION_FIELD_NUMBER = 2; + private volatile java.lang.Object selectedSuggestion_; + /** + * + * + *
+   * End user selected
+   * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2.CompleteQueryResponse.CompletionResult.suggestion].
+   * 
+ * + * string selected_suggestion = 2; + * + * @return The selectedSuggestion. + */ + @java.lang.Override + public java.lang.String getSelectedSuggestion() { + java.lang.Object ref = selectedSuggestion_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + selectedSuggestion_ = s; + return s; + } + } + /** + * + * + *
+   * End user selected
+   * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2.CompleteQueryResponse.CompletionResult.suggestion].
+   * 
+ * + * string selected_suggestion = 2; + * + * @return The bytes for selectedSuggestion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSelectedSuggestionBytes() { + java.lang.Object ref = selectedSuggestion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + selectedSuggestion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SELECTED_POSITION_FIELD_NUMBER = 3; + private int selectedPosition_; + /** + * + * + *
+   * End user selected
+   * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2.CompleteQueryResponse.CompletionResult.suggestion]
+   * position, starting from 0.
+   * 
+ * + * int32 selected_position = 3; + * + * @return The selectedPosition. + */ + @java.lang.Override + public int getSelectedPosition() { + return selectedPosition_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getCompletionAttributionTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, completionAttributionToken_); + } + if (!getSelectedSuggestionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, selectedSuggestion_); + } + if (selectedPosition_ != 0) { + output.writeInt32(3, selectedPosition_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getCompletionAttributionTokenBytes().isEmpty()) { + size += + com.google.protobuf.GeneratedMessageV3.computeStringSize(1, completionAttributionToken_); + } + if (!getSelectedSuggestionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, selectedSuggestion_); + } + if (selectedPosition_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, selectedPosition_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.retail.v2.CompletionDetail)) { + return super.equals(obj); + } + com.google.cloud.retail.v2.CompletionDetail other = + (com.google.cloud.retail.v2.CompletionDetail) obj; + + if (!getCompletionAttributionToken().equals(other.getCompletionAttributionToken())) + return false; + if (!getSelectedSuggestion().equals(other.getSelectedSuggestion())) return false; + if (getSelectedPosition() != other.getSelectedPosition()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + COMPLETION_ATTRIBUTION_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getCompletionAttributionToken().hashCode(); + hash = (37 * hash) + SELECTED_SUGGESTION_FIELD_NUMBER; + hash = (53 * hash) + getSelectedSuggestion().hashCode(); + hash = (37 * hash) + SELECTED_POSITION_FIELD_NUMBER; + hash = (53 * hash) + getSelectedPosition(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2.CompletionDetail parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.CompletionDetail parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.CompletionDetail parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.CompletionDetail parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.CompletionDetail parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.CompletionDetail parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.CompletionDetail parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.CompletionDetail parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.CompletionDetail parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.CompletionDetail parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.CompletionDetail parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.CompletionDetail parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2.CompletionDetail prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Detailed completion information including completion attribution token and
+   * clicked completion info.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2.CompletionDetail} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.CompletionDetail) + com.google.cloud.retail.v2.CompletionDetailOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.UserEventProto + .internal_static_google_cloud_retail_v2_CompletionDetail_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.UserEventProto + .internal_static_google_cloud_retail_v2_CompletionDetail_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.CompletionDetail.class, + com.google.cloud.retail.v2.CompletionDetail.Builder.class); + } + + // Construct using com.google.cloud.retail.v2.CompletionDetail.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + completionAttributionToken_ = ""; + + selectedSuggestion_ = ""; + + selectedPosition_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2.UserEventProto + .internal_static_google_cloud_retail_v2_CompletionDetail_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2.CompletionDetail getDefaultInstanceForType() { + return com.google.cloud.retail.v2.CompletionDetail.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2.CompletionDetail build() { + com.google.cloud.retail.v2.CompletionDetail result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2.CompletionDetail buildPartial() { + com.google.cloud.retail.v2.CompletionDetail result = + new com.google.cloud.retail.v2.CompletionDetail(this); + result.completionAttributionToken_ = completionAttributionToken_; + result.selectedSuggestion_ = selectedSuggestion_; + result.selectedPosition_ = selectedPosition_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.retail.v2.CompletionDetail) { + return mergeFrom((com.google.cloud.retail.v2.CompletionDetail) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2.CompletionDetail other) { + if (other == com.google.cloud.retail.v2.CompletionDetail.getDefaultInstance()) return this; + if (!other.getCompletionAttributionToken().isEmpty()) { + completionAttributionToken_ = other.completionAttributionToken_; + onChanged(); + } + if (!other.getSelectedSuggestion().isEmpty()) { + selectedSuggestion_ = other.selectedSuggestion_; + onChanged(); + } + if (other.getSelectedPosition() != 0) { + setSelectedPosition(other.getSelectedPosition()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.retail.v2.CompletionDetail parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2.CompletionDetail) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object completionAttributionToken_ = ""; + /** + * + * + *
+     * Completion attribution token in
+     * [CompleteQueryResponse.attribution_token][google.cloud.retail.v2.CompleteQueryResponse.attribution_token].
+     * 
+ * + * string completion_attribution_token = 1; + * + * @return The completionAttributionToken. + */ + public java.lang.String getCompletionAttributionToken() { + java.lang.Object ref = completionAttributionToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + completionAttributionToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Completion attribution token in
+     * [CompleteQueryResponse.attribution_token][google.cloud.retail.v2.CompleteQueryResponse.attribution_token].
+     * 
+ * + * string completion_attribution_token = 1; + * + * @return The bytes for completionAttributionToken. + */ + public com.google.protobuf.ByteString getCompletionAttributionTokenBytes() { + java.lang.Object ref = completionAttributionToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + completionAttributionToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Completion attribution token in
+     * [CompleteQueryResponse.attribution_token][google.cloud.retail.v2.CompleteQueryResponse.attribution_token].
+     * 
+ * + * string completion_attribution_token = 1; + * + * @param value The completionAttributionToken to set. + * @return This builder for chaining. + */ + public Builder setCompletionAttributionToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + completionAttributionToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Completion attribution token in
+     * [CompleteQueryResponse.attribution_token][google.cloud.retail.v2.CompleteQueryResponse.attribution_token].
+     * 
+ * + * string completion_attribution_token = 1; + * + * @return This builder for chaining. + */ + public Builder clearCompletionAttributionToken() { + + completionAttributionToken_ = getDefaultInstance().getCompletionAttributionToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Completion attribution token in
+     * [CompleteQueryResponse.attribution_token][google.cloud.retail.v2.CompleteQueryResponse.attribution_token].
+     * 
+ * + * string completion_attribution_token = 1; + * + * @param value The bytes for completionAttributionToken to set. + * @return This builder for chaining. + */ + public Builder setCompletionAttributionTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + completionAttributionToken_ = value; + onChanged(); + return this; + } + + private java.lang.Object selectedSuggestion_ = ""; + /** + * + * + *
+     * End user selected
+     * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2.CompleteQueryResponse.CompletionResult.suggestion].
+     * 
+ * + * string selected_suggestion = 2; + * + * @return The selectedSuggestion. + */ + public java.lang.String getSelectedSuggestion() { + java.lang.Object ref = selectedSuggestion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + selectedSuggestion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * End user selected
+     * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2.CompleteQueryResponse.CompletionResult.suggestion].
+     * 
+ * + * string selected_suggestion = 2; + * + * @return The bytes for selectedSuggestion. + */ + public com.google.protobuf.ByteString getSelectedSuggestionBytes() { + java.lang.Object ref = selectedSuggestion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + selectedSuggestion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * End user selected
+     * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2.CompleteQueryResponse.CompletionResult.suggestion].
+     * 
+ * + * string selected_suggestion = 2; + * + * @param value The selectedSuggestion to set. + * @return This builder for chaining. + */ + public Builder setSelectedSuggestion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + selectedSuggestion_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * End user selected
+     * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2.CompleteQueryResponse.CompletionResult.suggestion].
+     * 
+ * + * string selected_suggestion = 2; + * + * @return This builder for chaining. + */ + public Builder clearSelectedSuggestion() { + + selectedSuggestion_ = getDefaultInstance().getSelectedSuggestion(); + onChanged(); + return this; + } + /** + * + * + *
+     * End user selected
+     * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2.CompleteQueryResponse.CompletionResult.suggestion].
+     * 
+ * + * string selected_suggestion = 2; + * + * @param value The bytes for selectedSuggestion to set. + * @return This builder for chaining. + */ + public Builder setSelectedSuggestionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + selectedSuggestion_ = value; + onChanged(); + return this; + } + + private int selectedPosition_; + /** + * + * + *
+     * End user selected
+     * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2.CompleteQueryResponse.CompletionResult.suggestion]
+     * position, starting from 0.
+     * 
+ * + * int32 selected_position = 3; + * + * @return The selectedPosition. + */ + @java.lang.Override + public int getSelectedPosition() { + return selectedPosition_; + } + /** + * + * + *
+     * End user selected
+     * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2.CompleteQueryResponse.CompletionResult.suggestion]
+     * position, starting from 0.
+     * 
+ * + * int32 selected_position = 3; + * + * @param value The selectedPosition to set. + * @return This builder for chaining. + */ + public Builder setSelectedPosition(int value) { + + selectedPosition_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * End user selected
+     * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2.CompleteQueryResponse.CompletionResult.suggestion]
+     * position, starting from 0.
+     * 
+ * + * int32 selected_position = 3; + * + * @return This builder for chaining. + */ + public Builder clearSelectedPosition() { + + selectedPosition_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.CompletionDetail) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.CompletionDetail) + private static final com.google.cloud.retail.v2.CompletionDetail DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2.CompletionDetail(); + } + + public static com.google.cloud.retail.v2.CompletionDetail getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CompletionDetail parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CompletionDetail(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.retail.v2.CompletionDetail getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CompletionDetailOrBuilder.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CompletionDetailOrBuilder.java new file mode 100644 index 00000000..6941bd92 --- /dev/null +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CompletionDetailOrBuilder.java @@ -0,0 +1,94 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2/user_event.proto + +package com.google.cloud.retail.v2; + +public interface CompletionDetailOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2.CompletionDetail) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Completion attribution token in
+   * [CompleteQueryResponse.attribution_token][google.cloud.retail.v2.CompleteQueryResponse.attribution_token].
+   * 
+ * + * string completion_attribution_token = 1; + * + * @return The completionAttributionToken. + */ + java.lang.String getCompletionAttributionToken(); + /** + * + * + *
+   * Completion attribution token in
+   * [CompleteQueryResponse.attribution_token][google.cloud.retail.v2.CompleteQueryResponse.attribution_token].
+   * 
+ * + * string completion_attribution_token = 1; + * + * @return The bytes for completionAttributionToken. + */ + com.google.protobuf.ByteString getCompletionAttributionTokenBytes(); + + /** + * + * + *
+   * End user selected
+   * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2.CompleteQueryResponse.CompletionResult.suggestion].
+   * 
+ * + * string selected_suggestion = 2; + * + * @return The selectedSuggestion. + */ + java.lang.String getSelectedSuggestion(); + /** + * + * + *
+   * End user selected
+   * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2.CompleteQueryResponse.CompletionResult.suggestion].
+   * 
+ * + * string selected_suggestion = 2; + * + * @return The bytes for selectedSuggestion. + */ + com.google.protobuf.ByteString getSelectedSuggestionBytes(); + + /** + * + * + *
+   * End user selected
+   * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2.CompleteQueryResponse.CompletionResult.suggestion]
+   * position, starting from 0.
+   * 
+ * + * int32 selected_position = 3; + * + * @return The selectedPosition. + */ + int getSelectedPosition(); +} diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CompletionServiceProto.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CompletionServiceProto.java new file mode 100644 index 00000000..cfa974d3 --- /dev/null +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CompletionServiceProto.java @@ -0,0 +1,190 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2/completion_service.proto + +package com.google.cloud.retail.v2; + +public final class CompletionServiceProto { + private CompletionServiceProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2_CompleteQueryRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2_CompleteQueryRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2_CompleteQueryResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2_CompleteQueryResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2_CompleteQueryResponse_CompletionResult_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2_CompleteQueryResponse_CompletionResult_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2_CompleteQueryResponse_CompletionResult_AttributesEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2_CompleteQueryResponse_CompletionResult_AttributesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2_CompleteQueryResponse_RecentSearchResult_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2_CompleteQueryResponse_RecentSearchResult_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n/google/cloud/retail/v2/completion_serv" + + "ice.proto\022\026google.cloud.retail.v2\032\034googl" + + "e/api/annotations.proto\032\027google/api/clie" + + "nt.proto\032\037google/api/field_behavior.prot" + + "o\032\031google/api/resource.proto\032#google/clo" + + "ud/retail/v2/common.proto\032*google/cloud/" + + "retail/v2/import_config.proto\032#google/lo" + + "ngrunning/operations.proto\"\315\001\n\024CompleteQ" + + "ueryRequest\0226\n\007catalog\030\001 \001(\tB%\340A\002\372A\037\n\035re" + + "tail.googleapis.com/Catalog\022\022\n\005query\030\002 \001" + + "(\tB\003\340A\002\022\022\n\nvisitor_id\030\007 \001(\t\022\026\n\016language_" + + "codes\030\003 \003(\t\022\023\n\013device_type\030\004 \001(\t\022\017\n\007data" + + "set\030\006 \001(\t\022\027\n\017max_suggestions\030\005 \001(\005\"\205\004\n\025C" + + "ompleteQueryResponse\022Z\n\022completion_resul" + + "ts\030\001 \003(\0132>.google.cloud.retail.v2.Comple" + + "teQueryResponse.CompletionResult\022\031\n\021attr" + + "ibution_token\030\002 \001(\t\022_\n\025recent_search_res" + + "ults\030\003 \003(\0132@.google.cloud.retail.v2.Comp" + + "leteQueryResponse.RecentSearchResult\032\346\001\n" + + "\020CompletionResult\022\022\n\nsuggestion\030\001 \001(\t\022b\n" + + "\nattributes\030\002 \003(\0132N.google.cloud.retail." + + "v2.CompleteQueryResponse.CompletionResul" + + "t.AttributesEntry\032Z\n\017AttributesEntry\022\013\n\003" + + "key\030\001 \001(\t\0226\n\005value\030\002 \001(\0132\'.google.cloud." + + "retail.v2.CustomAttribute:\0028\001\032+\n\022RecentS" + + "earchResult\022\025\n\rrecent_search\030\001 \001(\t2\262\004\n\021C" + + "ompletionService\022\263\001\n\rCompleteQuery\022,.goo" + + "gle.cloud.retail.v2.CompleteQueryRequest" + + "\032-.google.cloud.retail.v2.CompleteQueryR" + + "esponse\"E\202\323\344\223\002?\022=/v2/{catalog=projects/*" + + "/locations/*/catalogs/*}:completeQuery\022\233" + + "\002\n\024ImportCompletionData\0223.google.cloud.r" + + "etail.v2.ImportCompletionDataRequest\032\035.g" + + "oogle.longrunning.Operation\"\256\001\202\323\344\223\002I\"D/v" + + "2/{parent=projects/*/locations/*/catalog" + + "s/*}/completionData:import:\001*\312A\\\n3google" + + ".cloud.retail.v2.ImportCompletionDataRes" + + "ponse\022%google.cloud.retail.v2.ImportMeta" + + "data\032I\312A\025retail.googleapis.com\322A.https:/" + + "/www.googleapis.com/auth/cloud-platformB" + + "\313\001\n\032com.google.cloud.retail.v2B\026Completi" + + "onServiceProtoP\001Z * A custom attribute that is not explicitly modeled in - * [Product][google.cloud.retail.v2.Product]]. + * [Product][google.cloud.retail.v2.Product]. * * * Protobuf type {@code google.cloud.retail.v2.CustomAttribute} @@ -106,6 +106,18 @@ private CustomAttribute( input.popLimit(limit); break; } + case 24: + { + bitField0_ |= 0x00000001; + searchable_ = input.readBool(); + break; + } + case 32: + { + bitField0_ |= 0x00000002; + indexable_ = input.readBool(); + break; + } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -146,6 +158,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.cloud.retail.v2.CustomAttribute.Builder.class); } + private int bitField0_; public static final int TEXT_FIELD_NUMBER = 1; private com.google.protobuf.LazyStringList text_; /** @@ -302,6 +315,96 @@ public double getNumbers(int index) { private int numbersMemoizedSerializedSize = -1; + public static final int SEARCHABLE_FIELD_NUMBER = 3; + private boolean searchable_; + /** + * + * + *
+   * 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].
+   * Only set if type [text][google.cloud.retail.v2.CustomAttribute.text] is
+   * set. Otherwise, a INVALID_ARGUMENT error is returned.
+   * 
+ * + * bool searchable = 3; + * + * @return Whether the searchable field is set. + */ + @java.lang.Override + public boolean hasSearchable() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * 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].
+   * Only set if type [text][google.cloud.retail.v2.CustomAttribute.text] is
+   * set. Otherwise, a INVALID_ARGUMENT error is returned.
+   * 
+ * + * bool searchable = 3; + * + * @return The searchable. + */ + @java.lang.Override + public boolean getSearchable() { + return searchable_; + } + + public static final int INDEXABLE_FIELD_NUMBER = 4; + private boolean indexable_; + /** + * + * + *
+   * 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].
+   * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter],
+   * [SearchRequest.facet_specs][google.cloud.retail.v2.SearchRequest.facet_specs]
+   * and
+   * [SearchRequest.boost_spec][google.cloud.retail.v2.SearchRequest.boost_spec]
+   * for more details.
+   * 
+ * + * bool indexable = 4; + * + * @return Whether the indexable field is set. + */ + @java.lang.Override + public boolean hasIndexable() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * 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].
+   * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter],
+   * [SearchRequest.facet_specs][google.cloud.retail.v2.SearchRequest.facet_specs]
+   * and
+   * [SearchRequest.boost_spec][google.cloud.retail.v2.SearchRequest.boost_spec]
+   * for more details.
+   * 
+ * + * bool indexable = 4; + * + * @return The indexable. + */ + @java.lang.Override + public boolean getIndexable() { + return indexable_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -327,6 +430,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < numbers_.size(); i++) { output.writeDoubleNoTag(numbers_.getDouble(i)); } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeBool(3, searchable_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeBool(4, indexable_); + } unknownFields.writeTo(output); } @@ -354,6 +463,12 @@ public int getSerializedSize() { } numbersMemoizedSerializedSize = dataSize; } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, searchable_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, indexable_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -372,6 +487,14 @@ public boolean equals(final java.lang.Object obj) { if (!getTextList().equals(other.getTextList())) return false; if (!getNumbersList().equals(other.getNumbersList())) return false; + if (hasSearchable() != other.hasSearchable()) return false; + if (hasSearchable()) { + if (getSearchable() != other.getSearchable()) return false; + } + if (hasIndexable() != other.hasIndexable()) return false; + if (hasIndexable()) { + if (getIndexable() != other.getIndexable()) return false; + } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -391,6 +514,14 @@ public int hashCode() { hash = (37 * hash) + NUMBERS_FIELD_NUMBER; hash = (53 * hash) + getNumbersList().hashCode(); } + if (hasSearchable()) { + hash = (37 * hash) + SEARCHABLE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSearchable()); + } + if (hasIndexable()) { + hash = (37 * hash) + INDEXABLE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIndexable()); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -496,7 +627,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * *
    * A custom attribute that is not explicitly modeled in
-   * [Product][google.cloud.retail.v2.Product]].
+   * [Product][google.cloud.retail.v2.Product].
    * 
* * Protobuf type {@code google.cloud.retail.v2.CustomAttribute} @@ -541,6 +672,10 @@ public Builder clear() { bitField0_ = (bitField0_ & ~0x00000001); numbers_ = emptyDoubleList(); bitField0_ = (bitField0_ & ~0x00000002); + searchable_ = false; + bitField0_ = (bitField0_ & ~0x00000004); + indexable_ = false; + bitField0_ = (bitField0_ & ~0x00000008); return this; } @@ -569,6 +704,7 @@ public com.google.cloud.retail.v2.CustomAttribute buildPartial() { com.google.cloud.retail.v2.CustomAttribute result = new com.google.cloud.retail.v2.CustomAttribute(this); int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; if (((bitField0_ & 0x00000001) != 0)) { text_ = text_.getUnmodifiableView(); bitField0_ = (bitField0_ & ~0x00000001); @@ -579,6 +715,15 @@ public com.google.cloud.retail.v2.CustomAttribute buildPartial() { bitField0_ = (bitField0_ & ~0x00000002); } result.numbers_ = numbers_; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.searchable_ = searchable_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.indexable_ = indexable_; + to_bitField0_ |= 0x00000002; + } + result.bitField0_ = to_bitField0_; onBuilt(); return result; } @@ -648,6 +793,12 @@ public Builder mergeFrom(com.google.cloud.retail.v2.CustomAttribute other) { } onChanged(); } + if (other.hasSearchable()) { + setSearchable(other.getSearchable()); + } + if (other.hasIndexable()) { + setIndexable(other.getIndexable()); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -1078,6 +1229,188 @@ public Builder clearNumbers() { return this; } + private boolean searchable_; + /** + * + * + *
+     * 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].
+     * Only set if type [text][google.cloud.retail.v2.CustomAttribute.text] is
+     * set. Otherwise, a INVALID_ARGUMENT error is returned.
+     * 
+ * + * bool searchable = 3; + * + * @return Whether the searchable field is set. + */ + @java.lang.Override + public boolean hasSearchable() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * 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].
+     * Only set if type [text][google.cloud.retail.v2.CustomAttribute.text] is
+     * set. Otherwise, a INVALID_ARGUMENT error is returned.
+     * 
+ * + * bool searchable = 3; + * + * @return The searchable. + */ + @java.lang.Override + public boolean getSearchable() { + return searchable_; + } + /** + * + * + *
+     * 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].
+     * Only set if type [text][google.cloud.retail.v2.CustomAttribute.text] is
+     * set. Otherwise, a INVALID_ARGUMENT error is returned.
+     * 
+ * + * bool searchable = 3; + * + * @param value The searchable to set. + * @return This builder for chaining. + */ + public Builder setSearchable(boolean value) { + bitField0_ |= 0x00000004; + searchable_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 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].
+     * Only set if type [text][google.cloud.retail.v2.CustomAttribute.text] is
+     * set. Otherwise, a INVALID_ARGUMENT error is returned.
+     * 
+ * + * bool searchable = 3; + * + * @return This builder for chaining. + */ + public Builder clearSearchable() { + bitField0_ = (bitField0_ & ~0x00000004); + searchable_ = false; + onChanged(); + return this; + } + + private boolean indexable_; + /** + * + * + *
+     * 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].
+     * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter],
+     * [SearchRequest.facet_specs][google.cloud.retail.v2.SearchRequest.facet_specs]
+     * and
+     * [SearchRequest.boost_spec][google.cloud.retail.v2.SearchRequest.boost_spec]
+     * for more details.
+     * 
+ * + * bool indexable = 4; + * + * @return Whether the indexable field is set. + */ + @java.lang.Override + public boolean hasIndexable() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * 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].
+     * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter],
+     * [SearchRequest.facet_specs][google.cloud.retail.v2.SearchRequest.facet_specs]
+     * and
+     * [SearchRequest.boost_spec][google.cloud.retail.v2.SearchRequest.boost_spec]
+     * for more details.
+     * 
+ * + * bool indexable = 4; + * + * @return The indexable. + */ + @java.lang.Override + public boolean getIndexable() { + return indexable_; + } + /** + * + * + *
+     * 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].
+     * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter],
+     * [SearchRequest.facet_specs][google.cloud.retail.v2.SearchRequest.facet_specs]
+     * and
+     * [SearchRequest.boost_spec][google.cloud.retail.v2.SearchRequest.boost_spec]
+     * for more details.
+     * 
+ * + * bool indexable = 4; + * + * @param value The indexable to set. + * @return This builder for chaining. + */ + public Builder setIndexable(boolean value) { + bitField0_ |= 0x00000008; + indexable_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 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].
+     * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter],
+     * [SearchRequest.facet_specs][google.cloud.retail.v2.SearchRequest.facet_specs]
+     * and
+     * [SearchRequest.boost_spec][google.cloud.retail.v2.SearchRequest.boost_spec]
+     * for more details.
+     * 
+ * + * bool indexable = 4; + * + * @return This builder for chaining. + */ + public Builder clearIndexable() { + bitField0_ = (bitField0_ & ~0x00000008); + indexable_ = false; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CustomAttributeOrBuilder.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CustomAttributeOrBuilder.java index 73b49c84..b4abb178 100644 --- a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CustomAttributeOrBuilder.java +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CustomAttributeOrBuilder.java @@ -157,4 +157,78 @@ public interface CustomAttributeOrBuilder * @return The numbers at the given index. */ double getNumbers(int index); + + /** + * + * + *
+   * 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].
+   * Only set if type [text][google.cloud.retail.v2.CustomAttribute.text] is
+   * set. Otherwise, a INVALID_ARGUMENT error is returned.
+   * 
+ * + * bool searchable = 3; + * + * @return Whether the searchable field is set. + */ + boolean hasSearchable(); + /** + * + * + *
+   * 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].
+   * Only set if type [text][google.cloud.retail.v2.CustomAttribute.text] is
+   * set. Otherwise, a INVALID_ARGUMENT error is returned.
+   * 
+ * + * bool searchable = 3; + * + * @return The searchable. + */ + boolean getSearchable(); + + /** + * + * + *
+   * 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].
+   * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter],
+   * [SearchRequest.facet_specs][google.cloud.retail.v2.SearchRequest.facet_specs]
+   * and
+   * [SearchRequest.boost_spec][google.cloud.retail.v2.SearchRequest.boost_spec]
+   * for more details.
+   * 
+ * + * bool indexable = 4; + * + * @return Whether the indexable field is set. + */ + boolean hasIndexable(); + /** + * + * + *
+   * 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].
+   * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter],
+   * [SearchRequest.facet_specs][google.cloud.retail.v2.SearchRequest.facet_specs]
+   * and
+   * [SearchRequest.boost_spec][google.cloud.retail.v2.SearchRequest.boost_spec]
+   * for more details.
+   * 
+ * + * bool indexable = 4; + * + * @return The indexable. + */ + boolean getIndexable(); } diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/DeleteProductRequest.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/DeleteProductRequest.java index 7115e0fe..aa7158eb 100644 --- a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/DeleteProductRequest.java +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/DeleteProductRequest.java @@ -125,6 +125,15 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * exists, a PERMISSION_DENIED error is returned. * If the [Product][google.cloud.retail.v2.Product] to delete does not exist, * a NOT_FOUND error is returned. + * The [Product][google.cloud.retail.v2.Product] to delete can neither be a + * [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION] + * [Product][google.cloud.retail.v2.Product] member nor a + * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] + * [Product][google.cloud.retail.v2.Product] with more than one + * [variants][google.cloud.retail.v2.Product.Type.VARIANT]. Otherwise, an + * INVALID_ARGUMENT error is returned. + * All inventory information for the named + * [Product][google.cloud.retail.v2.Product] will be deleted. * * * @@ -157,6 +166,15 @@ public java.lang.String getName() { * exists, a PERMISSION_DENIED error is returned. * If the [Product][google.cloud.retail.v2.Product] to delete does not exist, * a NOT_FOUND error is returned. + * The [Product][google.cloud.retail.v2.Product] to delete can neither be a + * [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION] + * [Product][google.cloud.retail.v2.Product] member nor a + * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] + * [Product][google.cloud.retail.v2.Product] with more than one + * [variants][google.cloud.retail.v2.Product.Type.VARIANT]. Otherwise, an + * INVALID_ARGUMENT error is returned. + * All inventory information for the named + * [Product][google.cloud.retail.v2.Product] will be deleted. * * * @@ -508,6 +526,15 @@ public Builder mergeFrom( * exists, a PERMISSION_DENIED error is returned. * If the [Product][google.cloud.retail.v2.Product] to delete does not exist, * a NOT_FOUND error is returned. + * The [Product][google.cloud.retail.v2.Product] to delete can neither be a + * [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION] + * [Product][google.cloud.retail.v2.Product] member nor a + * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] + * [Product][google.cloud.retail.v2.Product] with more than one + * [variants][google.cloud.retail.v2.Product.Type.VARIANT]. Otherwise, an + * INVALID_ARGUMENT error is returned. + * All inventory information for the named + * [Product][google.cloud.retail.v2.Product] will be deleted. * * * @@ -539,6 +566,15 @@ public java.lang.String getName() { * exists, a PERMISSION_DENIED error is returned. * If the [Product][google.cloud.retail.v2.Product] to delete does not exist, * a NOT_FOUND error is returned. + * The [Product][google.cloud.retail.v2.Product] to delete can neither be a + * [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION] + * [Product][google.cloud.retail.v2.Product] member nor a + * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] + * [Product][google.cloud.retail.v2.Product] with more than one + * [variants][google.cloud.retail.v2.Product.Type.VARIANT]. Otherwise, an + * INVALID_ARGUMENT error is returned. + * All inventory information for the named + * [Product][google.cloud.retail.v2.Product] will be deleted. * * * @@ -570,6 +606,15 @@ public com.google.protobuf.ByteString getNameBytes() { * exists, a PERMISSION_DENIED error is returned. * If the [Product][google.cloud.retail.v2.Product] to delete does not exist, * a NOT_FOUND error is returned. + * The [Product][google.cloud.retail.v2.Product] to delete can neither be a + * [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION] + * [Product][google.cloud.retail.v2.Product] member nor a + * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] + * [Product][google.cloud.retail.v2.Product] with more than one + * [variants][google.cloud.retail.v2.Product.Type.VARIANT]. Otherwise, an + * INVALID_ARGUMENT error is returned. + * All inventory information for the named + * [Product][google.cloud.retail.v2.Product] will be deleted. * * * @@ -600,6 +645,15 @@ public Builder setName(java.lang.String value) { * exists, a PERMISSION_DENIED error is returned. * If the [Product][google.cloud.retail.v2.Product] to delete does not exist, * a NOT_FOUND error is returned. + * The [Product][google.cloud.retail.v2.Product] to delete can neither be a + * [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION] + * [Product][google.cloud.retail.v2.Product] member nor a + * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] + * [Product][google.cloud.retail.v2.Product] with more than one + * [variants][google.cloud.retail.v2.Product.Type.VARIANT]. Otherwise, an + * INVALID_ARGUMENT error is returned. + * All inventory information for the named + * [Product][google.cloud.retail.v2.Product] will be deleted. * * * @@ -626,6 +680,15 @@ public Builder clearName() { * exists, a PERMISSION_DENIED error is returned. * If the [Product][google.cloud.retail.v2.Product] to delete does not exist, * a NOT_FOUND error is returned. + * The [Product][google.cloud.retail.v2.Product] to delete can neither be a + * [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION] + * [Product][google.cloud.retail.v2.Product] member nor a + * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] + * [Product][google.cloud.retail.v2.Product] with more than one + * [variants][google.cloud.retail.v2.Product.Type.VARIANT]. Otherwise, an + * INVALID_ARGUMENT error is returned. + * All inventory information for the named + * [Product][google.cloud.retail.v2.Product] will be deleted. * * * diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/DeleteProductRequestOrBuilder.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/DeleteProductRequestOrBuilder.java index 591a2f42..196f1e4b 100644 --- a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/DeleteProductRequestOrBuilder.java +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/DeleteProductRequestOrBuilder.java @@ -35,6 +35,15 @@ public interface DeleteProductRequestOrBuilder * exists, a PERMISSION_DENIED error is returned. * If the [Product][google.cloud.retail.v2.Product] to delete does not exist, * a NOT_FOUND error is returned. + * The [Product][google.cloud.retail.v2.Product] to delete can neither be a + * [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION] + * [Product][google.cloud.retail.v2.Product] member nor a + * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] + * [Product][google.cloud.retail.v2.Product] with more than one + * [variants][google.cloud.retail.v2.Product.Type.VARIANT]. Otherwise, an + * INVALID_ARGUMENT error is returned. + * All inventory information for the named + * [Product][google.cloud.retail.v2.Product] will be deleted. * * * @@ -56,6 +65,15 @@ public interface DeleteProductRequestOrBuilder * exists, a PERMISSION_DENIED error is returned. * If the [Product][google.cloud.retail.v2.Product] to delete does not exist, * a NOT_FOUND error is returned. + * The [Product][google.cloud.retail.v2.Product] to delete can neither be a + * [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION] + * [Product][google.cloud.retail.v2.Product] member nor a + * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] + * [Product][google.cloud.retail.v2.Product] with more than one + * [variants][google.cloud.retail.v2.Product.Type.VARIANT]. Otherwise, an + * INVALID_ARGUMENT error is returned. + * All inventory information for the named + * [Product][google.cloud.retail.v2.Product] will be deleted. * * * diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/FulfillmentInfo.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/FulfillmentInfo.java new file mode 100644 index 00000000..ba33f0cc --- /dev/null +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/FulfillmentInfo.java @@ -0,0 +1,1105 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2/common.proto + +package com.google.cloud.retail.v2; + +/** + * + * + *
+ * Fulfillment information, such as the store IDs for in-store pickup or region
+ * IDs for different shipping methods.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2.FulfillmentInfo} + */ +public final class FulfillmentInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.FulfillmentInfo) + FulfillmentInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use FulfillmentInfo.newBuilder() to construct. + private FulfillmentInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FulfillmentInfo() { + type_ = ""; + placeIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FulfillmentInfo(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private FulfillmentInfo( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + type_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + placeIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + placeIds_.add(s); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + placeIds_ = placeIds_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.CommonProto + .internal_static_google_cloud_retail_v2_FulfillmentInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.CommonProto + .internal_static_google_cloud_retail_v2_FulfillmentInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.FulfillmentInfo.class, + com.google.cloud.retail.v2.FulfillmentInfo.Builder.class); + } + + public static final int TYPE_FIELD_NUMBER = 1; + private volatile java.lang.Object type_; + /** + * + * + *
+   * The fulfillment type, including 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.
+   * 
+ * + * string type = 1; + * + * @return The type. + */ + @java.lang.Override + public java.lang.String getType() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } + } + /** + * + * + *
+   * The fulfillment type, including 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.
+   * 
+ * + * string type = 1; + * + * @return The bytes for type. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PLACE_IDS_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList placeIds_; + /** + * + * + *
+   * The IDs for this [type][google.cloud.retail.v2.FulfillmentInfo.type], such
+   * as the store IDs for
+   * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2.FulfillmentInfo.type]
+   * or the region IDs for
+   * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2.FulfillmentInfo.type].
+   * A maximum of 2000 values are allowed. Each value must be a string with a
+   * length limit of 10 characters, matching the pattern [a-zA-Z0-9_-]+, such as
+   * "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string place_ids = 2; + * + * @return A list containing the placeIds. + */ + public com.google.protobuf.ProtocolStringList getPlaceIdsList() { + return placeIds_; + } + /** + * + * + *
+   * The IDs for this [type][google.cloud.retail.v2.FulfillmentInfo.type], such
+   * as the store IDs for
+   * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2.FulfillmentInfo.type]
+   * or the region IDs for
+   * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2.FulfillmentInfo.type].
+   * A maximum of 2000 values are allowed. Each value must be a string with a
+   * length limit of 10 characters, matching the pattern [a-zA-Z0-9_-]+, such as
+   * "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string place_ids = 2; + * + * @return The count of placeIds. + */ + public int getPlaceIdsCount() { + return placeIds_.size(); + } + /** + * + * + *
+   * The IDs for this [type][google.cloud.retail.v2.FulfillmentInfo.type], such
+   * as the store IDs for
+   * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2.FulfillmentInfo.type]
+   * or the region IDs for
+   * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2.FulfillmentInfo.type].
+   * A maximum of 2000 values are allowed. Each value must be a string with a
+   * length limit of 10 characters, matching the pattern [a-zA-Z0-9_-]+, such as
+   * "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string place_ids = 2; + * + * @param index The index of the element to return. + * @return The placeIds at the given index. + */ + public java.lang.String getPlaceIds(int index) { + return placeIds_.get(index); + } + /** + * + * + *
+   * The IDs for this [type][google.cloud.retail.v2.FulfillmentInfo.type], such
+   * as the store IDs for
+   * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2.FulfillmentInfo.type]
+   * or the region IDs for
+   * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2.FulfillmentInfo.type].
+   * A maximum of 2000 values are allowed. Each value must be a string with a
+   * length limit of 10 characters, matching the pattern [a-zA-Z0-9_-]+, such as
+   * "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string place_ids = 2; + * + * @param index The index of the value to return. + * @return The bytes of the placeIds at the given index. + */ + public com.google.protobuf.ByteString getPlaceIdsBytes(int index) { + return placeIds_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, type_); + } + for (int i = 0; i < placeIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, placeIds_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, type_); + } + { + int dataSize = 0; + for (int i = 0; i < placeIds_.size(); i++) { + dataSize += computeStringSizeNoTag(placeIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getPlaceIdsList().size(); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.retail.v2.FulfillmentInfo)) { + return super.equals(obj); + } + com.google.cloud.retail.v2.FulfillmentInfo other = + (com.google.cloud.retail.v2.FulfillmentInfo) obj; + + if (!getType().equals(other.getType())) return false; + if (!getPlaceIdsList().equals(other.getPlaceIdsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + if (getPlaceIdsCount() > 0) { + hash = (37 * hash) + PLACE_IDS_FIELD_NUMBER; + hash = (53 * hash) + getPlaceIdsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2.FulfillmentInfo parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.FulfillmentInfo parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.FulfillmentInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.FulfillmentInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.FulfillmentInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.FulfillmentInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.FulfillmentInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.FulfillmentInfo parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.FulfillmentInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.FulfillmentInfo parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.FulfillmentInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.FulfillmentInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2.FulfillmentInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Fulfillment information, such as the store IDs for in-store pickup or region
+   * IDs for different shipping methods.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2.FulfillmentInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.FulfillmentInfo) + com.google.cloud.retail.v2.FulfillmentInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.CommonProto + .internal_static_google_cloud_retail_v2_FulfillmentInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.CommonProto + .internal_static_google_cloud_retail_v2_FulfillmentInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.FulfillmentInfo.class, + com.google.cloud.retail.v2.FulfillmentInfo.Builder.class); + } + + // Construct using com.google.cloud.retail.v2.FulfillmentInfo.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + type_ = ""; + + placeIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2.CommonProto + .internal_static_google_cloud_retail_v2_FulfillmentInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2.FulfillmentInfo getDefaultInstanceForType() { + return com.google.cloud.retail.v2.FulfillmentInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2.FulfillmentInfo build() { + com.google.cloud.retail.v2.FulfillmentInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2.FulfillmentInfo buildPartial() { + com.google.cloud.retail.v2.FulfillmentInfo result = + new com.google.cloud.retail.v2.FulfillmentInfo(this); + int from_bitField0_ = bitField0_; + result.type_ = type_; + if (((bitField0_ & 0x00000001) != 0)) { + placeIds_ = placeIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.placeIds_ = placeIds_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.retail.v2.FulfillmentInfo) { + return mergeFrom((com.google.cloud.retail.v2.FulfillmentInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2.FulfillmentInfo other) { + if (other == com.google.cloud.retail.v2.FulfillmentInfo.getDefaultInstance()) return this; + if (!other.getType().isEmpty()) { + type_ = other.type_; + onChanged(); + } + if (!other.placeIds_.isEmpty()) { + if (placeIds_.isEmpty()) { + placeIds_ = other.placeIds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePlaceIdsIsMutable(); + placeIds_.addAll(other.placeIds_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.retail.v2.FulfillmentInfo parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2.FulfillmentInfo) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object type_ = ""; + /** + * + * + *
+     * The fulfillment type, including 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.
+     * 
+ * + * string type = 1; + * + * @return The type. + */ + public java.lang.String getType() { + java.lang.Object ref = type_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The fulfillment type, including 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.
+     * 
+ * + * string type = 1; + * + * @return The bytes for type. + */ + public com.google.protobuf.ByteString getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The fulfillment type, including 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.
+     * 
+ * + * string type = 1; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + type_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The fulfillment type, including 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.
+     * 
+ * + * string type = 1; + * + * @return This builder for chaining. + */ + public Builder clearType() { + + type_ = getDefaultInstance().getType(); + onChanged(); + return this; + } + /** + * + * + *
+     * The fulfillment type, including 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.
+     * 
+ * + * string type = 1; + * + * @param value The bytes for type to set. + * @return This builder for chaining. + */ + public Builder setTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + type_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList placeIds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensurePlaceIdsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + placeIds_ = new com.google.protobuf.LazyStringArrayList(placeIds_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * The IDs for this [type][google.cloud.retail.v2.FulfillmentInfo.type], such
+     * as the store IDs for
+     * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2.FulfillmentInfo.type]
+     * or the region IDs for
+     * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2.FulfillmentInfo.type].
+     * A maximum of 2000 values are allowed. Each value must be a string with a
+     * length limit of 10 characters, matching the pattern [a-zA-Z0-9_-]+, such as
+     * "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string place_ids = 2; + * + * @return A list containing the placeIds. + */ + public com.google.protobuf.ProtocolStringList getPlaceIdsList() { + return placeIds_.getUnmodifiableView(); + } + /** + * + * + *
+     * The IDs for this [type][google.cloud.retail.v2.FulfillmentInfo.type], such
+     * as the store IDs for
+     * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2.FulfillmentInfo.type]
+     * or the region IDs for
+     * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2.FulfillmentInfo.type].
+     * A maximum of 2000 values are allowed. Each value must be a string with a
+     * length limit of 10 characters, matching the pattern [a-zA-Z0-9_-]+, such as
+     * "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string place_ids = 2; + * + * @return The count of placeIds. + */ + public int getPlaceIdsCount() { + return placeIds_.size(); + } + /** + * + * + *
+     * The IDs for this [type][google.cloud.retail.v2.FulfillmentInfo.type], such
+     * as the store IDs for
+     * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2.FulfillmentInfo.type]
+     * or the region IDs for
+     * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2.FulfillmentInfo.type].
+     * A maximum of 2000 values are allowed. Each value must be a string with a
+     * length limit of 10 characters, matching the pattern [a-zA-Z0-9_-]+, such as
+     * "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string place_ids = 2; + * + * @param index The index of the element to return. + * @return The placeIds at the given index. + */ + public java.lang.String getPlaceIds(int index) { + return placeIds_.get(index); + } + /** + * + * + *
+     * The IDs for this [type][google.cloud.retail.v2.FulfillmentInfo.type], such
+     * as the store IDs for
+     * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2.FulfillmentInfo.type]
+     * or the region IDs for
+     * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2.FulfillmentInfo.type].
+     * A maximum of 2000 values are allowed. Each value must be a string with a
+     * length limit of 10 characters, matching the pattern [a-zA-Z0-9_-]+, such as
+     * "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string place_ids = 2; + * + * @param index The index of the value to return. + * @return The bytes of the placeIds at the given index. + */ + public com.google.protobuf.ByteString getPlaceIdsBytes(int index) { + return placeIds_.getByteString(index); + } + /** + * + * + *
+     * The IDs for this [type][google.cloud.retail.v2.FulfillmentInfo.type], such
+     * as the store IDs for
+     * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2.FulfillmentInfo.type]
+     * or the region IDs for
+     * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2.FulfillmentInfo.type].
+     * A maximum of 2000 values are allowed. Each value must be a string with a
+     * length limit of 10 characters, matching the pattern [a-zA-Z0-9_-]+, such as
+     * "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string place_ids = 2; + * + * @param index The index to set the value at. + * @param value The placeIds to set. + * @return This builder for chaining. + */ + public Builder setPlaceIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePlaceIdsIsMutable(); + placeIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The IDs for this [type][google.cloud.retail.v2.FulfillmentInfo.type], such
+     * as the store IDs for
+     * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2.FulfillmentInfo.type]
+     * or the region IDs for
+     * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2.FulfillmentInfo.type].
+     * A maximum of 2000 values are allowed. Each value must be a string with a
+     * length limit of 10 characters, matching the pattern [a-zA-Z0-9_-]+, such as
+     * "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string place_ids = 2; + * + * @param value The placeIds to add. + * @return This builder for chaining. + */ + public Builder addPlaceIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePlaceIdsIsMutable(); + placeIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The IDs for this [type][google.cloud.retail.v2.FulfillmentInfo.type], such
+     * as the store IDs for
+     * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2.FulfillmentInfo.type]
+     * or the region IDs for
+     * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2.FulfillmentInfo.type].
+     * A maximum of 2000 values are allowed. Each value must be a string with a
+     * length limit of 10 characters, matching the pattern [a-zA-Z0-9_-]+, such as
+     * "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string place_ids = 2; + * + * @param values The placeIds to add. + * @return This builder for chaining. + */ + public Builder addAllPlaceIds(java.lang.Iterable values) { + ensurePlaceIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, placeIds_); + onChanged(); + return this; + } + /** + * + * + *
+     * The IDs for this [type][google.cloud.retail.v2.FulfillmentInfo.type], such
+     * as the store IDs for
+     * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2.FulfillmentInfo.type]
+     * or the region IDs for
+     * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2.FulfillmentInfo.type].
+     * A maximum of 2000 values are allowed. Each value must be a string with a
+     * length limit of 10 characters, matching the pattern [a-zA-Z0-9_-]+, such as
+     * "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string place_ids = 2; + * + * @return This builder for chaining. + */ + public Builder clearPlaceIds() { + placeIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The IDs for this [type][google.cloud.retail.v2.FulfillmentInfo.type], such
+     * as the store IDs for
+     * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2.FulfillmentInfo.type]
+     * or the region IDs for
+     * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2.FulfillmentInfo.type].
+     * A maximum of 2000 values are allowed. Each value must be a string with a
+     * length limit of 10 characters, matching the pattern [a-zA-Z0-9_-]+, such as
+     * "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string place_ids = 2; + * + * @param value The bytes of the placeIds to add. + * @return This builder for chaining. + */ + public Builder addPlaceIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensurePlaceIdsIsMutable(); + placeIds_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.FulfillmentInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.FulfillmentInfo) + private static final com.google.cloud.retail.v2.FulfillmentInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2.FulfillmentInfo(); + } + + public static com.google.cloud.retail.v2.FulfillmentInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FulfillmentInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new FulfillmentInfo(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.retail.v2.FulfillmentInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/FulfillmentInfoOrBuilder.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/FulfillmentInfoOrBuilder.java new file mode 100644 index 00000000..4b815d9a --- /dev/null +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/FulfillmentInfoOrBuilder.java @@ -0,0 +1,157 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2/common.proto + +package com.google.cloud.retail.v2; + +public interface FulfillmentInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2.FulfillmentInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The fulfillment type, including 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.
+   * 
+ * + * string type = 1; + * + * @return The type. + */ + java.lang.String getType(); + /** + * + * + *
+   * The fulfillment type, including 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.
+   * 
+ * + * string type = 1; + * + * @return The bytes for type. + */ + com.google.protobuf.ByteString getTypeBytes(); + + /** + * + * + *
+   * The IDs for this [type][google.cloud.retail.v2.FulfillmentInfo.type], such
+   * as the store IDs for
+   * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2.FulfillmentInfo.type]
+   * or the region IDs for
+   * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2.FulfillmentInfo.type].
+   * A maximum of 2000 values are allowed. Each value must be a string with a
+   * length limit of 10 characters, matching the pattern [a-zA-Z0-9_-]+, such as
+   * "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string place_ids = 2; + * + * @return A list containing the placeIds. + */ + java.util.List getPlaceIdsList(); + /** + * + * + *
+   * The IDs for this [type][google.cloud.retail.v2.FulfillmentInfo.type], such
+   * as the store IDs for
+   * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2.FulfillmentInfo.type]
+   * or the region IDs for
+   * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2.FulfillmentInfo.type].
+   * A maximum of 2000 values are allowed. Each value must be a string with a
+   * length limit of 10 characters, matching the pattern [a-zA-Z0-9_-]+, such as
+   * "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string place_ids = 2; + * + * @return The count of placeIds. + */ + int getPlaceIdsCount(); + /** + * + * + *
+   * The IDs for this [type][google.cloud.retail.v2.FulfillmentInfo.type], such
+   * as the store IDs for
+   * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2.FulfillmentInfo.type]
+   * or the region IDs for
+   * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2.FulfillmentInfo.type].
+   * A maximum of 2000 values are allowed. Each value must be a string with a
+   * length limit of 10 characters, matching the pattern [a-zA-Z0-9_-]+, such as
+   * "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string place_ids = 2; + * + * @param index The index of the element to return. + * @return The placeIds at the given index. + */ + java.lang.String getPlaceIds(int index); + /** + * + * + *
+   * The IDs for this [type][google.cloud.retail.v2.FulfillmentInfo.type], such
+   * as the store IDs for
+   * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2.FulfillmentInfo.type]
+   * or the region IDs for
+   * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2.FulfillmentInfo.type].
+   * A maximum of 2000 values are allowed. Each value must be a string with a
+   * length limit of 10 characters, matching the pattern [a-zA-Z0-9_-]+, such as
+   * "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string place_ids = 2; + * + * @param index The index of the value to return. + * @return The bytes of the placeIds at the given index. + */ + com.google.protobuf.ByteString getPlaceIdsBytes(int index); +} diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/GcsSource.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/GcsSource.java index 7423d348..948e5535 100644 --- a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/GcsSource.java +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/GcsSource.java @@ -139,7 +139,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * files, such as `gs://bucket/directory/*.json`. A request can * contain at most 100 files, and each file can be up to 2 GB. See * [Importing product - * information](https://cloud.google.com/recommendations-ai/docs/upload-catalog) + * information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog) * for the expected file format and setup instructions. * * @@ -160,7 +160,7 @@ public com.google.protobuf.ProtocolStringList getInputUrisList() { * files, such as `gs://bucket/directory/*.json`. A request can * contain at most 100 files, and each file can be up to 2 GB. See * [Importing product - * information](https://cloud.google.com/recommendations-ai/docs/upload-catalog) + * information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog) * for the expected file format and setup instructions. * * @@ -181,7 +181,7 @@ public int getInputUrisCount() { * files, such as `gs://bucket/directory/*.json`. A request can * contain at most 100 files, and each file can be up to 2 GB. See * [Importing product - * information](https://cloud.google.com/recommendations-ai/docs/upload-catalog) + * information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog) * for the expected file format and setup instructions. * * @@ -203,7 +203,7 @@ public java.lang.String getInputUris(int index) { * files, such as `gs://bucket/directory/*.json`. A request can * contain at most 100 files, and each file can be up to 2 GB. See * [Importing product - * information](https://cloud.google.com/recommendations-ai/docs/upload-catalog) + * information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog) * for the expected file format and setup instructions. * * @@ -233,7 +233,7 @@ public com.google.protobuf.ByteString getInputUrisBytes(int index) { * * `user_event` (default): One JSON * [UserEvent][google.cloud.retail.v2.UserEvent] per line. * * `user_event_ga360`: Using - * https://support.google.com/analytics/answer/3437719?hl=en. + * https://support.google.com/analytics/answer/3437719. * * * string data_schema = 2; @@ -267,7 +267,7 @@ public java.lang.String getDataSchema() { * * `user_event` (default): One JSON * [UserEvent][google.cloud.retail.v2.UserEvent] per line. * * `user_event_ga360`: Using - * https://support.google.com/analytics/answer/3437719?hl=en. + * https://support.google.com/analytics/answer/3437719. * * * string data_schema = 2; @@ -656,7 +656,7 @@ private void ensureInputUrisIsMutable() { * files, such as `gs://bucket/directory/*.json`. A request can * contain at most 100 files, and each file can be up to 2 GB. See * [Importing product - * information](https://cloud.google.com/recommendations-ai/docs/upload-catalog) + * information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog) * for the expected file format and setup instructions. * * @@ -677,7 +677,7 @@ public com.google.protobuf.ProtocolStringList getInputUrisList() { * files, such as `gs://bucket/directory/*.json`. A request can * contain at most 100 files, and each file can be up to 2 GB. See * [Importing product - * information](https://cloud.google.com/recommendations-ai/docs/upload-catalog) + * information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog) * for the expected file format and setup instructions. * * @@ -698,7 +698,7 @@ public int getInputUrisCount() { * files, such as `gs://bucket/directory/*.json`. A request can * contain at most 100 files, and each file can be up to 2 GB. See * [Importing product - * information](https://cloud.google.com/recommendations-ai/docs/upload-catalog) + * information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog) * for the expected file format and setup instructions. * * @@ -720,7 +720,7 @@ public java.lang.String getInputUris(int index) { * files, such as `gs://bucket/directory/*.json`. A request can * contain at most 100 files, and each file can be up to 2 GB. See * [Importing product - * information](https://cloud.google.com/recommendations-ai/docs/upload-catalog) + * information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog) * for the expected file format and setup instructions. * * @@ -742,7 +742,7 @@ public com.google.protobuf.ByteString getInputUrisBytes(int index) { * files, such as `gs://bucket/directory/*.json`. A request can * contain at most 100 files, and each file can be up to 2 GB. See * [Importing product - * information](https://cloud.google.com/recommendations-ai/docs/upload-catalog) + * information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog) * for the expected file format and setup instructions. * * @@ -771,7 +771,7 @@ public Builder setInputUris(int index, java.lang.String value) { * files, such as `gs://bucket/directory/*.json`. A request can * contain at most 100 files, and each file can be up to 2 GB. See * [Importing product - * information](https://cloud.google.com/recommendations-ai/docs/upload-catalog) + * information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog) * for the expected file format and setup instructions. * * @@ -799,7 +799,7 @@ public Builder addInputUris(java.lang.String value) { * files, such as `gs://bucket/directory/*.json`. A request can * contain at most 100 files, and each file can be up to 2 GB. See * [Importing product - * information](https://cloud.google.com/recommendations-ai/docs/upload-catalog) + * information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog) * for the expected file format and setup instructions. * * @@ -824,7 +824,7 @@ public Builder addAllInputUris(java.lang.Iterable values) { * files, such as `gs://bucket/directory/*.json`. A request can * contain at most 100 files, and each file can be up to 2 GB. See * [Importing product - * information](https://cloud.google.com/recommendations-ai/docs/upload-catalog) + * information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog) * for the expected file format and setup instructions. * * @@ -848,7 +848,7 @@ public Builder clearInputUris() { * files, such as `gs://bucket/directory/*.json`. A request can * contain at most 100 files, and each file can be up to 2 GB. See * [Importing product - * information](https://cloud.google.com/recommendations-ai/docs/upload-catalog) + * information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog) * for the expected file format and setup instructions. * * @@ -884,7 +884,7 @@ public Builder addInputUrisBytes(com.google.protobuf.ByteString value) { * * `user_event` (default): One JSON * [UserEvent][google.cloud.retail.v2.UserEvent] per line. * * `user_event_ga360`: Using - * https://support.google.com/analytics/answer/3437719?hl=en. + * https://support.google.com/analytics/answer/3437719. * * * string data_schema = 2; @@ -917,7 +917,7 @@ public java.lang.String getDataSchema() { * * `user_event` (default): One JSON * [UserEvent][google.cloud.retail.v2.UserEvent] per line. * * `user_event_ga360`: Using - * https://support.google.com/analytics/answer/3437719?hl=en. + * https://support.google.com/analytics/answer/3437719. * * * string data_schema = 2; @@ -950,7 +950,7 @@ public com.google.protobuf.ByteString getDataSchemaBytes() { * * `user_event` (default): One JSON * [UserEvent][google.cloud.retail.v2.UserEvent] per line. * * `user_event_ga360`: Using - * https://support.google.com/analytics/answer/3437719?hl=en. + * https://support.google.com/analytics/answer/3437719. * * * string data_schema = 2; @@ -982,7 +982,7 @@ public Builder setDataSchema(java.lang.String value) { * * `user_event` (default): One JSON * [UserEvent][google.cloud.retail.v2.UserEvent] per line. * * `user_event_ga360`: Using - * https://support.google.com/analytics/answer/3437719?hl=en. + * https://support.google.com/analytics/answer/3437719. * * * string data_schema = 2; @@ -1010,7 +1010,7 @@ public Builder clearDataSchema() { * * `user_event` (default): One JSON * [UserEvent][google.cloud.retail.v2.UserEvent] per line. * * `user_event_ga360`: Using - * https://support.google.com/analytics/answer/3437719?hl=en. + * https://support.google.com/analytics/answer/3437719. * * * string data_schema = 2; diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/GcsSourceOrBuilder.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/GcsSourceOrBuilder.java index 48748153..59ee49eb 100644 --- a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/GcsSourceOrBuilder.java +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/GcsSourceOrBuilder.java @@ -33,7 +33,7 @@ public interface GcsSourceOrBuilder * files, such as `gs://bucket/directory/*.json`. A request can * contain at most 100 files, and each file can be up to 2 GB. See * [Importing product - * information](https://cloud.google.com/recommendations-ai/docs/upload-catalog) + * information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog) * for the expected file format and setup instructions. * * @@ -52,7 +52,7 @@ public interface GcsSourceOrBuilder * files, such as `gs://bucket/directory/*.json`. A request can * contain at most 100 files, and each file can be up to 2 GB. See * [Importing product - * information](https://cloud.google.com/recommendations-ai/docs/upload-catalog) + * information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog) * for the expected file format and setup instructions. * * @@ -71,7 +71,7 @@ public interface GcsSourceOrBuilder * files, such as `gs://bucket/directory/*.json`. A request can * contain at most 100 files, and each file can be up to 2 GB. See * [Importing product - * information](https://cloud.google.com/recommendations-ai/docs/upload-catalog) + * information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog) * for the expected file format and setup instructions. * * @@ -91,7 +91,7 @@ public interface GcsSourceOrBuilder * files, such as `gs://bucket/directory/*.json`. A request can * contain at most 100 files, and each file can be up to 2 GB. See * [Importing product - * information](https://cloud.google.com/recommendations-ai/docs/upload-catalog) + * information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog) * for the expected file format and setup instructions. * * @@ -117,7 +117,7 @@ public interface GcsSourceOrBuilder * * `user_event` (default): One JSON * [UserEvent][google.cloud.retail.v2.UserEvent] per line. * * `user_event_ga360`: Using - * https://support.google.com/analytics/answer/3437719?hl=en. + * https://support.google.com/analytics/answer/3437719. * * * string data_schema = 2; @@ -140,7 +140,7 @@ public interface GcsSourceOrBuilder * * `user_event` (default): One JSON * [UserEvent][google.cloud.retail.v2.UserEvent] per line. * * `user_event_ga360`: Using - * https://support.google.com/analytics/answer/3437719?hl=en. + * https://support.google.com/analytics/answer/3437719. * * * string data_schema = 2; diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/GetDefaultBranchRequest.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/GetDefaultBranchRequest.java new file mode 100644 index 00000000..d6e1543c --- /dev/null +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/GetDefaultBranchRequest.java @@ -0,0 +1,643 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2/catalog_service.proto + +package com.google.cloud.retail.v2; + +/** + * + * + *
+ * Request message to show which branch is currently the default branch.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2.GetDefaultBranchRequest} + */ +public final class GetDefaultBranchRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.GetDefaultBranchRequest) + GetDefaultBranchRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetDefaultBranchRequest.newBuilder() to construct. + private GetDefaultBranchRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetDefaultBranchRequest() { + catalog_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetDefaultBranchRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetDefaultBranchRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + catalog_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.CatalogServiceProto + .internal_static_google_cloud_retail_v2_GetDefaultBranchRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.CatalogServiceProto + .internal_static_google_cloud_retail_v2_GetDefaultBranchRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.GetDefaultBranchRequest.class, + com.google.cloud.retail.v2.GetDefaultBranchRequest.Builder.class); + } + + public static final int CATALOG_FIELD_NUMBER = 1; + private volatile java.lang.Object catalog_; + /** + * + * + *
+   * The parent catalog resource name, such as
+   * `projects/*/locations/global/catalogs/default_catalog`.
+   * 
+ * + * string catalog = 1 [(.google.api.resource_reference) = { ... } + * + * @return The catalog. + */ + @java.lang.Override + public java.lang.String getCatalog() { + java.lang.Object ref = catalog_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + catalog_ = s; + return s; + } + } + /** + * + * + *
+   * The parent catalog resource name, such as
+   * `projects/*/locations/global/catalogs/default_catalog`.
+   * 
+ * + * string catalog = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for catalog. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCatalogBytes() { + java.lang.Object ref = catalog_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + catalog_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getCatalogBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, catalog_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getCatalogBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, catalog_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.retail.v2.GetDefaultBranchRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2.GetDefaultBranchRequest other = + (com.google.cloud.retail.v2.GetDefaultBranchRequest) obj; + + if (!getCatalog().equals(other.getCatalog())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CATALOG_FIELD_NUMBER; + hash = (53 * hash) + getCatalog().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2.GetDefaultBranchRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.GetDefaultBranchRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.GetDefaultBranchRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.GetDefaultBranchRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.GetDefaultBranchRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.GetDefaultBranchRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.GetDefaultBranchRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.GetDefaultBranchRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.GetDefaultBranchRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.GetDefaultBranchRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.GetDefaultBranchRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.GetDefaultBranchRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2.GetDefaultBranchRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message to show which branch is currently the default branch.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2.GetDefaultBranchRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.GetDefaultBranchRequest) + com.google.cloud.retail.v2.GetDefaultBranchRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.CatalogServiceProto + .internal_static_google_cloud_retail_v2_GetDefaultBranchRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.CatalogServiceProto + .internal_static_google_cloud_retail_v2_GetDefaultBranchRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.GetDefaultBranchRequest.class, + com.google.cloud.retail.v2.GetDefaultBranchRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2.GetDefaultBranchRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + catalog_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2.CatalogServiceProto + .internal_static_google_cloud_retail_v2_GetDefaultBranchRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2.GetDefaultBranchRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2.GetDefaultBranchRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2.GetDefaultBranchRequest build() { + com.google.cloud.retail.v2.GetDefaultBranchRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2.GetDefaultBranchRequest buildPartial() { + com.google.cloud.retail.v2.GetDefaultBranchRequest result = + new com.google.cloud.retail.v2.GetDefaultBranchRequest(this); + result.catalog_ = catalog_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.retail.v2.GetDefaultBranchRequest) { + return mergeFrom((com.google.cloud.retail.v2.GetDefaultBranchRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2.GetDefaultBranchRequest other) { + if (other == com.google.cloud.retail.v2.GetDefaultBranchRequest.getDefaultInstance()) + return this; + if (!other.getCatalog().isEmpty()) { + catalog_ = other.catalog_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.retail.v2.GetDefaultBranchRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2.GetDefaultBranchRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object catalog_ = ""; + /** + * + * + *
+     * The parent catalog resource name, such as
+     * `projects/*/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string catalog = 1 [(.google.api.resource_reference) = { ... } + * + * @return The catalog. + */ + public java.lang.String getCatalog() { + java.lang.Object ref = catalog_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + catalog_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The parent catalog resource name, such as
+     * `projects/*/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string catalog = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for catalog. + */ + public com.google.protobuf.ByteString getCatalogBytes() { + java.lang.Object ref = catalog_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + catalog_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The parent catalog resource name, such as
+     * `projects/*/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string catalog = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The catalog to set. + * @return This builder for chaining. + */ + public Builder setCatalog(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + catalog_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The parent catalog resource name, such as
+     * `projects/*/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string catalog = 1 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearCatalog() { + + catalog_ = getDefaultInstance().getCatalog(); + onChanged(); + return this; + } + /** + * + * + *
+     * The parent catalog resource name, such as
+     * `projects/*/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string catalog = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for catalog to set. + * @return This builder for chaining. + */ + public Builder setCatalogBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + catalog_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.GetDefaultBranchRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.GetDefaultBranchRequest) + private static final com.google.cloud.retail.v2.GetDefaultBranchRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2.GetDefaultBranchRequest(); + } + + public static com.google.cloud.retail.v2.GetDefaultBranchRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetDefaultBranchRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetDefaultBranchRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.retail.v2.GetDefaultBranchRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/GetDefaultBranchRequestOrBuilder.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/GetDefaultBranchRequestOrBuilder.java new file mode 100644 index 00000000..e768b0c9 --- /dev/null +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/GetDefaultBranchRequestOrBuilder.java @@ -0,0 +1,52 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2/catalog_service.proto + +package com.google.cloud.retail.v2; + +public interface GetDefaultBranchRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2.GetDefaultBranchRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The parent catalog resource name, such as
+   * `projects/*/locations/global/catalogs/default_catalog`.
+   * 
+ * + * string catalog = 1 [(.google.api.resource_reference) = { ... } + * + * @return The catalog. + */ + java.lang.String getCatalog(); + /** + * + * + *
+   * The parent catalog resource name, such as
+   * `projects/*/locations/global/catalogs/default_catalog`.
+   * 
+ * + * string catalog = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for catalog. + */ + com.google.protobuf.ByteString getCatalogBytes(); +} diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/GetDefaultBranchResponse.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/GetDefaultBranchResponse.java new file mode 100644 index 00000000..91743802 --- /dev/null +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/GetDefaultBranchResponse.java @@ -0,0 +1,1099 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2/catalog_service.proto + +package com.google.cloud.retail.v2; + +/** + * + * + *
+ * Response message of
+ * [CatalogService.GetDefaultBranch][google.cloud.retail.v2.CatalogService.GetDefaultBranch].
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2.GetDefaultBranchResponse} + */ +public final class GetDefaultBranchResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.GetDefaultBranchResponse) + GetDefaultBranchResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetDefaultBranchResponse.newBuilder() to construct. + private GetDefaultBranchResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetDefaultBranchResponse() { + branch_ = ""; + note_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetDefaultBranchResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetDefaultBranchResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + branch_ = s; + break; + } + case 18: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (setTime_ != null) { + subBuilder = setTime_.toBuilder(); + } + setTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(setTime_); + setTime_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + note_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.CatalogServiceProto + .internal_static_google_cloud_retail_v2_GetDefaultBranchResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.CatalogServiceProto + .internal_static_google_cloud_retail_v2_GetDefaultBranchResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.GetDefaultBranchResponse.class, + com.google.cloud.retail.v2.GetDefaultBranchResponse.Builder.class); + } + + public static final int BRANCH_FIELD_NUMBER = 1; + private volatile java.lang.Object branch_; + /** + * + * + *
+   * Full resource name of the branch id currently set as default branch.
+   * 
+ * + * string branch = 1 [(.google.api.resource_reference) = { ... } + * + * @return The branch. + */ + @java.lang.Override + public java.lang.String getBranch() { + java.lang.Object ref = branch_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + branch_ = s; + return s; + } + } + /** + * + * + *
+   * Full resource name of the branch id currently set as default branch.
+   * 
+ * + * string branch = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for branch. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBranchBytes() { + java.lang.Object ref = branch_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + branch_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SET_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp setTime_; + /** + * + * + *
+   * The time when this branch is set to default.
+   * 
+ * + * .google.protobuf.Timestamp set_time = 2; + * + * @return Whether the setTime field is set. + */ + @java.lang.Override + public boolean hasSetTime() { + return setTime_ != null; + } + /** + * + * + *
+   * The time when this branch is set to default.
+   * 
+ * + * .google.protobuf.Timestamp set_time = 2; + * + * @return The setTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getSetTime() { + return setTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : setTime_; + } + /** + * + * + *
+   * The time when this branch is set to default.
+   * 
+ * + * .google.protobuf.Timestamp set_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getSetTimeOrBuilder() { + return getSetTime(); + } + + public static final int NOTE_FIELD_NUMBER = 3; + private volatile java.lang.Object note_; + /** + * + * + *
+   * This corresponds to
+   * [SetDefaultBranchRequest.note][google.cloud.retail.v2.SetDefaultBranchRequest.note]
+   * field, when this branch was set as default.
+   * 
+ * + * string note = 3; + * + * @return The note. + */ + @java.lang.Override + public java.lang.String getNote() { + java.lang.Object ref = note_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + note_ = s; + return s; + } + } + /** + * + * + *
+   * This corresponds to
+   * [SetDefaultBranchRequest.note][google.cloud.retail.v2.SetDefaultBranchRequest.note]
+   * field, when this branch was set as default.
+   * 
+ * + * string note = 3; + * + * @return The bytes for note. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNoteBytes() { + java.lang.Object ref = note_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + note_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getBranchBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, branch_); + } + if (setTime_ != null) { + output.writeMessage(2, getSetTime()); + } + if (!getNoteBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, note_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getBranchBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, branch_); + } + if (setTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getSetTime()); + } + if (!getNoteBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, note_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.retail.v2.GetDefaultBranchResponse)) { + return super.equals(obj); + } + com.google.cloud.retail.v2.GetDefaultBranchResponse other = + (com.google.cloud.retail.v2.GetDefaultBranchResponse) obj; + + if (!getBranch().equals(other.getBranch())) return false; + if (hasSetTime() != other.hasSetTime()) return false; + if (hasSetTime()) { + if (!getSetTime().equals(other.getSetTime())) return false; + } + if (!getNote().equals(other.getNote())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + BRANCH_FIELD_NUMBER; + hash = (53 * hash) + getBranch().hashCode(); + if (hasSetTime()) { + hash = (37 * hash) + SET_TIME_FIELD_NUMBER; + hash = (53 * hash) + getSetTime().hashCode(); + } + hash = (37 * hash) + NOTE_FIELD_NUMBER; + hash = (53 * hash) + getNote().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2.GetDefaultBranchResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.GetDefaultBranchResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.GetDefaultBranchResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.GetDefaultBranchResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.GetDefaultBranchResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.GetDefaultBranchResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.GetDefaultBranchResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.GetDefaultBranchResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.GetDefaultBranchResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.GetDefaultBranchResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.GetDefaultBranchResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.GetDefaultBranchResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2.GetDefaultBranchResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message of
+   * [CatalogService.GetDefaultBranch][google.cloud.retail.v2.CatalogService.GetDefaultBranch].
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2.GetDefaultBranchResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.GetDefaultBranchResponse) + com.google.cloud.retail.v2.GetDefaultBranchResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.CatalogServiceProto + .internal_static_google_cloud_retail_v2_GetDefaultBranchResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.CatalogServiceProto + .internal_static_google_cloud_retail_v2_GetDefaultBranchResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.GetDefaultBranchResponse.class, + com.google.cloud.retail.v2.GetDefaultBranchResponse.Builder.class); + } + + // Construct using com.google.cloud.retail.v2.GetDefaultBranchResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + branch_ = ""; + + if (setTimeBuilder_ == null) { + setTime_ = null; + } else { + setTime_ = null; + setTimeBuilder_ = null; + } + note_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2.CatalogServiceProto + .internal_static_google_cloud_retail_v2_GetDefaultBranchResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2.GetDefaultBranchResponse getDefaultInstanceForType() { + return com.google.cloud.retail.v2.GetDefaultBranchResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2.GetDefaultBranchResponse build() { + com.google.cloud.retail.v2.GetDefaultBranchResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2.GetDefaultBranchResponse buildPartial() { + com.google.cloud.retail.v2.GetDefaultBranchResponse result = + new com.google.cloud.retail.v2.GetDefaultBranchResponse(this); + result.branch_ = branch_; + if (setTimeBuilder_ == null) { + result.setTime_ = setTime_; + } else { + result.setTime_ = setTimeBuilder_.build(); + } + result.note_ = note_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.retail.v2.GetDefaultBranchResponse) { + return mergeFrom((com.google.cloud.retail.v2.GetDefaultBranchResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2.GetDefaultBranchResponse other) { + if (other == com.google.cloud.retail.v2.GetDefaultBranchResponse.getDefaultInstance()) + return this; + if (!other.getBranch().isEmpty()) { + branch_ = other.branch_; + onChanged(); + } + if (other.hasSetTime()) { + mergeSetTime(other.getSetTime()); + } + if (!other.getNote().isEmpty()) { + note_ = other.note_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.retail.v2.GetDefaultBranchResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2.GetDefaultBranchResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object branch_ = ""; + /** + * + * + *
+     * Full resource name of the branch id currently set as default branch.
+     * 
+ * + * string branch = 1 [(.google.api.resource_reference) = { ... } + * + * @return The branch. + */ + public java.lang.String getBranch() { + java.lang.Object ref = branch_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + branch_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Full resource name of the branch id currently set as default branch.
+     * 
+ * + * string branch = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for branch. + */ + public com.google.protobuf.ByteString getBranchBytes() { + java.lang.Object ref = branch_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + branch_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Full resource name of the branch id currently set as default branch.
+     * 
+ * + * string branch = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The branch to set. + * @return This builder for chaining. + */ + public Builder setBranch(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + branch_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Full resource name of the branch id currently set as default branch.
+     * 
+ * + * string branch = 1 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearBranch() { + + branch_ = getDefaultInstance().getBranch(); + onChanged(); + return this; + } + /** + * + * + *
+     * Full resource name of the branch id currently set as default branch.
+     * 
+ * + * string branch = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for branch to set. + * @return This builder for chaining. + */ + public Builder setBranchBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + branch_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp setTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + setTimeBuilder_; + /** + * + * + *
+     * The time when this branch is set to default.
+     * 
+ * + * .google.protobuf.Timestamp set_time = 2; + * + * @return Whether the setTime field is set. + */ + public boolean hasSetTime() { + return setTimeBuilder_ != null || setTime_ != null; + } + /** + * + * + *
+     * The time when this branch is set to default.
+     * 
+ * + * .google.protobuf.Timestamp set_time = 2; + * + * @return The setTime. + */ + public com.google.protobuf.Timestamp getSetTime() { + if (setTimeBuilder_ == null) { + return setTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : setTime_; + } else { + return setTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time when this branch is set to default.
+     * 
+ * + * .google.protobuf.Timestamp set_time = 2; + */ + public Builder setSetTime(com.google.protobuf.Timestamp value) { + if (setTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + setTime_ = value; + onChanged(); + } else { + setTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The time when this branch is set to default.
+     * 
+ * + * .google.protobuf.Timestamp set_time = 2; + */ + public Builder setSetTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (setTimeBuilder_ == null) { + setTime_ = builderForValue.build(); + onChanged(); + } else { + setTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time when this branch is set to default.
+     * 
+ * + * .google.protobuf.Timestamp set_time = 2; + */ + public Builder mergeSetTime(com.google.protobuf.Timestamp value) { + if (setTimeBuilder_ == null) { + if (setTime_ != null) { + setTime_ = + com.google.protobuf.Timestamp.newBuilder(setTime_).mergeFrom(value).buildPartial(); + } else { + setTime_ = value; + } + onChanged(); + } else { + setTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The time when this branch is set to default.
+     * 
+ * + * .google.protobuf.Timestamp set_time = 2; + */ + public Builder clearSetTime() { + if (setTimeBuilder_ == null) { + setTime_ = null; + onChanged(); + } else { + setTime_ = null; + setTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time when this branch is set to default.
+     * 
+ * + * .google.protobuf.Timestamp set_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getSetTimeBuilder() { + + onChanged(); + return getSetTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time when this branch is set to default.
+     * 
+ * + * .google.protobuf.Timestamp set_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getSetTimeOrBuilder() { + if (setTimeBuilder_ != null) { + return setTimeBuilder_.getMessageOrBuilder(); + } else { + return setTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : setTime_; + } + } + /** + * + * + *
+     * The time when this branch is set to default.
+     * 
+ * + * .google.protobuf.Timestamp set_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getSetTimeFieldBuilder() { + if (setTimeBuilder_ == null) { + setTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getSetTime(), getParentForChildren(), isClean()); + setTime_ = null; + } + return setTimeBuilder_; + } + + private java.lang.Object note_ = ""; + /** + * + * + *
+     * This corresponds to
+     * [SetDefaultBranchRequest.note][google.cloud.retail.v2.SetDefaultBranchRequest.note]
+     * field, when this branch was set as default.
+     * 
+ * + * string note = 3; + * + * @return The note. + */ + public java.lang.String getNote() { + java.lang.Object ref = note_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + note_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * This corresponds to
+     * [SetDefaultBranchRequest.note][google.cloud.retail.v2.SetDefaultBranchRequest.note]
+     * field, when this branch was set as default.
+     * 
+ * + * string note = 3; + * + * @return The bytes for note. + */ + public com.google.protobuf.ByteString getNoteBytes() { + java.lang.Object ref = note_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + note_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * This corresponds to
+     * [SetDefaultBranchRequest.note][google.cloud.retail.v2.SetDefaultBranchRequest.note]
+     * field, when this branch was set as default.
+     * 
+ * + * string note = 3; + * + * @param value The note to set. + * @return This builder for chaining. + */ + public Builder setNote(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + note_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * This corresponds to
+     * [SetDefaultBranchRequest.note][google.cloud.retail.v2.SetDefaultBranchRequest.note]
+     * field, when this branch was set as default.
+     * 
+ * + * string note = 3; + * + * @return This builder for chaining. + */ + public Builder clearNote() { + + note_ = getDefaultInstance().getNote(); + onChanged(); + return this; + } + /** + * + * + *
+     * This corresponds to
+     * [SetDefaultBranchRequest.note][google.cloud.retail.v2.SetDefaultBranchRequest.note]
+     * field, when this branch was set as default.
+     * 
+ * + * string note = 3; + * + * @param value The bytes for note to set. + * @return This builder for chaining. + */ + public Builder setNoteBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + note_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.GetDefaultBranchResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.GetDefaultBranchResponse) + private static final com.google.cloud.retail.v2.GetDefaultBranchResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2.GetDefaultBranchResponse(); + } + + public static com.google.cloud.retail.v2.GetDefaultBranchResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetDefaultBranchResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetDefaultBranchResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.retail.v2.GetDefaultBranchResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/GetDefaultBranchResponseOrBuilder.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/GetDefaultBranchResponseOrBuilder.java new file mode 100644 index 00000000..b83c9e6f --- /dev/null +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/GetDefaultBranchResponseOrBuilder.java @@ -0,0 +1,114 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2/catalog_service.proto + +package com.google.cloud.retail.v2; + +public interface GetDefaultBranchResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2.GetDefaultBranchResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Full resource name of the branch id currently set as default branch.
+   * 
+ * + * string branch = 1 [(.google.api.resource_reference) = { ... } + * + * @return The branch. + */ + java.lang.String getBranch(); + /** + * + * + *
+   * Full resource name of the branch id currently set as default branch.
+   * 
+ * + * string branch = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for branch. + */ + com.google.protobuf.ByteString getBranchBytes(); + + /** + * + * + *
+   * The time when this branch is set to default.
+   * 
+ * + * .google.protobuf.Timestamp set_time = 2; + * + * @return Whether the setTime field is set. + */ + boolean hasSetTime(); + /** + * + * + *
+   * The time when this branch is set to default.
+   * 
+ * + * .google.protobuf.Timestamp set_time = 2; + * + * @return The setTime. + */ + com.google.protobuf.Timestamp getSetTime(); + /** + * + * + *
+   * The time when this branch is set to default.
+   * 
+ * + * .google.protobuf.Timestamp set_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getSetTimeOrBuilder(); + + /** + * + * + *
+   * This corresponds to
+   * [SetDefaultBranchRequest.note][google.cloud.retail.v2.SetDefaultBranchRequest.note]
+   * field, when this branch was set as default.
+   * 
+ * + * string note = 3; + * + * @return The note. + */ + java.lang.String getNote(); + /** + * + * + *
+   * This corresponds to
+   * [SetDefaultBranchRequest.note][google.cloud.retail.v2.SetDefaultBranchRequest.note]
+   * field, when this branch was set as default.
+   * 
+ * + * string note = 3; + * + * @return The bytes for note. + */ + com.google.protobuf.ByteString getNoteBytes(); +} diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ImportCompletionDataRequest.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ImportCompletionDataRequest.java new file mode 100644 index 00000000..710b0a62 --- /dev/null +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ImportCompletionDataRequest.java @@ -0,0 +1,1168 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2/import_config.proto + +package com.google.cloud.retail.v2; + +/** + * + * + *
+ * Request message for ImportCompletionData methods.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2.ImportCompletionDataRequest} + */ +public final class ImportCompletionDataRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.ImportCompletionDataRequest) + ImportCompletionDataRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ImportCompletionDataRequest.newBuilder() to construct. + private ImportCompletionDataRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ImportCompletionDataRequest() { + parent_ = ""; + notificationPubsubTopic_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ImportCompletionDataRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ImportCompletionDataRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + com.google.cloud.retail.v2.CompletionDataInputConfig.Builder subBuilder = null; + if (inputConfig_ != null) { + subBuilder = inputConfig_.toBuilder(); + } + inputConfig_ = + input.readMessage( + com.google.cloud.retail.v2.CompletionDataInputConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(inputConfig_); + inputConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + notificationPubsubTopic_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.ImportConfigProto + .internal_static_google_cloud_retail_v2_ImportCompletionDataRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.ImportConfigProto + .internal_static_google_cloud_retail_v2_ImportCompletionDataRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.ImportCompletionDataRequest.class, + com.google.cloud.retail.v2.ImportCompletionDataRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The catalog which the suggestions dataset belongs to.
+   * Format: `projects/1234/locations/global/catalogs/default_catalog`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The catalog which the suggestions dataset belongs to.
+   * Format: `projects/1234/locations/global/catalogs/default_catalog`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INPUT_CONFIG_FIELD_NUMBER = 2; + private com.google.cloud.retail.v2.CompletionDataInputConfig inputConfig_; + /** + * + * + *
+   * Required. The desired input location of the data.
+   * 
+ * + * + * .google.cloud.retail.v2.CompletionDataInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the inputConfig field is set. + */ + @java.lang.Override + public boolean hasInputConfig() { + return inputConfig_ != null; + } + /** + * + * + *
+   * Required. The desired input location of the data.
+   * 
+ * + * + * .google.cloud.retail.v2.CompletionDataInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The inputConfig. + */ + @java.lang.Override + public com.google.cloud.retail.v2.CompletionDataInputConfig getInputConfig() { + return inputConfig_ == null + ? com.google.cloud.retail.v2.CompletionDataInputConfig.getDefaultInstance() + : inputConfig_; + } + /** + * + * + *
+   * Required. The desired input location of the data.
+   * 
+ * + * + * .google.cloud.retail.v2.CompletionDataInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2.CompletionDataInputConfigOrBuilder getInputConfigOrBuilder() { + return getInputConfig(); + } + + public static final int NOTIFICATION_PUBSUB_TOPIC_FIELD_NUMBER = 3; + private volatile java.lang.Object notificationPubsubTopic_; + /** + * + * + *
+   * Pub/Sub topic for receiving notification. If this field is set,
+   * when the import is finished, a notification will be sent to
+   * specified Pub/Sub topic. The message data will be JSON string of a
+   * [Operation][google.longrunning.Operation].
+   * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+   * 
+ * + * string notification_pubsub_topic = 3; + * + * @return The notificationPubsubTopic. + */ + @java.lang.Override + public java.lang.String getNotificationPubsubTopic() { + java.lang.Object ref = notificationPubsubTopic_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + notificationPubsubTopic_ = s; + return s; + } + } + /** + * + * + *
+   * Pub/Sub topic for receiving notification. If this field is set,
+   * when the import is finished, a notification will be sent to
+   * specified Pub/Sub topic. The message data will be JSON string of a
+   * [Operation][google.longrunning.Operation].
+   * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+   * 
+ * + * string notification_pubsub_topic = 3; + * + * @return The bytes for notificationPubsubTopic. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNotificationPubsubTopicBytes() { + java.lang.Object ref = notificationPubsubTopic_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + notificationPubsubTopic_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (inputConfig_ != null) { + output.writeMessage(2, getInputConfig()); + } + if (!getNotificationPubsubTopicBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, notificationPubsubTopic_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (inputConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getInputConfig()); + } + if (!getNotificationPubsubTopicBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, notificationPubsubTopic_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.retail.v2.ImportCompletionDataRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2.ImportCompletionDataRequest other = + (com.google.cloud.retail.v2.ImportCompletionDataRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasInputConfig() != other.hasInputConfig()) return false; + if (hasInputConfig()) { + if (!getInputConfig().equals(other.getInputConfig())) return false; + } + if (!getNotificationPubsubTopic().equals(other.getNotificationPubsubTopic())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasInputConfig()) { + hash = (37 * hash) + INPUT_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getInputConfig().hashCode(); + } + hash = (37 * hash) + NOTIFICATION_PUBSUB_TOPIC_FIELD_NUMBER; + hash = (53 * hash) + getNotificationPubsubTopic().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2.ImportCompletionDataRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.ImportCompletionDataRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.ImportCompletionDataRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.ImportCompletionDataRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.ImportCompletionDataRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.ImportCompletionDataRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.ImportCompletionDataRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.ImportCompletionDataRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.ImportCompletionDataRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.ImportCompletionDataRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.ImportCompletionDataRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.ImportCompletionDataRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2.ImportCompletionDataRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for ImportCompletionData methods.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2.ImportCompletionDataRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.ImportCompletionDataRequest) + com.google.cloud.retail.v2.ImportCompletionDataRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.ImportConfigProto + .internal_static_google_cloud_retail_v2_ImportCompletionDataRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.ImportConfigProto + .internal_static_google_cloud_retail_v2_ImportCompletionDataRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.ImportCompletionDataRequest.class, + com.google.cloud.retail.v2.ImportCompletionDataRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2.ImportCompletionDataRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + if (inputConfigBuilder_ == null) { + inputConfig_ = null; + } else { + inputConfig_ = null; + inputConfigBuilder_ = null; + } + notificationPubsubTopic_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2.ImportConfigProto + .internal_static_google_cloud_retail_v2_ImportCompletionDataRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2.ImportCompletionDataRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2.ImportCompletionDataRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2.ImportCompletionDataRequest build() { + com.google.cloud.retail.v2.ImportCompletionDataRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2.ImportCompletionDataRequest buildPartial() { + com.google.cloud.retail.v2.ImportCompletionDataRequest result = + new com.google.cloud.retail.v2.ImportCompletionDataRequest(this); + result.parent_ = parent_; + if (inputConfigBuilder_ == null) { + result.inputConfig_ = inputConfig_; + } else { + result.inputConfig_ = inputConfigBuilder_.build(); + } + result.notificationPubsubTopic_ = notificationPubsubTopic_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.retail.v2.ImportCompletionDataRequest) { + return mergeFrom((com.google.cloud.retail.v2.ImportCompletionDataRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2.ImportCompletionDataRequest other) { + if (other == com.google.cloud.retail.v2.ImportCompletionDataRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasInputConfig()) { + mergeInputConfig(other.getInputConfig()); + } + if (!other.getNotificationPubsubTopic().isEmpty()) { + notificationPubsubTopic_ = other.notificationPubsubTopic_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.retail.v2.ImportCompletionDataRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2.ImportCompletionDataRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The catalog which the suggestions dataset belongs to.
+     * Format: `projects/1234/locations/global/catalogs/default_catalog`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The catalog which the suggestions dataset belongs to.
+     * Format: `projects/1234/locations/global/catalogs/default_catalog`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The catalog which the suggestions dataset belongs to.
+     * Format: `projects/1234/locations/global/catalogs/default_catalog`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The catalog which the suggestions dataset belongs to.
+     * Format: `projects/1234/locations/global/catalogs/default_catalog`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The catalog which the suggestions dataset belongs to.
+     * Format: `projects/1234/locations/global/catalogs/default_catalog`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private com.google.cloud.retail.v2.CompletionDataInputConfig inputConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2.CompletionDataInputConfig, + com.google.cloud.retail.v2.CompletionDataInputConfig.Builder, + com.google.cloud.retail.v2.CompletionDataInputConfigOrBuilder> + inputConfigBuilder_; + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2.CompletionDataInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the inputConfig field is set. + */ + public boolean hasInputConfig() { + return inputConfigBuilder_ != null || inputConfig_ != null; + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2.CompletionDataInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The inputConfig. + */ + public com.google.cloud.retail.v2.CompletionDataInputConfig getInputConfig() { + if (inputConfigBuilder_ == null) { + return inputConfig_ == null + ? com.google.cloud.retail.v2.CompletionDataInputConfig.getDefaultInstance() + : inputConfig_; + } else { + return inputConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2.CompletionDataInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInputConfig(com.google.cloud.retail.v2.CompletionDataInputConfig value) { + if (inputConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + inputConfig_ = value; + onChanged(); + } else { + inputConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2.CompletionDataInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInputConfig( + com.google.cloud.retail.v2.CompletionDataInputConfig.Builder builderForValue) { + if (inputConfigBuilder_ == null) { + inputConfig_ = builderForValue.build(); + onChanged(); + } else { + inputConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2.CompletionDataInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeInputConfig(com.google.cloud.retail.v2.CompletionDataInputConfig value) { + if (inputConfigBuilder_ == null) { + if (inputConfig_ != null) { + inputConfig_ = + com.google.cloud.retail.v2.CompletionDataInputConfig.newBuilder(inputConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + inputConfig_ = value; + } + onChanged(); + } else { + inputConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2.CompletionDataInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearInputConfig() { + if (inputConfigBuilder_ == null) { + inputConfig_ = null; + onChanged(); + } else { + inputConfig_ = null; + inputConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2.CompletionDataInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2.CompletionDataInputConfig.Builder getInputConfigBuilder() { + + onChanged(); + return getInputConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2.CompletionDataInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2.CompletionDataInputConfigOrBuilder getInputConfigOrBuilder() { + if (inputConfigBuilder_ != null) { + return inputConfigBuilder_.getMessageOrBuilder(); + } else { + return inputConfig_ == null + ? com.google.cloud.retail.v2.CompletionDataInputConfig.getDefaultInstance() + : inputConfig_; + } + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2.CompletionDataInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2.CompletionDataInputConfig, + com.google.cloud.retail.v2.CompletionDataInputConfig.Builder, + com.google.cloud.retail.v2.CompletionDataInputConfigOrBuilder> + getInputConfigFieldBuilder() { + if (inputConfigBuilder_ == null) { + inputConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2.CompletionDataInputConfig, + com.google.cloud.retail.v2.CompletionDataInputConfig.Builder, + com.google.cloud.retail.v2.CompletionDataInputConfigOrBuilder>( + getInputConfig(), getParentForChildren(), isClean()); + inputConfig_ = null; + } + return inputConfigBuilder_; + } + + private java.lang.Object notificationPubsubTopic_ = ""; + /** + * + * + *
+     * Pub/Sub topic for receiving notification. If this field is set,
+     * when the import is finished, a notification will be sent to
+     * specified Pub/Sub topic. The message data will be JSON string of a
+     * [Operation][google.longrunning.Operation].
+     * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+     * 
+ * + * string notification_pubsub_topic = 3; + * + * @return The notificationPubsubTopic. + */ + public java.lang.String getNotificationPubsubTopic() { + java.lang.Object ref = notificationPubsubTopic_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + notificationPubsubTopic_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Pub/Sub topic for receiving notification. If this field is set,
+     * when the import is finished, a notification will be sent to
+     * specified Pub/Sub topic. The message data will be JSON string of a
+     * [Operation][google.longrunning.Operation].
+     * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+     * 
+ * + * string notification_pubsub_topic = 3; + * + * @return The bytes for notificationPubsubTopic. + */ + public com.google.protobuf.ByteString getNotificationPubsubTopicBytes() { + java.lang.Object ref = notificationPubsubTopic_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + notificationPubsubTopic_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Pub/Sub topic for receiving notification. If this field is set,
+     * when the import is finished, a notification will be sent to
+     * specified Pub/Sub topic. The message data will be JSON string of a
+     * [Operation][google.longrunning.Operation].
+     * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+     * 
+ * + * string notification_pubsub_topic = 3; + * + * @param value The notificationPubsubTopic to set. + * @return This builder for chaining. + */ + public Builder setNotificationPubsubTopic(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + notificationPubsubTopic_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Pub/Sub topic for receiving notification. If this field is set,
+     * when the import is finished, a notification will be sent to
+     * specified Pub/Sub topic. The message data will be JSON string of a
+     * [Operation][google.longrunning.Operation].
+     * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+     * 
+ * + * string notification_pubsub_topic = 3; + * + * @return This builder for chaining. + */ + public Builder clearNotificationPubsubTopic() { + + notificationPubsubTopic_ = getDefaultInstance().getNotificationPubsubTopic(); + onChanged(); + return this; + } + /** + * + * + *
+     * Pub/Sub topic for receiving notification. If this field is set,
+     * when the import is finished, a notification will be sent to
+     * specified Pub/Sub topic. The message data will be JSON string of a
+     * [Operation][google.longrunning.Operation].
+     * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+     * 
+ * + * string notification_pubsub_topic = 3; + * + * @param value The bytes for notificationPubsubTopic to set. + * @return This builder for chaining. + */ + public Builder setNotificationPubsubTopicBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + notificationPubsubTopic_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.ImportCompletionDataRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.ImportCompletionDataRequest) + private static final com.google.cloud.retail.v2.ImportCompletionDataRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2.ImportCompletionDataRequest(); + } + + public static com.google.cloud.retail.v2.ImportCompletionDataRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ImportCompletionDataRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ImportCompletionDataRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.retail.v2.ImportCompletionDataRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ImportCompletionDataRequestOrBuilder.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ImportCompletionDataRequestOrBuilder.java new file mode 100644 index 00000000..833c25cb --- /dev/null +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ImportCompletionDataRequestOrBuilder.java @@ -0,0 +1,130 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2/import_config.proto + +package com.google.cloud.retail.v2; + +public interface ImportCompletionDataRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2.ImportCompletionDataRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The catalog which the suggestions dataset belongs to.
+   * Format: `projects/1234/locations/global/catalogs/default_catalog`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The catalog which the suggestions dataset belongs to.
+   * Format: `projects/1234/locations/global/catalogs/default_catalog`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The desired input location of the data.
+   * 
+ * + * + * .google.cloud.retail.v2.CompletionDataInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the inputConfig field is set. + */ + boolean hasInputConfig(); + /** + * + * + *
+   * Required. The desired input location of the data.
+   * 
+ * + * + * .google.cloud.retail.v2.CompletionDataInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The inputConfig. + */ + com.google.cloud.retail.v2.CompletionDataInputConfig getInputConfig(); + /** + * + * + *
+   * Required. The desired input location of the data.
+   * 
+ * + * + * .google.cloud.retail.v2.CompletionDataInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2.CompletionDataInputConfigOrBuilder getInputConfigOrBuilder(); + + /** + * + * + *
+   * Pub/Sub topic for receiving notification. If this field is set,
+   * when the import is finished, a notification will be sent to
+   * specified Pub/Sub topic. The message data will be JSON string of a
+   * [Operation][google.longrunning.Operation].
+   * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+   * 
+ * + * string notification_pubsub_topic = 3; + * + * @return The notificationPubsubTopic. + */ + java.lang.String getNotificationPubsubTopic(); + /** + * + * + *
+   * Pub/Sub topic for receiving notification. If this field is set,
+   * when the import is finished, a notification will be sent to
+   * specified Pub/Sub topic. The message data will be JSON string of a
+   * [Operation][google.longrunning.Operation].
+   * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+   * 
+ * + * string notification_pubsub_topic = 3; + * + * @return The bytes for notificationPubsubTopic. + */ + com.google.protobuf.ByteString getNotificationPubsubTopicBytes(); +} diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ImportCompletionDataResponse.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ImportCompletionDataResponse.java new file mode 100644 index 00000000..7fe59032 --- /dev/null +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ImportCompletionDataResponse.java @@ -0,0 +1,943 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2/import_config.proto + +package com.google.cloud.retail.v2; + +/** + * + * + *
+ * Response of the
+ * [ImportCompletionDataRequest][google.cloud.retail.v2.ImportCompletionDataRequest].
+ * If the long running operation is done, this message is returned by the
+ * google.longrunning.Operations.response field if the operation is successful.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2.ImportCompletionDataResponse} + */ +public final class ImportCompletionDataResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.ImportCompletionDataResponse) + ImportCompletionDataResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ImportCompletionDataResponse.newBuilder() to construct. + private ImportCompletionDataResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ImportCompletionDataResponse() { + errorSamples_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ImportCompletionDataResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ImportCompletionDataResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + errorSamples_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + errorSamples_.add( + input.readMessage(com.google.rpc.Status.parser(), extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + errorSamples_ = java.util.Collections.unmodifiableList(errorSamples_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.ImportConfigProto + .internal_static_google_cloud_retail_v2_ImportCompletionDataResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.ImportConfigProto + .internal_static_google_cloud_retail_v2_ImportCompletionDataResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.ImportCompletionDataResponse.class, + com.google.cloud.retail.v2.ImportCompletionDataResponse.Builder.class); + } + + public static final int ERROR_SAMPLES_FIELD_NUMBER = 1; + private java.util.List errorSamples_; + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public java.util.List getErrorSamplesList() { + return errorSamples_; + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public java.util.List getErrorSamplesOrBuilderList() { + return errorSamples_; + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public int getErrorSamplesCount() { + return errorSamples_.size(); + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public com.google.rpc.Status getErrorSamples(int index) { + return errorSamples_.get(index); + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getErrorSamplesOrBuilder(int index) { + return errorSamples_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < errorSamples_.size(); i++) { + output.writeMessage(1, errorSamples_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < errorSamples_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, errorSamples_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.retail.v2.ImportCompletionDataResponse)) { + return super.equals(obj); + } + com.google.cloud.retail.v2.ImportCompletionDataResponse other = + (com.google.cloud.retail.v2.ImportCompletionDataResponse) obj; + + if (!getErrorSamplesList().equals(other.getErrorSamplesList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getErrorSamplesCount() > 0) { + hash = (37 * hash) + ERROR_SAMPLES_FIELD_NUMBER; + hash = (53 * hash) + getErrorSamplesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2.ImportCompletionDataResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.ImportCompletionDataResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.ImportCompletionDataResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.ImportCompletionDataResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.ImportCompletionDataResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.ImportCompletionDataResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.ImportCompletionDataResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.ImportCompletionDataResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.ImportCompletionDataResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.ImportCompletionDataResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.ImportCompletionDataResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.ImportCompletionDataResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2.ImportCompletionDataResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response of the
+   * [ImportCompletionDataRequest][google.cloud.retail.v2.ImportCompletionDataRequest].
+   * If the long running operation is done, this message is returned by the
+   * google.longrunning.Operations.response field if the operation is successful.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2.ImportCompletionDataResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.ImportCompletionDataResponse) + com.google.cloud.retail.v2.ImportCompletionDataResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.ImportConfigProto + .internal_static_google_cloud_retail_v2_ImportCompletionDataResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.ImportConfigProto + .internal_static_google_cloud_retail_v2_ImportCompletionDataResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.ImportCompletionDataResponse.class, + com.google.cloud.retail.v2.ImportCompletionDataResponse.Builder.class); + } + + // Construct using com.google.cloud.retail.v2.ImportCompletionDataResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getErrorSamplesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (errorSamplesBuilder_ == null) { + errorSamples_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + errorSamplesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2.ImportConfigProto + .internal_static_google_cloud_retail_v2_ImportCompletionDataResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2.ImportCompletionDataResponse getDefaultInstanceForType() { + return com.google.cloud.retail.v2.ImportCompletionDataResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2.ImportCompletionDataResponse build() { + com.google.cloud.retail.v2.ImportCompletionDataResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2.ImportCompletionDataResponse buildPartial() { + com.google.cloud.retail.v2.ImportCompletionDataResponse result = + new com.google.cloud.retail.v2.ImportCompletionDataResponse(this); + int from_bitField0_ = bitField0_; + if (errorSamplesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + errorSamples_ = java.util.Collections.unmodifiableList(errorSamples_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.errorSamples_ = errorSamples_; + } else { + result.errorSamples_ = errorSamplesBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.retail.v2.ImportCompletionDataResponse) { + return mergeFrom((com.google.cloud.retail.v2.ImportCompletionDataResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2.ImportCompletionDataResponse other) { + if (other == com.google.cloud.retail.v2.ImportCompletionDataResponse.getDefaultInstance()) + return this; + if (errorSamplesBuilder_ == null) { + if (!other.errorSamples_.isEmpty()) { + if (errorSamples_.isEmpty()) { + errorSamples_ = other.errorSamples_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureErrorSamplesIsMutable(); + errorSamples_.addAll(other.errorSamples_); + } + onChanged(); + } + } else { + if (!other.errorSamples_.isEmpty()) { + if (errorSamplesBuilder_.isEmpty()) { + errorSamplesBuilder_.dispose(); + errorSamplesBuilder_ = null; + errorSamples_ = other.errorSamples_; + bitField0_ = (bitField0_ & ~0x00000001); + errorSamplesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getErrorSamplesFieldBuilder() + : null; + } else { + errorSamplesBuilder_.addAllMessages(other.errorSamples_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.retail.v2.ImportCompletionDataResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2.ImportCompletionDataResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List errorSamples_ = java.util.Collections.emptyList(); + + private void ensureErrorSamplesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + errorSamples_ = new java.util.ArrayList(errorSamples_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + errorSamplesBuilder_; + + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public java.util.List getErrorSamplesList() { + if (errorSamplesBuilder_ == null) { + return java.util.Collections.unmodifiableList(errorSamples_); + } else { + return errorSamplesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public int getErrorSamplesCount() { + if (errorSamplesBuilder_ == null) { + return errorSamples_.size(); + } else { + return errorSamplesBuilder_.getCount(); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status getErrorSamples(int index) { + if (errorSamplesBuilder_ == null) { + return errorSamples_.get(index); + } else { + return errorSamplesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder setErrorSamples(int index, com.google.rpc.Status value) { + if (errorSamplesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorSamplesIsMutable(); + errorSamples_.set(index, value); + onChanged(); + } else { + errorSamplesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder setErrorSamples(int index, com.google.rpc.Status.Builder builderForValue) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.set(index, builderForValue.build()); + onChanged(); + } else { + errorSamplesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(com.google.rpc.Status value) { + if (errorSamplesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorSamplesIsMutable(); + errorSamples_.add(value); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(int index, com.google.rpc.Status value) { + if (errorSamplesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorSamplesIsMutable(); + errorSamples_.add(index, value); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(com.google.rpc.Status.Builder builderForValue) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.add(builderForValue.build()); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(int index, com.google.rpc.Status.Builder builderForValue) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.add(index, builderForValue.build()); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addAllErrorSamples(java.lang.Iterable values) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, errorSamples_); + onChanged(); + } else { + errorSamplesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder clearErrorSamples() { + if (errorSamplesBuilder_ == null) { + errorSamples_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + errorSamplesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder removeErrorSamples(int index) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.remove(index); + onChanged(); + } else { + errorSamplesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status.Builder getErrorSamplesBuilder(int index) { + return getErrorSamplesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.StatusOrBuilder getErrorSamplesOrBuilder(int index) { + if (errorSamplesBuilder_ == null) { + return errorSamples_.get(index); + } else { + return errorSamplesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public java.util.List getErrorSamplesOrBuilderList() { + if (errorSamplesBuilder_ != null) { + return errorSamplesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(errorSamples_); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status.Builder addErrorSamplesBuilder() { + return getErrorSamplesFieldBuilder().addBuilder(com.google.rpc.Status.getDefaultInstance()); + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status.Builder addErrorSamplesBuilder(int index) { + return getErrorSamplesFieldBuilder() + .addBuilder(index, com.google.rpc.Status.getDefaultInstance()); + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public java.util.List getErrorSamplesBuilderList() { + return getErrorSamplesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getErrorSamplesFieldBuilder() { + if (errorSamplesBuilder_ == null) { + errorSamplesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>( + errorSamples_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + errorSamples_ = null; + } + return errorSamplesBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.ImportCompletionDataResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.ImportCompletionDataResponse) + private static final com.google.cloud.retail.v2.ImportCompletionDataResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2.ImportCompletionDataResponse(); + } + + public static com.google.cloud.retail.v2.ImportCompletionDataResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ImportCompletionDataResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ImportCompletionDataResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.retail.v2.ImportCompletionDataResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ImportCompletionDataResponseOrBuilder.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ImportCompletionDataResponseOrBuilder.java new file mode 100644 index 00000000..28562e1c --- /dev/null +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ImportCompletionDataResponseOrBuilder.java @@ -0,0 +1,76 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2/import_config.proto + +package com.google.cloud.retail.v2; + +public interface ImportCompletionDataResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2.ImportCompletionDataResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + java.util.List getErrorSamplesList(); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + com.google.rpc.Status getErrorSamples(int index); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + int getErrorSamplesCount(); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + java.util.List getErrorSamplesOrBuilderList(); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + com.google.rpc.StatusOrBuilder getErrorSamplesOrBuilder(int index); +} diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ImportConfigProto.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ImportConfigProto.java index d912605f..d7d67b2c 100644 --- a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ImportConfigProto.java +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ImportConfigProto.java @@ -55,6 +55,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_retail_v2_ImportUserEventsRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_retail_v2_ImportUserEventsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2_ImportCompletionDataRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2_ImportCompletionDataRequest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_retail_v2_ProductInputConfig_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -63,6 +67,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_retail_v2_UserEventInputConfig_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_retail_v2_UserEventInputConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2_CompletionDataInputConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2_CompletionDataInputConfig_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_retail_v2_ImportMetadata_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -79,6 +87,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_retail_v2_UserEventImportSummary_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_retail_v2_UserEventImportSummary_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2_ImportCompletionDataResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2_ImportCompletionDataResponse_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -91,65 +103,86 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "\n*google/cloud/retail/v2/import_config.p" + "roto\022\026google.cloud.retail.v2\032\034google/api" + "/annotations.proto\032\037google/api/field_beh" - + "avior.proto\032$google/cloud/retail/v2/prod" - + "uct.proto\032\'google/cloud/retail/v2/user_e" - + "vent.proto\032 google/protobuf/field_mask.p" - + "roto\032\037google/protobuf/timestamp.proto\032\027g" - + "oogle/rpc/status.proto\"9\n\tGcsSource\022\027\n\ni" - + "nput_uris\030\001 \003(\tB\003\340A\002\022\023\n\013data_schema\030\002 \001(" - + "\t\"\202\001\n\016BigQuerySource\022\022\n\nproject_id\030\005 \001(\t" - + "\022\027\n\ndataset_id\030\001 \001(\tB\003\340A\002\022\025\n\010table_id\030\002 " - + "\001(\tB\003\340A\002\022\027\n\017gcs_staging_dir\030\003 \001(\t\022\023\n\013dat" - + "a_schema\030\004 \001(\t\"M\n\023ProductInlineSource\0226\n" - + "\010products\030\001 \003(\0132\037.google.cloud.retail.v2" - + ".ProductB\003\340A\002\"T\n\025UserEventInlineSource\022;" - + "\n\013user_events\030\001 \003(\0132!.google.cloud.retai" - + "l.v2.UserEventB\003\340A\002\"9\n\022ImportErrorsConfi" - + "g\022\024\n\ngcs_prefix\030\001 \001(\tH\000B\r\n\013destination\"\347" - + "\001\n\025ImportProductsRequest\022\023\n\006parent\030\001 \001(\t" - + "B\003\340A\002\022E\n\014input_config\030\002 \001(\0132*.google.clo" - + "ud.retail.v2.ProductInputConfigB\003\340A\002\022A\n\r" - + "errors_config\030\003 \001(\0132*.google.cloud.retai" - + "l.v2.ImportErrorsConfig\022/\n\013update_mask\030\004" - + " \001(\0132\032.google.protobuf.FieldMask\"\272\001\n\027Imp" - + "ortUserEventsRequest\022\023\n\006parent\030\001 \001(\tB\003\340A" - + "\002\022G\n\014input_config\030\002 \001(\0132,.google.cloud.r" - + "etail.v2.UserEventInputConfigB\003\340A\002\022A\n\rer" - + "rors_config\030\003 \001(\0132*.google.cloud.retail." - + "v2.ImportErrorsConfig\"\351\001\n\022ProductInputCo" - + "nfig\022L\n\025product_inline_source\030\001 \001(\0132+.go" - + "ogle.cloud.retail.v2.ProductInlineSource" - + "H\000\0227\n\ngcs_source\030\002 \001(\0132!.google.cloud.re" - + "tail.v2.GcsSourceH\000\022B\n\020big_query_source\030" - + "\003 \001(\0132&.google.cloud.retail.v2.BigQueryS" - + "ourceH\000B\010\n\006source\"\377\001\n\024UserEventInputConf" - + "ig\022V\n\030user_event_inline_source\030\001 \001(\0132-.g" - + "oogle.cloud.retail.v2.UserEventInlineSou" - + "rceB\003\340A\002H\000\022<\n\ngcs_source\030\002 \001(\0132!.google." - + "cloud.retail.v2.GcsSourceB\003\340A\002H\000\022G\n\020big_" - + "query_source\030\003 \001(\0132&.google.cloud.retail" - + ".v2.BigQuerySourceB\003\340A\002H\000B\010\n\006source\"\240\001\n\016" - + "ImportMetadata\022/\n\013create_time\030\001 \001(\0132\032.go" - + "ogle.protobuf.Timestamp\022/\n\013update_time\030\002" - + " \001(\0132\032.google.protobuf.Timestamp\022\025\n\rsucc" - + "ess_count\030\003 \001(\003\022\025\n\rfailure_count\030\004 \001(\003\"\206" - + "\001\n\026ImportProductsResponse\022)\n\rerror_sampl" - + "es\030\001 \003(\0132\022.google.rpc.Status\022A\n\rerrors_c" - + "onfig\030\002 \001(\0132*.google.cloud.retail.v2.Imp" - + "ortErrorsConfig\"\320\001\n\030ImportUserEventsResp" + + "avior.proto\032\031google/api/resource.proto\032$" + + "google/cloud/retail/v2/product.proto\032\'go" + + "ogle/cloud/retail/v2/user_event.proto\032 g" + + "oogle/protobuf/field_mask.proto\032\037google/" + + "protobuf/timestamp.proto\032\027google/rpc/sta" + + "tus.proto\032\026google/type/date.proto\"9\n\tGcs" + + "Source\022\027\n\ninput_uris\030\001 \003(\tB\003\340A\002\022\023\n\013data_" + + "schema\030\002 \001(\t\"\274\001\n\016BigQuerySource\022+\n\016parti" + + "tion_date\030\006 \001(\0132\021.google.type.DateH\000\022\022\n\n" + + "project_id\030\005 \001(\t\022\027\n\ndataset_id\030\001 \001(\tB\003\340A" + + "\002\022\025\n\010table_id\030\002 \001(\tB\003\340A\002\022\027\n\017gcs_staging_" + + "dir\030\003 \001(\t\022\023\n\013data_schema\030\004 \001(\tB\013\n\tpartit" + + "ion\"M\n\023ProductInlineSource\0226\n\010products\030\001" + + " \003(\0132\037.google.cloud.retail.v2.ProductB\003\340" + + "A\002\"T\n\025UserEventInlineSource\022;\n\013user_even" + + "ts\030\001 \003(\0132!.google.cloud.retail.v2.UserEv" + + "entB\003\340A\002\"9\n\022ImportErrorsConfig\022\024\n\ngcs_pr" + + "efix\030\001 \001(\tH\000B\r\n\013destination\"\364\003\n\025ImportPr" + + "oductsRequest\0224\n\006parent\030\001 \001(\tB$\340A\002\372A\036\n\034r" + + "etail.googleapis.com/Branch\022\022\n\nrequest_i" + + "d\030\006 \001(\t\022E\n\014input_config\030\002 \001(\0132*.google.c" + + "loud.retail.v2.ProductInputConfigB\003\340A\002\022A" + + "\n\rerrors_config\030\003 \001(\0132*.google.cloud.ret" + + "ail.v2.ImportErrorsConfig\022/\n\013update_mask" + + "\030\004 \001(\0132\032.google.protobuf.FieldMask\022]\n\023re" + + "conciliation_mode\030\005 \001(\0162@.google.cloud.r" + + "etail.v2.ImportProductsRequest.Reconcili" + + "ationMode\022!\n\031notification_pubsub_topic\030\007" + + " \001(\t\"T\n\022ReconciliationMode\022#\n\037RECONCILIA" + + "TION_MODE_UNSPECIFIED\020\000\022\017\n\013INCREMENTAL\020\001" + + "\022\010\n\004FULL\020\002\"\334\001\n\027ImportUserEventsRequest\0225" + + "\n\006parent\030\001 \001(\tB%\340A\002\372A\037\n\035retail.googleapi" + + "s.com/Catalog\022G\n\014input_config\030\002 \001(\0132,.go" + + "ogle.cloud.retail.v2.UserEventInputConfi" + + "gB\003\340A\002\022A\n\rerrors_config\030\003 \001(\0132*.google.c" + + "loud.retail.v2.ImportErrorsConfig\"\305\001\n\033Im" + + "portCompletionDataRequest\0225\n\006parent\030\001 \001(" + + "\tB%\340A\002\372A\037\n\035retail.googleapis.com/Catalog" + + "\022L\n\014input_config\030\002 \001(\01321.google.cloud.re" + + "tail.v2.CompletionDataInputConfigB\003\340A\002\022!" + + "\n\031notification_pubsub_topic\030\003 \001(\t\"\351\001\n\022Pr" + + "oductInputConfig\022L\n\025product_inline_sourc" + + "e\030\001 \001(\0132+.google.cloud.retail.v2.Product" + + "InlineSourceH\000\0227\n\ngcs_source\030\002 \001(\0132!.goo" + + "gle.cloud.retail.v2.GcsSourceH\000\022B\n\020big_q" + + "uery_source\030\003 \001(\0132&.google.cloud.retail." + + "v2.BigQuerySourceH\000B\010\n\006source\"\377\001\n\024UserEv" + + "entInputConfig\022V\n\030user_event_inline_sour" + + "ce\030\001 \001(\0132-.google.cloud.retail.v2.UserEv" + + "entInlineSourceB\003\340A\002H\000\022<\n\ngcs_source\030\002 \001" + + "(\0132!.google.cloud.retail.v2.GcsSourceB\003\340" + + "A\002H\000\022G\n\020big_query_source\030\003 \001(\0132&.google." + + "cloud.retail.v2.BigQuerySourceB\003\340A\002H\000B\010\n" + + "\006source\"n\n\031CompletionDataInputConfig\022G\n\020" + + "big_query_source\030\001 \001(\0132&.google.cloud.re" + + "tail.v2.BigQuerySourceB\003\340A\002H\000B\010\n\006source\"" + + "\327\001\n\016ImportMetadata\022/\n\013create_time\030\001 \001(\0132" + + "\032.google.protobuf.Timestamp\022/\n\013update_ti" + + "me\030\002 \001(\0132\032.google.protobuf.Timestamp\022\025\n\r" + + "success_count\030\003 \001(\003\022\025\n\rfailure_count\030\004 \001" + + "(\003\022\022\n\nrequest_id\030\005 \001(\t\022!\n\031notification_p" + + "ubsub_topic\030\006 \001(\t\"\206\001\n\026ImportProductsResp" + "onse\022)\n\rerror_samples\030\001 \003(\0132\022.google.rpc" + ".Status\022A\n\rerrors_config\030\002 \001(\0132*.google." - + "cloud.retail.v2.ImportErrorsConfig\022F\n\016im" - + "port_summary\030\003 \001(\0132..google.cloud.retail" - + ".v2.UserEventImportSummary\"T\n\026UserEventI" - + "mportSummary\022\033\n\023joined_events_count\030\001 \001(" - + "\003\022\035\n\025unjoined_events_count\030\002 \001(\003B\306\001\n\032com" - + ".google.cloud.retail.v2B\021ImportConfigPro" - + "toP\001Z builder super(builder); } - private ImportMetadata() {} + private ImportMetadata() { + requestId_ = ""; + notificationPubsubTopic_ = ""; + } @java.lang.Override @SuppressWarnings({"unused"}) @@ -109,6 +112,20 @@ private ImportMetadata( failureCount_ = input.readInt64(); break; } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + requestId_ = s; + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + notificationPubsubTopic_ = s; + break; + } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -274,6 +291,114 @@ public long getFailureCount() { return failureCount_; } + public static final int REQUEST_ID_FIELD_NUMBER = 5; + private volatile java.lang.Object requestId_; + /** + * + * + *
+   * Id of the request / operation. This is parroting back the requestId
+   * that was passed in the request.
+   * 
+ * + * string request_id = 5; + * + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } + } + /** + * + * + *
+   * Id of the request / operation. This is parroting back the requestId
+   * that was passed in the request.
+   * 
+ * + * string request_id = 5; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NOTIFICATION_PUBSUB_TOPIC_FIELD_NUMBER = 6; + private volatile java.lang.Object notificationPubsubTopic_; + /** + * + * + *
+   * Pub/Sub topic for receiving notification. If this field is set,
+   * when the import is finished, a notification will be sent to
+   * specified Pub/Sub topic. The message data will be JSON string of a
+   * [Operation][google.longrunning.Operation].
+   * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+   * 
+ * + * string notification_pubsub_topic = 6; + * + * @return The notificationPubsubTopic. + */ + @java.lang.Override + public java.lang.String getNotificationPubsubTopic() { + java.lang.Object ref = notificationPubsubTopic_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + notificationPubsubTopic_ = s; + return s; + } + } + /** + * + * + *
+   * Pub/Sub topic for receiving notification. If this field is set,
+   * when the import is finished, a notification will be sent to
+   * specified Pub/Sub topic. The message data will be JSON string of a
+   * [Operation][google.longrunning.Operation].
+   * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+   * 
+ * + * string notification_pubsub_topic = 6; + * + * @return The bytes for notificationPubsubTopic. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNotificationPubsubTopicBytes() { + java.lang.Object ref = notificationPubsubTopic_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + notificationPubsubTopic_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -300,6 +425,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (failureCount_ != 0L) { output.writeInt64(4, failureCount_); } + if (!getRequestIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, requestId_); + } + if (!getNotificationPubsubTopicBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, notificationPubsubTopic_); + } unknownFields.writeTo(output); } @@ -321,6 +452,12 @@ public int getSerializedSize() { if (failureCount_ != 0L) { size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, failureCount_); } + if (!getRequestIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, requestId_); + } + if (!getNotificationPubsubTopicBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, notificationPubsubTopic_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -347,6 +484,8 @@ public boolean equals(final java.lang.Object obj) { } if (getSuccessCount() != other.getSuccessCount()) return false; if (getFailureCount() != other.getFailureCount()) return false; + if (!getRequestId().equals(other.getRequestId())) return false; + if (!getNotificationPubsubTopic().equals(other.getNotificationPubsubTopic())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -370,6 +509,10 @@ public int hashCode() { hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getSuccessCount()); hash = (37 * hash) + FAILURE_COUNT_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getFailureCount()); + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + NOTIFICATION_PUBSUB_TOPIC_FIELD_NUMBER; + hash = (53 * hash) + getNotificationPubsubTopic().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -532,6 +675,10 @@ public Builder clear() { failureCount_ = 0L; + requestId_ = ""; + + notificationPubsubTopic_ = ""; + return this; } @@ -571,6 +718,8 @@ public com.google.cloud.retail.v2.ImportMetadata buildPartial() { } result.successCount_ = successCount_; result.failureCount_ = failureCount_; + result.requestId_ = requestId_; + result.notificationPubsubTopic_ = notificationPubsubTopic_; onBuilt(); return result; } @@ -632,6 +781,14 @@ public Builder mergeFrom(com.google.cloud.retail.v2.ImportMetadata other) { if (other.getFailureCount() != 0L) { setFailureCount(other.getFailureCount()); } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + onChanged(); + } + if (!other.getNotificationPubsubTopic().isEmpty()) { + notificationPubsubTopic_ = other.notificationPubsubTopic_; + onChanged(); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -1140,6 +1297,243 @@ public Builder clearFailureCount() { return this; } + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Id of the request / operation. This is parroting back the requestId
+     * that was passed in the request.
+     * 
+ * + * string request_id = 5; + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Id of the request / operation. This is parroting back the requestId
+     * that was passed in the request.
+     * 
+ * + * string request_id = 5; + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Id of the request / operation. This is parroting back the requestId
+     * that was passed in the request.
+     * 
+ * + * string request_id = 5; + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + requestId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Id of the request / operation. This is parroting back the requestId
+     * that was passed in the request.
+     * 
+ * + * string request_id = 5; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + + requestId_ = getDefaultInstance().getRequestId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Id of the request / operation. This is parroting back the requestId
+     * that was passed in the request.
+     * 
+ * + * string request_id = 5; + * + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + requestId_ = value; + onChanged(); + return this; + } + + private java.lang.Object notificationPubsubTopic_ = ""; + /** + * + * + *
+     * Pub/Sub topic for receiving notification. If this field is set,
+     * when the import is finished, a notification will be sent to
+     * specified Pub/Sub topic. The message data will be JSON string of a
+     * [Operation][google.longrunning.Operation].
+     * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+     * 
+ * + * string notification_pubsub_topic = 6; + * + * @return The notificationPubsubTopic. + */ + public java.lang.String getNotificationPubsubTopic() { + java.lang.Object ref = notificationPubsubTopic_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + notificationPubsubTopic_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Pub/Sub topic for receiving notification. If this field is set,
+     * when the import is finished, a notification will be sent to
+     * specified Pub/Sub topic. The message data will be JSON string of a
+     * [Operation][google.longrunning.Operation].
+     * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+     * 
+ * + * string notification_pubsub_topic = 6; + * + * @return The bytes for notificationPubsubTopic. + */ + public com.google.protobuf.ByteString getNotificationPubsubTopicBytes() { + java.lang.Object ref = notificationPubsubTopic_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + notificationPubsubTopic_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Pub/Sub topic for receiving notification. If this field is set,
+     * when the import is finished, a notification will be sent to
+     * specified Pub/Sub topic. The message data will be JSON string of a
+     * [Operation][google.longrunning.Operation].
+     * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+     * 
+ * + * string notification_pubsub_topic = 6; + * + * @param value The notificationPubsubTopic to set. + * @return This builder for chaining. + */ + public Builder setNotificationPubsubTopic(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + notificationPubsubTopic_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Pub/Sub topic for receiving notification. If this field is set,
+     * when the import is finished, a notification will be sent to
+     * specified Pub/Sub topic. The message data will be JSON string of a
+     * [Operation][google.longrunning.Operation].
+     * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+     * 
+ * + * string notification_pubsub_topic = 6; + * + * @return This builder for chaining. + */ + public Builder clearNotificationPubsubTopic() { + + notificationPubsubTopic_ = getDefaultInstance().getNotificationPubsubTopic(); + onChanged(); + return this; + } + /** + * + * + *
+     * Pub/Sub topic for receiving notification. If this field is set,
+     * when the import is finished, a notification will be sent to
+     * specified Pub/Sub topic. The message data will be JSON string of a
+     * [Operation][google.longrunning.Operation].
+     * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+     * 
+ * + * string notification_pubsub_topic = 6; + * + * @param value The bytes for notificationPubsubTopic to set. + * @return This builder for chaining. + */ + public Builder setNotificationPubsubTopicBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + notificationPubsubTopic_ = value; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ImportMetadataOrBuilder.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ImportMetadataOrBuilder.java index 2fcb4274..3c919719 100644 --- a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ImportMetadataOrBuilder.java +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ImportMetadataOrBuilder.java @@ -121,4 +121,64 @@ public interface ImportMetadataOrBuilder * @return The failureCount. */ long getFailureCount(); + + /** + * + * + *
+   * Id of the request / operation. This is parroting back the requestId
+   * that was passed in the request.
+   * 
+ * + * string request_id = 5; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Id of the request / operation. This is parroting back the requestId
+   * that was passed in the request.
+   * 
+ * + * string request_id = 5; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Pub/Sub topic for receiving notification. If this field is set,
+   * when the import is finished, a notification will be sent to
+   * specified Pub/Sub topic. The message data will be JSON string of a
+   * [Operation][google.longrunning.Operation].
+   * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+   * 
+ * + * string notification_pubsub_topic = 6; + * + * @return The notificationPubsubTopic. + */ + java.lang.String getNotificationPubsubTopic(); + /** + * + * + *
+   * Pub/Sub topic for receiving notification. If this field is set,
+   * when the import is finished, a notification will be sent to
+   * specified Pub/Sub topic. The message data will be JSON string of a
+   * [Operation][google.longrunning.Operation].
+   * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+   * 
+ * + * string notification_pubsub_topic = 6; + * + * @return The bytes for notificationPubsubTopic. + */ + com.google.protobuf.ByteString getNotificationPubsubTopicBytes(); } diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ImportProductsRequest.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ImportProductsRequest.java index ab908457..7b9ed09c 100644 --- a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ImportProductsRequest.java +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ImportProductsRequest.java @@ -39,6 +39,9 @@ private ImportProductsRequest(com.google.protobuf.GeneratedMessageV3.Builder private ImportProductsRequest() { parent_ = ""; + requestId_ = ""; + reconciliationMode_ = 0; + notificationPubsubTopic_ = ""; } @java.lang.Override @@ -122,6 +125,27 @@ private ImportProductsRequest( updateMask_ = subBuilder.buildPartial(); } + break; + } + case 40: + { + int rawValue = input.readEnum(); + + reconciliationMode_ = rawValue; + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + requestId_ = s; + break; + } + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + + notificationPubsubTopic_ = s; break; } default: @@ -158,6 +182,185 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.cloud.retail.v2.ImportProductsRequest.Builder.class); } + /** + * + * + *
+   * Indicates how imported products are reconciled with the existing products
+   * created or imported before.
+   * 
+ * + * Protobuf enum {@code google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode} + */ + public enum ReconciliationMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Defaults to INCREMENTAL.
+     * 
+ * + * RECONCILIATION_MODE_UNSPECIFIED = 0; + */ + RECONCILIATION_MODE_UNSPECIFIED(0), + /** + * + * + *
+     * Inserts new products or updates existing products.
+     * 
+ * + * INCREMENTAL = 1; + */ + INCREMENTAL(1), + /** + * + * + *
+     * 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].
+     * 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.
+     * Contact Retail Support (retail-search-support@google.com) if you are
+     * interested in using Retail Search.
+     * 
+ * + * FULL = 2; + */ + FULL(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Defaults to INCREMENTAL.
+     * 
+ * + * RECONCILIATION_MODE_UNSPECIFIED = 0; + */ + public static final int RECONCILIATION_MODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Inserts new products or updates existing products.
+     * 
+ * + * INCREMENTAL = 1; + */ + public static final int INCREMENTAL_VALUE = 1; + /** + * + * + *
+     * 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].
+     * 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.
+     * Contact Retail Support (retail-search-support@google.com) if you are
+     * interested in using Retail Search.
+     * 
+ * + * FULL = 2; + */ + public static final int FULL_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ReconciliationMode valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static ReconciliationMode forNumber(int value) { + switch (value) { + case 0: + return RECONCILIATION_MODE_UNSPECIFIED; + case 1: + return INCREMENTAL; + case 2: + return FULL; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ReconciliationMode findValueByNumber(int number) { + return ReconciliationMode.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.retail.v2.ImportProductsRequest.getDescriptor().getEnumTypes().get(0); + } + + private static final ReconciliationMode[] VALUES = values(); + + public static ReconciliationMode valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private ReconciliationMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode) + } + public static final int PARENT_FIELD_NUMBER = 1; private volatile java.lang.Object parent_; /** @@ -170,7 +373,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * If updateMask is specified, requires products.update permission. * * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The parent. */ @@ -196,7 +401,9 @@ public java.lang.String getParent() { * If updateMask is specified, requires products.update permission. * * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The bytes for parent. */ @@ -213,6 +420,69 @@ public com.google.protobuf.ByteString getParentBytes() { } } + public static final int REQUEST_ID_FIELD_NUMBER = 6; + private volatile java.lang.Object 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: "[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; + * + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } + } + /** + * + * + *
+   * 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; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + public static final int INPUT_CONFIG_FIELD_NUMBER = 2; private com.google.cloud.retail.v2.ProductInputConfig inputConfig_; /** @@ -364,6 +634,115 @@ public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { return getUpdateMask(); } + public static final int RECONCILIATION_MODE_FIELD_NUMBER = 5; + private int reconciliationMode_; + /** + * + * + *
+   * The mode of reconciliation between existing products and the products to be
+   * imported. Defaults to
+   * [ReconciliationMode.INCREMENTAL][google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode.INCREMENTAL].
+   * 
+ * + * .google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode reconciliation_mode = 5; + * + * + * @return The enum numeric value on the wire for reconciliationMode. + */ + @java.lang.Override + public int getReconciliationModeValue() { + return reconciliationMode_; + } + /** + * + * + *
+   * The mode of reconciliation between existing products and the products to be
+   * imported. Defaults to
+   * [ReconciliationMode.INCREMENTAL][google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode.INCREMENTAL].
+   * 
+ * + * .google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode reconciliation_mode = 5; + * + * + * @return The reconciliationMode. + */ + @java.lang.Override + public com.google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode + getReconciliationMode() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode result = + com.google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode.valueOf( + reconciliationMode_); + return result == null + ? com.google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode.UNRECOGNIZED + : result; + } + + public static final int NOTIFICATION_PUBSUB_TOPIC_FIELD_NUMBER = 7; + private volatile java.lang.Object notificationPubsubTopic_; + /** + * + * + *
+   * Pub/Sub topic for receiving notification. If this field is set,
+   * when the import is finished, a notification will be sent to
+   * specified Pub/Sub topic. The message data will be JSON string of a
+   * [Operation][google.longrunning.Operation].
+   * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+   * Only supported when
+   * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2.ImportProductsRequest.reconciliation_mode]
+   * is set to `FULL`.
+   * 
+ * + * string notification_pubsub_topic = 7; + * + * @return The notificationPubsubTopic. + */ + @java.lang.Override + public java.lang.String getNotificationPubsubTopic() { + java.lang.Object ref = notificationPubsubTopic_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + notificationPubsubTopic_ = s; + return s; + } + } + /** + * + * + *
+   * Pub/Sub topic for receiving notification. If this field is set,
+   * when the import is finished, a notification will be sent to
+   * specified Pub/Sub topic. The message data will be JSON string of a
+   * [Operation][google.longrunning.Operation].
+   * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+   * Only supported when
+   * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2.ImportProductsRequest.reconciliation_mode]
+   * is set to `FULL`.
+   * 
+ * + * string notification_pubsub_topic = 7; + * + * @return The bytes for notificationPubsubTopic. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNotificationPubsubTopicBytes() { + java.lang.Object ref = notificationPubsubTopic_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + notificationPubsubTopic_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -390,6 +769,18 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (updateMask_ != null) { output.writeMessage(4, getUpdateMask()); } + if (reconciliationMode_ + != com.google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode + .RECONCILIATION_MODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(5, reconciliationMode_); + } + if (!getRequestIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, requestId_); + } + if (!getNotificationPubsubTopicBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, notificationPubsubTopic_); + } unknownFields.writeTo(output); } @@ -411,6 +802,18 @@ public int getSerializedSize() { if (updateMask_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getUpdateMask()); } + if (reconciliationMode_ + != com.google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode + .RECONCILIATION_MODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, reconciliationMode_); + } + if (!getRequestIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, requestId_); + } + if (!getNotificationPubsubTopicBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, notificationPubsubTopic_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -428,6 +831,7 @@ public boolean equals(final java.lang.Object obj) { (com.google.cloud.retail.v2.ImportProductsRequest) obj; if (!getParent().equals(other.getParent())) return false; + if (!getRequestId().equals(other.getRequestId())) return false; if (hasInputConfig() != other.hasInputConfig()) return false; if (hasInputConfig()) { if (!getInputConfig().equals(other.getInputConfig())) return false; @@ -440,6 +844,8 @@ public boolean equals(final java.lang.Object obj) { if (hasUpdateMask()) { if (!getUpdateMask().equals(other.getUpdateMask())) return false; } + if (reconciliationMode_ != other.reconciliationMode_) return false; + if (!getNotificationPubsubTopic().equals(other.getNotificationPubsubTopic())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -453,6 +859,8 @@ public int hashCode() { hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + PARENT_FIELD_NUMBER; hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); if (hasInputConfig()) { hash = (37 * hash) + INPUT_CONFIG_FIELD_NUMBER; hash = (53 * hash) + getInputConfig().hashCode(); @@ -465,6 +873,10 @@ public int hashCode() { hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; hash = (53 * hash) + getUpdateMask().hashCode(); } + hash = (37 * hash) + RECONCILIATION_MODE_FIELD_NUMBER; + hash = (53 * hash) + reconciliationMode_; + hash = (37 * hash) + NOTIFICATION_PUBSUB_TOPIC_FIELD_NUMBER; + hash = (53 * hash) + getNotificationPubsubTopic().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -612,6 +1024,8 @@ public Builder clear() { super.clear(); parent_ = ""; + requestId_ = ""; + if (inputConfigBuilder_ == null) { inputConfig_ = null; } else { @@ -630,6 +1044,10 @@ public Builder clear() { updateMask_ = null; updateMaskBuilder_ = null; } + reconciliationMode_ = 0; + + notificationPubsubTopic_ = ""; + return this; } @@ -658,6 +1076,7 @@ public com.google.cloud.retail.v2.ImportProductsRequest buildPartial() { com.google.cloud.retail.v2.ImportProductsRequest result = new com.google.cloud.retail.v2.ImportProductsRequest(this); result.parent_ = parent_; + result.requestId_ = requestId_; if (inputConfigBuilder_ == null) { result.inputConfig_ = inputConfig_; } else { @@ -673,6 +1092,8 @@ public com.google.cloud.retail.v2.ImportProductsRequest buildPartial() { } else { result.updateMask_ = updateMaskBuilder_.build(); } + result.reconciliationMode_ = reconciliationMode_; + result.notificationPubsubTopic_ = notificationPubsubTopic_; onBuilt(); return result; } @@ -727,6 +1148,10 @@ public Builder mergeFrom(com.google.cloud.retail.v2.ImportProductsRequest other) parent_ = other.parent_; onChanged(); } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + onChanged(); + } if (other.hasInputConfig()) { mergeInputConfig(other.getInputConfig()); } @@ -736,6 +1161,13 @@ public Builder mergeFrom(com.google.cloud.retail.v2.ImportProductsRequest other) if (other.hasUpdateMask()) { mergeUpdateMask(other.getUpdateMask()); } + if (other.reconciliationMode_ != 0) { + setReconciliationModeValue(other.getReconciliationModeValue()); + } + if (!other.getNotificationPubsubTopic().isEmpty()) { + notificationPubsubTopic_ = other.notificationPubsubTopic_; + onChanged(); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -776,7 +1208,9 @@ public Builder mergeFrom( * If updateMask is specified, requires products.update permission. * * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The parent. */ @@ -801,7 +1235,9 @@ public java.lang.String getParent() { * If updateMask is specified, requires products.update permission. * * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The bytes for parent. */ @@ -826,7 +1262,9 @@ public com.google.protobuf.ByteString getParentBytes() { * If updateMask is specified, requires products.update permission. * * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @param value The parent to set. * @return This builder for chaining. @@ -850,7 +1288,9 @@ public Builder setParent(java.lang.String value) { * If updateMask is specified, requires products.update permission. * * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return This builder for chaining. */ @@ -870,7 +1310,9 @@ public Builder clearParent() { * If updateMask is specified, requires products.update permission. * * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @param value The bytes for parent to set. * @return This builder for chaining. @@ -886,6 +1328,147 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { return this; } + private java.lang.Object 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: "[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; + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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; + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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; + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + requestId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 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; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + + requestId_ = getDefaultInstance().getRequestId(); + onChanged(); + return this; + } + /** + * + * + *
+     * 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; + * + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + requestId_ = value; + onChanged(); + return this; + } + private com.google.cloud.retail.v2.ProductInputConfig inputConfig_; private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.retail.v2.ProductInputConfig, @@ -1468,6 +2051,263 @@ public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { return updateMaskBuilder_; } + private int reconciliationMode_ = 0; + /** + * + * + *
+     * The mode of reconciliation between existing products and the products to be
+     * imported. Defaults to
+     * [ReconciliationMode.INCREMENTAL][google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode.INCREMENTAL].
+     * 
+ * + * + * .google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode reconciliation_mode = 5; + * + * + * @return The enum numeric value on the wire for reconciliationMode. + */ + @java.lang.Override + public int getReconciliationModeValue() { + return reconciliationMode_; + } + /** + * + * + *
+     * The mode of reconciliation between existing products and the products to be
+     * imported. Defaults to
+     * [ReconciliationMode.INCREMENTAL][google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode.INCREMENTAL].
+     * 
+ * + * + * .google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode reconciliation_mode = 5; + * + * + * @param value The enum numeric value on the wire for reconciliationMode to set. + * @return This builder for chaining. + */ + public Builder setReconciliationModeValue(int value) { + + reconciliationMode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The mode of reconciliation between existing products and the products to be
+     * imported. Defaults to
+     * [ReconciliationMode.INCREMENTAL][google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode.INCREMENTAL].
+     * 
+ * + * + * .google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode reconciliation_mode = 5; + * + * + * @return The reconciliationMode. + */ + @java.lang.Override + public com.google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode + getReconciliationMode() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode result = + com.google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode.valueOf( + reconciliationMode_); + return result == null + ? com.google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The mode of reconciliation between existing products and the products to be
+     * imported. Defaults to
+     * [ReconciliationMode.INCREMENTAL][google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode.INCREMENTAL].
+     * 
+ * + * + * .google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode reconciliation_mode = 5; + * + * + * @param value The reconciliationMode to set. + * @return This builder for chaining. + */ + public Builder setReconciliationMode( + com.google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode value) { + if (value == null) { + throw new NullPointerException(); + } + + reconciliationMode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The mode of reconciliation between existing products and the products to be
+     * imported. Defaults to
+     * [ReconciliationMode.INCREMENTAL][google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode.INCREMENTAL].
+     * 
+ * + * + * .google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode reconciliation_mode = 5; + * + * + * @return This builder for chaining. + */ + public Builder clearReconciliationMode() { + + reconciliationMode_ = 0; + onChanged(); + return this; + } + + private java.lang.Object notificationPubsubTopic_ = ""; + /** + * + * + *
+     * Pub/Sub topic for receiving notification. If this field is set,
+     * when the import is finished, a notification will be sent to
+     * specified Pub/Sub topic. The message data will be JSON string of a
+     * [Operation][google.longrunning.Operation].
+     * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+     * Only supported when
+     * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2.ImportProductsRequest.reconciliation_mode]
+     * is set to `FULL`.
+     * 
+ * + * string notification_pubsub_topic = 7; + * + * @return The notificationPubsubTopic. + */ + public java.lang.String getNotificationPubsubTopic() { + java.lang.Object ref = notificationPubsubTopic_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + notificationPubsubTopic_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Pub/Sub topic for receiving notification. If this field is set,
+     * when the import is finished, a notification will be sent to
+     * specified Pub/Sub topic. The message data will be JSON string of a
+     * [Operation][google.longrunning.Operation].
+     * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+     * Only supported when
+     * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2.ImportProductsRequest.reconciliation_mode]
+     * is set to `FULL`.
+     * 
+ * + * string notification_pubsub_topic = 7; + * + * @return The bytes for notificationPubsubTopic. + */ + public com.google.protobuf.ByteString getNotificationPubsubTopicBytes() { + java.lang.Object ref = notificationPubsubTopic_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + notificationPubsubTopic_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Pub/Sub topic for receiving notification. If this field is set,
+     * when the import is finished, a notification will be sent to
+     * specified Pub/Sub topic. The message data will be JSON string of a
+     * [Operation][google.longrunning.Operation].
+     * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+     * Only supported when
+     * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2.ImportProductsRequest.reconciliation_mode]
+     * is set to `FULL`.
+     * 
+ * + * string notification_pubsub_topic = 7; + * + * @param value The notificationPubsubTopic to set. + * @return This builder for chaining. + */ + public Builder setNotificationPubsubTopic(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + notificationPubsubTopic_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Pub/Sub topic for receiving notification. If this field is set,
+     * when the import is finished, a notification will be sent to
+     * specified Pub/Sub topic. The message data will be JSON string of a
+     * [Operation][google.longrunning.Operation].
+     * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+     * Only supported when
+     * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2.ImportProductsRequest.reconciliation_mode]
+     * is set to `FULL`.
+     * 
+ * + * string notification_pubsub_topic = 7; + * + * @return This builder for chaining. + */ + public Builder clearNotificationPubsubTopic() { + + notificationPubsubTopic_ = getDefaultInstance().getNotificationPubsubTopic(); + onChanged(); + return this; + } + /** + * + * + *
+     * Pub/Sub topic for receiving notification. If this field is set,
+     * when the import is finished, a notification will be sent to
+     * specified Pub/Sub topic. The message data will be JSON string of a
+     * [Operation][google.longrunning.Operation].
+     * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+     * Only supported when
+     * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2.ImportProductsRequest.reconciliation_mode]
+     * is set to `FULL`.
+     * 
+ * + * string notification_pubsub_topic = 7; + * + * @param value The bytes for notificationPubsubTopic to set. + * @return This builder for chaining. + */ + public Builder setNotificationPubsubTopicBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + notificationPubsubTopic_ = value; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ImportProductsRequestOrBuilder.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ImportProductsRequestOrBuilder.java index 88494ca0..e13812be 100644 --- a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ImportProductsRequestOrBuilder.java +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ImportProductsRequestOrBuilder.java @@ -33,7 +33,9 @@ public interface ImportProductsRequestOrBuilder * If updateMask is specified, requires products.update permission. * * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The parent. */ @@ -48,12 +50,53 @@ public interface ImportProductsRequestOrBuilder * If updateMask is specified, requires products.update permission. * * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The bytes for parent. */ com.google.protobuf.ByteString getParentBytes(); + /** + * + * + *
+   * 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; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * 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; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + /** * * @@ -167,4 +210,74 @@ public interface ImportProductsRequestOrBuilder * .google.protobuf.FieldMask update_mask = 4; */ com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * The mode of reconciliation between existing products and the products to be
+   * imported. Defaults to
+   * [ReconciliationMode.INCREMENTAL][google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode.INCREMENTAL].
+   * 
+ * + * .google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode reconciliation_mode = 5; + * + * + * @return The enum numeric value on the wire for reconciliationMode. + */ + int getReconciliationModeValue(); + /** + * + * + *
+   * The mode of reconciliation between existing products and the products to be
+   * imported. Defaults to
+   * [ReconciliationMode.INCREMENTAL][google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode.INCREMENTAL].
+   * 
+ * + * .google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode reconciliation_mode = 5; + * + * + * @return The reconciliationMode. + */ + com.google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode getReconciliationMode(); + + /** + * + * + *
+   * Pub/Sub topic for receiving notification. If this field is set,
+   * when the import is finished, a notification will be sent to
+   * specified Pub/Sub topic. The message data will be JSON string of a
+   * [Operation][google.longrunning.Operation].
+   * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+   * Only supported when
+   * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2.ImportProductsRequest.reconciliation_mode]
+   * is set to `FULL`.
+   * 
+ * + * string notification_pubsub_topic = 7; + * + * @return The notificationPubsubTopic. + */ + java.lang.String getNotificationPubsubTopic(); + /** + * + * + *
+   * Pub/Sub topic for receiving notification. If this field is set,
+   * when the import is finished, a notification will be sent to
+   * specified Pub/Sub topic. The message data will be JSON string of a
+   * [Operation][google.longrunning.Operation].
+   * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+   * Only supported when
+   * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2.ImportProductsRequest.reconciliation_mode]
+   * is set to `FULL`.
+   * 
+ * + * string notification_pubsub_topic = 7; + * + * @return The bytes for notificationPubsubTopic. + */ + com.google.protobuf.ByteString getNotificationPubsubTopicBytes(); } diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ImportUserEventsRequest.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ImportUserEventsRequest.java index 3194be88..2b5b2ee9 100644 --- a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ImportUserEventsRequest.java +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ImportUserEventsRequest.java @@ -152,7 +152,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * Required. `projects/1234/locations/global/catalogs/default_catalog` * * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The parent. */ @@ -175,7 +177,9 @@ public java.lang.String getParent() { * Required. `projects/1234/locations/global/catalogs/default_catalog` * * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The bytes for parent. */ @@ -679,7 +683,9 @@ public Builder mergeFrom( * Required. `projects/1234/locations/global/catalogs/default_catalog` * * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The parent. */ @@ -701,7 +707,9 @@ public java.lang.String getParent() { * Required. `projects/1234/locations/global/catalogs/default_catalog` * * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The bytes for parent. */ @@ -723,7 +731,9 @@ public com.google.protobuf.ByteString getParentBytes() { * Required. `projects/1234/locations/global/catalogs/default_catalog` * * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @param value The parent to set. * @return This builder for chaining. @@ -744,7 +754,9 @@ public Builder setParent(java.lang.String value) { * Required. `projects/1234/locations/global/catalogs/default_catalog` * * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return This builder for chaining. */ @@ -761,7 +773,9 @@ public Builder clearParent() { * Required. `projects/1234/locations/global/catalogs/default_catalog` * * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @param value The bytes for parent to set. * @return This builder for chaining. diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ImportUserEventsRequestOrBuilder.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ImportUserEventsRequestOrBuilder.java index f8a5c0f6..25ba4677 100644 --- a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ImportUserEventsRequestOrBuilder.java +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ImportUserEventsRequestOrBuilder.java @@ -30,7 +30,9 @@ public interface ImportUserEventsRequestOrBuilder * Required. `projects/1234/locations/global/catalogs/default_catalog` * * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The parent. */ @@ -42,7 +44,9 @@ public interface ImportUserEventsRequestOrBuilder * Required. `projects/1234/locations/global/catalogs/default_catalog` * * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The bytes for parent. */ diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/Interval.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/Interval.java new file mode 100644 index 00000000..00850345 --- /dev/null +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/Interval.java @@ -0,0 +1,1157 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2/common.proto + +package com.google.cloud.retail.v2; + +/** + * + * + *
+ * A floating point interval.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2.Interval} + */ +public final class Interval extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.Interval) + IntervalOrBuilder { + private static final long serialVersionUID = 0L; + // Use Interval.newBuilder() to construct. + private Interval(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Interval() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Interval(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Interval( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 9: + { + minCase_ = 1; + min_ = input.readDouble(); + break; + } + case 17: + { + minCase_ = 2; + min_ = input.readDouble(); + break; + } + case 25: + { + maxCase_ = 3; + max_ = input.readDouble(); + break; + } + case 33: + { + maxCase_ = 4; + max_ = input.readDouble(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.CommonProto + .internal_static_google_cloud_retail_v2_Interval_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.CommonProto + .internal_static_google_cloud_retail_v2_Interval_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.Interval.class, + com.google.cloud.retail.v2.Interval.Builder.class); + } + + private int minCase_ = 0; + private java.lang.Object min_; + + public enum MinCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + MINIMUM(1), + EXCLUSIVE_MINIMUM(2), + MIN_NOT_SET(0); + private final int value; + + private MinCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static MinCase valueOf(int value) { + return forNumber(value); + } + + public static MinCase forNumber(int value) { + switch (value) { + case 1: + return MINIMUM; + case 2: + return EXCLUSIVE_MINIMUM; + case 0: + return MIN_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public MinCase getMinCase() { + return MinCase.forNumber(minCase_); + } + + private int maxCase_ = 0; + private java.lang.Object max_; + + public enum MaxCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + MAXIMUM(3), + EXCLUSIVE_MAXIMUM(4), + MAX_NOT_SET(0); + private final int value; + + private MaxCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static MaxCase valueOf(int value) { + return forNumber(value); + } + + public static MaxCase forNumber(int value) { + switch (value) { + case 3: + return MAXIMUM; + case 4: + return EXCLUSIVE_MAXIMUM; + case 0: + return MAX_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public MaxCase getMaxCase() { + return MaxCase.forNumber(maxCase_); + } + + public static final int MINIMUM_FIELD_NUMBER = 1; + /** + * + * + *
+   * Inclusive lower bound.
+   * 
+ * + * double minimum = 1; + * + * @return Whether the minimum field is set. + */ + @java.lang.Override + public boolean hasMinimum() { + return minCase_ == 1; + } + /** + * + * + *
+   * Inclusive lower bound.
+   * 
+ * + * double minimum = 1; + * + * @return The minimum. + */ + @java.lang.Override + public double getMinimum() { + if (minCase_ == 1) { + return (java.lang.Double) min_; + } + return 0D; + } + + public static final int EXCLUSIVE_MINIMUM_FIELD_NUMBER = 2; + /** + * + * + *
+   * Exclusive lower bound.
+   * 
+ * + * double exclusive_minimum = 2; + * + * @return Whether the exclusiveMinimum field is set. + */ + @java.lang.Override + public boolean hasExclusiveMinimum() { + return minCase_ == 2; + } + /** + * + * + *
+   * Exclusive lower bound.
+   * 
+ * + * double exclusive_minimum = 2; + * + * @return The exclusiveMinimum. + */ + @java.lang.Override + public double getExclusiveMinimum() { + if (minCase_ == 2) { + return (java.lang.Double) min_; + } + return 0D; + } + + public static final int MAXIMUM_FIELD_NUMBER = 3; + /** + * + * + *
+   * Inclusive upper bound.
+   * 
+ * + * double maximum = 3; + * + * @return Whether the maximum field is set. + */ + @java.lang.Override + public boolean hasMaximum() { + return maxCase_ == 3; + } + /** + * + * + *
+   * Inclusive upper bound.
+   * 
+ * + * double maximum = 3; + * + * @return The maximum. + */ + @java.lang.Override + public double getMaximum() { + if (maxCase_ == 3) { + return (java.lang.Double) max_; + } + return 0D; + } + + public static final int EXCLUSIVE_MAXIMUM_FIELD_NUMBER = 4; + /** + * + * + *
+   * Exclusive upper bound.
+   * 
+ * + * double exclusive_maximum = 4; + * + * @return Whether the exclusiveMaximum field is set. + */ + @java.lang.Override + public boolean hasExclusiveMaximum() { + return maxCase_ == 4; + } + /** + * + * + *
+   * Exclusive upper bound.
+   * 
+ * + * double exclusive_maximum = 4; + * + * @return The exclusiveMaximum. + */ + @java.lang.Override + public double getExclusiveMaximum() { + if (maxCase_ == 4) { + return (java.lang.Double) max_; + } + return 0D; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (minCase_ == 1) { + output.writeDouble(1, (double) ((java.lang.Double) min_)); + } + if (minCase_ == 2) { + output.writeDouble(2, (double) ((java.lang.Double) min_)); + } + if (maxCase_ == 3) { + output.writeDouble(3, (double) ((java.lang.Double) max_)); + } + if (maxCase_ == 4) { + output.writeDouble(4, (double) ((java.lang.Double) max_)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (minCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeDoubleSize( + 1, (double) ((java.lang.Double) min_)); + } + if (minCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeDoubleSize( + 2, (double) ((java.lang.Double) min_)); + } + if (maxCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeDoubleSize( + 3, (double) ((java.lang.Double) max_)); + } + if (maxCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeDoubleSize( + 4, (double) ((java.lang.Double) max_)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.retail.v2.Interval)) { + return super.equals(obj); + } + com.google.cloud.retail.v2.Interval other = (com.google.cloud.retail.v2.Interval) obj; + + if (!getMinCase().equals(other.getMinCase())) return false; + switch (minCase_) { + case 1: + if (java.lang.Double.doubleToLongBits(getMinimum()) + != java.lang.Double.doubleToLongBits(other.getMinimum())) return false; + break; + case 2: + if (java.lang.Double.doubleToLongBits(getExclusiveMinimum()) + != java.lang.Double.doubleToLongBits(other.getExclusiveMinimum())) return false; + break; + case 0: + default: + } + if (!getMaxCase().equals(other.getMaxCase())) return false; + switch (maxCase_) { + case 3: + if (java.lang.Double.doubleToLongBits(getMaximum()) + != java.lang.Double.doubleToLongBits(other.getMaximum())) return false; + break; + case 4: + if (java.lang.Double.doubleToLongBits(getExclusiveMaximum()) + != java.lang.Double.doubleToLongBits(other.getExclusiveMaximum())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (minCase_) { + case 1: + hash = (37 * hash) + MINIMUM_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getMinimum())); + break; + case 2: + hash = (37 * hash) + EXCLUSIVE_MINIMUM_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getExclusiveMinimum())); + break; + case 0: + default: + } + switch (maxCase_) { + case 3: + hash = (37 * hash) + MAXIMUM_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getMaximum())); + break; + case 4: + hash = (37 * hash) + EXCLUSIVE_MAXIMUM_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getExclusiveMaximum())); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2.Interval parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.Interval parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.Interval parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.Interval parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.Interval parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.Interval parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.Interval parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.Interval parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.Interval parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.Interval parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.Interval parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.Interval parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2.Interval prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A floating point interval.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2.Interval} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.Interval) + com.google.cloud.retail.v2.IntervalOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.CommonProto + .internal_static_google_cloud_retail_v2_Interval_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.CommonProto + .internal_static_google_cloud_retail_v2_Interval_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.Interval.class, + com.google.cloud.retail.v2.Interval.Builder.class); + } + + // Construct using com.google.cloud.retail.v2.Interval.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + minCase_ = 0; + min_ = null; + maxCase_ = 0; + max_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2.CommonProto + .internal_static_google_cloud_retail_v2_Interval_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2.Interval getDefaultInstanceForType() { + return com.google.cloud.retail.v2.Interval.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2.Interval build() { + com.google.cloud.retail.v2.Interval result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2.Interval buildPartial() { + com.google.cloud.retail.v2.Interval result = new com.google.cloud.retail.v2.Interval(this); + if (minCase_ == 1) { + result.min_ = min_; + } + if (minCase_ == 2) { + result.min_ = min_; + } + if (maxCase_ == 3) { + result.max_ = max_; + } + if (maxCase_ == 4) { + result.max_ = max_; + } + result.minCase_ = minCase_; + result.maxCase_ = maxCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.retail.v2.Interval) { + return mergeFrom((com.google.cloud.retail.v2.Interval) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2.Interval other) { + if (other == com.google.cloud.retail.v2.Interval.getDefaultInstance()) return this; + switch (other.getMinCase()) { + case MINIMUM: + { + setMinimum(other.getMinimum()); + break; + } + case EXCLUSIVE_MINIMUM: + { + setExclusiveMinimum(other.getExclusiveMinimum()); + break; + } + case MIN_NOT_SET: + { + break; + } + } + switch (other.getMaxCase()) { + case MAXIMUM: + { + setMaximum(other.getMaximum()); + break; + } + case EXCLUSIVE_MAXIMUM: + { + setExclusiveMaximum(other.getExclusiveMaximum()); + break; + } + case MAX_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.retail.v2.Interval parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2.Interval) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int minCase_ = 0; + private java.lang.Object min_; + + public MinCase getMinCase() { + return MinCase.forNumber(minCase_); + } + + public Builder clearMin() { + minCase_ = 0; + min_ = null; + onChanged(); + return this; + } + + private int maxCase_ = 0; + private java.lang.Object max_; + + public MaxCase getMaxCase() { + return MaxCase.forNumber(maxCase_); + } + + public Builder clearMax() { + maxCase_ = 0; + max_ = null; + onChanged(); + return this; + } + + /** + * + * + *
+     * Inclusive lower bound.
+     * 
+ * + * double minimum = 1; + * + * @return Whether the minimum field is set. + */ + public boolean hasMinimum() { + return minCase_ == 1; + } + /** + * + * + *
+     * Inclusive lower bound.
+     * 
+ * + * double minimum = 1; + * + * @return The minimum. + */ + public double getMinimum() { + if (minCase_ == 1) { + return (java.lang.Double) min_; + } + return 0D; + } + /** + * + * + *
+     * Inclusive lower bound.
+     * 
+ * + * double minimum = 1; + * + * @param value The minimum to set. + * @return This builder for chaining. + */ + public Builder setMinimum(double value) { + minCase_ = 1; + min_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Inclusive lower bound.
+     * 
+ * + * double minimum = 1; + * + * @return This builder for chaining. + */ + public Builder clearMinimum() { + if (minCase_ == 1) { + minCase_ = 0; + min_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Exclusive lower bound.
+     * 
+ * + * double exclusive_minimum = 2; + * + * @return Whether the exclusiveMinimum field is set. + */ + public boolean hasExclusiveMinimum() { + return minCase_ == 2; + } + /** + * + * + *
+     * Exclusive lower bound.
+     * 
+ * + * double exclusive_minimum = 2; + * + * @return The exclusiveMinimum. + */ + public double getExclusiveMinimum() { + if (minCase_ == 2) { + return (java.lang.Double) min_; + } + return 0D; + } + /** + * + * + *
+     * Exclusive lower bound.
+     * 
+ * + * double exclusive_minimum = 2; + * + * @param value The exclusiveMinimum to set. + * @return This builder for chaining. + */ + public Builder setExclusiveMinimum(double value) { + minCase_ = 2; + min_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Exclusive lower bound.
+     * 
+ * + * double exclusive_minimum = 2; + * + * @return This builder for chaining. + */ + public Builder clearExclusiveMinimum() { + if (minCase_ == 2) { + minCase_ = 0; + min_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Inclusive upper bound.
+     * 
+ * + * double maximum = 3; + * + * @return Whether the maximum field is set. + */ + public boolean hasMaximum() { + return maxCase_ == 3; + } + /** + * + * + *
+     * Inclusive upper bound.
+     * 
+ * + * double maximum = 3; + * + * @return The maximum. + */ + public double getMaximum() { + if (maxCase_ == 3) { + return (java.lang.Double) max_; + } + return 0D; + } + /** + * + * + *
+     * Inclusive upper bound.
+     * 
+ * + * double maximum = 3; + * + * @param value The maximum to set. + * @return This builder for chaining. + */ + public Builder setMaximum(double value) { + maxCase_ = 3; + max_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Inclusive upper bound.
+     * 
+ * + * double maximum = 3; + * + * @return This builder for chaining. + */ + public Builder clearMaximum() { + if (maxCase_ == 3) { + maxCase_ = 0; + max_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Exclusive upper bound.
+     * 
+ * + * double exclusive_maximum = 4; + * + * @return Whether the exclusiveMaximum field is set. + */ + public boolean hasExclusiveMaximum() { + return maxCase_ == 4; + } + /** + * + * + *
+     * Exclusive upper bound.
+     * 
+ * + * double exclusive_maximum = 4; + * + * @return The exclusiveMaximum. + */ + public double getExclusiveMaximum() { + if (maxCase_ == 4) { + return (java.lang.Double) max_; + } + return 0D; + } + /** + * + * + *
+     * Exclusive upper bound.
+     * 
+ * + * double exclusive_maximum = 4; + * + * @param value The exclusiveMaximum to set. + * @return This builder for chaining. + */ + public Builder setExclusiveMaximum(double value) { + maxCase_ = 4; + max_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Exclusive upper bound.
+     * 
+ * + * double exclusive_maximum = 4; + * + * @return This builder for chaining. + */ + public Builder clearExclusiveMaximum() { + if (maxCase_ == 4) { + maxCase_ = 0; + max_ = null; + onChanged(); + } + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.Interval) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.Interval) + private static final com.google.cloud.retail.v2.Interval DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2.Interval(); + } + + public static com.google.cloud.retail.v2.Interval getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Interval parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Interval(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.retail.v2.Interval getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/IntervalOrBuilder.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/IntervalOrBuilder.java new file mode 100644 index 00000000..8eefd126 --- /dev/null +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/IntervalOrBuilder.java @@ -0,0 +1,129 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2/common.proto + +package com.google.cloud.retail.v2; + +public interface IntervalOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2.Interval) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Inclusive lower bound.
+   * 
+ * + * double minimum = 1; + * + * @return Whether the minimum field is set. + */ + boolean hasMinimum(); + /** + * + * + *
+   * Inclusive lower bound.
+   * 
+ * + * double minimum = 1; + * + * @return The minimum. + */ + double getMinimum(); + + /** + * + * + *
+   * Exclusive lower bound.
+   * 
+ * + * double exclusive_minimum = 2; + * + * @return Whether the exclusiveMinimum field is set. + */ + boolean hasExclusiveMinimum(); + /** + * + * + *
+   * Exclusive lower bound.
+   * 
+ * + * double exclusive_minimum = 2; + * + * @return The exclusiveMinimum. + */ + double getExclusiveMinimum(); + + /** + * + * + *
+   * Inclusive upper bound.
+   * 
+ * + * double maximum = 3; + * + * @return Whether the maximum field is set. + */ + boolean hasMaximum(); + /** + * + * + *
+   * Inclusive upper bound.
+   * 
+ * + * double maximum = 3; + * + * @return The maximum. + */ + double getMaximum(); + + /** + * + * + *
+   * Exclusive upper bound.
+   * 
+ * + * double exclusive_maximum = 4; + * + * @return Whether the exclusiveMaximum field is set. + */ + boolean hasExclusiveMaximum(); + /** + * + * + *
+   * Exclusive upper bound.
+   * 
+ * + * double exclusive_maximum = 4; + * + * @return The exclusiveMaximum. + */ + double getExclusiveMaximum(); + + public com.google.cloud.retail.v2.Interval.MinCase getMinCase(); + + public com.google.cloud.retail.v2.Interval.MaxCase getMaxCase(); +} diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ListProductsRequest.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ListProductsRequest.java new file mode 100644 index 00000000..6557f089 --- /dev/null +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ListProductsRequest.java @@ -0,0 +1,1802 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2/product_service.proto + +package com.google.cloud.retail.v2; + +/** + * + * + *
+ * Request message for
+ * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2.ListProductsRequest} + */ +public final class ListProductsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.ListProductsRequest) + ListProductsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListProductsRequest.newBuilder() to construct. + private ListProductsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListProductsRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListProductsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListProductsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: + { + pageSize_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 42: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (readMask_ != null) { + subBuilder = readMask_.toBuilder(); + } + readMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(readMask_); + readMask_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.ProductServiceProto + .internal_static_google_cloud_retail_v2_ListProductsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.ProductServiceProto + .internal_static_google_cloud_retail_v2_ListProductsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.ListProductsRequest.class, + com.google.cloud.retail.v2.ListProductsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent branch resource name, such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use
+   * `default_branch` as the branch ID, to list products under the default
+   * branch.
+   * If the caller does not have permission to list
+   * [Product][google.cloud.retail.v2.Product]s under this branch, regardless of
+   * whether or not this branch exists, a PERMISSION_DENIED error is returned.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent branch resource name, such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use
+   * `default_branch` as the branch ID, to list products under the default
+   * branch.
+   * If the caller does not have permission to list
+   * [Product][google.cloud.retail.v2.Product]s under this branch, regardless of
+   * whether or not this branch exists, a PERMISSION_DENIED error is returned.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * + * + *
+   * Maximum number of [Product][google.cloud.retail.v2.Product]s to return. If
+   * unspecified, defaults to 100. The maximum allowed value is 1000. Values
+   * above 1000 will be coerced to 1000.
+   * If this field is negative, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * A page token
+   * [ListProductsResponse.next_page_token][google.cloud.retail.v2.ListProductsResponse.next_page_token],
+   * received from a previous
+   * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]
+   * call. Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to
+   * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]
+   * must match the call that provided the page token. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A page token
+   * [ListProductsResponse.next_page_token][google.cloud.retail.v2.ListProductsResponse.next_page_token],
+   * received from a previous
+   * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]
+   * call. Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to
+   * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]
+   * must match the call that provided the page token. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 4; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * A filter to apply on the list results. Supported features:
+   * * List all the products under the parent branch if
+   * [filter][google.cloud.retail.v2.ListProductsRequest.filter] is unset.
+   * * List [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2.Product]s sharing the same
+   *   [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+   *   [Product][google.cloud.retail.v2.Product]. For example:
+   *     `primary_product_id = "some_product_id"`
+   * * List [Product][google.cloud.retail.v2.Product]s bundled in a
+   * [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]
+   * [Product][google.cloud.retail.v2.Product].
+   *   For example:
+   *     `collection_product_id = "some_product_id"`
+   * * List [Product][google.cloud.retail.v2.Product]s with a partibular type.
+   * For example:
+   *     `type = "PRIMARY"`
+   *     `type = "VARIANT"`
+   *     `type = "COLLECTION"`
+   * If the field is unrecognizable, an INVALID_ARGUMENT error is returned.
+   * If the specified
+   * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2.Product] or
+   * [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]
+   * [Product][google.cloud.retail.v2.Product] does not exist, a NOT_FOUND error
+   * is returned.
+   * 
+ * + * string filter = 4; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * A filter to apply on the list results. Supported features:
+   * * List all the products under the parent branch if
+   * [filter][google.cloud.retail.v2.ListProductsRequest.filter] is unset.
+   * * List [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2.Product]s sharing the same
+   *   [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+   *   [Product][google.cloud.retail.v2.Product]. For example:
+   *     `primary_product_id = "some_product_id"`
+   * * List [Product][google.cloud.retail.v2.Product]s bundled in a
+   * [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]
+   * [Product][google.cloud.retail.v2.Product].
+   *   For example:
+   *     `collection_product_id = "some_product_id"`
+   * * List [Product][google.cloud.retail.v2.Product]s with a partibular type.
+   * For example:
+   *     `type = "PRIMARY"`
+   *     `type = "VARIANT"`
+   *     `type = "COLLECTION"`
+   * If the field is unrecognizable, an INVALID_ARGUMENT error is returned.
+   * If the specified
+   * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2.Product] or
+   * [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]
+   * [Product][google.cloud.retail.v2.Product] does not exist, a NOT_FOUND error
+   * is returned.
+   * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int READ_MASK_FIELD_NUMBER = 5; + private com.google.protobuf.FieldMask readMask_; + /** + * + * + *
+   * The fields of [Product][google.cloud.retail.v2.Product] to return in the
+   * responses. If not set or empty, the following fields are returned:
+   * * [Product.name][google.cloud.retail.v2.Product.name]
+   * * [Product.id][google.cloud.retail.v2.Product.id]
+   * * [Product.title][google.cloud.retail.v2.Product.title]
+   * * [Product.uri][google.cloud.retail.v2.Product.uri]
+   * * [Product.images][google.cloud.retail.v2.Product.images]
+   * * [Product.price_info][google.cloud.retail.v2.Product.price_info]
+   * * [Product.brands][google.cloud.retail.v2.Product.brands]
+   * If "*" is provided, all fields are returned.
+   * [Product.name][google.cloud.retail.v2.Product.name] is always returned no
+   * matter what mask is set.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * .google.protobuf.FieldMask read_mask = 5; + * + * @return Whether the readMask field is set. + */ + @java.lang.Override + public boolean hasReadMask() { + return readMask_ != null; + } + /** + * + * + *
+   * The fields of [Product][google.cloud.retail.v2.Product] to return in the
+   * responses. If not set or empty, the following fields are returned:
+   * * [Product.name][google.cloud.retail.v2.Product.name]
+   * * [Product.id][google.cloud.retail.v2.Product.id]
+   * * [Product.title][google.cloud.retail.v2.Product.title]
+   * * [Product.uri][google.cloud.retail.v2.Product.uri]
+   * * [Product.images][google.cloud.retail.v2.Product.images]
+   * * [Product.price_info][google.cloud.retail.v2.Product.price_info]
+   * * [Product.brands][google.cloud.retail.v2.Product.brands]
+   * If "*" is provided, all fields are returned.
+   * [Product.name][google.cloud.retail.v2.Product.name] is always returned no
+   * matter what mask is set.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * .google.protobuf.FieldMask read_mask = 5; + * + * @return The readMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getReadMask() { + return readMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : readMask_; + } + /** + * + * + *
+   * The fields of [Product][google.cloud.retail.v2.Product] to return in the
+   * responses. If not set or empty, the following fields are returned:
+   * * [Product.name][google.cloud.retail.v2.Product.name]
+   * * [Product.id][google.cloud.retail.v2.Product.id]
+   * * [Product.title][google.cloud.retail.v2.Product.title]
+   * * [Product.uri][google.cloud.retail.v2.Product.uri]
+   * * [Product.images][google.cloud.retail.v2.Product.images]
+   * * [Product.price_info][google.cloud.retail.v2.Product.price_info]
+   * * [Product.brands][google.cloud.retail.v2.Product.brands]
+   * If "*" is provided, all fields are returned.
+   * [Product.name][google.cloud.retail.v2.Product.name] is always returned no
+   * matter what mask is set.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * .google.protobuf.FieldMask read_mask = 5; + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getReadMaskOrBuilder() { + return getReadMask(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); + } + if (readMask_ != null) { + output.writeMessage(5, getReadMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); + } + if (readMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getReadMask()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.retail.v2.ListProductsRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2.ListProductsRequest other = + (com.google.cloud.retail.v2.ListProductsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (hasReadMask() != other.hasReadMask()) return false; + if (hasReadMask()) { + if (!getReadMask().equals(other.getReadMask())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + if (hasReadMask()) { + hash = (37 * hash) + READ_MASK_FIELD_NUMBER; + hash = (53 * hash) + getReadMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2.ListProductsRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.ListProductsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.ListProductsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.ListProductsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.ListProductsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.ListProductsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.ListProductsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.ListProductsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.ListProductsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.ListProductsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.ListProductsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.ListProductsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2.ListProductsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for
+   * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2.ListProductsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.ListProductsRequest) + com.google.cloud.retail.v2.ListProductsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.ProductServiceProto + .internal_static_google_cloud_retail_v2_ListProductsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.ProductServiceProto + .internal_static_google_cloud_retail_v2_ListProductsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.ListProductsRequest.class, + com.google.cloud.retail.v2.ListProductsRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2.ListProductsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + filter_ = ""; + + if (readMaskBuilder_ == null) { + readMask_ = null; + } else { + readMask_ = null; + readMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2.ProductServiceProto + .internal_static_google_cloud_retail_v2_ListProductsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2.ListProductsRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2.ListProductsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2.ListProductsRequest build() { + com.google.cloud.retail.v2.ListProductsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2.ListProductsRequest buildPartial() { + com.google.cloud.retail.v2.ListProductsRequest result = + new com.google.cloud.retail.v2.ListProductsRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + result.filter_ = filter_; + if (readMaskBuilder_ == null) { + result.readMask_ = readMask_; + } else { + result.readMask_ = readMaskBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.retail.v2.ListProductsRequest) { + return mergeFrom((com.google.cloud.retail.v2.ListProductsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2.ListProductsRequest other) { + if (other == com.google.cloud.retail.v2.ListProductsRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (other.hasReadMask()) { + mergeReadMask(other.getReadMask()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.retail.v2.ListProductsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2.ListProductsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent branch resource name, such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use
+     * `default_branch` as the branch ID, to list products under the default
+     * branch.
+     * If the caller does not have permission to list
+     * [Product][google.cloud.retail.v2.Product]s under this branch, regardless of
+     * whether or not this branch exists, a PERMISSION_DENIED error is returned.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent branch resource name, such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use
+     * `default_branch` as the branch ID, to list products under the default
+     * branch.
+     * If the caller does not have permission to list
+     * [Product][google.cloud.retail.v2.Product]s under this branch, regardless of
+     * whether or not this branch exists, a PERMISSION_DENIED error is returned.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent branch resource name, such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use
+     * `default_branch` as the branch ID, to list products under the default
+     * branch.
+     * If the caller does not have permission to list
+     * [Product][google.cloud.retail.v2.Product]s under this branch, regardless of
+     * whether or not this branch exists, a PERMISSION_DENIED error is returned.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent branch resource name, such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use
+     * `default_branch` as the branch ID, to list products under the default
+     * branch.
+     * If the caller does not have permission to list
+     * [Product][google.cloud.retail.v2.Product]s under this branch, regardless of
+     * whether or not this branch exists, a PERMISSION_DENIED error is returned.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent branch resource name, such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use
+     * `default_branch` as the branch ID, to list products under the default
+     * branch.
+     * If the caller does not have permission to list
+     * [Product][google.cloud.retail.v2.Product]s under this branch, regardless of
+     * whether or not this branch exists, a PERMISSION_DENIED error is returned.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Maximum number of [Product][google.cloud.retail.v2.Product]s to return. If
+     * unspecified, defaults to 100. The maximum allowed value is 1000. Values
+     * above 1000 will be coerced to 1000.
+     * If this field is negative, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Maximum number of [Product][google.cloud.retail.v2.Product]s to return. If
+     * unspecified, defaults to 100. The maximum allowed value is 1000. Values
+     * above 1000 will be coerced to 1000.
+     * If this field is negative, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Maximum number of [Product][google.cloud.retail.v2.Product]s to return. If
+     * unspecified, defaults to 100. The maximum allowed value is 1000. Values
+     * above 1000 will be coerced to 1000.
+     * If this field is negative, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A page token
+     * [ListProductsResponse.next_page_token][google.cloud.retail.v2.ListProductsResponse.next_page_token],
+     * received from a previous
+     * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]
+     * call. Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to
+     * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]
+     * must match the call that provided the page token. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A page token
+     * [ListProductsResponse.next_page_token][google.cloud.retail.v2.ListProductsResponse.next_page_token],
+     * received from a previous
+     * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]
+     * call. Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to
+     * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]
+     * must match the call that provided the page token. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A page token
+     * [ListProductsResponse.next_page_token][google.cloud.retail.v2.ListProductsResponse.next_page_token],
+     * received from a previous
+     * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]
+     * call. Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to
+     * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]
+     * must match the call that provided the page token. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A page token
+     * [ListProductsResponse.next_page_token][google.cloud.retail.v2.ListProductsResponse.next_page_token],
+     * received from a previous
+     * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]
+     * call. Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to
+     * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]
+     * must match the call that provided the page token. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A page token
+     * [ListProductsResponse.next_page_token][google.cloud.retail.v2.ListProductsResponse.next_page_token],
+     * received from a previous
+     * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]
+     * call. Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to
+     * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]
+     * must match the call that provided the page token. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * A filter to apply on the list results. Supported features:
+     * * List all the products under the parent branch if
+     * [filter][google.cloud.retail.v2.ListProductsRequest.filter] is unset.
+     * * List [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2.Product]s sharing the same
+     *   [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     *   [Product][google.cloud.retail.v2.Product]. For example:
+     *     `primary_product_id = "some_product_id"`
+     * * List [Product][google.cloud.retail.v2.Product]s bundled in a
+     * [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]
+     * [Product][google.cloud.retail.v2.Product].
+     *   For example:
+     *     `collection_product_id = "some_product_id"`
+     * * List [Product][google.cloud.retail.v2.Product]s with a partibular type.
+     * For example:
+     *     `type = "PRIMARY"`
+     *     `type = "VARIANT"`
+     *     `type = "COLLECTION"`
+     * If the field is unrecognizable, an INVALID_ARGUMENT error is returned.
+     * If the specified
+     * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product] or
+     * [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]
+     * [Product][google.cloud.retail.v2.Product] does not exist, a NOT_FOUND error
+     * is returned.
+     * 
+ * + * string filter = 4; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A filter to apply on the list results. Supported features:
+     * * List all the products under the parent branch if
+     * [filter][google.cloud.retail.v2.ListProductsRequest.filter] is unset.
+     * * List [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2.Product]s sharing the same
+     *   [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     *   [Product][google.cloud.retail.v2.Product]. For example:
+     *     `primary_product_id = "some_product_id"`
+     * * List [Product][google.cloud.retail.v2.Product]s bundled in a
+     * [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]
+     * [Product][google.cloud.retail.v2.Product].
+     *   For example:
+     *     `collection_product_id = "some_product_id"`
+     * * List [Product][google.cloud.retail.v2.Product]s with a partibular type.
+     * For example:
+     *     `type = "PRIMARY"`
+     *     `type = "VARIANT"`
+     *     `type = "COLLECTION"`
+     * If the field is unrecognizable, an INVALID_ARGUMENT error is returned.
+     * If the specified
+     * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product] or
+     * [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]
+     * [Product][google.cloud.retail.v2.Product] does not exist, a NOT_FOUND error
+     * is returned.
+     * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A filter to apply on the list results. Supported features:
+     * * List all the products under the parent branch if
+     * [filter][google.cloud.retail.v2.ListProductsRequest.filter] is unset.
+     * * List [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2.Product]s sharing the same
+     *   [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     *   [Product][google.cloud.retail.v2.Product]. For example:
+     *     `primary_product_id = "some_product_id"`
+     * * List [Product][google.cloud.retail.v2.Product]s bundled in a
+     * [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]
+     * [Product][google.cloud.retail.v2.Product].
+     *   For example:
+     *     `collection_product_id = "some_product_id"`
+     * * List [Product][google.cloud.retail.v2.Product]s with a partibular type.
+     * For example:
+     *     `type = "PRIMARY"`
+     *     `type = "VARIANT"`
+     *     `type = "COLLECTION"`
+     * If the field is unrecognizable, an INVALID_ARGUMENT error is returned.
+     * If the specified
+     * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product] or
+     * [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]
+     * [Product][google.cloud.retail.v2.Product] does not exist, a NOT_FOUND error
+     * is returned.
+     * 
+ * + * string filter = 4; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A filter to apply on the list results. Supported features:
+     * * List all the products under the parent branch if
+     * [filter][google.cloud.retail.v2.ListProductsRequest.filter] is unset.
+     * * List [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2.Product]s sharing the same
+     *   [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     *   [Product][google.cloud.retail.v2.Product]. For example:
+     *     `primary_product_id = "some_product_id"`
+     * * List [Product][google.cloud.retail.v2.Product]s bundled in a
+     * [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]
+     * [Product][google.cloud.retail.v2.Product].
+     *   For example:
+     *     `collection_product_id = "some_product_id"`
+     * * List [Product][google.cloud.retail.v2.Product]s with a partibular type.
+     * For example:
+     *     `type = "PRIMARY"`
+     *     `type = "VARIANT"`
+     *     `type = "COLLECTION"`
+     * If the field is unrecognizable, an INVALID_ARGUMENT error is returned.
+     * If the specified
+     * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product] or
+     * [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]
+     * [Product][google.cloud.retail.v2.Product] does not exist, a NOT_FOUND error
+     * is returned.
+     * 
+ * + * string filter = 4; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * A filter to apply on the list results. Supported features:
+     * * List all the products under the parent branch if
+     * [filter][google.cloud.retail.v2.ListProductsRequest.filter] is unset.
+     * * List [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2.Product]s sharing the same
+     *   [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     *   [Product][google.cloud.retail.v2.Product]. For example:
+     *     `primary_product_id = "some_product_id"`
+     * * List [Product][google.cloud.retail.v2.Product]s bundled in a
+     * [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]
+     * [Product][google.cloud.retail.v2.Product].
+     *   For example:
+     *     `collection_product_id = "some_product_id"`
+     * * List [Product][google.cloud.retail.v2.Product]s with a partibular type.
+     * For example:
+     *     `type = "PRIMARY"`
+     *     `type = "VARIANT"`
+     *     `type = "COLLECTION"`
+     * If the field is unrecognizable, an INVALID_ARGUMENT error is returned.
+     * If the specified
+     * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product] or
+     * [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]
+     * [Product][google.cloud.retail.v2.Product] does not exist, a NOT_FOUND error
+     * is returned.
+     * 
+ * + * string filter = 4; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.FieldMask readMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + readMaskBuilder_; + /** + * + * + *
+     * The fields of [Product][google.cloud.retail.v2.Product] to return in the
+     * responses. If not set or empty, the following fields are returned:
+     * * [Product.name][google.cloud.retail.v2.Product.name]
+     * * [Product.id][google.cloud.retail.v2.Product.id]
+     * * [Product.title][google.cloud.retail.v2.Product.title]
+     * * [Product.uri][google.cloud.retail.v2.Product.uri]
+     * * [Product.images][google.cloud.retail.v2.Product.images]
+     * * [Product.price_info][google.cloud.retail.v2.Product.price_info]
+     * * [Product.brands][google.cloud.retail.v2.Product.brands]
+     * If "*" is provided, all fields are returned.
+     * [Product.name][google.cloud.retail.v2.Product.name] is always returned no
+     * matter what mask is set.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask read_mask = 5; + * + * @return Whether the readMask field is set. + */ + public boolean hasReadMask() { + return readMaskBuilder_ != null || readMask_ != null; + } + /** + * + * + *
+     * The fields of [Product][google.cloud.retail.v2.Product] to return in the
+     * responses. If not set or empty, the following fields are returned:
+     * * [Product.name][google.cloud.retail.v2.Product.name]
+     * * [Product.id][google.cloud.retail.v2.Product.id]
+     * * [Product.title][google.cloud.retail.v2.Product.title]
+     * * [Product.uri][google.cloud.retail.v2.Product.uri]
+     * * [Product.images][google.cloud.retail.v2.Product.images]
+     * * [Product.price_info][google.cloud.retail.v2.Product.price_info]
+     * * [Product.brands][google.cloud.retail.v2.Product.brands]
+     * If "*" is provided, all fields are returned.
+     * [Product.name][google.cloud.retail.v2.Product.name] is always returned no
+     * matter what mask is set.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask read_mask = 5; + * + * @return The readMask. + */ + public com.google.protobuf.FieldMask getReadMask() { + if (readMaskBuilder_ == null) { + return readMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : readMask_; + } else { + return readMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The fields of [Product][google.cloud.retail.v2.Product] to return in the
+     * responses. If not set or empty, the following fields are returned:
+     * * [Product.name][google.cloud.retail.v2.Product.name]
+     * * [Product.id][google.cloud.retail.v2.Product.id]
+     * * [Product.title][google.cloud.retail.v2.Product.title]
+     * * [Product.uri][google.cloud.retail.v2.Product.uri]
+     * * [Product.images][google.cloud.retail.v2.Product.images]
+     * * [Product.price_info][google.cloud.retail.v2.Product.price_info]
+     * * [Product.brands][google.cloud.retail.v2.Product.brands]
+     * If "*" is provided, all fields are returned.
+     * [Product.name][google.cloud.retail.v2.Product.name] is always returned no
+     * matter what mask is set.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask read_mask = 5; + */ + public Builder setReadMask(com.google.protobuf.FieldMask value) { + if (readMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + readMask_ = value; + onChanged(); + } else { + readMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The fields of [Product][google.cloud.retail.v2.Product] to return in the
+     * responses. If not set or empty, the following fields are returned:
+     * * [Product.name][google.cloud.retail.v2.Product.name]
+     * * [Product.id][google.cloud.retail.v2.Product.id]
+     * * [Product.title][google.cloud.retail.v2.Product.title]
+     * * [Product.uri][google.cloud.retail.v2.Product.uri]
+     * * [Product.images][google.cloud.retail.v2.Product.images]
+     * * [Product.price_info][google.cloud.retail.v2.Product.price_info]
+     * * [Product.brands][google.cloud.retail.v2.Product.brands]
+     * If "*" is provided, all fields are returned.
+     * [Product.name][google.cloud.retail.v2.Product.name] is always returned no
+     * matter what mask is set.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask read_mask = 5; + */ + public Builder setReadMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (readMaskBuilder_ == null) { + readMask_ = builderForValue.build(); + onChanged(); + } else { + readMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The fields of [Product][google.cloud.retail.v2.Product] to return in the
+     * responses. If not set or empty, the following fields are returned:
+     * * [Product.name][google.cloud.retail.v2.Product.name]
+     * * [Product.id][google.cloud.retail.v2.Product.id]
+     * * [Product.title][google.cloud.retail.v2.Product.title]
+     * * [Product.uri][google.cloud.retail.v2.Product.uri]
+     * * [Product.images][google.cloud.retail.v2.Product.images]
+     * * [Product.price_info][google.cloud.retail.v2.Product.price_info]
+     * * [Product.brands][google.cloud.retail.v2.Product.brands]
+     * If "*" is provided, all fields are returned.
+     * [Product.name][google.cloud.retail.v2.Product.name] is always returned no
+     * matter what mask is set.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask read_mask = 5; + */ + public Builder mergeReadMask(com.google.protobuf.FieldMask value) { + if (readMaskBuilder_ == null) { + if (readMask_ != null) { + readMask_ = + com.google.protobuf.FieldMask.newBuilder(readMask_).mergeFrom(value).buildPartial(); + } else { + readMask_ = value; + } + onChanged(); + } else { + readMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The fields of [Product][google.cloud.retail.v2.Product] to return in the
+     * responses. If not set or empty, the following fields are returned:
+     * * [Product.name][google.cloud.retail.v2.Product.name]
+     * * [Product.id][google.cloud.retail.v2.Product.id]
+     * * [Product.title][google.cloud.retail.v2.Product.title]
+     * * [Product.uri][google.cloud.retail.v2.Product.uri]
+     * * [Product.images][google.cloud.retail.v2.Product.images]
+     * * [Product.price_info][google.cloud.retail.v2.Product.price_info]
+     * * [Product.brands][google.cloud.retail.v2.Product.brands]
+     * If "*" is provided, all fields are returned.
+     * [Product.name][google.cloud.retail.v2.Product.name] is always returned no
+     * matter what mask is set.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask read_mask = 5; + */ + public Builder clearReadMask() { + if (readMaskBuilder_ == null) { + readMask_ = null; + onChanged(); + } else { + readMask_ = null; + readMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The fields of [Product][google.cloud.retail.v2.Product] to return in the
+     * responses. If not set or empty, the following fields are returned:
+     * * [Product.name][google.cloud.retail.v2.Product.name]
+     * * [Product.id][google.cloud.retail.v2.Product.id]
+     * * [Product.title][google.cloud.retail.v2.Product.title]
+     * * [Product.uri][google.cloud.retail.v2.Product.uri]
+     * * [Product.images][google.cloud.retail.v2.Product.images]
+     * * [Product.price_info][google.cloud.retail.v2.Product.price_info]
+     * * [Product.brands][google.cloud.retail.v2.Product.brands]
+     * If "*" is provided, all fields are returned.
+     * [Product.name][google.cloud.retail.v2.Product.name] is always returned no
+     * matter what mask is set.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask read_mask = 5; + */ + public com.google.protobuf.FieldMask.Builder getReadMaskBuilder() { + + onChanged(); + return getReadMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The fields of [Product][google.cloud.retail.v2.Product] to return in the
+     * responses. If not set or empty, the following fields are returned:
+     * * [Product.name][google.cloud.retail.v2.Product.name]
+     * * [Product.id][google.cloud.retail.v2.Product.id]
+     * * [Product.title][google.cloud.retail.v2.Product.title]
+     * * [Product.uri][google.cloud.retail.v2.Product.uri]
+     * * [Product.images][google.cloud.retail.v2.Product.images]
+     * * [Product.price_info][google.cloud.retail.v2.Product.price_info]
+     * * [Product.brands][google.cloud.retail.v2.Product.brands]
+     * If "*" is provided, all fields are returned.
+     * [Product.name][google.cloud.retail.v2.Product.name] is always returned no
+     * matter what mask is set.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask read_mask = 5; + */ + public com.google.protobuf.FieldMaskOrBuilder getReadMaskOrBuilder() { + if (readMaskBuilder_ != null) { + return readMaskBuilder_.getMessageOrBuilder(); + } else { + return readMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : readMask_; + } + } + /** + * + * + *
+     * The fields of [Product][google.cloud.retail.v2.Product] to return in the
+     * responses. If not set or empty, the following fields are returned:
+     * * [Product.name][google.cloud.retail.v2.Product.name]
+     * * [Product.id][google.cloud.retail.v2.Product.id]
+     * * [Product.title][google.cloud.retail.v2.Product.title]
+     * * [Product.uri][google.cloud.retail.v2.Product.uri]
+     * * [Product.images][google.cloud.retail.v2.Product.images]
+     * * [Product.price_info][google.cloud.retail.v2.Product.price_info]
+     * * [Product.brands][google.cloud.retail.v2.Product.brands]
+     * If "*" is provided, all fields are returned.
+     * [Product.name][google.cloud.retail.v2.Product.name] is always returned no
+     * matter what mask is set.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask read_mask = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getReadMaskFieldBuilder() { + if (readMaskBuilder_ == null) { + readMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getReadMask(), getParentForChildren(), isClean()); + readMask_ = null; + } + return readMaskBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.ListProductsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.ListProductsRequest) + private static final com.google.cloud.retail.v2.ListProductsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2.ListProductsRequest(); + } + + public static com.google.cloud.retail.v2.ListProductsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListProductsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListProductsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.retail.v2.ListProductsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ListProductsRequestOrBuilder.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ListProductsRequestOrBuilder.java new file mode 100644 index 00000000..76532357 --- /dev/null +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ListProductsRequestOrBuilder.java @@ -0,0 +1,270 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2/product_service.proto + +package com.google.cloud.retail.v2; + +public interface ListProductsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2.ListProductsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent branch resource name, such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use
+   * `default_branch` as the branch ID, to list products under the default
+   * branch.
+   * If the caller does not have permission to list
+   * [Product][google.cloud.retail.v2.Product]s under this branch, regardless of
+   * whether or not this branch exists, a PERMISSION_DENIED error is returned.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent branch resource name, such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use
+   * `default_branch` as the branch ID, to list products under the default
+   * branch.
+   * If the caller does not have permission to list
+   * [Product][google.cloud.retail.v2.Product]s under this branch, regardless of
+   * whether or not this branch exists, a PERMISSION_DENIED error is returned.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Maximum number of [Product][google.cloud.retail.v2.Product]s to return. If
+   * unspecified, defaults to 100. The maximum allowed value is 1000. Values
+   * above 1000 will be coerced to 1000.
+   * If this field is negative, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * A page token
+   * [ListProductsResponse.next_page_token][google.cloud.retail.v2.ListProductsResponse.next_page_token],
+   * received from a previous
+   * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]
+   * call. Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to
+   * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]
+   * must match the call that provided the page token. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A page token
+   * [ListProductsResponse.next_page_token][google.cloud.retail.v2.ListProductsResponse.next_page_token],
+   * received from a previous
+   * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]
+   * call. Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to
+   * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]
+   * must match the call that provided the page token. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * A filter to apply on the list results. Supported features:
+   * * List all the products under the parent branch if
+   * [filter][google.cloud.retail.v2.ListProductsRequest.filter] is unset.
+   * * List [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2.Product]s sharing the same
+   *   [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+   *   [Product][google.cloud.retail.v2.Product]. For example:
+   *     `primary_product_id = "some_product_id"`
+   * * List [Product][google.cloud.retail.v2.Product]s bundled in a
+   * [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]
+   * [Product][google.cloud.retail.v2.Product].
+   *   For example:
+   *     `collection_product_id = "some_product_id"`
+   * * List [Product][google.cloud.retail.v2.Product]s with a partibular type.
+   * For example:
+   *     `type = "PRIMARY"`
+   *     `type = "VARIANT"`
+   *     `type = "COLLECTION"`
+   * If the field is unrecognizable, an INVALID_ARGUMENT error is returned.
+   * If the specified
+   * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2.Product] or
+   * [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]
+   * [Product][google.cloud.retail.v2.Product] does not exist, a NOT_FOUND error
+   * is returned.
+   * 
+ * + * string filter = 4; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * A filter to apply on the list results. Supported features:
+   * * List all the products under the parent branch if
+   * [filter][google.cloud.retail.v2.ListProductsRequest.filter] is unset.
+   * * List [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2.Product]s sharing the same
+   *   [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+   *   [Product][google.cloud.retail.v2.Product]. For example:
+   *     `primary_product_id = "some_product_id"`
+   * * List [Product][google.cloud.retail.v2.Product]s bundled in a
+   * [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]
+   * [Product][google.cloud.retail.v2.Product].
+   *   For example:
+   *     `collection_product_id = "some_product_id"`
+   * * List [Product][google.cloud.retail.v2.Product]s with a partibular type.
+   * For example:
+   *     `type = "PRIMARY"`
+   *     `type = "VARIANT"`
+   *     `type = "COLLECTION"`
+   * If the field is unrecognizable, an INVALID_ARGUMENT error is returned.
+   * If the specified
+   * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2.Product] or
+   * [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]
+   * [Product][google.cloud.retail.v2.Product] does not exist, a NOT_FOUND error
+   * is returned.
+   * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * The fields of [Product][google.cloud.retail.v2.Product] to return in the
+   * responses. If not set or empty, the following fields are returned:
+   * * [Product.name][google.cloud.retail.v2.Product.name]
+   * * [Product.id][google.cloud.retail.v2.Product.id]
+   * * [Product.title][google.cloud.retail.v2.Product.title]
+   * * [Product.uri][google.cloud.retail.v2.Product.uri]
+   * * [Product.images][google.cloud.retail.v2.Product.images]
+   * * [Product.price_info][google.cloud.retail.v2.Product.price_info]
+   * * [Product.brands][google.cloud.retail.v2.Product.brands]
+   * If "*" is provided, all fields are returned.
+   * [Product.name][google.cloud.retail.v2.Product.name] is always returned no
+   * matter what mask is set.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * .google.protobuf.FieldMask read_mask = 5; + * + * @return Whether the readMask field is set. + */ + boolean hasReadMask(); + /** + * + * + *
+   * The fields of [Product][google.cloud.retail.v2.Product] to return in the
+   * responses. If not set or empty, the following fields are returned:
+   * * [Product.name][google.cloud.retail.v2.Product.name]
+   * * [Product.id][google.cloud.retail.v2.Product.id]
+   * * [Product.title][google.cloud.retail.v2.Product.title]
+   * * [Product.uri][google.cloud.retail.v2.Product.uri]
+   * * [Product.images][google.cloud.retail.v2.Product.images]
+   * * [Product.price_info][google.cloud.retail.v2.Product.price_info]
+   * * [Product.brands][google.cloud.retail.v2.Product.brands]
+   * If "*" is provided, all fields are returned.
+   * [Product.name][google.cloud.retail.v2.Product.name] is always returned no
+   * matter what mask is set.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * .google.protobuf.FieldMask read_mask = 5; + * + * @return The readMask. + */ + com.google.protobuf.FieldMask getReadMask(); + /** + * + * + *
+   * The fields of [Product][google.cloud.retail.v2.Product] to return in the
+   * responses. If not set or empty, the following fields are returned:
+   * * [Product.name][google.cloud.retail.v2.Product.name]
+   * * [Product.id][google.cloud.retail.v2.Product.id]
+   * * [Product.title][google.cloud.retail.v2.Product.title]
+   * * [Product.uri][google.cloud.retail.v2.Product.uri]
+   * * [Product.images][google.cloud.retail.v2.Product.images]
+   * * [Product.price_info][google.cloud.retail.v2.Product.price_info]
+   * * [Product.brands][google.cloud.retail.v2.Product.brands]
+   * If "*" is provided, all fields are returned.
+   * [Product.name][google.cloud.retail.v2.Product.name] is always returned no
+   * matter what mask is set.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * .google.protobuf.FieldMask read_mask = 5; + */ + com.google.protobuf.FieldMaskOrBuilder getReadMaskOrBuilder(); +} diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ListProductsResponse.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ListProductsResponse.java new file mode 100644 index 00000000..f51d5906 --- /dev/null +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ListProductsResponse.java @@ -0,0 +1,1151 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2/product_service.proto + +package com.google.cloud.retail.v2; + +/** + * + * + *
+ * Response message for
+ * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2.ListProductsResponse} + */ +public final class ListProductsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.ListProductsResponse) + ListProductsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListProductsResponse.newBuilder() to construct. + private ListProductsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListProductsResponse() { + products_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListProductsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListProductsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + products_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + products_.add( + input.readMessage( + com.google.cloud.retail.v2.Product.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + products_ = java.util.Collections.unmodifiableList(products_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.ProductServiceProto + .internal_static_google_cloud_retail_v2_ListProductsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.ProductServiceProto + .internal_static_google_cloud_retail_v2_ListProductsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.ListProductsResponse.class, + com.google.cloud.retail.v2.ListProductsResponse.Builder.class); + } + + public static final int PRODUCTS_FIELD_NUMBER = 1; + private java.util.List products_; + /** + * + * + *
+   * The [Product][google.cloud.retail.v2.Product]s.
+   * 
+ * + * repeated .google.cloud.retail.v2.Product products = 1; + */ + @java.lang.Override + public java.util.List getProductsList() { + return products_; + } + /** + * + * + *
+   * The [Product][google.cloud.retail.v2.Product]s.
+   * 
+ * + * repeated .google.cloud.retail.v2.Product products = 1; + */ + @java.lang.Override + public java.util.List + getProductsOrBuilderList() { + return products_; + } + /** + * + * + *
+   * The [Product][google.cloud.retail.v2.Product]s.
+   * 
+ * + * repeated .google.cloud.retail.v2.Product products = 1; + */ + @java.lang.Override + public int getProductsCount() { + return products_.size(); + } + /** + * + * + *
+   * The [Product][google.cloud.retail.v2.Product]s.
+   * 
+ * + * repeated .google.cloud.retail.v2.Product products = 1; + */ + @java.lang.Override + public com.google.cloud.retail.v2.Product getProducts(int index) { + return products_.get(index); + } + /** + * + * + *
+   * The [Product][google.cloud.retail.v2.Product]s.
+   * 
+ * + * repeated .google.cloud.retail.v2.Product products = 1; + */ + @java.lang.Override + public com.google.cloud.retail.v2.ProductOrBuilder getProductsOrBuilder(int index) { + return products_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * A token that can be sent as
+   * [ListProductsRequest.page_token][google.cloud.retail.v2.ListProductsRequest.page_token]
+   * to retrieve the next page. If this field is omitted, there are no
+   * subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A token that can be sent as
+   * [ListProductsRequest.page_token][google.cloud.retail.v2.ListProductsRequest.page_token]
+   * to retrieve the next page. If this field is omitted, there are no
+   * subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < products_.size(); i++) { + output.writeMessage(1, products_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < products_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, products_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.retail.v2.ListProductsResponse)) { + return super.equals(obj); + } + com.google.cloud.retail.v2.ListProductsResponse other = + (com.google.cloud.retail.v2.ListProductsResponse) obj; + + if (!getProductsList().equals(other.getProductsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getProductsCount() > 0) { + hash = (37 * hash) + PRODUCTS_FIELD_NUMBER; + hash = (53 * hash) + getProductsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2.ListProductsResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.ListProductsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.ListProductsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.ListProductsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.ListProductsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.ListProductsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.ListProductsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.ListProductsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.ListProductsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.ListProductsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.ListProductsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.ListProductsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2.ListProductsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for
+   * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2.ListProductsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.ListProductsResponse) + com.google.cloud.retail.v2.ListProductsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.ProductServiceProto + .internal_static_google_cloud_retail_v2_ListProductsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.ProductServiceProto + .internal_static_google_cloud_retail_v2_ListProductsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.ListProductsResponse.class, + com.google.cloud.retail.v2.ListProductsResponse.Builder.class); + } + + // Construct using com.google.cloud.retail.v2.ListProductsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getProductsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (productsBuilder_ == null) { + products_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + productsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2.ProductServiceProto + .internal_static_google_cloud_retail_v2_ListProductsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2.ListProductsResponse getDefaultInstanceForType() { + return com.google.cloud.retail.v2.ListProductsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2.ListProductsResponse build() { + com.google.cloud.retail.v2.ListProductsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2.ListProductsResponse buildPartial() { + com.google.cloud.retail.v2.ListProductsResponse result = + new com.google.cloud.retail.v2.ListProductsResponse(this); + int from_bitField0_ = bitField0_; + if (productsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + products_ = java.util.Collections.unmodifiableList(products_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.products_ = products_; + } else { + result.products_ = productsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.retail.v2.ListProductsResponse) { + return mergeFrom((com.google.cloud.retail.v2.ListProductsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2.ListProductsResponse other) { + if (other == com.google.cloud.retail.v2.ListProductsResponse.getDefaultInstance()) + return this; + if (productsBuilder_ == null) { + if (!other.products_.isEmpty()) { + if (products_.isEmpty()) { + products_ = other.products_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureProductsIsMutable(); + products_.addAll(other.products_); + } + onChanged(); + } + } else { + if (!other.products_.isEmpty()) { + if (productsBuilder_.isEmpty()) { + productsBuilder_.dispose(); + productsBuilder_ = null; + products_ = other.products_; + bitField0_ = (bitField0_ & ~0x00000001); + productsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getProductsFieldBuilder() + : null; + } else { + productsBuilder_.addAllMessages(other.products_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.retail.v2.ListProductsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2.ListProductsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List products_ = + java.util.Collections.emptyList(); + + private void ensureProductsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + products_ = new java.util.ArrayList(products_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2.Product, + com.google.cloud.retail.v2.Product.Builder, + com.google.cloud.retail.v2.ProductOrBuilder> + productsBuilder_; + + /** + * + * + *
+     * The [Product][google.cloud.retail.v2.Product]s.
+     * 
+ * + * repeated .google.cloud.retail.v2.Product products = 1; + */ + public java.util.List getProductsList() { + if (productsBuilder_ == null) { + return java.util.Collections.unmodifiableList(products_); + } else { + return productsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The [Product][google.cloud.retail.v2.Product]s.
+     * 
+ * + * repeated .google.cloud.retail.v2.Product products = 1; + */ + public int getProductsCount() { + if (productsBuilder_ == null) { + return products_.size(); + } else { + return productsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The [Product][google.cloud.retail.v2.Product]s.
+     * 
+ * + * repeated .google.cloud.retail.v2.Product products = 1; + */ + public com.google.cloud.retail.v2.Product getProducts(int index) { + if (productsBuilder_ == null) { + return products_.get(index); + } else { + return productsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The [Product][google.cloud.retail.v2.Product]s.
+     * 
+ * + * repeated .google.cloud.retail.v2.Product products = 1; + */ + public Builder setProducts(int index, com.google.cloud.retail.v2.Product value) { + if (productsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProductsIsMutable(); + products_.set(index, value); + onChanged(); + } else { + productsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The [Product][google.cloud.retail.v2.Product]s.
+     * 
+ * + * repeated .google.cloud.retail.v2.Product products = 1; + */ + public Builder setProducts( + int index, com.google.cloud.retail.v2.Product.Builder builderForValue) { + if (productsBuilder_ == null) { + ensureProductsIsMutable(); + products_.set(index, builderForValue.build()); + onChanged(); + } else { + productsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The [Product][google.cloud.retail.v2.Product]s.
+     * 
+ * + * repeated .google.cloud.retail.v2.Product products = 1; + */ + public Builder addProducts(com.google.cloud.retail.v2.Product value) { + if (productsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProductsIsMutable(); + products_.add(value); + onChanged(); + } else { + productsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The [Product][google.cloud.retail.v2.Product]s.
+     * 
+ * + * repeated .google.cloud.retail.v2.Product products = 1; + */ + public Builder addProducts(int index, com.google.cloud.retail.v2.Product value) { + if (productsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProductsIsMutable(); + products_.add(index, value); + onChanged(); + } else { + productsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The [Product][google.cloud.retail.v2.Product]s.
+     * 
+ * + * repeated .google.cloud.retail.v2.Product products = 1; + */ + public Builder addProducts(com.google.cloud.retail.v2.Product.Builder builderForValue) { + if (productsBuilder_ == null) { + ensureProductsIsMutable(); + products_.add(builderForValue.build()); + onChanged(); + } else { + productsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The [Product][google.cloud.retail.v2.Product]s.
+     * 
+ * + * repeated .google.cloud.retail.v2.Product products = 1; + */ + public Builder addProducts( + int index, com.google.cloud.retail.v2.Product.Builder builderForValue) { + if (productsBuilder_ == null) { + ensureProductsIsMutable(); + products_.add(index, builderForValue.build()); + onChanged(); + } else { + productsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The [Product][google.cloud.retail.v2.Product]s.
+     * 
+ * + * repeated .google.cloud.retail.v2.Product products = 1; + */ + public Builder addAllProducts( + java.lang.Iterable values) { + if (productsBuilder_ == null) { + ensureProductsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, products_); + onChanged(); + } else { + productsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The [Product][google.cloud.retail.v2.Product]s.
+     * 
+ * + * repeated .google.cloud.retail.v2.Product products = 1; + */ + public Builder clearProducts() { + if (productsBuilder_ == null) { + products_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + productsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The [Product][google.cloud.retail.v2.Product]s.
+     * 
+ * + * repeated .google.cloud.retail.v2.Product products = 1; + */ + public Builder removeProducts(int index) { + if (productsBuilder_ == null) { + ensureProductsIsMutable(); + products_.remove(index); + onChanged(); + } else { + productsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The [Product][google.cloud.retail.v2.Product]s.
+     * 
+ * + * repeated .google.cloud.retail.v2.Product products = 1; + */ + public com.google.cloud.retail.v2.Product.Builder getProductsBuilder(int index) { + return getProductsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The [Product][google.cloud.retail.v2.Product]s.
+     * 
+ * + * repeated .google.cloud.retail.v2.Product products = 1; + */ + public com.google.cloud.retail.v2.ProductOrBuilder getProductsOrBuilder(int index) { + if (productsBuilder_ == null) { + return products_.get(index); + } else { + return productsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The [Product][google.cloud.retail.v2.Product]s.
+     * 
+ * + * repeated .google.cloud.retail.v2.Product products = 1; + */ + public java.util.List + getProductsOrBuilderList() { + if (productsBuilder_ != null) { + return productsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(products_); + } + } + /** + * + * + *
+     * The [Product][google.cloud.retail.v2.Product]s.
+     * 
+ * + * repeated .google.cloud.retail.v2.Product products = 1; + */ + public com.google.cloud.retail.v2.Product.Builder addProductsBuilder() { + return getProductsFieldBuilder() + .addBuilder(com.google.cloud.retail.v2.Product.getDefaultInstance()); + } + /** + * + * + *
+     * The [Product][google.cloud.retail.v2.Product]s.
+     * 
+ * + * repeated .google.cloud.retail.v2.Product products = 1; + */ + public com.google.cloud.retail.v2.Product.Builder addProductsBuilder(int index) { + return getProductsFieldBuilder() + .addBuilder(index, com.google.cloud.retail.v2.Product.getDefaultInstance()); + } + /** + * + * + *
+     * The [Product][google.cloud.retail.v2.Product]s.
+     * 
+ * + * repeated .google.cloud.retail.v2.Product products = 1; + */ + public java.util.List getProductsBuilderList() { + return getProductsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2.Product, + com.google.cloud.retail.v2.Product.Builder, + com.google.cloud.retail.v2.ProductOrBuilder> + getProductsFieldBuilder() { + if (productsBuilder_ == null) { + productsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2.Product, + com.google.cloud.retail.v2.Product.Builder, + com.google.cloud.retail.v2.ProductOrBuilder>( + products_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + products_ = null; + } + return productsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token that can be sent as
+     * [ListProductsRequest.page_token][google.cloud.retail.v2.ListProductsRequest.page_token]
+     * to retrieve the next page. If this field is omitted, there are no
+     * subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A token that can be sent as
+     * [ListProductsRequest.page_token][google.cloud.retail.v2.ListProductsRequest.page_token]
+     * to retrieve the next page. If this field is omitted, there are no
+     * subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A token that can be sent as
+     * [ListProductsRequest.page_token][google.cloud.retail.v2.ListProductsRequest.page_token]
+     * to retrieve the next page. If this field is omitted, there are no
+     * subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A token that can be sent as
+     * [ListProductsRequest.page_token][google.cloud.retail.v2.ListProductsRequest.page_token]
+     * to retrieve the next page. If this field is omitted, there are no
+     * subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A token that can be sent as
+     * [ListProductsRequest.page_token][google.cloud.retail.v2.ListProductsRequest.page_token]
+     * to retrieve the next page. If this field is omitted, there are no
+     * subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.ListProductsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.ListProductsResponse) + private static final com.google.cloud.retail.v2.ListProductsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2.ListProductsResponse(); + } + + public static com.google.cloud.retail.v2.ListProductsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListProductsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListProductsResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.retail.v2.ListProductsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ListProductsResponseOrBuilder.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ListProductsResponseOrBuilder.java new file mode 100644 index 00000000..b1e2e8ec --- /dev/null +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ListProductsResponseOrBuilder.java @@ -0,0 +1,107 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2/product_service.proto + +package com.google.cloud.retail.v2; + +public interface ListProductsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2.ListProductsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The [Product][google.cloud.retail.v2.Product]s.
+   * 
+ * + * repeated .google.cloud.retail.v2.Product products = 1; + */ + java.util.List getProductsList(); + /** + * + * + *
+   * The [Product][google.cloud.retail.v2.Product]s.
+   * 
+ * + * repeated .google.cloud.retail.v2.Product products = 1; + */ + com.google.cloud.retail.v2.Product getProducts(int index); + /** + * + * + *
+   * The [Product][google.cloud.retail.v2.Product]s.
+   * 
+ * + * repeated .google.cloud.retail.v2.Product products = 1; + */ + int getProductsCount(); + /** + * + * + *
+   * The [Product][google.cloud.retail.v2.Product]s.
+   * 
+ * + * repeated .google.cloud.retail.v2.Product products = 1; + */ + java.util.List getProductsOrBuilderList(); + /** + * + * + *
+   * The [Product][google.cloud.retail.v2.Product]s.
+   * 
+ * + * repeated .google.cloud.retail.v2.Product products = 1; + */ + com.google.cloud.retail.v2.ProductOrBuilder getProductsOrBuilder(int index); + + /** + * + * + *
+   * A token that can be sent as
+   * [ListProductsRequest.page_token][google.cloud.retail.v2.ListProductsRequest.page_token]
+   * to retrieve the next page. If this field is omitted, there are no
+   * subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token that can be sent as
+   * [ListProductsRequest.page_token][google.cloud.retail.v2.ListProductsRequest.page_token]
+   * to retrieve the next page. If this field is omitted, there are no
+   * subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/PredictRequest.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/PredictRequest.java index 3160883f..f7172fcb 100644 --- a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/PredictRequest.java +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/PredictRequest.java @@ -201,25 +201,10 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { *
    * Required. Full resource name of the format:
    * {name=projects/*/locations/global/catalogs/default_catalog/placements/*}
-   * The id of the recommendation engine placement. This id is used to identify
-   * the set of models that will be used to make the prediction.
-   * We currently support three placements with the following IDs by default:
-   * * `shopping_cart`: Predicts products frequently bought together with one or
-   *   more  products in the same shopping session. Commonly displayed after
-   *   `add-to-cart` events, on product detail pages, or on the shopping cart
-   *   page.
-   * * `home_page`: Predicts the next product that a user will most likely
-   *   engage with or purchase based on the shopping or viewing history of the
-   *   specified `userId` or `visitorId`. For example - Recommendations for you.
-   * * `product_detail`: Predicts the next product that a user will most likely
-   *   engage with or purchase. The prediction is based on the shopping or
-   *   viewing history of the specified `userId` or `visitorId` and its
-   *   relevance to a specified `CatalogItem`. Typically used on product detail
-   *   pages. For example - More products like this.
-   * * `recently_viewed_default`: Returns up to 75 products recently viewed by
-   *   the specified `userId` or `visitorId`, most recent ones first. Returns
-   *   nothing if neither of them has viewed any products yet. For example -
-   *   Recently viewed.
+   * The ID of the Recommendations AI placement. Before you can request
+   * predictions from your model, you must create at least one placement for it.
+   * For more information, see [Managing
+   * placements](https://cloud.google.com/retail/recommendations-ai/docs/manage-placements).
    * The full list of available placements can be seen at
    * https://console.cloud.google.com/recommendation/catalogs/default_catalog/placements
    * 
@@ -246,25 +231,10 @@ public java.lang.String getPlacement() { *
    * Required. Full resource name of the format:
    * {name=projects/*/locations/global/catalogs/default_catalog/placements/*}
-   * The id of the recommendation engine placement. This id is used to identify
-   * the set of models that will be used to make the prediction.
-   * We currently support three placements with the following IDs by default:
-   * * `shopping_cart`: Predicts products frequently bought together with one or
-   *   more  products in the same shopping session. Commonly displayed after
-   *   `add-to-cart` events, on product detail pages, or on the shopping cart
-   *   page.
-   * * `home_page`: Predicts the next product that a user will most likely
-   *   engage with or purchase based on the shopping or viewing history of the
-   *   specified `userId` or `visitorId`. For example - Recommendations for you.
-   * * `product_detail`: Predicts the next product that a user will most likely
-   *   engage with or purchase. The prediction is based on the shopping or
-   *   viewing history of the specified `userId` or `visitorId` and its
-   *   relevance to a specified `CatalogItem`. Typically used on product detail
-   *   pages. For example - More products like this.
-   * * `recently_viewed_default`: Returns up to 75 products recently viewed by
-   *   the specified `userId` or `visitorId`, most recent ones first. Returns
-   *   nothing if neither of them has viewed any products yet. For example -
-   *   Recently viewed.
+   * The ID of the Recommendations AI placement. Before you can request
+   * predictions from your model, you must create at least one placement for it.
+   * For more information, see [Managing
+   * placements](https://cloud.google.com/retail/recommendations-ai/docs/manage-placements).
    * The full list of available placements can be seen at
    * https://console.cloud.google.com/recommendation/catalogs/default_catalog/placements
    * 
@@ -433,6 +403,8 @@ public com.google.protobuf.ByteString getPageTokenBytes() { * tag values by a space. `-"tagA"` is also supported and is equivalent to * `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings * with a size limit of 1,000 characters. + * Note: "Recently viewed" models don't support tag filtering at the + * moment. * * filterOutOfStockItems. Restricts predictions to products that do not * have a * stockState value of OUT_OF_STOCK. @@ -473,6 +445,8 @@ public java.lang.String getFilter() { * tag values by a space. `-"tagA"` is also supported and is equivalent to * `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings * with a size limit of 1,000 characters. + * Note: "Recently viewed" models don't support tag filtering at the + * moment. * * filterOutOfStockItems. Restricts predictions to products that do not * have a * stockState value of OUT_OF_STOCK. @@ -568,6 +542,16 @@ public int getParamsCount() { * * `strictFiltering`: Boolean. True by default. If set to false, the service * will return generic (unfiltered) popular products instead of empty if * your filter blocks all prediction results. + * * `priceRerankLevel`: String. Default empty. If set to be non-empty, then + * it needs to be one of {'no-price-reranking', 'low-price-reranking', + * 'medium-price-reranking', 'high-price-reranking'}. This gives + * request-level control and adjusts prediction results based on product + * price. + * * `diversityLevel`: String. Default empty. If set to be non-empty, then + * it needs to be one of {'no-diversity', 'low-diversity', + * 'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives + * request-level control and adjusts prediction results based on product + * category. * * * map<string, .google.protobuf.Value> params = 7; @@ -602,6 +586,16 @@ public java.util.Map getParams() { * * `strictFiltering`: Boolean. True by default. If set to false, the service * will return generic (unfiltered) popular products instead of empty if * your filter blocks all prediction results. + * * `priceRerankLevel`: String. Default empty. If set to be non-empty, then + * it needs to be one of {'no-price-reranking', 'low-price-reranking', + * 'medium-price-reranking', 'high-price-reranking'}. This gives + * request-level control and adjusts prediction results based on product + * price. + * * `diversityLevel`: String. Default empty. If set to be non-empty, then + * it needs to be one of {'no-diversity', 'low-diversity', + * 'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives + * request-level control and adjusts prediction results based on product + * category. * * * map<string, .google.protobuf.Value> params = 7; @@ -627,6 +621,16 @@ public java.util.Map getParamsMap() * * `strictFiltering`: Boolean. True by default. If set to false, the service * will return generic (unfiltered) popular products instead of empty if * your filter blocks all prediction results. + * * `priceRerankLevel`: String. Default empty. If set to be non-empty, then + * it needs to be one of {'no-price-reranking', 'low-price-reranking', + * 'medium-price-reranking', 'high-price-reranking'}. This gives + * request-level control and adjusts prediction results based on product + * price. + * * `diversityLevel`: String. Default empty. If set to be non-empty, then + * it needs to be one of {'no-diversity', 'low-diversity', + * 'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives + * request-level control and adjusts prediction results based on product + * category. * * * map<string, .google.protobuf.Value> params = 7; @@ -657,6 +661,16 @@ public com.google.protobuf.Value getParamsOrDefault( * * `strictFiltering`: Boolean. True by default. If set to false, the service * will return generic (unfiltered) popular products instead of empty if * your filter blocks all prediction results. + * * `priceRerankLevel`: String. Default empty. If set to be non-empty, then + * it needs to be one of {'no-price-reranking', 'low-price-reranking', + * 'medium-price-reranking', 'high-price-reranking'}. This gives + * request-level control and adjusts prediction results based on product + * price. + * * `diversityLevel`: String. Default empty. If set to be non-empty, then + * it needs to be one of {'no-diversity', 'low-diversity', + * 'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives + * request-level control and adjusts prediction results based on product + * category. * * * map<string, .google.protobuf.Value> params = 7; @@ -702,13 +716,21 @@ public int getLabelsCount() { * * *
-   * The labels for the predict request.
-   *  * Label keys can contain lowercase letters, digits and hyphens, must start
-   *    with a letter, and must end with a letter or digit.
-   *  * Non-zero label values can contain lowercase letters, digits and hyphens,
-   *    must start with a letter, and must end with a letter or digit.
-   *  * No more than 64 labels can be associated with a given request.
-   * See https://goo.gl/xmQnxf for more information on and examples of labels.
+   * The labels applied to a resource must meet the following requirements:
+   * * Each resource can have multiple labels, up to a maximum of 64.
+   * * Each label must be a key-value pair.
+   * * Keys have a minimum length of 1 character and a maximum length of 63
+   *   characters, and cannot be empty. Values can be empty, and have a maximum
+   *   length of 63 characters.
+   * * Keys and values can contain only lowercase letters, numeric characters,
+   *   underscores, and dashes. All characters must use UTF-8 encoding, and
+   *   international characters are allowed.
+   * * The key portion of a label must be unique. However, you can use the same
+   *   key with multiple resources.
+   * * Keys must start with a lowercase letter or international character.
+   * See [Google Cloud
+   * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+   * for more details.
    * 
* * map<string, string> labels = 8; @@ -730,13 +752,21 @@ public java.util.Map getLabels() { * * *
-   * The labels for the predict request.
-   *  * Label keys can contain lowercase letters, digits and hyphens, must start
-   *    with a letter, and must end with a letter or digit.
-   *  * Non-zero label values can contain lowercase letters, digits and hyphens,
-   *    must start with a letter, and must end with a letter or digit.
-   *  * No more than 64 labels can be associated with a given request.
-   * See https://goo.gl/xmQnxf for more information on and examples of labels.
+   * The labels applied to a resource must meet the following requirements:
+   * * Each resource can have multiple labels, up to a maximum of 64.
+   * * Each label must be a key-value pair.
+   * * Keys have a minimum length of 1 character and a maximum length of 63
+   *   characters, and cannot be empty. Values can be empty, and have a maximum
+   *   length of 63 characters.
+   * * Keys and values can contain only lowercase letters, numeric characters,
+   *   underscores, and dashes. All characters must use UTF-8 encoding, and
+   *   international characters are allowed.
+   * * The key portion of a label must be unique. However, you can use the same
+   *   key with multiple resources.
+   * * Keys must start with a lowercase letter or international character.
+   * See [Google Cloud
+   * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+   * for more details.
    * 
* * map<string, string> labels = 8; @@ -749,13 +779,21 @@ public java.util.Map getLabelsMap() { * * *
-   * The labels for the predict request.
-   *  * Label keys can contain lowercase letters, digits and hyphens, must start
-   *    with a letter, and must end with a letter or digit.
-   *  * Non-zero label values can contain lowercase letters, digits and hyphens,
-   *    must start with a letter, and must end with a letter or digit.
-   *  * No more than 64 labels can be associated with a given request.
-   * See https://goo.gl/xmQnxf for more information on and examples of labels.
+   * The labels applied to a resource must meet the following requirements:
+   * * Each resource can have multiple labels, up to a maximum of 64.
+   * * Each label must be a key-value pair.
+   * * Keys have a minimum length of 1 character and a maximum length of 63
+   *   characters, and cannot be empty. Values can be empty, and have a maximum
+   *   length of 63 characters.
+   * * Keys and values can contain only lowercase letters, numeric characters,
+   *   underscores, and dashes. All characters must use UTF-8 encoding, and
+   *   international characters are allowed.
+   * * The key portion of a label must be unique. However, you can use the same
+   *   key with multiple resources.
+   * * Keys must start with a lowercase letter or international character.
+   * See [Google Cloud
+   * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+   * for more details.
    * 
* * map<string, string> labels = 8; @@ -772,13 +810,21 @@ public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.Strin * * *
-   * The labels for the predict request.
-   *  * Label keys can contain lowercase letters, digits and hyphens, must start
-   *    with a letter, and must end with a letter or digit.
-   *  * Non-zero label values can contain lowercase letters, digits and hyphens,
-   *    must start with a letter, and must end with a letter or digit.
-   *  * No more than 64 labels can be associated with a given request.
-   * See https://goo.gl/xmQnxf for more information on and examples of labels.
+   * The labels applied to a resource must meet the following requirements:
+   * * Each resource can have multiple labels, up to a maximum of 64.
+   * * Each label must be a key-value pair.
+   * * Keys have a minimum length of 1 character and a maximum length of 63
+   *   characters, and cannot be empty. Values can be empty, and have a maximum
+   *   length of 63 characters.
+   * * Keys and values can contain only lowercase letters, numeric characters,
+   *   underscores, and dashes. All characters must use UTF-8 encoding, and
+   *   international characters are allowed.
+   * * The key portion of a label must be unique. However, you can use the same
+   *   key with multiple resources.
+   * * Keys must start with a lowercase letter or international character.
+   * See [Google Cloud
+   * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+   * for more details.
    * 
* * map<string, string> labels = 8; @@ -1277,25 +1323,10 @@ public Builder mergeFrom( *
      * Required. Full resource name of the format:
      * {name=projects/*/locations/global/catalogs/default_catalog/placements/*}
-     * The id of the recommendation engine placement. This id is used to identify
-     * the set of models that will be used to make the prediction.
-     * We currently support three placements with the following IDs by default:
-     * * `shopping_cart`: Predicts products frequently bought together with one or
-     *   more  products in the same shopping session. Commonly displayed after
-     *   `add-to-cart` events, on product detail pages, or on the shopping cart
-     *   page.
-     * * `home_page`: Predicts the next product that a user will most likely
-     *   engage with or purchase based on the shopping or viewing history of the
-     *   specified `userId` or `visitorId`. For example - Recommendations for you.
-     * * `product_detail`: Predicts the next product that a user will most likely
-     *   engage with or purchase. The prediction is based on the shopping or
-     *   viewing history of the specified `userId` or `visitorId` and its
-     *   relevance to a specified `CatalogItem`. Typically used on product detail
-     *   pages. For example - More products like this.
-     * * `recently_viewed_default`: Returns up to 75 products recently viewed by
-     *   the specified `userId` or `visitorId`, most recent ones first. Returns
-     *   nothing if neither of them has viewed any products yet. For example -
-     *   Recently viewed.
+     * The ID of the Recommendations AI placement. Before you can request
+     * predictions from your model, you must create at least one placement for it.
+     * For more information, see [Managing
+     * placements](https://cloud.google.com/retail/recommendations-ai/docs/manage-placements).
      * The full list of available placements can be seen at
      * https://console.cloud.google.com/recommendation/catalogs/default_catalog/placements
      * 
@@ -1321,25 +1352,10 @@ public java.lang.String getPlacement() { *
      * Required. Full resource name of the format:
      * {name=projects/*/locations/global/catalogs/default_catalog/placements/*}
-     * The id of the recommendation engine placement. This id is used to identify
-     * the set of models that will be used to make the prediction.
-     * We currently support three placements with the following IDs by default:
-     * * `shopping_cart`: Predicts products frequently bought together with one or
-     *   more  products in the same shopping session. Commonly displayed after
-     *   `add-to-cart` events, on product detail pages, or on the shopping cart
-     *   page.
-     * * `home_page`: Predicts the next product that a user will most likely
-     *   engage with or purchase based on the shopping or viewing history of the
-     *   specified `userId` or `visitorId`. For example - Recommendations for you.
-     * * `product_detail`: Predicts the next product that a user will most likely
-     *   engage with or purchase. The prediction is based on the shopping or
-     *   viewing history of the specified `userId` or `visitorId` and its
-     *   relevance to a specified `CatalogItem`. Typically used on product detail
-     *   pages. For example - More products like this.
-     * * `recently_viewed_default`: Returns up to 75 products recently viewed by
-     *   the specified `userId` or `visitorId`, most recent ones first. Returns
-     *   nothing if neither of them has viewed any products yet. For example -
-     *   Recently viewed.
+     * The ID of the Recommendations AI placement. Before you can request
+     * predictions from your model, you must create at least one placement for it.
+     * For more information, see [Managing
+     * placements](https://cloud.google.com/retail/recommendations-ai/docs/manage-placements).
      * The full list of available placements can be seen at
      * https://console.cloud.google.com/recommendation/catalogs/default_catalog/placements
      * 
@@ -1365,25 +1381,10 @@ public com.google.protobuf.ByteString getPlacementBytes() { *
      * Required. Full resource name of the format:
      * {name=projects/*/locations/global/catalogs/default_catalog/placements/*}
-     * The id of the recommendation engine placement. This id is used to identify
-     * the set of models that will be used to make the prediction.
-     * We currently support three placements with the following IDs by default:
-     * * `shopping_cart`: Predicts products frequently bought together with one or
-     *   more  products in the same shopping session. Commonly displayed after
-     *   `add-to-cart` events, on product detail pages, or on the shopping cart
-     *   page.
-     * * `home_page`: Predicts the next product that a user will most likely
-     *   engage with or purchase based on the shopping or viewing history of the
-     *   specified `userId` or `visitorId`. For example - Recommendations for you.
-     * * `product_detail`: Predicts the next product that a user will most likely
-     *   engage with or purchase. The prediction is based on the shopping or
-     *   viewing history of the specified `userId` or `visitorId` and its
-     *   relevance to a specified `CatalogItem`. Typically used on product detail
-     *   pages. For example - More products like this.
-     * * `recently_viewed_default`: Returns up to 75 products recently viewed by
-     *   the specified `userId` or `visitorId`, most recent ones first. Returns
-     *   nothing if neither of them has viewed any products yet. For example -
-     *   Recently viewed.
+     * The ID of the Recommendations AI placement. Before you can request
+     * predictions from your model, you must create at least one placement for it.
+     * For more information, see [Managing
+     * placements](https://cloud.google.com/retail/recommendations-ai/docs/manage-placements).
      * The full list of available placements can be seen at
      * https://console.cloud.google.com/recommendation/catalogs/default_catalog/placements
      * 
@@ -1408,25 +1409,10 @@ public Builder setPlacement(java.lang.String value) { *
      * Required. Full resource name of the format:
      * {name=projects/*/locations/global/catalogs/default_catalog/placements/*}
-     * The id of the recommendation engine placement. This id is used to identify
-     * the set of models that will be used to make the prediction.
-     * We currently support three placements with the following IDs by default:
-     * * `shopping_cart`: Predicts products frequently bought together with one or
-     *   more  products in the same shopping session. Commonly displayed after
-     *   `add-to-cart` events, on product detail pages, or on the shopping cart
-     *   page.
-     * * `home_page`: Predicts the next product that a user will most likely
-     *   engage with or purchase based on the shopping or viewing history of the
-     *   specified `userId` or `visitorId`. For example - Recommendations for you.
-     * * `product_detail`: Predicts the next product that a user will most likely
-     *   engage with or purchase. The prediction is based on the shopping or
-     *   viewing history of the specified `userId` or `visitorId` and its
-     *   relevance to a specified `CatalogItem`. Typically used on product detail
-     *   pages. For example - More products like this.
-     * * `recently_viewed_default`: Returns up to 75 products recently viewed by
-     *   the specified `userId` or `visitorId`, most recent ones first. Returns
-     *   nothing if neither of them has viewed any products yet. For example -
-     *   Recently viewed.
+     * The ID of the Recommendations AI placement. Before you can request
+     * predictions from your model, you must create at least one placement for it.
+     * For more information, see [Managing
+     * placements](https://cloud.google.com/retail/recommendations-ai/docs/manage-placements).
      * The full list of available placements can be seen at
      * https://console.cloud.google.com/recommendation/catalogs/default_catalog/placements
      * 
@@ -1447,25 +1433,10 @@ public Builder clearPlacement() { *
      * Required. Full resource name of the format:
      * {name=projects/*/locations/global/catalogs/default_catalog/placements/*}
-     * The id of the recommendation engine placement. This id is used to identify
-     * the set of models that will be used to make the prediction.
-     * We currently support three placements with the following IDs by default:
-     * * `shopping_cart`: Predicts products frequently bought together with one or
-     *   more  products in the same shopping session. Commonly displayed after
-     *   `add-to-cart` events, on product detail pages, or on the shopping cart
-     *   page.
-     * * `home_page`: Predicts the next product that a user will most likely
-     *   engage with or purchase based on the shopping or viewing history of the
-     *   specified `userId` or `visitorId`. For example - Recommendations for you.
-     * * `product_detail`: Predicts the next product that a user will most likely
-     *   engage with or purchase. The prediction is based on the shopping or
-     *   viewing history of the specified `userId` or `visitorId` and its
-     *   relevance to a specified `CatalogItem`. Typically used on product detail
-     *   pages. For example - More products like this.
-     * * `recently_viewed_default`: Returns up to 75 products recently viewed by
-     *   the specified `userId` or `visitorId`, most recent ones first. Returns
-     *   nothing if neither of them has viewed any products yet. For example -
-     *   Recently viewed.
+     * The ID of the Recommendations AI placement. Before you can request
+     * predictions from your model, you must create at least one placement for it.
+     * For more information, see [Managing
+     * placements](https://cloud.google.com/retail/recommendations-ai/docs/manage-placements).
      * The full list of available placements can be seen at
      * https://console.cloud.google.com/recommendation/catalogs/default_catalog/placements
      * 
@@ -1896,6 +1867,8 @@ public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { * tag values by a space. `-"tagA"` is also supported and is equivalent to * `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings * with a size limit of 1,000 characters. + * Note: "Recently viewed" models don't support tag filtering at the + * moment. * * filterOutOfStockItems. Restricts predictions to products that do not * have a * stockState value of OUT_OF_STOCK. @@ -1935,6 +1908,8 @@ public java.lang.String getFilter() { * tag values by a space. `-"tagA"` is also supported and is equivalent to * `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings * with a size limit of 1,000 characters. + * Note: "Recently viewed" models don't support tag filtering at the + * moment. * * filterOutOfStockItems. Restricts predictions to products that do not * have a * stockState value of OUT_OF_STOCK. @@ -1974,6 +1949,8 @@ public com.google.protobuf.ByteString getFilterBytes() { * tag values by a space. `-"tagA"` is also supported and is equivalent to * `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings * with a size limit of 1,000 characters. + * Note: "Recently viewed" models don't support tag filtering at the + * moment. * * filterOutOfStockItems. Restricts predictions to products that do not * have a * stockState value of OUT_OF_STOCK. @@ -2012,6 +1989,8 @@ public Builder setFilter(java.lang.String value) { * tag values by a space. `-"tagA"` is also supported and is equivalent to * `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings * with a size limit of 1,000 characters. + * Note: "Recently viewed" models don't support tag filtering at the + * moment. * * filterOutOfStockItems. Restricts predictions to products that do not * have a * stockState value of OUT_OF_STOCK. @@ -2046,6 +2025,8 @@ public Builder clearFilter() { * tag values by a space. `-"tagA"` is also supported and is equivalent to * `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings * with a size limit of 1,000 characters. + * Note: "Recently viewed" models don't support tag filtering at the + * moment. * * filterOutOfStockItems. Restricts predictions to products that do not * have a * stockState value of OUT_OF_STOCK. @@ -2178,6 +2159,16 @@ public int getParamsCount() { * * `strictFiltering`: Boolean. True by default. If set to false, the service * will return generic (unfiltered) popular products instead of empty if * your filter blocks all prediction results. + * * `priceRerankLevel`: String. Default empty. If set to be non-empty, then + * it needs to be one of {'no-price-reranking', 'low-price-reranking', + * 'medium-price-reranking', 'high-price-reranking'}. This gives + * request-level control and adjusts prediction results based on product + * price. + * * `diversityLevel`: String. Default empty. If set to be non-empty, then + * it needs to be one of {'no-diversity', 'low-diversity', + * 'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives + * request-level control and adjusts prediction results based on product + * category. * * * map<string, .google.protobuf.Value> params = 7; @@ -2212,6 +2203,16 @@ public java.util.Map getParams() { * * `strictFiltering`: Boolean. True by default. If set to false, the service * will return generic (unfiltered) popular products instead of empty if * your filter blocks all prediction results. + * * `priceRerankLevel`: String. Default empty. If set to be non-empty, then + * it needs to be one of {'no-price-reranking', 'low-price-reranking', + * 'medium-price-reranking', 'high-price-reranking'}. This gives + * request-level control and adjusts prediction results based on product + * price. + * * `diversityLevel`: String. Default empty. If set to be non-empty, then + * it needs to be one of {'no-diversity', 'low-diversity', + * 'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives + * request-level control and adjusts prediction results based on product + * category. * * * map<string, .google.protobuf.Value> params = 7; @@ -2237,6 +2238,16 @@ public java.util.Map getParamsMap() * * `strictFiltering`: Boolean. True by default. If set to false, the service * will return generic (unfiltered) popular products instead of empty if * your filter blocks all prediction results. + * * `priceRerankLevel`: String. Default empty. If set to be non-empty, then + * it needs to be one of {'no-price-reranking', 'low-price-reranking', + * 'medium-price-reranking', 'high-price-reranking'}. This gives + * request-level control and adjusts prediction results based on product + * price. + * * `diversityLevel`: String. Default empty. If set to be non-empty, then + * it needs to be one of {'no-diversity', 'low-diversity', + * 'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives + * request-level control and adjusts prediction results based on product + * category. * * * map<string, .google.protobuf.Value> params = 7; @@ -2267,6 +2278,16 @@ public com.google.protobuf.Value getParamsOrDefault( * * `strictFiltering`: Boolean. True by default. If set to false, the service * will return generic (unfiltered) popular products instead of empty if * your filter blocks all prediction results. + * * `priceRerankLevel`: String. Default empty. If set to be non-empty, then + * it needs to be one of {'no-price-reranking', 'low-price-reranking', + * 'medium-price-reranking', 'high-price-reranking'}. This gives + * request-level control and adjusts prediction results based on product + * price. + * * `diversityLevel`: String. Default empty. If set to be non-empty, then + * it needs to be one of {'no-diversity', 'low-diversity', + * 'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives + * request-level control and adjusts prediction results based on product + * category. * * * map<string, .google.protobuf.Value> params = 7; @@ -2304,6 +2325,16 @@ public Builder clearParams() { * * `strictFiltering`: Boolean. True by default. If set to false, the service * will return generic (unfiltered) popular products instead of empty if * your filter blocks all prediction results. + * * `priceRerankLevel`: String. Default empty. If set to be non-empty, then + * it needs to be one of {'no-price-reranking', 'low-price-reranking', + * 'medium-price-reranking', 'high-price-reranking'}. This gives + * request-level control and adjusts prediction results based on product + * price. + * * `diversityLevel`: String. Default empty. If set to be non-empty, then + * it needs to be one of {'no-diversity', 'low-diversity', + * 'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives + * request-level control and adjusts prediction results based on product + * category. * * * map<string, .google.protobuf.Value> params = 7; @@ -2337,6 +2368,16 @@ public java.util.Map getMutablePara * * `strictFiltering`: Boolean. True by default. If set to false, the service * will return generic (unfiltered) popular products instead of empty if * your filter blocks all prediction results. + * * `priceRerankLevel`: String. Default empty. If set to be non-empty, then + * it needs to be one of {'no-price-reranking', 'low-price-reranking', + * 'medium-price-reranking', 'high-price-reranking'}. This gives + * request-level control and adjusts prediction results based on product + * price. + * * `diversityLevel`: String. Default empty. If set to be non-empty, then + * it needs to be one of {'no-diversity', 'low-diversity', + * 'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives + * request-level control and adjusts prediction results based on product + * category. * * * map<string, .google.protobuf.Value> params = 7; @@ -2368,6 +2409,16 @@ public Builder putParams(java.lang.String key, com.google.protobuf.Value value) * * `strictFiltering`: Boolean. True by default. If set to false, the service * will return generic (unfiltered) popular products instead of empty if * your filter blocks all prediction results. + * * `priceRerankLevel`: String. Default empty. If set to be non-empty, then + * it needs to be one of {'no-price-reranking', 'low-price-reranking', + * 'medium-price-reranking', 'high-price-reranking'}. This gives + * request-level control and adjusts prediction results based on product + * price. + * * `diversityLevel`: String. Default empty. If set to be non-empty, then + * it needs to be one of {'no-diversity', 'low-diversity', + * 'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives + * request-level control and adjusts prediction results based on product + * category. * * * map<string, .google.protobuf.Value> params = 7; @@ -2406,13 +2457,21 @@ public int getLabelsCount() { * * *
-     * The labels for the predict request.
-     *  * Label keys can contain lowercase letters, digits and hyphens, must start
-     *    with a letter, and must end with a letter or digit.
-     *  * Non-zero label values can contain lowercase letters, digits and hyphens,
-     *    must start with a letter, and must end with a letter or digit.
-     *  * No more than 64 labels can be associated with a given request.
-     * See https://goo.gl/xmQnxf for more information on and examples of labels.
+     * The labels applied to a resource must meet the following requirements:
+     * * Each resource can have multiple labels, up to a maximum of 64.
+     * * Each label must be a key-value pair.
+     * * Keys have a minimum length of 1 character and a maximum length of 63
+     *   characters, and cannot be empty. Values can be empty, and have a maximum
+     *   length of 63 characters.
+     * * Keys and values can contain only lowercase letters, numeric characters,
+     *   underscores, and dashes. All characters must use UTF-8 encoding, and
+     *   international characters are allowed.
+     * * The key portion of a label must be unique. However, you can use the same
+     *   key with multiple resources.
+     * * Keys must start with a lowercase letter or international character.
+     * See [Google Cloud
+     * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+     * for more details.
      * 
* * map<string, string> labels = 8; @@ -2434,13 +2493,21 @@ public java.util.Map getLabels() { * * *
-     * The labels for the predict request.
-     *  * Label keys can contain lowercase letters, digits and hyphens, must start
-     *    with a letter, and must end with a letter or digit.
-     *  * Non-zero label values can contain lowercase letters, digits and hyphens,
-     *    must start with a letter, and must end with a letter or digit.
-     *  * No more than 64 labels can be associated with a given request.
-     * See https://goo.gl/xmQnxf for more information on and examples of labels.
+     * The labels applied to a resource must meet the following requirements:
+     * * Each resource can have multiple labels, up to a maximum of 64.
+     * * Each label must be a key-value pair.
+     * * Keys have a minimum length of 1 character and a maximum length of 63
+     *   characters, and cannot be empty. Values can be empty, and have a maximum
+     *   length of 63 characters.
+     * * Keys and values can contain only lowercase letters, numeric characters,
+     *   underscores, and dashes. All characters must use UTF-8 encoding, and
+     *   international characters are allowed.
+     * * The key portion of a label must be unique. However, you can use the same
+     *   key with multiple resources.
+     * * Keys must start with a lowercase letter or international character.
+     * See [Google Cloud
+     * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+     * for more details.
      * 
* * map<string, string> labels = 8; @@ -2453,13 +2520,21 @@ public java.util.Map getLabelsMap() { * * *
-     * The labels for the predict request.
-     *  * Label keys can contain lowercase letters, digits and hyphens, must start
-     *    with a letter, and must end with a letter or digit.
-     *  * Non-zero label values can contain lowercase letters, digits and hyphens,
-     *    must start with a letter, and must end with a letter or digit.
-     *  * No more than 64 labels can be associated with a given request.
-     * See https://goo.gl/xmQnxf for more information on and examples of labels.
+     * The labels applied to a resource must meet the following requirements:
+     * * Each resource can have multiple labels, up to a maximum of 64.
+     * * Each label must be a key-value pair.
+     * * Keys have a minimum length of 1 character and a maximum length of 63
+     *   characters, and cannot be empty. Values can be empty, and have a maximum
+     *   length of 63 characters.
+     * * Keys and values can contain only lowercase letters, numeric characters,
+     *   underscores, and dashes. All characters must use UTF-8 encoding, and
+     *   international characters are allowed.
+     * * The key portion of a label must be unique. However, you can use the same
+     *   key with multiple resources.
+     * * Keys must start with a lowercase letter or international character.
+     * See [Google Cloud
+     * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+     * for more details.
      * 
* * map<string, string> labels = 8; @@ -2477,13 +2552,21 @@ public java.lang.String getLabelsOrDefault( * * *
-     * The labels for the predict request.
-     *  * Label keys can contain lowercase letters, digits and hyphens, must start
-     *    with a letter, and must end with a letter or digit.
-     *  * Non-zero label values can contain lowercase letters, digits and hyphens,
-     *    must start with a letter, and must end with a letter or digit.
-     *  * No more than 64 labels can be associated with a given request.
-     * See https://goo.gl/xmQnxf for more information on and examples of labels.
+     * The labels applied to a resource must meet the following requirements:
+     * * Each resource can have multiple labels, up to a maximum of 64.
+     * * Each label must be a key-value pair.
+     * * Keys have a minimum length of 1 character and a maximum length of 63
+     *   characters, and cannot be empty. Values can be empty, and have a maximum
+     *   length of 63 characters.
+     * * Keys and values can contain only lowercase letters, numeric characters,
+     *   underscores, and dashes. All characters must use UTF-8 encoding, and
+     *   international characters are allowed.
+     * * The key portion of a label must be unique. However, you can use the same
+     *   key with multiple resources.
+     * * Keys must start with a lowercase letter or international character.
+     * See [Google Cloud
+     * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+     * for more details.
      * 
* * map<string, string> labels = 8; @@ -2508,13 +2591,21 @@ public Builder clearLabels() { * * *
-     * The labels for the predict request.
-     *  * Label keys can contain lowercase letters, digits and hyphens, must start
-     *    with a letter, and must end with a letter or digit.
-     *  * Non-zero label values can contain lowercase letters, digits and hyphens,
-     *    must start with a letter, and must end with a letter or digit.
-     *  * No more than 64 labels can be associated with a given request.
-     * See https://goo.gl/xmQnxf for more information on and examples of labels.
+     * The labels applied to a resource must meet the following requirements:
+     * * Each resource can have multiple labels, up to a maximum of 64.
+     * * Each label must be a key-value pair.
+     * * Keys have a minimum length of 1 character and a maximum length of 63
+     *   characters, and cannot be empty. Values can be empty, and have a maximum
+     *   length of 63 characters.
+     * * Keys and values can contain only lowercase letters, numeric characters,
+     *   underscores, and dashes. All characters must use UTF-8 encoding, and
+     *   international characters are allowed.
+     * * The key portion of a label must be unique. However, you can use the same
+     *   key with multiple resources.
+     * * Keys must start with a lowercase letter or international character.
+     * See [Google Cloud
+     * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+     * for more details.
      * 
* * map<string, string> labels = 8; @@ -2535,13 +2626,21 @@ public java.util.Map getMutableLabels() { * * *
-     * The labels for the predict request.
-     *  * Label keys can contain lowercase letters, digits and hyphens, must start
-     *    with a letter, and must end with a letter or digit.
-     *  * Non-zero label values can contain lowercase letters, digits and hyphens,
-     *    must start with a letter, and must end with a letter or digit.
-     *  * No more than 64 labels can be associated with a given request.
-     * See https://goo.gl/xmQnxf for more information on and examples of labels.
+     * The labels applied to a resource must meet the following requirements:
+     * * Each resource can have multiple labels, up to a maximum of 64.
+     * * Each label must be a key-value pair.
+     * * Keys have a minimum length of 1 character and a maximum length of 63
+     *   characters, and cannot be empty. Values can be empty, and have a maximum
+     *   length of 63 characters.
+     * * Keys and values can contain only lowercase letters, numeric characters,
+     *   underscores, and dashes. All characters must use UTF-8 encoding, and
+     *   international characters are allowed.
+     * * The key portion of a label must be unique. However, you can use the same
+     *   key with multiple resources.
+     * * Keys must start with a lowercase letter or international character.
+     * See [Google Cloud
+     * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+     * for more details.
      * 
* * map<string, string> labels = 8; @@ -2560,13 +2659,21 @@ public Builder putLabels(java.lang.String key, java.lang.String value) { * * *
-     * The labels for the predict request.
-     *  * Label keys can contain lowercase letters, digits and hyphens, must start
-     *    with a letter, and must end with a letter or digit.
-     *  * Non-zero label values can contain lowercase letters, digits and hyphens,
-     *    must start with a letter, and must end with a letter or digit.
-     *  * No more than 64 labels can be associated with a given request.
-     * See https://goo.gl/xmQnxf for more information on and examples of labels.
+     * The labels applied to a resource must meet the following requirements:
+     * * Each resource can have multiple labels, up to a maximum of 64.
+     * * Each label must be a key-value pair.
+     * * Keys have a minimum length of 1 character and a maximum length of 63
+     *   characters, and cannot be empty. Values can be empty, and have a maximum
+     *   length of 63 characters.
+     * * Keys and values can contain only lowercase letters, numeric characters,
+     *   underscores, and dashes. All characters must use UTF-8 encoding, and
+     *   international characters are allowed.
+     * * The key portion of a label must be unique. However, you can use the same
+     *   key with multiple resources.
+     * * Keys must start with a lowercase letter or international character.
+     * See [Google Cloud
+     * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+     * for more details.
      * 
* * map<string, string> labels = 8; diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/PredictRequestOrBuilder.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/PredictRequestOrBuilder.java index fad4018b..24fd483e 100644 --- a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/PredictRequestOrBuilder.java +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/PredictRequestOrBuilder.java @@ -29,25 +29,10 @@ public interface PredictRequestOrBuilder *
    * Required. Full resource name of the format:
    * {name=projects/*/locations/global/catalogs/default_catalog/placements/*}
-   * The id of the recommendation engine placement. This id is used to identify
-   * the set of models that will be used to make the prediction.
-   * We currently support three placements with the following IDs by default:
-   * * `shopping_cart`: Predicts products frequently bought together with one or
-   *   more  products in the same shopping session. Commonly displayed after
-   *   `add-to-cart` events, on product detail pages, or on the shopping cart
-   *   page.
-   * * `home_page`: Predicts the next product that a user will most likely
-   *   engage with or purchase based on the shopping or viewing history of the
-   *   specified `userId` or `visitorId`. For example - Recommendations for you.
-   * * `product_detail`: Predicts the next product that a user will most likely
-   *   engage with or purchase. The prediction is based on the shopping or
-   *   viewing history of the specified `userId` or `visitorId` and its
-   *   relevance to a specified `CatalogItem`. Typically used on product detail
-   *   pages. For example - More products like this.
-   * * `recently_viewed_default`: Returns up to 75 products recently viewed by
-   *   the specified `userId` or `visitorId`, most recent ones first. Returns
-   *   nothing if neither of them has viewed any products yet. For example -
-   *   Recently viewed.
+   * The ID of the Recommendations AI placement. Before you can request
+   * predictions from your model, you must create at least one placement for it.
+   * For more information, see [Managing
+   * placements](https://cloud.google.com/retail/recommendations-ai/docs/manage-placements).
    * The full list of available placements can be seen at
    * https://console.cloud.google.com/recommendation/catalogs/default_catalog/placements
    * 
@@ -63,25 +48,10 @@ public interface PredictRequestOrBuilder *
    * Required. Full resource name of the format:
    * {name=projects/*/locations/global/catalogs/default_catalog/placements/*}
-   * The id of the recommendation engine placement. This id is used to identify
-   * the set of models that will be used to make the prediction.
-   * We currently support three placements with the following IDs by default:
-   * * `shopping_cart`: Predicts products frequently bought together with one or
-   *   more  products in the same shopping session. Commonly displayed after
-   *   `add-to-cart` events, on product detail pages, or on the shopping cart
-   *   page.
-   * * `home_page`: Predicts the next product that a user will most likely
-   *   engage with or purchase based on the shopping or viewing history of the
-   *   specified `userId` or `visitorId`. For example - Recommendations for you.
-   * * `product_detail`: Predicts the next product that a user will most likely
-   *   engage with or purchase. The prediction is based on the shopping or
-   *   viewing history of the specified `userId` or `visitorId` and its
-   *   relevance to a specified `CatalogItem`. Typically used on product detail
-   *   pages. For example - More products like this.
-   * * `recently_viewed_default`: Returns up to 75 products recently viewed by
-   *   the specified `userId` or `visitorId`, most recent ones first. Returns
-   *   nothing if neither of them has viewed any products yet. For example -
-   *   Recently viewed.
+   * The ID of the Recommendations AI placement. Before you can request
+   * predictions from your model, you must create at least one placement for it.
+   * For more information, see [Managing
+   * placements](https://cloud.google.com/retail/recommendations-ai/docs/manage-placements).
    * The full list of available placements can be seen at
    * https://console.cloud.google.com/recommendation/catalogs/default_catalog/placements
    * 
@@ -195,6 +165,8 @@ public interface PredictRequestOrBuilder * tag values by a space. `-"tagA"` is also supported and is equivalent to * `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings * with a size limit of 1,000 characters. + * Note: "Recently viewed" models don't support tag filtering at the + * moment. * * filterOutOfStockItems. Restricts predictions to products that do not * have a * stockState value of OUT_OF_STOCK. @@ -224,6 +196,8 @@ public interface PredictRequestOrBuilder * tag values by a space. `-"tagA"` is also supported and is equivalent to * `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings * with a size limit of 1,000 characters. + * Note: "Recently viewed" models don't support tag filtering at the + * moment. * * filterOutOfStockItems. Restricts predictions to products that do not * have a * stockState value of OUT_OF_STOCK. @@ -275,6 +249,16 @@ public interface PredictRequestOrBuilder * * `strictFiltering`: Boolean. True by default. If set to false, the service * will return generic (unfiltered) popular products instead of empty if * your filter blocks all prediction results. + * * `priceRerankLevel`: String. Default empty. If set to be non-empty, then + * it needs to be one of {'no-price-reranking', 'low-price-reranking', + * 'medium-price-reranking', 'high-price-reranking'}. This gives + * request-level control and adjusts prediction results based on product + * price. + * * `diversityLevel`: String. Default empty. If set to be non-empty, then + * it needs to be one of {'no-diversity', 'low-diversity', + * 'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives + * request-level control and adjusts prediction results based on product + * category. * * * map<string, .google.protobuf.Value> params = 7; @@ -297,6 +281,16 @@ public interface PredictRequestOrBuilder * * `strictFiltering`: Boolean. True by default. If set to false, the service * will return generic (unfiltered) popular products instead of empty if * your filter blocks all prediction results. + * * `priceRerankLevel`: String. Default empty. If set to be non-empty, then + * it needs to be one of {'no-price-reranking', 'low-price-reranking', + * 'medium-price-reranking', 'high-price-reranking'}. This gives + * request-level control and adjusts prediction results based on product + * price. + * * `diversityLevel`: String. Default empty. If set to be non-empty, then + * it needs to be one of {'no-diversity', 'low-diversity', + * 'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives + * request-level control and adjusts prediction results based on product + * category. * * * map<string, .google.protobuf.Value> params = 7; @@ -322,6 +316,16 @@ public interface PredictRequestOrBuilder * * `strictFiltering`: Boolean. True by default. If set to false, the service * will return generic (unfiltered) popular products instead of empty if * your filter blocks all prediction results. + * * `priceRerankLevel`: String. Default empty. If set to be non-empty, then + * it needs to be one of {'no-price-reranking', 'low-price-reranking', + * 'medium-price-reranking', 'high-price-reranking'}. This gives + * request-level control and adjusts prediction results based on product + * price. + * * `diversityLevel`: String. Default empty. If set to be non-empty, then + * it needs to be one of {'no-diversity', 'low-diversity', + * 'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives + * request-level control and adjusts prediction results based on product + * category. * * * map<string, .google.protobuf.Value> params = 7; @@ -344,6 +348,16 @@ public interface PredictRequestOrBuilder * * `strictFiltering`: Boolean. True by default. If set to false, the service * will return generic (unfiltered) popular products instead of empty if * your filter blocks all prediction results. + * * `priceRerankLevel`: String. Default empty. If set to be non-empty, then + * it needs to be one of {'no-price-reranking', 'low-price-reranking', + * 'medium-price-reranking', 'high-price-reranking'}. This gives + * request-level control and adjusts prediction results based on product + * price. + * * `diversityLevel`: String. Default empty. If set to be non-empty, then + * it needs to be one of {'no-diversity', 'low-diversity', + * 'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives + * request-level control and adjusts prediction results based on product + * category. * * * map<string, .google.protobuf.Value> params = 7; @@ -367,6 +381,16 @@ com.google.protobuf.Value getParamsOrDefault( * * `strictFiltering`: Boolean. True by default. If set to false, the service * will return generic (unfiltered) popular products instead of empty if * your filter blocks all prediction results. + * * `priceRerankLevel`: String. Default empty. If set to be non-empty, then + * it needs to be one of {'no-price-reranking', 'low-price-reranking', + * 'medium-price-reranking', 'high-price-reranking'}. This gives + * request-level control and adjusts prediction results based on product + * price. + * * `diversityLevel`: String. Default empty. If set to be non-empty, then + * it needs to be one of {'no-diversity', 'low-diversity', + * 'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives + * request-level control and adjusts prediction results based on product + * category. * * * map<string, .google.protobuf.Value> params = 7; @@ -377,13 +401,21 @@ com.google.protobuf.Value getParamsOrDefault( * * *
-   * The labels for the predict request.
-   *  * Label keys can contain lowercase letters, digits and hyphens, must start
-   *    with a letter, and must end with a letter or digit.
-   *  * Non-zero label values can contain lowercase letters, digits and hyphens,
-   *    must start with a letter, and must end with a letter or digit.
-   *  * No more than 64 labels can be associated with a given request.
-   * See https://goo.gl/xmQnxf for more information on and examples of labels.
+   * The labels applied to a resource must meet the following requirements:
+   * * Each resource can have multiple labels, up to a maximum of 64.
+   * * Each label must be a key-value pair.
+   * * Keys have a minimum length of 1 character and a maximum length of 63
+   *   characters, and cannot be empty. Values can be empty, and have a maximum
+   *   length of 63 characters.
+   * * Keys and values can contain only lowercase letters, numeric characters,
+   *   underscores, and dashes. All characters must use UTF-8 encoding, and
+   *   international characters are allowed.
+   * * The key portion of a label must be unique. However, you can use the same
+   *   key with multiple resources.
+   * * Keys must start with a lowercase letter or international character.
+   * See [Google Cloud
+   * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+   * for more details.
    * 
* * map<string, string> labels = 8; @@ -393,13 +425,21 @@ com.google.protobuf.Value getParamsOrDefault( * * *
-   * The labels for the predict request.
-   *  * Label keys can contain lowercase letters, digits and hyphens, must start
-   *    with a letter, and must end with a letter or digit.
-   *  * Non-zero label values can contain lowercase letters, digits and hyphens,
-   *    must start with a letter, and must end with a letter or digit.
-   *  * No more than 64 labels can be associated with a given request.
-   * See https://goo.gl/xmQnxf for more information on and examples of labels.
+   * The labels applied to a resource must meet the following requirements:
+   * * Each resource can have multiple labels, up to a maximum of 64.
+   * * Each label must be a key-value pair.
+   * * Keys have a minimum length of 1 character and a maximum length of 63
+   *   characters, and cannot be empty. Values can be empty, and have a maximum
+   *   length of 63 characters.
+   * * Keys and values can contain only lowercase letters, numeric characters,
+   *   underscores, and dashes. All characters must use UTF-8 encoding, and
+   *   international characters are allowed.
+   * * The key portion of a label must be unique. However, you can use the same
+   *   key with multiple resources.
+   * * Keys must start with a lowercase letter or international character.
+   * See [Google Cloud
+   * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+   * for more details.
    * 
* * map<string, string> labels = 8; @@ -412,13 +452,21 @@ com.google.protobuf.Value getParamsOrDefault( * * *
-   * The labels for the predict request.
-   *  * Label keys can contain lowercase letters, digits and hyphens, must start
-   *    with a letter, and must end with a letter or digit.
-   *  * Non-zero label values can contain lowercase letters, digits and hyphens,
-   *    must start with a letter, and must end with a letter or digit.
-   *  * No more than 64 labels can be associated with a given request.
-   * See https://goo.gl/xmQnxf for more information on and examples of labels.
+   * The labels applied to a resource must meet the following requirements:
+   * * Each resource can have multiple labels, up to a maximum of 64.
+   * * Each label must be a key-value pair.
+   * * Keys have a minimum length of 1 character and a maximum length of 63
+   *   characters, and cannot be empty. Values can be empty, and have a maximum
+   *   length of 63 characters.
+   * * Keys and values can contain only lowercase letters, numeric characters,
+   *   underscores, and dashes. All characters must use UTF-8 encoding, and
+   *   international characters are allowed.
+   * * The key portion of a label must be unique. However, you can use the same
+   *   key with multiple resources.
+   * * Keys must start with a lowercase letter or international character.
+   * See [Google Cloud
+   * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+   * for more details.
    * 
* * map<string, string> labels = 8; @@ -428,13 +476,21 @@ com.google.protobuf.Value getParamsOrDefault( * * *
-   * The labels for the predict request.
-   *  * Label keys can contain lowercase letters, digits and hyphens, must start
-   *    with a letter, and must end with a letter or digit.
-   *  * Non-zero label values can contain lowercase letters, digits and hyphens,
-   *    must start with a letter, and must end with a letter or digit.
-   *  * No more than 64 labels can be associated with a given request.
-   * See https://goo.gl/xmQnxf for more information on and examples of labels.
+   * The labels applied to a resource must meet the following requirements:
+   * * Each resource can have multiple labels, up to a maximum of 64.
+   * * Each label must be a key-value pair.
+   * * Keys have a minimum length of 1 character and a maximum length of 63
+   *   characters, and cannot be empty. Values can be empty, and have a maximum
+   *   length of 63 characters.
+   * * Keys and values can contain only lowercase letters, numeric characters,
+   *   underscores, and dashes. All characters must use UTF-8 encoding, and
+   *   international characters are allowed.
+   * * The key portion of a label must be unique. However, you can use the same
+   *   key with multiple resources.
+   * * Keys must start with a lowercase letter or international character.
+   * See [Google Cloud
+   * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+   * for more details.
    * 
* * map<string, string> labels = 8; @@ -444,13 +500,21 @@ com.google.protobuf.Value getParamsOrDefault( * * *
-   * The labels for the predict request.
-   *  * Label keys can contain lowercase letters, digits and hyphens, must start
-   *    with a letter, and must end with a letter or digit.
-   *  * Non-zero label values can contain lowercase letters, digits and hyphens,
-   *    must start with a letter, and must end with a letter or digit.
-   *  * No more than 64 labels can be associated with a given request.
-   * See https://goo.gl/xmQnxf for more information on and examples of labels.
+   * The labels applied to a resource must meet the following requirements:
+   * * Each resource can have multiple labels, up to a maximum of 64.
+   * * Each label must be a key-value pair.
+   * * Keys have a minimum length of 1 character and a maximum length of 63
+   *   characters, and cannot be empty. Values can be empty, and have a maximum
+   *   length of 63 characters.
+   * * Keys and values can contain only lowercase letters, numeric characters,
+   *   underscores, and dashes. All characters must use UTF-8 encoding, and
+   *   international characters are allowed.
+   * * The key portion of a label must be unique. However, you can use the same
+   *   key with multiple resources.
+   * * Keys must start with a lowercase letter or international character.
+   * See [Google Cloud
+   * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+   * for more details.
    * 
* * map<string, string> labels = 8; diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/PriceInfo.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/PriceInfo.java index 8d380510..1df1bd95 100644 --- a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/PriceInfo.java +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/PriceInfo.java @@ -90,6 +90,52 @@ private PriceInfo( case 37: { cost_ = input.readFloat(); + break; + } + case 42: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (priceEffectiveTime_ != null) { + subBuilder = priceEffectiveTime_.toBuilder(); + } + priceEffectiveTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(priceEffectiveTime_); + priceEffectiveTime_ = subBuilder.buildPartial(); + } + + break; + } + case 50: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (priceExpireTime_ != null) { + subBuilder = priceExpireTime_.toBuilder(); + } + priceExpireTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(priceExpireTime_); + priceExpireTime_ = subBuilder.buildPartial(); + } + + break; + } + case 58: + { + com.google.cloud.retail.v2.PriceInfo.PriceRange.Builder subBuilder = null; + if (priceRange_ != null) { + subBuilder = priceRange_.toBuilder(); + } + priceRange_ = + input.readMessage( + com.google.cloud.retail.v2.PriceInfo.PriceRange.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(priceRange_); + priceRange_ = subBuilder.buildPartial(); + } + break; } default: @@ -126,787 +172,3188 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.cloud.retail.v2.PriceInfo.Builder.class); } - public static final int CURRENCY_CODE_FIELD_NUMBER = 1; - private volatile java.lang.Object currencyCode_; - /** - * - * - *
-   * The 3-letter currency code defined in [ISO
-   * 4217](https://www.iso.org/iso-4217-currency-codes.html).
-   * If this field is an unrecognizable currency code, an INVALID_ARGUMENT
-   * error is returned.
-   * 
- * - * string currency_code = 1; - * - * @return The currencyCode. - */ - @java.lang.Override - public java.lang.String getCurrencyCode() { - java.lang.Object ref = currencyCode_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - currencyCode_ = s; - return s; - } - } - /** - * - * - *
-   * The 3-letter currency code defined in [ISO
-   * 4217](https://www.iso.org/iso-4217-currency-codes.html).
-   * If this field is an unrecognizable currency code, an INVALID_ARGUMENT
-   * error is returned.
-   * 
- * - * string currency_code = 1; - * - * @return The bytes for currencyCode. - */ - @java.lang.Override - public com.google.protobuf.ByteString getCurrencyCodeBytes() { - java.lang.Object ref = currencyCode_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - currencyCode_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } + public interface PriceRangeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2.PriceInfo.PriceRange) + com.google.protobuf.MessageOrBuilder { - public static final int PRICE_FIELD_NUMBER = 2; - private float price_; - /** - * - * - *
-   * Price of the product.
-   * Google Merchant Center property
-   * [price](https://support.google.com/merchants/answer/6324371). Schema.org
-   * property [Offer.priceSpecification](https://schema.org/priceSpecification).
-   * 
- * - * float price = 2; - * - * @return The price. - */ - @java.lang.Override - public float getPrice() { - return price_; - } + /** + * + * + *
+     * The inclusive
+     * [Product.pricing_info.price][google.cloud.retail.v2.PriceInfo.price]
+     * interval of all [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2.Product] having the same
+     * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id].
+     * 
+ * + * .google.cloud.retail.v2.Interval price = 1; + * + * @return Whether the price field is set. + */ + boolean hasPrice(); + /** + * + * + *
+     * The inclusive
+     * [Product.pricing_info.price][google.cloud.retail.v2.PriceInfo.price]
+     * interval of all [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2.Product] having the same
+     * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id].
+     * 
+ * + * .google.cloud.retail.v2.Interval price = 1; + * + * @return The price. + */ + com.google.cloud.retail.v2.Interval getPrice(); + /** + * + * + *
+     * The inclusive
+     * [Product.pricing_info.price][google.cloud.retail.v2.PriceInfo.price]
+     * interval of all [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2.Product] having the same
+     * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id].
+     * 
+ * + * .google.cloud.retail.v2.Interval price = 1; + */ + com.google.cloud.retail.v2.IntervalOrBuilder getPriceOrBuilder(); - public static final int ORIGINAL_PRICE_FIELD_NUMBER = 3; - private float originalPrice_; - /** - * - * - *
-   * Price of the product without any discount. If zero, by default set to be
-   * the [price][google.cloud.retail.v2.PriceInfo.price].
-   * 
- * - * float original_price = 3; - * - * @return The originalPrice. - */ - @java.lang.Override - public float getOriginalPrice() { - return originalPrice_; + /** + * + * + *
+     * The inclusive
+     * [Product.pricing_info.original_price][google.cloud.retail.v2.PriceInfo.original_price]
+     * internal of all [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2.Product] having the same
+     * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id].
+     * 
+ * + * .google.cloud.retail.v2.Interval original_price = 2; + * + * @return Whether the originalPrice field is set. + */ + boolean hasOriginalPrice(); + /** + * + * + *
+     * The inclusive
+     * [Product.pricing_info.original_price][google.cloud.retail.v2.PriceInfo.original_price]
+     * internal of all [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2.Product] having the same
+     * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id].
+     * 
+ * + * .google.cloud.retail.v2.Interval original_price = 2; + * + * @return The originalPrice. + */ + com.google.cloud.retail.v2.Interval getOriginalPrice(); + /** + * + * + *
+     * The inclusive
+     * [Product.pricing_info.original_price][google.cloud.retail.v2.PriceInfo.original_price]
+     * internal of all [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2.Product] having the same
+     * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id].
+     * 
+ * + * .google.cloud.retail.v2.Interval original_price = 2; + */ + com.google.cloud.retail.v2.IntervalOrBuilder getOriginalPriceOrBuilder(); } - - public static final int COST_FIELD_NUMBER = 4; - private float cost_; /** * * *
-   * The costs associated with the sale of a particular product. Used for gross
-   * profit reporting.
-   * * Profit = [price][google.cloud.retail.v2.PriceInfo.price] -
-   * [cost][google.cloud.retail.v2.PriceInfo.cost]
-   * Google Merchant Center property
-   * [cost_of_goods_sold](https://support.google.com/merchants/answer/9017895).
+   * The price range of all
+   * [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2.Product] having the same
+   * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id].
    * 
* - * float cost = 4; - * - * @return The cost. + * Protobuf type {@code google.cloud.retail.v2.PriceInfo.PriceRange} */ - @java.lang.Override - public float getCost() { - return cost_; - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getCurrencyCodeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, currencyCode_); - } - if (price_ != 0F) { - output.writeFloat(2, price_); - } - if (originalPrice_ != 0F) { - output.writeFloat(3, originalPrice_); - } - if (cost_ != 0F) { - output.writeFloat(4, cost_); + public static final class PriceRange extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.PriceInfo.PriceRange) + PriceRangeOrBuilder { + private static final long serialVersionUID = 0L; + // Use PriceRange.newBuilder() to construct. + private PriceRange(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); } - unknownFields.writeTo(output); - } - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; + private PriceRange() {} - size = 0; - if (!getCurrencyCodeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, currencyCode_); - } - if (price_ != 0F) { - size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, price_); + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PriceRange(); } - if (originalPrice_ != 0F) { - size += com.google.protobuf.CodedOutputStream.computeFloatSize(3, originalPrice_); + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; } - if (cost_ != 0F) { - size += com.google.protobuf.CodedOutputStream.computeFloatSize(4, cost_); + + private PriceRange( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.retail.v2.Interval.Builder subBuilder = null; + if (price_ != null) { + subBuilder = price_.toBuilder(); + } + price_ = + input.readMessage( + com.google.cloud.retail.v2.Interval.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(price_); + price_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.cloud.retail.v2.Interval.Builder subBuilder = null; + if (originalPrice_ != null) { + subBuilder = originalPrice_.toBuilder(); + } + originalPrice_ = + input.readMessage( + com.google.cloud.retail.v2.Interval.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(originalPrice_); + originalPrice_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.CommonProto + .internal_static_google_cloud_retail_v2_PriceInfo_PriceRange_descriptor; } - if (!(obj instanceof com.google.cloud.retail.v2.PriceInfo)) { - return super.equals(obj); + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.CommonProto + .internal_static_google_cloud_retail_v2_PriceInfo_PriceRange_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.PriceInfo.PriceRange.class, + com.google.cloud.retail.v2.PriceInfo.PriceRange.Builder.class); } - com.google.cloud.retail.v2.PriceInfo other = (com.google.cloud.retail.v2.PriceInfo) obj; - if (!getCurrencyCode().equals(other.getCurrencyCode())) return false; - if (java.lang.Float.floatToIntBits(getPrice()) - != java.lang.Float.floatToIntBits(other.getPrice())) return false; - if (java.lang.Float.floatToIntBits(getOriginalPrice()) - != java.lang.Float.floatToIntBits(other.getOriginalPrice())) return false; - if (java.lang.Float.floatToIntBits(getCost()) - != java.lang.Float.floatToIntBits(other.getCost())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } + public static final int PRICE_FIELD_NUMBER = 1; + private com.google.cloud.retail.v2.Interval price_; + /** + * + * + *
+     * The inclusive
+     * [Product.pricing_info.price][google.cloud.retail.v2.PriceInfo.price]
+     * interval of all [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2.Product] having the same
+     * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id].
+     * 
+ * + * .google.cloud.retail.v2.Interval price = 1; + * + * @return Whether the price field is set. + */ + @java.lang.Override + public boolean hasPrice() { + return price_ != null; + } + /** + * + * + *
+     * The inclusive
+     * [Product.pricing_info.price][google.cloud.retail.v2.PriceInfo.price]
+     * interval of all [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2.Product] having the same
+     * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id].
+     * 
+ * + * .google.cloud.retail.v2.Interval price = 1; + * + * @return The price. + */ + @java.lang.Override + public com.google.cloud.retail.v2.Interval getPrice() { + return price_ == null ? com.google.cloud.retail.v2.Interval.getDefaultInstance() : price_; + } + /** + * + * + *
+     * The inclusive
+     * [Product.pricing_info.price][google.cloud.retail.v2.PriceInfo.price]
+     * interval of all [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2.Product] having the same
+     * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id].
+     * 
+ * + * .google.cloud.retail.v2.Interval price = 1; + */ + @java.lang.Override + public com.google.cloud.retail.v2.IntervalOrBuilder getPriceOrBuilder() { + return getPrice(); + } - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; + public static final int ORIGINAL_PRICE_FIELD_NUMBER = 2; + private com.google.cloud.retail.v2.Interval originalPrice_; + /** + * + * + *
+     * The inclusive
+     * [Product.pricing_info.original_price][google.cloud.retail.v2.PriceInfo.original_price]
+     * internal of all [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2.Product] having the same
+     * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id].
+     * 
+ * + * .google.cloud.retail.v2.Interval original_price = 2; + * + * @return Whether the originalPrice field is set. + */ + @java.lang.Override + public boolean hasOriginalPrice() { + return originalPrice_ != null; + } + /** + * + * + *
+     * The inclusive
+     * [Product.pricing_info.original_price][google.cloud.retail.v2.PriceInfo.original_price]
+     * internal of all [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2.Product] having the same
+     * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id].
+     * 
+ * + * .google.cloud.retail.v2.Interval original_price = 2; + * + * @return The originalPrice. + */ + @java.lang.Override + public com.google.cloud.retail.v2.Interval getOriginalPrice() { + return originalPrice_ == null + ? com.google.cloud.retail.v2.Interval.getDefaultInstance() + : originalPrice_; + } + /** + * + * + *
+     * The inclusive
+     * [Product.pricing_info.original_price][google.cloud.retail.v2.PriceInfo.original_price]
+     * internal of all [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2.Product] having the same
+     * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id].
+     * 
+ * + * .google.cloud.retail.v2.Interval original_price = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2.IntervalOrBuilder getOriginalPriceOrBuilder() { + return getOriginalPrice(); } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + CURRENCY_CODE_FIELD_NUMBER; - hash = (53 * hash) + getCurrencyCode().hashCode(); - hash = (37 * hash) + PRICE_FIELD_NUMBER; - hash = (53 * hash) + java.lang.Float.floatToIntBits(getPrice()); - hash = (37 * hash) + ORIGINAL_PRICE_FIELD_NUMBER; - hash = (53 * hash) + java.lang.Float.floatToIntBits(getOriginalPrice()); - hash = (37 * hash) + COST_FIELD_NUMBER; - hash = (53 * hash) + java.lang.Float.floatToIntBits(getCost()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - public static com.google.cloud.retail.v2.PriceInfo parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } + private byte memoizedIsInitialized = -1; - public static com.google.cloud.retail.v2.PriceInfo parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; - public static com.google.cloud.retail.v2.PriceInfo parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } + memoizedIsInitialized = 1; + return true; + } - public static com.google.cloud.retail.v2.PriceInfo parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (price_ != null) { + output.writeMessage(1, getPrice()); + } + if (originalPrice_ != null) { + output.writeMessage(2, getOriginalPrice()); + } + unknownFields.writeTo(output); + } - public static com.google.cloud.retail.v2.PriceInfo parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; - public static com.google.cloud.retail.v2.PriceInfo parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } + size = 0; + if (price_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getPrice()); + } + if (originalPrice_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getOriginalPrice()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } - public static com.google.cloud.retail.v2.PriceInfo parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.retail.v2.PriceInfo.PriceRange)) { + return super.equals(obj); + } + com.google.cloud.retail.v2.PriceInfo.PriceRange other = + (com.google.cloud.retail.v2.PriceInfo.PriceRange) obj; - public static com.google.cloud.retail.v2.PriceInfo parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } + if (hasPrice() != other.hasPrice()) return false; + if (hasPrice()) { + if (!getPrice().equals(other.getPrice())) return false; + } + if (hasOriginalPrice() != other.hasOriginalPrice()) return false; + if (hasOriginalPrice()) { + if (!getOriginalPrice().equals(other.getOriginalPrice())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } - public static com.google.cloud.retail.v2.PriceInfo parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasPrice()) { + hash = (37 * hash) + PRICE_FIELD_NUMBER; + hash = (53 * hash) + getPrice().hashCode(); + } + if (hasOriginalPrice()) { + hash = (37 * hash) + ORIGINAL_PRICE_FIELD_NUMBER; + hash = (53 * hash) + getOriginalPrice().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } - public static com.google.cloud.retail.v2.PriceInfo parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } + public static com.google.cloud.retail.v2.PriceInfo.PriceRange parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } - public static com.google.cloud.retail.v2.PriceInfo parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } + public static com.google.cloud.retail.v2.PriceInfo.PriceRange parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } - public static com.google.cloud.retail.v2.PriceInfo parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } + public static com.google.cloud.retail.v2.PriceInfo.PriceRange parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } + public static com.google.cloud.retail.v2.PriceInfo.PriceRange parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } + public static com.google.cloud.retail.v2.PriceInfo.PriceRange parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } - public static Builder newBuilder(com.google.cloud.retail.v2.PriceInfo prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } + public static com.google.cloud.retail.v2.PriceInfo.PriceRange parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } + public static com.google.cloud.retail.v2.PriceInfo.PriceRange parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-   * The price information of a [Product][google.cloud.retail.v2.Product].
-   * 
- * - * Protobuf type {@code google.cloud.retail.v2.PriceInfo} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.PriceInfo) - com.google.cloud.retail.v2.PriceInfoOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.retail.v2.CommonProto - .internal_static_google_cloud_retail_v2_PriceInfo_descriptor; + public static com.google.cloud.retail.v2.PriceInfo.PriceRange parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.retail.v2.CommonProto - .internal_static_google_cloud_retail_v2_PriceInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.retail.v2.PriceInfo.class, - com.google.cloud.retail.v2.PriceInfo.Builder.class); + public static com.google.cloud.retail.v2.PriceInfo.PriceRange parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); } - // Construct using com.google.cloud.retail.v2.PriceInfo.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); + public static com.google.cloud.retail.v2.PriceInfo.PriceRange parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); + public static com.google.cloud.retail.v2.PriceInfo.PriceRange parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + public static com.google.cloud.retail.v2.PriceInfo.PriceRange parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); } @java.lang.Override - public Builder clear() { - super.clear(); - currencyCode_ = ""; - - price_ = 0F; - - originalPrice_ = 0F; - - cost_ = 0F; - - return this; + public Builder newBuilderForType() { + return newBuilder(); } - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.retail.v2.CommonProto - .internal_static_google_cloud_retail_v2_PriceInfo_descriptor; + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); } - @java.lang.Override - public com.google.cloud.retail.v2.PriceInfo getDefaultInstanceForType() { - return com.google.cloud.retail.v2.PriceInfo.getDefaultInstance(); + public static Builder newBuilder(com.google.cloud.retail.v2.PriceInfo.PriceRange prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override - public com.google.cloud.retail.v2.PriceInfo build() { - com.google.cloud.retail.v2.PriceInfo result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override - public com.google.cloud.retail.v2.PriceInfo buildPartial() { - com.google.cloud.retail.v2.PriceInfo result = new com.google.cloud.retail.v2.PriceInfo(this); - result.currencyCode_ = currencyCode_; + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * The price range of all
+     * [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2.Product] having the same
+     * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id].
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2.PriceInfo.PriceRange} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.PriceInfo.PriceRange) + com.google.cloud.retail.v2.PriceInfo.PriceRangeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.CommonProto + .internal_static_google_cloud_retail_v2_PriceInfo_PriceRange_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.CommonProto + .internal_static_google_cloud_retail_v2_PriceInfo_PriceRange_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.PriceInfo.PriceRange.class, + com.google.cloud.retail.v2.PriceInfo.PriceRange.Builder.class); + } + + // Construct using com.google.cloud.retail.v2.PriceInfo.PriceRange.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (priceBuilder_ == null) { + price_ = null; + } else { + price_ = null; + priceBuilder_ = null; + } + if (originalPriceBuilder_ == null) { + originalPrice_ = null; + } else { + originalPrice_ = null; + originalPriceBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2.CommonProto + .internal_static_google_cloud_retail_v2_PriceInfo_PriceRange_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2.PriceInfo.PriceRange getDefaultInstanceForType() { + return com.google.cloud.retail.v2.PriceInfo.PriceRange.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2.PriceInfo.PriceRange build() { + com.google.cloud.retail.v2.PriceInfo.PriceRange result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2.PriceInfo.PriceRange buildPartial() { + com.google.cloud.retail.v2.PriceInfo.PriceRange result = + new com.google.cloud.retail.v2.PriceInfo.PriceRange(this); + if (priceBuilder_ == null) { + result.price_ = price_; + } else { + result.price_ = priceBuilder_.build(); + } + if (originalPriceBuilder_ == null) { + result.originalPrice_ = originalPrice_; + } else { + result.originalPrice_ = originalPriceBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.retail.v2.PriceInfo.PriceRange) { + return mergeFrom((com.google.cloud.retail.v2.PriceInfo.PriceRange) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2.PriceInfo.PriceRange other) { + if (other == com.google.cloud.retail.v2.PriceInfo.PriceRange.getDefaultInstance()) + return this; + if (other.hasPrice()) { + mergePrice(other.getPrice()); + } + if (other.hasOriginalPrice()) { + mergeOriginalPrice(other.getOriginalPrice()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.retail.v2.PriceInfo.PriceRange parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2.PriceInfo.PriceRange) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.retail.v2.Interval price_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2.Interval, + com.google.cloud.retail.v2.Interval.Builder, + com.google.cloud.retail.v2.IntervalOrBuilder> + priceBuilder_; + /** + * + * + *
+       * The inclusive
+       * [Product.pricing_info.price][google.cloud.retail.v2.PriceInfo.price]
+       * interval of all [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2.Product] having the same
+       * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id].
+       * 
+ * + * .google.cloud.retail.v2.Interval price = 1; + * + * @return Whether the price field is set. + */ + public boolean hasPrice() { + return priceBuilder_ != null || price_ != null; + } + /** + * + * + *
+       * The inclusive
+       * [Product.pricing_info.price][google.cloud.retail.v2.PriceInfo.price]
+       * interval of all [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2.Product] having the same
+       * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id].
+       * 
+ * + * .google.cloud.retail.v2.Interval price = 1; + * + * @return The price. + */ + public com.google.cloud.retail.v2.Interval getPrice() { + if (priceBuilder_ == null) { + return price_ == null ? com.google.cloud.retail.v2.Interval.getDefaultInstance() : price_; + } else { + return priceBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The inclusive
+       * [Product.pricing_info.price][google.cloud.retail.v2.PriceInfo.price]
+       * interval of all [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2.Product] having the same
+       * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id].
+       * 
+ * + * .google.cloud.retail.v2.Interval price = 1; + */ + public Builder setPrice(com.google.cloud.retail.v2.Interval value) { + if (priceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + price_ = value; + onChanged(); + } else { + priceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * The inclusive
+       * [Product.pricing_info.price][google.cloud.retail.v2.PriceInfo.price]
+       * interval of all [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2.Product] having the same
+       * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id].
+       * 
+ * + * .google.cloud.retail.v2.Interval price = 1; + */ + public Builder setPrice(com.google.cloud.retail.v2.Interval.Builder builderForValue) { + if (priceBuilder_ == null) { + price_ = builderForValue.build(); + onChanged(); + } else { + priceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * The inclusive
+       * [Product.pricing_info.price][google.cloud.retail.v2.PriceInfo.price]
+       * interval of all [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2.Product] having the same
+       * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id].
+       * 
+ * + * .google.cloud.retail.v2.Interval price = 1; + */ + public Builder mergePrice(com.google.cloud.retail.v2.Interval value) { + if (priceBuilder_ == null) { + if (price_ != null) { + price_ = + com.google.cloud.retail.v2.Interval.newBuilder(price_) + .mergeFrom(value) + .buildPartial(); + } else { + price_ = value; + } + onChanged(); + } else { + priceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * The inclusive
+       * [Product.pricing_info.price][google.cloud.retail.v2.PriceInfo.price]
+       * interval of all [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2.Product] having the same
+       * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id].
+       * 
+ * + * .google.cloud.retail.v2.Interval price = 1; + */ + public Builder clearPrice() { + if (priceBuilder_ == null) { + price_ = null; + onChanged(); + } else { + price_ = null; + priceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * The inclusive
+       * [Product.pricing_info.price][google.cloud.retail.v2.PriceInfo.price]
+       * interval of all [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2.Product] having the same
+       * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id].
+       * 
+ * + * .google.cloud.retail.v2.Interval price = 1; + */ + public com.google.cloud.retail.v2.Interval.Builder getPriceBuilder() { + + onChanged(); + return getPriceFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The inclusive
+       * [Product.pricing_info.price][google.cloud.retail.v2.PriceInfo.price]
+       * interval of all [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2.Product] having the same
+       * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id].
+       * 
+ * + * .google.cloud.retail.v2.Interval price = 1; + */ + public com.google.cloud.retail.v2.IntervalOrBuilder getPriceOrBuilder() { + if (priceBuilder_ != null) { + return priceBuilder_.getMessageOrBuilder(); + } else { + return price_ == null ? com.google.cloud.retail.v2.Interval.getDefaultInstance() : price_; + } + } + /** + * + * + *
+       * The inclusive
+       * [Product.pricing_info.price][google.cloud.retail.v2.PriceInfo.price]
+       * interval of all [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2.Product] having the same
+       * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id].
+       * 
+ * + * .google.cloud.retail.v2.Interval price = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2.Interval, + com.google.cloud.retail.v2.Interval.Builder, + com.google.cloud.retail.v2.IntervalOrBuilder> + getPriceFieldBuilder() { + if (priceBuilder_ == null) { + priceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2.Interval, + com.google.cloud.retail.v2.Interval.Builder, + com.google.cloud.retail.v2.IntervalOrBuilder>( + getPrice(), getParentForChildren(), isClean()); + price_ = null; + } + return priceBuilder_; + } + + private com.google.cloud.retail.v2.Interval originalPrice_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2.Interval, + com.google.cloud.retail.v2.Interval.Builder, + com.google.cloud.retail.v2.IntervalOrBuilder> + originalPriceBuilder_; + /** + * + * + *
+       * The inclusive
+       * [Product.pricing_info.original_price][google.cloud.retail.v2.PriceInfo.original_price]
+       * internal of all [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2.Product] having the same
+       * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id].
+       * 
+ * + * .google.cloud.retail.v2.Interval original_price = 2; + * + * @return Whether the originalPrice field is set. + */ + public boolean hasOriginalPrice() { + return originalPriceBuilder_ != null || originalPrice_ != null; + } + /** + * + * + *
+       * The inclusive
+       * [Product.pricing_info.original_price][google.cloud.retail.v2.PriceInfo.original_price]
+       * internal of all [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2.Product] having the same
+       * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id].
+       * 
+ * + * .google.cloud.retail.v2.Interval original_price = 2; + * + * @return The originalPrice. + */ + public com.google.cloud.retail.v2.Interval getOriginalPrice() { + if (originalPriceBuilder_ == null) { + return originalPrice_ == null + ? com.google.cloud.retail.v2.Interval.getDefaultInstance() + : originalPrice_; + } else { + return originalPriceBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The inclusive
+       * [Product.pricing_info.original_price][google.cloud.retail.v2.PriceInfo.original_price]
+       * internal of all [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2.Product] having the same
+       * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id].
+       * 
+ * + * .google.cloud.retail.v2.Interval original_price = 2; + */ + public Builder setOriginalPrice(com.google.cloud.retail.v2.Interval value) { + if (originalPriceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + originalPrice_ = value; + onChanged(); + } else { + originalPriceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * The inclusive
+       * [Product.pricing_info.original_price][google.cloud.retail.v2.PriceInfo.original_price]
+       * internal of all [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2.Product] having the same
+       * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id].
+       * 
+ * + * .google.cloud.retail.v2.Interval original_price = 2; + */ + public Builder setOriginalPrice(com.google.cloud.retail.v2.Interval.Builder builderForValue) { + if (originalPriceBuilder_ == null) { + originalPrice_ = builderForValue.build(); + onChanged(); + } else { + originalPriceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * The inclusive
+       * [Product.pricing_info.original_price][google.cloud.retail.v2.PriceInfo.original_price]
+       * internal of all [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2.Product] having the same
+       * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id].
+       * 
+ * + * .google.cloud.retail.v2.Interval original_price = 2; + */ + public Builder mergeOriginalPrice(com.google.cloud.retail.v2.Interval value) { + if (originalPriceBuilder_ == null) { + if (originalPrice_ != null) { + originalPrice_ = + com.google.cloud.retail.v2.Interval.newBuilder(originalPrice_) + .mergeFrom(value) + .buildPartial(); + } else { + originalPrice_ = value; + } + onChanged(); + } else { + originalPriceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * The inclusive
+       * [Product.pricing_info.original_price][google.cloud.retail.v2.PriceInfo.original_price]
+       * internal of all [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2.Product] having the same
+       * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id].
+       * 
+ * + * .google.cloud.retail.v2.Interval original_price = 2; + */ + public Builder clearOriginalPrice() { + if (originalPriceBuilder_ == null) { + originalPrice_ = null; + onChanged(); + } else { + originalPrice_ = null; + originalPriceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * The inclusive
+       * [Product.pricing_info.original_price][google.cloud.retail.v2.PriceInfo.original_price]
+       * internal of all [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2.Product] having the same
+       * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id].
+       * 
+ * + * .google.cloud.retail.v2.Interval original_price = 2; + */ + public com.google.cloud.retail.v2.Interval.Builder getOriginalPriceBuilder() { + + onChanged(); + return getOriginalPriceFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The inclusive
+       * [Product.pricing_info.original_price][google.cloud.retail.v2.PriceInfo.original_price]
+       * internal of all [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2.Product] having the same
+       * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id].
+       * 
+ * + * .google.cloud.retail.v2.Interval original_price = 2; + */ + public com.google.cloud.retail.v2.IntervalOrBuilder getOriginalPriceOrBuilder() { + if (originalPriceBuilder_ != null) { + return originalPriceBuilder_.getMessageOrBuilder(); + } else { + return originalPrice_ == null + ? com.google.cloud.retail.v2.Interval.getDefaultInstance() + : originalPrice_; + } + } + /** + * + * + *
+       * The inclusive
+       * [Product.pricing_info.original_price][google.cloud.retail.v2.PriceInfo.original_price]
+       * internal of all [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2.Product] having the same
+       * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id].
+       * 
+ * + * .google.cloud.retail.v2.Interval original_price = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2.Interval, + com.google.cloud.retail.v2.Interval.Builder, + com.google.cloud.retail.v2.IntervalOrBuilder> + getOriginalPriceFieldBuilder() { + if (originalPriceBuilder_ == null) { + originalPriceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2.Interval, + com.google.cloud.retail.v2.Interval.Builder, + com.google.cloud.retail.v2.IntervalOrBuilder>( + getOriginalPrice(), getParentForChildren(), isClean()); + originalPrice_ = null; + } + return originalPriceBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.PriceInfo.PriceRange) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.PriceInfo.PriceRange) + private static final com.google.cloud.retail.v2.PriceInfo.PriceRange DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2.PriceInfo.PriceRange(); + } + + public static com.google.cloud.retail.v2.PriceInfo.PriceRange getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PriceRange parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PriceRange(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.retail.v2.PriceInfo.PriceRange getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int CURRENCY_CODE_FIELD_NUMBER = 1; + private volatile java.lang.Object currencyCode_; + /** + * + * + *
+   * The 3-letter currency code defined in [ISO
+   * 4217](https://www.iso.org/iso-4217-currency-codes.html).
+   * If this field is an unrecognizable currency code, an INVALID_ARGUMENT
+   * error is returned.
+   * The [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2.Product]s with the same
+   * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id]
+   * must share the same
+   * [currency_code][google.cloud.retail.v2.PriceInfo.currency_code]. Otherwise,
+   * a FAILED_PRECONDITION error is returned.
+   * 
+ * + * string currency_code = 1; + * + * @return The currencyCode. + */ + @java.lang.Override + public java.lang.String getCurrencyCode() { + java.lang.Object ref = currencyCode_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + currencyCode_ = s; + return s; + } + } + /** + * + * + *
+   * The 3-letter currency code defined in [ISO
+   * 4217](https://www.iso.org/iso-4217-currency-codes.html).
+   * If this field is an unrecognizable currency code, an INVALID_ARGUMENT
+   * error is returned.
+   * The [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2.Product]s with the same
+   * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id]
+   * must share the same
+   * [currency_code][google.cloud.retail.v2.PriceInfo.currency_code]. Otherwise,
+   * a FAILED_PRECONDITION error is returned.
+   * 
+ * + * string currency_code = 1; + * + * @return The bytes for currencyCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCurrencyCodeBytes() { + java.lang.Object ref = currencyCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + currencyCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PRICE_FIELD_NUMBER = 2; + private float price_; + /** + * + * + *
+   * Price of the product.
+   * Google Merchant Center property
+   * [price](https://support.google.com/merchants/answer/6324371). Schema.org
+   * property [Offer.priceSpecification](https://schema.org/priceSpecification).
+   * 
+ * + * float price = 2; + * + * @return The price. + */ + @java.lang.Override + public float getPrice() { + return price_; + } + + public static final int ORIGINAL_PRICE_FIELD_NUMBER = 3; + private float originalPrice_; + /** + * + * + *
+   * Price of the product without any discount. If zero, by default set to be
+   * the [price][google.cloud.retail.v2.PriceInfo.price].
+   * 
+ * + * float original_price = 3; + * + * @return The originalPrice. + */ + @java.lang.Override + public float getOriginalPrice() { + return originalPrice_; + } + + public static final int COST_FIELD_NUMBER = 4; + private float cost_; + /** + * + * + *
+   * The costs associated with the sale of a particular product. Used for gross
+   * profit reporting.
+   * * Profit = [price][google.cloud.retail.v2.PriceInfo.price] -
+   * [cost][google.cloud.retail.v2.PriceInfo.cost]
+   * Google Merchant Center property
+   * [cost_of_goods_sold](https://support.google.com/merchants/answer/9017895).
+   * 
+ * + * float cost = 4; + * + * @return The cost. + */ + @java.lang.Override + public float getCost() { + return cost_; + } + + public static final int PRICE_EFFECTIVE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp priceEffectiveTime_; + /** + * + * + *
+   * The timestamp when the [price][google.cloud.retail.v2.PriceInfo.price]
+   * starts to be effective. This can be set as a future timestamp, and the
+   * [price][google.cloud.retail.v2.PriceInfo.price] is only used for search
+   * after
+   * [price_effective_time][google.cloud.retail.v2.PriceInfo.price_effective_time].
+   * If so, the
+   * [original_price][google.cloud.retail.v2.PriceInfo.original_price] must be
+   * set and [original_price][google.cloud.retail.v2.PriceInfo.original_price]
+   * is used before
+   * [price_effective_time][google.cloud.retail.v2.PriceInfo.price_effective_time].
+   * Do not set if [price][google.cloud.retail.v2.PriceInfo.price] is always
+   * effective because it will cause additional latency during search.
+   * 
+ * + * .google.protobuf.Timestamp price_effective_time = 5; + * + * @return Whether the priceEffectiveTime field is set. + */ + @java.lang.Override + public boolean hasPriceEffectiveTime() { + return priceEffectiveTime_ != null; + } + /** + * + * + *
+   * The timestamp when the [price][google.cloud.retail.v2.PriceInfo.price]
+   * starts to be effective. This can be set as a future timestamp, and the
+   * [price][google.cloud.retail.v2.PriceInfo.price] is only used for search
+   * after
+   * [price_effective_time][google.cloud.retail.v2.PriceInfo.price_effective_time].
+   * If so, the
+   * [original_price][google.cloud.retail.v2.PriceInfo.original_price] must be
+   * set and [original_price][google.cloud.retail.v2.PriceInfo.original_price]
+   * is used before
+   * [price_effective_time][google.cloud.retail.v2.PriceInfo.price_effective_time].
+   * Do not set if [price][google.cloud.retail.v2.PriceInfo.price] is always
+   * effective because it will cause additional latency during search.
+   * 
+ * + * .google.protobuf.Timestamp price_effective_time = 5; + * + * @return The priceEffectiveTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getPriceEffectiveTime() { + return priceEffectiveTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : priceEffectiveTime_; + } + /** + * + * + *
+   * The timestamp when the [price][google.cloud.retail.v2.PriceInfo.price]
+   * starts to be effective. This can be set as a future timestamp, and the
+   * [price][google.cloud.retail.v2.PriceInfo.price] is only used for search
+   * after
+   * [price_effective_time][google.cloud.retail.v2.PriceInfo.price_effective_time].
+   * If so, the
+   * [original_price][google.cloud.retail.v2.PriceInfo.original_price] must be
+   * set and [original_price][google.cloud.retail.v2.PriceInfo.original_price]
+   * is used before
+   * [price_effective_time][google.cloud.retail.v2.PriceInfo.price_effective_time].
+   * Do not set if [price][google.cloud.retail.v2.PriceInfo.price] is always
+   * effective because it will cause additional latency during search.
+   * 
+ * + * .google.protobuf.Timestamp price_effective_time = 5; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getPriceEffectiveTimeOrBuilder() { + return getPriceEffectiveTime(); + } + + public static final int PRICE_EXPIRE_TIME_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp priceExpireTime_; + /** + * + * + *
+   * The timestamp when the [price][google.cloud.retail.v2.PriceInfo.price]
+   * stops to be effective. The [price][google.cloud.retail.v2.PriceInfo.price]
+   * is used for search before
+   * [price_expire_time][google.cloud.retail.v2.PriceInfo.price_expire_time]. If
+   * this field is set, the
+   * [original_price][google.cloud.retail.v2.PriceInfo.original_price] must be
+   * set and [original_price][google.cloud.retail.v2.PriceInfo.original_price]
+   * is used after
+   * [price_expire_time][google.cloud.retail.v2.PriceInfo.price_expire_time].
+   * Do not set if [price][google.cloud.retail.v2.PriceInfo.price] is always
+   * effective because it will cause additional latency during search.
+   * 
+ * + * .google.protobuf.Timestamp price_expire_time = 6; + * + * @return Whether the priceExpireTime field is set. + */ + @java.lang.Override + public boolean hasPriceExpireTime() { + return priceExpireTime_ != null; + } + /** + * + * + *
+   * The timestamp when the [price][google.cloud.retail.v2.PriceInfo.price]
+   * stops to be effective. The [price][google.cloud.retail.v2.PriceInfo.price]
+   * is used for search before
+   * [price_expire_time][google.cloud.retail.v2.PriceInfo.price_expire_time]. If
+   * this field is set, the
+   * [original_price][google.cloud.retail.v2.PriceInfo.original_price] must be
+   * set and [original_price][google.cloud.retail.v2.PriceInfo.original_price]
+   * is used after
+   * [price_expire_time][google.cloud.retail.v2.PriceInfo.price_expire_time].
+   * Do not set if [price][google.cloud.retail.v2.PriceInfo.price] is always
+   * effective because it will cause additional latency during search.
+   * 
+ * + * .google.protobuf.Timestamp price_expire_time = 6; + * + * @return The priceExpireTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getPriceExpireTime() { + return priceExpireTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : priceExpireTime_; + } + /** + * + * + *
+   * The timestamp when the [price][google.cloud.retail.v2.PriceInfo.price]
+   * stops to be effective. The [price][google.cloud.retail.v2.PriceInfo.price]
+   * is used for search before
+   * [price_expire_time][google.cloud.retail.v2.PriceInfo.price_expire_time]. If
+   * this field is set, the
+   * [original_price][google.cloud.retail.v2.PriceInfo.original_price] must be
+   * set and [original_price][google.cloud.retail.v2.PriceInfo.original_price]
+   * is used after
+   * [price_expire_time][google.cloud.retail.v2.PriceInfo.price_expire_time].
+   * Do not set if [price][google.cloud.retail.v2.PriceInfo.price] is always
+   * effective because it will cause additional latency during search.
+   * 
+ * + * .google.protobuf.Timestamp price_expire_time = 6; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getPriceExpireTimeOrBuilder() { + return getPriceExpireTime(); + } + + public static final int PRICE_RANGE_FIELD_NUMBER = 7; + private com.google.cloud.retail.v2.PriceInfo.PriceRange priceRange_; + /** + * + * + *
+   * Output only. The price range of all the child
+   * [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2.Product]s grouped together on the
+   * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2.Product]. Only populated for
+   * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2.Product]s.
+   * Note: This field is OUTPUT_ONLY for
+   * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct].
+   * Do not set this field in API requests.
+   * 
+ * + * + * .google.cloud.retail.v2.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the priceRange field is set. + */ + @java.lang.Override + public boolean hasPriceRange() { + return priceRange_ != null; + } + /** + * + * + *
+   * Output only. The price range of all the child
+   * [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2.Product]s grouped together on the
+   * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2.Product]. Only populated for
+   * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2.Product]s.
+   * Note: This field is OUTPUT_ONLY for
+   * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct].
+   * Do not set this field in API requests.
+   * 
+ * + * + * .google.cloud.retail.v2.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The priceRange. + */ + @java.lang.Override + public com.google.cloud.retail.v2.PriceInfo.PriceRange getPriceRange() { + return priceRange_ == null + ? com.google.cloud.retail.v2.PriceInfo.PriceRange.getDefaultInstance() + : priceRange_; + } + /** + * + * + *
+   * Output only. The price range of all the child
+   * [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2.Product]s grouped together on the
+   * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2.Product]. Only populated for
+   * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2.Product]s.
+   * Note: This field is OUTPUT_ONLY for
+   * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct].
+   * Do not set this field in API requests.
+   * 
+ * + * + * .google.cloud.retail.v2.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2.PriceInfo.PriceRangeOrBuilder getPriceRangeOrBuilder() { + return getPriceRange(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getCurrencyCodeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, currencyCode_); + } + if (price_ != 0F) { + output.writeFloat(2, price_); + } + if (originalPrice_ != 0F) { + output.writeFloat(3, originalPrice_); + } + if (cost_ != 0F) { + output.writeFloat(4, cost_); + } + if (priceEffectiveTime_ != null) { + output.writeMessage(5, getPriceEffectiveTime()); + } + if (priceExpireTime_ != null) { + output.writeMessage(6, getPriceExpireTime()); + } + if (priceRange_ != null) { + output.writeMessage(7, getPriceRange()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getCurrencyCodeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, currencyCode_); + } + if (price_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, price_); + } + if (originalPrice_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(3, originalPrice_); + } + if (cost_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(4, cost_); + } + if (priceEffectiveTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getPriceEffectiveTime()); + } + if (priceExpireTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getPriceExpireTime()); + } + if (priceRange_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getPriceRange()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.retail.v2.PriceInfo)) { + return super.equals(obj); + } + com.google.cloud.retail.v2.PriceInfo other = (com.google.cloud.retail.v2.PriceInfo) obj; + + if (!getCurrencyCode().equals(other.getCurrencyCode())) return false; + if (java.lang.Float.floatToIntBits(getPrice()) + != java.lang.Float.floatToIntBits(other.getPrice())) return false; + if (java.lang.Float.floatToIntBits(getOriginalPrice()) + != java.lang.Float.floatToIntBits(other.getOriginalPrice())) return false; + if (java.lang.Float.floatToIntBits(getCost()) + != java.lang.Float.floatToIntBits(other.getCost())) return false; + if (hasPriceEffectiveTime() != other.hasPriceEffectiveTime()) return false; + if (hasPriceEffectiveTime()) { + if (!getPriceEffectiveTime().equals(other.getPriceEffectiveTime())) return false; + } + if (hasPriceExpireTime() != other.hasPriceExpireTime()) return false; + if (hasPriceExpireTime()) { + if (!getPriceExpireTime().equals(other.getPriceExpireTime())) return false; + } + if (hasPriceRange() != other.hasPriceRange()) return false; + if (hasPriceRange()) { + if (!getPriceRange().equals(other.getPriceRange())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CURRENCY_CODE_FIELD_NUMBER; + hash = (53 * hash) + getCurrencyCode().hashCode(); + hash = (37 * hash) + PRICE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getPrice()); + hash = (37 * hash) + ORIGINAL_PRICE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getOriginalPrice()); + hash = (37 * hash) + COST_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getCost()); + if (hasPriceEffectiveTime()) { + hash = (37 * hash) + PRICE_EFFECTIVE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getPriceEffectiveTime().hashCode(); + } + if (hasPriceExpireTime()) { + hash = (37 * hash) + PRICE_EXPIRE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getPriceExpireTime().hashCode(); + } + if (hasPriceRange()) { + hash = (37 * hash) + PRICE_RANGE_FIELD_NUMBER; + hash = (53 * hash) + getPriceRange().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2.PriceInfo parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.PriceInfo parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.PriceInfo parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.PriceInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.PriceInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.PriceInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.PriceInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.PriceInfo parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.PriceInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.PriceInfo parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.PriceInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.PriceInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2.PriceInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The price information of a [Product][google.cloud.retail.v2.Product].
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2.PriceInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.PriceInfo) + com.google.cloud.retail.v2.PriceInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.CommonProto + .internal_static_google_cloud_retail_v2_PriceInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.CommonProto + .internal_static_google_cloud_retail_v2_PriceInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.PriceInfo.class, + com.google.cloud.retail.v2.PriceInfo.Builder.class); + } + + // Construct using com.google.cloud.retail.v2.PriceInfo.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + currencyCode_ = ""; + + price_ = 0F; + + originalPrice_ = 0F; + + cost_ = 0F; + + if (priceEffectiveTimeBuilder_ == null) { + priceEffectiveTime_ = null; + } else { + priceEffectiveTime_ = null; + priceEffectiveTimeBuilder_ = null; + } + if (priceExpireTimeBuilder_ == null) { + priceExpireTime_ = null; + } else { + priceExpireTime_ = null; + priceExpireTimeBuilder_ = null; + } + if (priceRangeBuilder_ == null) { + priceRange_ = null; + } else { + priceRange_ = null; + priceRangeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2.CommonProto + .internal_static_google_cloud_retail_v2_PriceInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2.PriceInfo getDefaultInstanceForType() { + return com.google.cloud.retail.v2.PriceInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2.PriceInfo build() { + com.google.cloud.retail.v2.PriceInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2.PriceInfo buildPartial() { + com.google.cloud.retail.v2.PriceInfo result = new com.google.cloud.retail.v2.PriceInfo(this); + result.currencyCode_ = currencyCode_; result.price_ = price_; result.originalPrice_ = originalPrice_; result.cost_ = cost_; + if (priceEffectiveTimeBuilder_ == null) { + result.priceEffectiveTime_ = priceEffectiveTime_; + } else { + result.priceEffectiveTime_ = priceEffectiveTimeBuilder_.build(); + } + if (priceExpireTimeBuilder_ == null) { + result.priceExpireTime_ = priceExpireTime_; + } else { + result.priceExpireTime_ = priceExpireTimeBuilder_.build(); + } + if (priceRangeBuilder_ == null) { + result.priceRange_ = priceRange_; + } else { + result.priceRange_ = priceRangeBuilder_.build(); + } onBuilt(); return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.retail.v2.PriceInfo) { + return mergeFrom((com.google.cloud.retail.v2.PriceInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2.PriceInfo other) { + if (other == com.google.cloud.retail.v2.PriceInfo.getDefaultInstance()) return this; + if (!other.getCurrencyCode().isEmpty()) { + currencyCode_ = other.currencyCode_; + onChanged(); + } + if (other.getPrice() != 0F) { + setPrice(other.getPrice()); + } + if (other.getOriginalPrice() != 0F) { + setOriginalPrice(other.getOriginalPrice()); + } + if (other.getCost() != 0F) { + setCost(other.getCost()); + } + if (other.hasPriceEffectiveTime()) { + mergePriceEffectiveTime(other.getPriceEffectiveTime()); + } + if (other.hasPriceExpireTime()) { + mergePriceExpireTime(other.getPriceExpireTime()); + } + if (other.hasPriceRange()) { + mergePriceRange(other.getPriceRange()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.retail.v2.PriceInfo parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2.PriceInfo) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object currencyCode_ = ""; + /** + * + * + *
+     * The 3-letter currency code defined in [ISO
+     * 4217](https://www.iso.org/iso-4217-currency-codes.html).
+     * If this field is an unrecognizable currency code, an INVALID_ARGUMENT
+     * error is returned.
+     * The [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2.Product]s with the same
+     * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id]
+     * must share the same
+     * [currency_code][google.cloud.retail.v2.PriceInfo.currency_code]. Otherwise,
+     * a FAILED_PRECONDITION error is returned.
+     * 
+ * + * string currency_code = 1; + * + * @return The currencyCode. + */ + public java.lang.String getCurrencyCode() { + java.lang.Object ref = currencyCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + currencyCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The 3-letter currency code defined in [ISO
+     * 4217](https://www.iso.org/iso-4217-currency-codes.html).
+     * If this field is an unrecognizable currency code, an INVALID_ARGUMENT
+     * error is returned.
+     * The [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2.Product]s with the same
+     * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id]
+     * must share the same
+     * [currency_code][google.cloud.retail.v2.PriceInfo.currency_code]. Otherwise,
+     * a FAILED_PRECONDITION error is returned.
+     * 
+ * + * string currency_code = 1; + * + * @return The bytes for currencyCode. + */ + public com.google.protobuf.ByteString getCurrencyCodeBytes() { + java.lang.Object ref = currencyCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + currencyCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The 3-letter currency code defined in [ISO
+     * 4217](https://www.iso.org/iso-4217-currency-codes.html).
+     * If this field is an unrecognizable currency code, an INVALID_ARGUMENT
+     * error is returned.
+     * The [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2.Product]s with the same
+     * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id]
+     * must share the same
+     * [currency_code][google.cloud.retail.v2.PriceInfo.currency_code]. Otherwise,
+     * a FAILED_PRECONDITION error is returned.
+     * 
+ * + * string currency_code = 1; + * + * @param value The currencyCode to set. + * @return This builder for chaining. + */ + public Builder setCurrencyCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + currencyCode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The 3-letter currency code defined in [ISO
+     * 4217](https://www.iso.org/iso-4217-currency-codes.html).
+     * If this field is an unrecognizable currency code, an INVALID_ARGUMENT
+     * error is returned.
+     * The [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2.Product]s with the same
+     * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id]
+     * must share the same
+     * [currency_code][google.cloud.retail.v2.PriceInfo.currency_code]. Otherwise,
+     * a FAILED_PRECONDITION error is returned.
+     * 
+ * + * string currency_code = 1; + * + * @return This builder for chaining. + */ + public Builder clearCurrencyCode() { + + currencyCode_ = getDefaultInstance().getCurrencyCode(); + onChanged(); + return this; + } + /** + * + * + *
+     * The 3-letter currency code defined in [ISO
+     * 4217](https://www.iso.org/iso-4217-currency-codes.html).
+     * If this field is an unrecognizable currency code, an INVALID_ARGUMENT
+     * error is returned.
+     * The [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2.Product]s with the same
+     * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id]
+     * must share the same
+     * [currency_code][google.cloud.retail.v2.PriceInfo.currency_code]. Otherwise,
+     * a FAILED_PRECONDITION error is returned.
+     * 
+ * + * string currency_code = 1; + * + * @param value The bytes for currencyCode to set. + * @return This builder for chaining. + */ + public Builder setCurrencyCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + currencyCode_ = value; + onChanged(); + return this; + } + + private float price_; + /** + * + * + *
+     * Price of the product.
+     * Google Merchant Center property
+     * [price](https://support.google.com/merchants/answer/6324371). Schema.org
+     * property [Offer.priceSpecification](https://schema.org/priceSpecification).
+     * 
+ * + * float price = 2; + * + * @return The price. + */ + @java.lang.Override + public float getPrice() { + return price_; + } + /** + * + * + *
+     * Price of the product.
+     * Google Merchant Center property
+     * [price](https://support.google.com/merchants/answer/6324371). Schema.org
+     * property [Offer.priceSpecification](https://schema.org/priceSpecification).
+     * 
+ * + * float price = 2; + * + * @param value The price to set. + * @return This builder for chaining. + */ + public Builder setPrice(float value) { + + price_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Price of the product.
+     * Google Merchant Center property
+     * [price](https://support.google.com/merchants/answer/6324371). Schema.org
+     * property [Offer.priceSpecification](https://schema.org/priceSpecification).
+     * 
+ * + * float price = 2; + * + * @return This builder for chaining. + */ + public Builder clearPrice() { + + price_ = 0F; + onChanged(); + return this; } + private float originalPrice_; + /** + * + * + *
+     * Price of the product without any discount. If zero, by default set to be
+     * the [price][google.cloud.retail.v2.PriceInfo.price].
+     * 
+ * + * float original_price = 3; + * + * @return The originalPrice. + */ @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); + public float getOriginalPrice() { + return originalPrice_; } + /** + * + * + *
+     * Price of the product without any discount. If zero, by default set to be
+     * the [price][google.cloud.retail.v2.PriceInfo.price].
+     * 
+ * + * float original_price = 3; + * + * @param value The originalPrice to set. + * @return This builder for chaining. + */ + public Builder setOriginalPrice(float value) { - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); + originalPrice_ = value; + onChanged(); + return this; } + /** + * + * + *
+     * Price of the product without any discount. If zero, by default set to be
+     * the [price][google.cloud.retail.v2.PriceInfo.price].
+     * 
+ * + * float original_price = 3; + * + * @return This builder for chaining. + */ + public Builder clearOriginalPrice() { - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); + originalPrice_ = 0F; + onChanged(); + return this; } + private float cost_; + /** + * + * + *
+     * The costs associated with the sale of a particular product. Used for gross
+     * profit reporting.
+     * * Profit = [price][google.cloud.retail.v2.PriceInfo.price] -
+     * [cost][google.cloud.retail.v2.PriceInfo.cost]
+     * Google Merchant Center property
+     * [cost_of_goods_sold](https://support.google.com/merchants/answer/9017895).
+     * 
+ * + * float cost = 4; + * + * @return The cost. + */ @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); + public float getCost() { + return cost_; } + /** + * + * + *
+     * The costs associated with the sale of a particular product. Used for gross
+     * profit reporting.
+     * * Profit = [price][google.cloud.retail.v2.PriceInfo.price] -
+     * [cost][google.cloud.retail.v2.PriceInfo.cost]
+     * Google Merchant Center property
+     * [cost_of_goods_sold](https://support.google.com/merchants/answer/9017895).
+     * 
+ * + * float cost = 4; + * + * @param value The cost to set. + * @return This builder for chaining. + */ + public Builder setCost(float value) { - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + cost_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The costs associated with the sale of a particular product. Used for gross
+     * profit reporting.
+     * * Profit = [price][google.cloud.retail.v2.PriceInfo.price] -
+     * [cost][google.cloud.retail.v2.PriceInfo.cost]
+     * Google Merchant Center property
+     * [cost_of_goods_sold](https://support.google.com/merchants/answer/9017895).
+     * 
+ * + * float cost = 4; + * + * @return This builder for chaining. + */ + public Builder clearCost() { + + cost_ = 0F; + onChanged(); + return this; } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.retail.v2.PriceInfo) { - return mergeFrom((com.google.cloud.retail.v2.PriceInfo) other); + private com.google.protobuf.Timestamp priceEffectiveTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + priceEffectiveTimeBuilder_; + /** + * + * + *
+     * The timestamp when the [price][google.cloud.retail.v2.PriceInfo.price]
+     * starts to be effective. This can be set as a future timestamp, and the
+     * [price][google.cloud.retail.v2.PriceInfo.price] is only used for search
+     * after
+     * [price_effective_time][google.cloud.retail.v2.PriceInfo.price_effective_time].
+     * If so, the
+     * [original_price][google.cloud.retail.v2.PriceInfo.original_price] must be
+     * set and [original_price][google.cloud.retail.v2.PriceInfo.original_price]
+     * is used before
+     * [price_effective_time][google.cloud.retail.v2.PriceInfo.price_effective_time].
+     * Do not set if [price][google.cloud.retail.v2.PriceInfo.price] is always
+     * effective because it will cause additional latency during search.
+     * 
+ * + * .google.protobuf.Timestamp price_effective_time = 5; + * + * @return Whether the priceEffectiveTime field is set. + */ + public boolean hasPriceEffectiveTime() { + return priceEffectiveTimeBuilder_ != null || priceEffectiveTime_ != null; + } + /** + * + * + *
+     * The timestamp when the [price][google.cloud.retail.v2.PriceInfo.price]
+     * starts to be effective. This can be set as a future timestamp, and the
+     * [price][google.cloud.retail.v2.PriceInfo.price] is only used for search
+     * after
+     * [price_effective_time][google.cloud.retail.v2.PriceInfo.price_effective_time].
+     * If so, the
+     * [original_price][google.cloud.retail.v2.PriceInfo.original_price] must be
+     * set and [original_price][google.cloud.retail.v2.PriceInfo.original_price]
+     * is used before
+     * [price_effective_time][google.cloud.retail.v2.PriceInfo.price_effective_time].
+     * Do not set if [price][google.cloud.retail.v2.PriceInfo.price] is always
+     * effective because it will cause additional latency during search.
+     * 
+ * + * .google.protobuf.Timestamp price_effective_time = 5; + * + * @return The priceEffectiveTime. + */ + public com.google.protobuf.Timestamp getPriceEffectiveTime() { + if (priceEffectiveTimeBuilder_ == null) { + return priceEffectiveTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : priceEffectiveTime_; } else { - super.mergeFrom(other); - return this; + return priceEffectiveTimeBuilder_.getMessage(); } } - - public Builder mergeFrom(com.google.cloud.retail.v2.PriceInfo other) { - if (other == com.google.cloud.retail.v2.PriceInfo.getDefaultInstance()) return this; - if (!other.getCurrencyCode().isEmpty()) { - currencyCode_ = other.currencyCode_; + /** + * + * + *
+     * The timestamp when the [price][google.cloud.retail.v2.PriceInfo.price]
+     * starts to be effective. This can be set as a future timestamp, and the
+     * [price][google.cloud.retail.v2.PriceInfo.price] is only used for search
+     * after
+     * [price_effective_time][google.cloud.retail.v2.PriceInfo.price_effective_time].
+     * If so, the
+     * [original_price][google.cloud.retail.v2.PriceInfo.original_price] must be
+     * set and [original_price][google.cloud.retail.v2.PriceInfo.original_price]
+     * is used before
+     * [price_effective_time][google.cloud.retail.v2.PriceInfo.price_effective_time].
+     * Do not set if [price][google.cloud.retail.v2.PriceInfo.price] is always
+     * effective because it will cause additional latency during search.
+     * 
+ * + * .google.protobuf.Timestamp price_effective_time = 5; + */ + public Builder setPriceEffectiveTime(com.google.protobuf.Timestamp value) { + if (priceEffectiveTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + priceEffectiveTime_ = value; onChanged(); + } else { + priceEffectiveTimeBuilder_.setMessage(value); } - if (other.getPrice() != 0F) { - setPrice(other.getPrice()); - } - if (other.getOriginalPrice() != 0F) { - setOriginalPrice(other.getOriginalPrice()); - } - if (other.getCost() != 0F) { - setCost(other.getCost()); + + return this; + } + /** + * + * + *
+     * The timestamp when the [price][google.cloud.retail.v2.PriceInfo.price]
+     * starts to be effective. This can be set as a future timestamp, and the
+     * [price][google.cloud.retail.v2.PriceInfo.price] is only used for search
+     * after
+     * [price_effective_time][google.cloud.retail.v2.PriceInfo.price_effective_time].
+     * If so, the
+     * [original_price][google.cloud.retail.v2.PriceInfo.original_price] must be
+     * set and [original_price][google.cloud.retail.v2.PriceInfo.original_price]
+     * is used before
+     * [price_effective_time][google.cloud.retail.v2.PriceInfo.price_effective_time].
+     * Do not set if [price][google.cloud.retail.v2.PriceInfo.price] is always
+     * effective because it will cause additional latency during search.
+     * 
+ * + * .google.protobuf.Timestamp price_effective_time = 5; + */ + public Builder setPriceEffectiveTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (priceEffectiveTimeBuilder_ == null) { + priceEffectiveTime_ = builderForValue.build(); + onChanged(); + } else { + priceEffectiveTimeBuilder_.setMessage(builderForValue.build()); } - this.mergeUnknownFields(other.unknownFields); - onChanged(); + return this; } + /** + * + * + *
+     * The timestamp when the [price][google.cloud.retail.v2.PriceInfo.price]
+     * starts to be effective. This can be set as a future timestamp, and the
+     * [price][google.cloud.retail.v2.PriceInfo.price] is only used for search
+     * after
+     * [price_effective_time][google.cloud.retail.v2.PriceInfo.price_effective_time].
+     * If so, the
+     * [original_price][google.cloud.retail.v2.PriceInfo.original_price] must be
+     * set and [original_price][google.cloud.retail.v2.PriceInfo.original_price]
+     * is used before
+     * [price_effective_time][google.cloud.retail.v2.PriceInfo.price_effective_time].
+     * Do not set if [price][google.cloud.retail.v2.PriceInfo.price] is always
+     * effective because it will cause additional latency during search.
+     * 
+ * + * .google.protobuf.Timestamp price_effective_time = 5; + */ + public Builder mergePriceEffectiveTime(com.google.protobuf.Timestamp value) { + if (priceEffectiveTimeBuilder_ == null) { + if (priceEffectiveTime_ != null) { + priceEffectiveTime_ = + com.google.protobuf.Timestamp.newBuilder(priceEffectiveTime_) + .mergeFrom(value) + .buildPartial(); + } else { + priceEffectiveTime_ = value; + } + onChanged(); + } else { + priceEffectiveTimeBuilder_.mergeFrom(value); + } - @java.lang.Override - public final boolean isInitialized() { - return true; + return this; } + /** + * + * + *
+     * The timestamp when the [price][google.cloud.retail.v2.PriceInfo.price]
+     * starts to be effective. This can be set as a future timestamp, and the
+     * [price][google.cloud.retail.v2.PriceInfo.price] is only used for search
+     * after
+     * [price_effective_time][google.cloud.retail.v2.PriceInfo.price_effective_time].
+     * If so, the
+     * [original_price][google.cloud.retail.v2.PriceInfo.original_price] must be
+     * set and [original_price][google.cloud.retail.v2.PriceInfo.original_price]
+     * is used before
+     * [price_effective_time][google.cloud.retail.v2.PriceInfo.price_effective_time].
+     * Do not set if [price][google.cloud.retail.v2.PriceInfo.price] is always
+     * effective because it will cause additional latency during search.
+     * 
+ * + * .google.protobuf.Timestamp price_effective_time = 5; + */ + public Builder clearPriceEffectiveTime() { + if (priceEffectiveTimeBuilder_ == null) { + priceEffectiveTime_ = null; + onChanged(); + } else { + priceEffectiveTime_ = null; + priceEffectiveTimeBuilder_ = null; + } - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.retail.v2.PriceInfo parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.retail.v2.PriceInfo) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } + return this; + } + /** + * + * + *
+     * The timestamp when the [price][google.cloud.retail.v2.PriceInfo.price]
+     * starts to be effective. This can be set as a future timestamp, and the
+     * [price][google.cloud.retail.v2.PriceInfo.price] is only used for search
+     * after
+     * [price_effective_time][google.cloud.retail.v2.PriceInfo.price_effective_time].
+     * If so, the
+     * [original_price][google.cloud.retail.v2.PriceInfo.original_price] must be
+     * set and [original_price][google.cloud.retail.v2.PriceInfo.original_price]
+     * is used before
+     * [price_effective_time][google.cloud.retail.v2.PriceInfo.price_effective_time].
+     * Do not set if [price][google.cloud.retail.v2.PriceInfo.price] is always
+     * effective because it will cause additional latency during search.
+     * 
+ * + * .google.protobuf.Timestamp price_effective_time = 5; + */ + public com.google.protobuf.Timestamp.Builder getPriceEffectiveTimeBuilder() { + + onChanged(); + return getPriceEffectiveTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The timestamp when the [price][google.cloud.retail.v2.PriceInfo.price]
+     * starts to be effective. This can be set as a future timestamp, and the
+     * [price][google.cloud.retail.v2.PriceInfo.price] is only used for search
+     * after
+     * [price_effective_time][google.cloud.retail.v2.PriceInfo.price_effective_time].
+     * If so, the
+     * [original_price][google.cloud.retail.v2.PriceInfo.original_price] must be
+     * set and [original_price][google.cloud.retail.v2.PriceInfo.original_price]
+     * is used before
+     * [price_effective_time][google.cloud.retail.v2.PriceInfo.price_effective_time].
+     * Do not set if [price][google.cloud.retail.v2.PriceInfo.price] is always
+     * effective because it will cause additional latency during search.
+     * 
+ * + * .google.protobuf.Timestamp price_effective_time = 5; + */ + public com.google.protobuf.TimestampOrBuilder getPriceEffectiveTimeOrBuilder() { + if (priceEffectiveTimeBuilder_ != null) { + return priceEffectiveTimeBuilder_.getMessageOrBuilder(); + } else { + return priceEffectiveTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : priceEffectiveTime_; } - return this; + } + /** + * + * + *
+     * The timestamp when the [price][google.cloud.retail.v2.PriceInfo.price]
+     * starts to be effective. This can be set as a future timestamp, and the
+     * [price][google.cloud.retail.v2.PriceInfo.price] is only used for search
+     * after
+     * [price_effective_time][google.cloud.retail.v2.PriceInfo.price_effective_time].
+     * If so, the
+     * [original_price][google.cloud.retail.v2.PriceInfo.original_price] must be
+     * set and [original_price][google.cloud.retail.v2.PriceInfo.original_price]
+     * is used before
+     * [price_effective_time][google.cloud.retail.v2.PriceInfo.price_effective_time].
+     * Do not set if [price][google.cloud.retail.v2.PriceInfo.price] is always
+     * effective because it will cause additional latency during search.
+     * 
+ * + * .google.protobuf.Timestamp price_effective_time = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getPriceEffectiveTimeFieldBuilder() { + if (priceEffectiveTimeBuilder_ == null) { + priceEffectiveTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getPriceEffectiveTime(), getParentForChildren(), isClean()); + priceEffectiveTime_ = null; + } + return priceEffectiveTimeBuilder_; } - private java.lang.Object currencyCode_ = ""; + private com.google.protobuf.Timestamp priceExpireTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + priceExpireTimeBuilder_; /** * * *
-     * The 3-letter currency code defined in [ISO
-     * 4217](https://www.iso.org/iso-4217-currency-codes.html).
-     * If this field is an unrecognizable currency code, an INVALID_ARGUMENT
-     * error is returned.
+     * The timestamp when the [price][google.cloud.retail.v2.PriceInfo.price]
+     * stops to be effective. The [price][google.cloud.retail.v2.PriceInfo.price]
+     * is used for search before
+     * [price_expire_time][google.cloud.retail.v2.PriceInfo.price_expire_time]. If
+     * this field is set, the
+     * [original_price][google.cloud.retail.v2.PriceInfo.original_price] must be
+     * set and [original_price][google.cloud.retail.v2.PriceInfo.original_price]
+     * is used after
+     * [price_expire_time][google.cloud.retail.v2.PriceInfo.price_expire_time].
+     * Do not set if [price][google.cloud.retail.v2.PriceInfo.price] is always
+     * effective because it will cause additional latency during search.
      * 
* - * string currency_code = 1; + * .google.protobuf.Timestamp price_expire_time = 6; * - * @return The currencyCode. + * @return Whether the priceExpireTime field is set. */ - public java.lang.String getCurrencyCode() { - java.lang.Object ref = currencyCode_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - currencyCode_ = s; - return s; - } else { - return (java.lang.String) ref; - } + public boolean hasPriceExpireTime() { + return priceExpireTimeBuilder_ != null || priceExpireTime_ != null; } /** * * *
-     * The 3-letter currency code defined in [ISO
-     * 4217](https://www.iso.org/iso-4217-currency-codes.html).
-     * If this field is an unrecognizable currency code, an INVALID_ARGUMENT
-     * error is returned.
+     * The timestamp when the [price][google.cloud.retail.v2.PriceInfo.price]
+     * stops to be effective. The [price][google.cloud.retail.v2.PriceInfo.price]
+     * is used for search before
+     * [price_expire_time][google.cloud.retail.v2.PriceInfo.price_expire_time]. If
+     * this field is set, the
+     * [original_price][google.cloud.retail.v2.PriceInfo.original_price] must be
+     * set and [original_price][google.cloud.retail.v2.PriceInfo.original_price]
+     * is used after
+     * [price_expire_time][google.cloud.retail.v2.PriceInfo.price_expire_time].
+     * Do not set if [price][google.cloud.retail.v2.PriceInfo.price] is always
+     * effective because it will cause additional latency during search.
      * 
* - * string currency_code = 1; + * .google.protobuf.Timestamp price_expire_time = 6; * - * @return The bytes for currencyCode. + * @return The priceExpireTime. */ - public com.google.protobuf.ByteString getCurrencyCodeBytes() { - java.lang.Object ref = currencyCode_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - currencyCode_ = b; - return b; + public com.google.protobuf.Timestamp getPriceExpireTime() { + if (priceExpireTimeBuilder_ == null) { + return priceExpireTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : priceExpireTime_; } else { - return (com.google.protobuf.ByteString) ref; + return priceExpireTimeBuilder_.getMessage(); } } /** * * *
-     * The 3-letter currency code defined in [ISO
-     * 4217](https://www.iso.org/iso-4217-currency-codes.html).
-     * If this field is an unrecognizable currency code, an INVALID_ARGUMENT
-     * error is returned.
+     * The timestamp when the [price][google.cloud.retail.v2.PriceInfo.price]
+     * stops to be effective. The [price][google.cloud.retail.v2.PriceInfo.price]
+     * is used for search before
+     * [price_expire_time][google.cloud.retail.v2.PriceInfo.price_expire_time]. If
+     * this field is set, the
+     * [original_price][google.cloud.retail.v2.PriceInfo.original_price] must be
+     * set and [original_price][google.cloud.retail.v2.PriceInfo.original_price]
+     * is used after
+     * [price_expire_time][google.cloud.retail.v2.PriceInfo.price_expire_time].
+     * Do not set if [price][google.cloud.retail.v2.PriceInfo.price] is always
+     * effective because it will cause additional latency during search.
      * 
* - * string currency_code = 1; - * - * @param value The currencyCode to set. - * @return This builder for chaining. + * .google.protobuf.Timestamp price_expire_time = 6; */ - public Builder setCurrencyCode(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); + public Builder setPriceExpireTime(com.google.protobuf.Timestamp value) { + if (priceExpireTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + priceExpireTime_ = value; + onChanged(); + } else { + priceExpireTimeBuilder_.setMessage(value); } - currencyCode_ = value; - onChanged(); return this; } /** * * *
-     * The 3-letter currency code defined in [ISO
-     * 4217](https://www.iso.org/iso-4217-currency-codes.html).
-     * If this field is an unrecognizable currency code, an INVALID_ARGUMENT
-     * error is returned.
+     * The timestamp when the [price][google.cloud.retail.v2.PriceInfo.price]
+     * stops to be effective. The [price][google.cloud.retail.v2.PriceInfo.price]
+     * is used for search before
+     * [price_expire_time][google.cloud.retail.v2.PriceInfo.price_expire_time]. If
+     * this field is set, the
+     * [original_price][google.cloud.retail.v2.PriceInfo.original_price] must be
+     * set and [original_price][google.cloud.retail.v2.PriceInfo.original_price]
+     * is used after
+     * [price_expire_time][google.cloud.retail.v2.PriceInfo.price_expire_time].
+     * Do not set if [price][google.cloud.retail.v2.PriceInfo.price] is always
+     * effective because it will cause additional latency during search.
      * 
* - * string currency_code = 1; - * - * @return This builder for chaining. + * .google.protobuf.Timestamp price_expire_time = 6; */ - public Builder clearCurrencyCode() { + public Builder setPriceExpireTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (priceExpireTimeBuilder_ == null) { + priceExpireTime_ = builderForValue.build(); + onChanged(); + } else { + priceExpireTimeBuilder_.setMessage(builderForValue.build()); + } - currencyCode_ = getDefaultInstance().getCurrencyCode(); - onChanged(); return this; } /** * * *
-     * The 3-letter currency code defined in [ISO
-     * 4217](https://www.iso.org/iso-4217-currency-codes.html).
-     * If this field is an unrecognizable currency code, an INVALID_ARGUMENT
-     * error is returned.
+     * The timestamp when the [price][google.cloud.retail.v2.PriceInfo.price]
+     * stops to be effective. The [price][google.cloud.retail.v2.PriceInfo.price]
+     * is used for search before
+     * [price_expire_time][google.cloud.retail.v2.PriceInfo.price_expire_time]. If
+     * this field is set, the
+     * [original_price][google.cloud.retail.v2.PriceInfo.original_price] must be
+     * set and [original_price][google.cloud.retail.v2.PriceInfo.original_price]
+     * is used after
+     * [price_expire_time][google.cloud.retail.v2.PriceInfo.price_expire_time].
+     * Do not set if [price][google.cloud.retail.v2.PriceInfo.price] is always
+     * effective because it will cause additional latency during search.
      * 
* - * string currency_code = 1; - * - * @param value The bytes for currencyCode to set. - * @return This builder for chaining. + * .google.protobuf.Timestamp price_expire_time = 6; */ - public Builder setCurrencyCodeBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); + public Builder mergePriceExpireTime(com.google.protobuf.Timestamp value) { + if (priceExpireTimeBuilder_ == null) { + if (priceExpireTime_ != null) { + priceExpireTime_ = + com.google.protobuf.Timestamp.newBuilder(priceExpireTime_) + .mergeFrom(value) + .buildPartial(); + } else { + priceExpireTime_ = value; + } + onChanged(); + } else { + priceExpireTimeBuilder_.mergeFrom(value); } - checkByteStringIsUtf8(value); - currencyCode_ = value; - onChanged(); return this; } - - private float price_; /** * * *
-     * Price of the product.
-     * Google Merchant Center property
-     * [price](https://support.google.com/merchants/answer/6324371). Schema.org
-     * property [Offer.priceSpecification](https://schema.org/priceSpecification).
+     * The timestamp when the [price][google.cloud.retail.v2.PriceInfo.price]
+     * stops to be effective. The [price][google.cloud.retail.v2.PriceInfo.price]
+     * is used for search before
+     * [price_expire_time][google.cloud.retail.v2.PriceInfo.price_expire_time]. If
+     * this field is set, the
+     * [original_price][google.cloud.retail.v2.PriceInfo.original_price] must be
+     * set and [original_price][google.cloud.retail.v2.PriceInfo.original_price]
+     * is used after
+     * [price_expire_time][google.cloud.retail.v2.PriceInfo.price_expire_time].
+     * Do not set if [price][google.cloud.retail.v2.PriceInfo.price] is always
+     * effective because it will cause additional latency during search.
      * 
* - * float price = 2; - * - * @return The price. + * .google.protobuf.Timestamp price_expire_time = 6; */ - @java.lang.Override - public float getPrice() { - return price_; + public Builder clearPriceExpireTime() { + if (priceExpireTimeBuilder_ == null) { + priceExpireTime_ = null; + onChanged(); + } else { + priceExpireTime_ = null; + priceExpireTimeBuilder_ = null; + } + + return this; } /** * * *
-     * Price of the product.
-     * Google Merchant Center property
-     * [price](https://support.google.com/merchants/answer/6324371). Schema.org
-     * property [Offer.priceSpecification](https://schema.org/priceSpecification).
+     * The timestamp when the [price][google.cloud.retail.v2.PriceInfo.price]
+     * stops to be effective. The [price][google.cloud.retail.v2.PriceInfo.price]
+     * is used for search before
+     * [price_expire_time][google.cloud.retail.v2.PriceInfo.price_expire_time]. If
+     * this field is set, the
+     * [original_price][google.cloud.retail.v2.PriceInfo.original_price] must be
+     * set and [original_price][google.cloud.retail.v2.PriceInfo.original_price]
+     * is used after
+     * [price_expire_time][google.cloud.retail.v2.PriceInfo.price_expire_time].
+     * Do not set if [price][google.cloud.retail.v2.PriceInfo.price] is always
+     * effective because it will cause additional latency during search.
      * 
* - * float price = 2; - * - * @param value The price to set. - * @return This builder for chaining. + * .google.protobuf.Timestamp price_expire_time = 6; */ - public Builder setPrice(float value) { + public com.google.protobuf.Timestamp.Builder getPriceExpireTimeBuilder() { - price_ = value; onChanged(); - return this; + return getPriceExpireTimeFieldBuilder().getBuilder(); } /** * * *
-     * Price of the product.
-     * Google Merchant Center property
-     * [price](https://support.google.com/merchants/answer/6324371). Schema.org
-     * property [Offer.priceSpecification](https://schema.org/priceSpecification).
+     * The timestamp when the [price][google.cloud.retail.v2.PriceInfo.price]
+     * stops to be effective. The [price][google.cloud.retail.v2.PriceInfo.price]
+     * is used for search before
+     * [price_expire_time][google.cloud.retail.v2.PriceInfo.price_expire_time]. If
+     * this field is set, the
+     * [original_price][google.cloud.retail.v2.PriceInfo.original_price] must be
+     * set and [original_price][google.cloud.retail.v2.PriceInfo.original_price]
+     * is used after
+     * [price_expire_time][google.cloud.retail.v2.PriceInfo.price_expire_time].
+     * Do not set if [price][google.cloud.retail.v2.PriceInfo.price] is always
+     * effective because it will cause additional latency during search.
      * 
* - * float price = 2; + * .google.protobuf.Timestamp price_expire_time = 6; + */ + public com.google.protobuf.TimestampOrBuilder getPriceExpireTimeOrBuilder() { + if (priceExpireTimeBuilder_ != null) { + return priceExpireTimeBuilder_.getMessageOrBuilder(); + } else { + return priceExpireTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : priceExpireTime_; + } + } + /** * - * @return This builder for chaining. + * + *
+     * The timestamp when the [price][google.cloud.retail.v2.PriceInfo.price]
+     * stops to be effective. The [price][google.cloud.retail.v2.PriceInfo.price]
+     * is used for search before
+     * [price_expire_time][google.cloud.retail.v2.PriceInfo.price_expire_time]. If
+     * this field is set, the
+     * [original_price][google.cloud.retail.v2.PriceInfo.original_price] must be
+     * set and [original_price][google.cloud.retail.v2.PriceInfo.original_price]
+     * is used after
+     * [price_expire_time][google.cloud.retail.v2.PriceInfo.price_expire_time].
+     * Do not set if [price][google.cloud.retail.v2.PriceInfo.price] is always
+     * effective because it will cause additional latency during search.
+     * 
+ * + * .google.protobuf.Timestamp price_expire_time = 6; */ - public Builder clearPrice() { - - price_ = 0F; - onChanged(); - return this; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getPriceExpireTimeFieldBuilder() { + if (priceExpireTimeBuilder_ == null) { + priceExpireTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getPriceExpireTime(), getParentForChildren(), isClean()); + priceExpireTime_ = null; + } + return priceExpireTimeBuilder_; } - private float originalPrice_; + private com.google.cloud.retail.v2.PriceInfo.PriceRange priceRange_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2.PriceInfo.PriceRange, + com.google.cloud.retail.v2.PriceInfo.PriceRange.Builder, + com.google.cloud.retail.v2.PriceInfo.PriceRangeOrBuilder> + priceRangeBuilder_; /** * * *
-     * Price of the product without any discount. If zero, by default set to be
-     * the [price][google.cloud.retail.v2.PriceInfo.price].
+     * Output only. The price range of all the child
+     * [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2.Product]s grouped together on the
+     * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product]. Only populated for
+     * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct].
+     * Do not set this field in API requests.
      * 
* - * float original_price = 3; + * + * .google.cloud.retail.v2.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * - * @return The originalPrice. + * @return Whether the priceRange field is set. */ - @java.lang.Override - public float getOriginalPrice() { - return originalPrice_; + public boolean hasPriceRange() { + return priceRangeBuilder_ != null || priceRange_ != null; } /** * * *
-     * Price of the product without any discount. If zero, by default set to be
-     * the [price][google.cloud.retail.v2.PriceInfo.price].
+     * Output only. The price range of all the child
+     * [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2.Product]s grouped together on the
+     * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product]. Only populated for
+     * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct].
+     * Do not set this field in API requests.
      * 
* - * float original_price = 3; + * + * .google.cloud.retail.v2.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * - * @param value The originalPrice to set. - * @return This builder for chaining. + * @return The priceRange. */ - public Builder setOriginalPrice(float value) { + public com.google.cloud.retail.v2.PriceInfo.PriceRange getPriceRange() { + if (priceRangeBuilder_ == null) { + return priceRange_ == null + ? com.google.cloud.retail.v2.PriceInfo.PriceRange.getDefaultInstance() + : priceRange_; + } else { + return priceRangeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The price range of all the child
+     * [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2.Product]s grouped together on the
+     * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product]. Only populated for
+     * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct].
+     * Do not set this field in API requests.
+     * 
+ * + * + * .google.cloud.retail.v2.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setPriceRange(com.google.cloud.retail.v2.PriceInfo.PriceRange value) { + if (priceRangeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + priceRange_ = value; + onChanged(); + } else { + priceRangeBuilder_.setMessage(value); + } - originalPrice_ = value; - onChanged(); return this; } /** * * *
-     * Price of the product without any discount. If zero, by default set to be
-     * the [price][google.cloud.retail.v2.PriceInfo.price].
+     * Output only. The price range of all the child
+     * [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2.Product]s grouped together on the
+     * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product]. Only populated for
+     * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct].
+     * Do not set this field in API requests.
      * 
* - * float original_price = 3; - * - * @return This builder for chaining. + * + * .google.cloud.retail.v2.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ - public Builder clearOriginalPrice() { + public Builder setPriceRange( + com.google.cloud.retail.v2.PriceInfo.PriceRange.Builder builderForValue) { + if (priceRangeBuilder_ == null) { + priceRange_ = builderForValue.build(); + onChanged(); + } else { + priceRangeBuilder_.setMessage(builderForValue.build()); + } - originalPrice_ = 0F; - onChanged(); return this; } - - private float cost_; /** * * *
-     * The costs associated with the sale of a particular product. Used for gross
-     * profit reporting.
-     * * Profit = [price][google.cloud.retail.v2.PriceInfo.price] -
-     * [cost][google.cloud.retail.v2.PriceInfo.cost]
-     * Google Merchant Center property
-     * [cost_of_goods_sold](https://support.google.com/merchants/answer/9017895).
+     * Output only. The price range of all the child
+     * [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2.Product]s grouped together on the
+     * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product]. Only populated for
+     * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct].
+     * Do not set this field in API requests.
      * 
* - * float cost = 4; - * - * @return The cost. + * + * .google.cloud.retail.v2.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ - @java.lang.Override - public float getCost() { - return cost_; + public Builder mergePriceRange(com.google.cloud.retail.v2.PriceInfo.PriceRange value) { + if (priceRangeBuilder_ == null) { + if (priceRange_ != null) { + priceRange_ = + com.google.cloud.retail.v2.PriceInfo.PriceRange.newBuilder(priceRange_) + .mergeFrom(value) + .buildPartial(); + } else { + priceRange_ = value; + } + onChanged(); + } else { + priceRangeBuilder_.mergeFrom(value); + } + + return this; } /** * * *
-     * The costs associated with the sale of a particular product. Used for gross
-     * profit reporting.
-     * * Profit = [price][google.cloud.retail.v2.PriceInfo.price] -
-     * [cost][google.cloud.retail.v2.PriceInfo.cost]
-     * Google Merchant Center property
-     * [cost_of_goods_sold](https://support.google.com/merchants/answer/9017895).
+     * Output only. The price range of all the child
+     * [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2.Product]s grouped together on the
+     * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product]. Only populated for
+     * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct].
+     * Do not set this field in API requests.
      * 
* - * float cost = 4; - * - * @param value The cost to set. - * @return This builder for chaining. + * + * .google.cloud.retail.v2.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ - public Builder setCost(float value) { + public Builder clearPriceRange() { + if (priceRangeBuilder_ == null) { + priceRange_ = null; + onChanged(); + } else { + priceRange_ = null; + priceRangeBuilder_ = null; + } - cost_ = value; - onChanged(); return this; } /** * * *
-     * The costs associated with the sale of a particular product. Used for gross
-     * profit reporting.
-     * * Profit = [price][google.cloud.retail.v2.PriceInfo.price] -
-     * [cost][google.cloud.retail.v2.PriceInfo.cost]
-     * Google Merchant Center property
-     * [cost_of_goods_sold](https://support.google.com/merchants/answer/9017895).
+     * Output only. The price range of all the child
+     * [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2.Product]s grouped together on the
+     * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product]. Only populated for
+     * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct].
+     * Do not set this field in API requests.
      * 
* - * float cost = 4; - * - * @return This builder for chaining. + * + * .google.cloud.retail.v2.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ - public Builder clearCost() { + public com.google.cloud.retail.v2.PriceInfo.PriceRange.Builder getPriceRangeBuilder() { - cost_ = 0F; onChanged(); - return this; + return getPriceRangeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The price range of all the child
+     * [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2.Product]s grouped together on the
+     * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product]. Only populated for
+     * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct].
+     * Do not set this field in API requests.
+     * 
+ * + * + * .google.cloud.retail.v2.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.retail.v2.PriceInfo.PriceRangeOrBuilder getPriceRangeOrBuilder() { + if (priceRangeBuilder_ != null) { + return priceRangeBuilder_.getMessageOrBuilder(); + } else { + return priceRange_ == null + ? com.google.cloud.retail.v2.PriceInfo.PriceRange.getDefaultInstance() + : priceRange_; + } + } + /** + * + * + *
+     * Output only. The price range of all the child
+     * [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2.Product]s grouped together on the
+     * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product]. Only populated for
+     * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct].
+     * Do not set this field in API requests.
+     * 
+ * + * + * .google.cloud.retail.v2.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2.PriceInfo.PriceRange, + com.google.cloud.retail.v2.PriceInfo.PriceRange.Builder, + com.google.cloud.retail.v2.PriceInfo.PriceRangeOrBuilder> + getPriceRangeFieldBuilder() { + if (priceRangeBuilder_ == null) { + priceRangeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2.PriceInfo.PriceRange, + com.google.cloud.retail.v2.PriceInfo.PriceRange.Builder, + com.google.cloud.retail.v2.PriceInfo.PriceRangeOrBuilder>( + getPriceRange(), getParentForChildren(), isClean()); + priceRange_ = null; + } + return priceRangeBuilder_; } @java.lang.Override diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/PriceInfoOrBuilder.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/PriceInfoOrBuilder.java index d8b05141..07e79113 100644 --- a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/PriceInfoOrBuilder.java +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/PriceInfoOrBuilder.java @@ -31,6 +31,12 @@ public interface PriceInfoOrBuilder * 4217](https://www.iso.org/iso-4217-currency-codes.html). * If this field is an unrecognizable currency code, an INVALID_ARGUMENT * error is returned. + * The [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] + * [Product][google.cloud.retail.v2.Product]s with the same + * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id] + * must share the same + * [currency_code][google.cloud.retail.v2.PriceInfo.currency_code]. Otherwise, + * a FAILED_PRECONDITION error is returned. * * * string currency_code = 1; @@ -46,6 +52,12 @@ public interface PriceInfoOrBuilder * 4217](https://www.iso.org/iso-4217-currency-codes.html). * If this field is an unrecognizable currency code, an INVALID_ARGUMENT * error is returned. + * The [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] + * [Product][google.cloud.retail.v2.Product]s with the same + * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id] + * must share the same + * [currency_code][google.cloud.retail.v2.PriceInfo.currency_code]. Otherwise, + * a FAILED_PRECONDITION error is returned. * * * string currency_code = 1; @@ -101,4 +113,205 @@ public interface PriceInfoOrBuilder * @return The cost. */ float getCost(); + + /** + * + * + *
+   * The timestamp when the [price][google.cloud.retail.v2.PriceInfo.price]
+   * starts to be effective. This can be set as a future timestamp, and the
+   * [price][google.cloud.retail.v2.PriceInfo.price] is only used for search
+   * after
+   * [price_effective_time][google.cloud.retail.v2.PriceInfo.price_effective_time].
+   * If so, the
+   * [original_price][google.cloud.retail.v2.PriceInfo.original_price] must be
+   * set and [original_price][google.cloud.retail.v2.PriceInfo.original_price]
+   * is used before
+   * [price_effective_time][google.cloud.retail.v2.PriceInfo.price_effective_time].
+   * Do not set if [price][google.cloud.retail.v2.PriceInfo.price] is always
+   * effective because it will cause additional latency during search.
+   * 
+ * + * .google.protobuf.Timestamp price_effective_time = 5; + * + * @return Whether the priceEffectiveTime field is set. + */ + boolean hasPriceEffectiveTime(); + /** + * + * + *
+   * The timestamp when the [price][google.cloud.retail.v2.PriceInfo.price]
+   * starts to be effective. This can be set as a future timestamp, and the
+   * [price][google.cloud.retail.v2.PriceInfo.price] is only used for search
+   * after
+   * [price_effective_time][google.cloud.retail.v2.PriceInfo.price_effective_time].
+   * If so, the
+   * [original_price][google.cloud.retail.v2.PriceInfo.original_price] must be
+   * set and [original_price][google.cloud.retail.v2.PriceInfo.original_price]
+   * is used before
+   * [price_effective_time][google.cloud.retail.v2.PriceInfo.price_effective_time].
+   * Do not set if [price][google.cloud.retail.v2.PriceInfo.price] is always
+   * effective because it will cause additional latency during search.
+   * 
+ * + * .google.protobuf.Timestamp price_effective_time = 5; + * + * @return The priceEffectiveTime. + */ + com.google.protobuf.Timestamp getPriceEffectiveTime(); + /** + * + * + *
+   * The timestamp when the [price][google.cloud.retail.v2.PriceInfo.price]
+   * starts to be effective. This can be set as a future timestamp, and the
+   * [price][google.cloud.retail.v2.PriceInfo.price] is only used for search
+   * after
+   * [price_effective_time][google.cloud.retail.v2.PriceInfo.price_effective_time].
+   * If so, the
+   * [original_price][google.cloud.retail.v2.PriceInfo.original_price] must be
+   * set and [original_price][google.cloud.retail.v2.PriceInfo.original_price]
+   * is used before
+   * [price_effective_time][google.cloud.retail.v2.PriceInfo.price_effective_time].
+   * Do not set if [price][google.cloud.retail.v2.PriceInfo.price] is always
+   * effective because it will cause additional latency during search.
+   * 
+ * + * .google.protobuf.Timestamp price_effective_time = 5; + */ + com.google.protobuf.TimestampOrBuilder getPriceEffectiveTimeOrBuilder(); + + /** + * + * + *
+   * The timestamp when the [price][google.cloud.retail.v2.PriceInfo.price]
+   * stops to be effective. The [price][google.cloud.retail.v2.PriceInfo.price]
+   * is used for search before
+   * [price_expire_time][google.cloud.retail.v2.PriceInfo.price_expire_time]. If
+   * this field is set, the
+   * [original_price][google.cloud.retail.v2.PriceInfo.original_price] must be
+   * set and [original_price][google.cloud.retail.v2.PriceInfo.original_price]
+   * is used after
+   * [price_expire_time][google.cloud.retail.v2.PriceInfo.price_expire_time].
+   * Do not set if [price][google.cloud.retail.v2.PriceInfo.price] is always
+   * effective because it will cause additional latency during search.
+   * 
+ * + * .google.protobuf.Timestamp price_expire_time = 6; + * + * @return Whether the priceExpireTime field is set. + */ + boolean hasPriceExpireTime(); + /** + * + * + *
+   * The timestamp when the [price][google.cloud.retail.v2.PriceInfo.price]
+   * stops to be effective. The [price][google.cloud.retail.v2.PriceInfo.price]
+   * is used for search before
+   * [price_expire_time][google.cloud.retail.v2.PriceInfo.price_expire_time]. If
+   * this field is set, the
+   * [original_price][google.cloud.retail.v2.PriceInfo.original_price] must be
+   * set and [original_price][google.cloud.retail.v2.PriceInfo.original_price]
+   * is used after
+   * [price_expire_time][google.cloud.retail.v2.PriceInfo.price_expire_time].
+   * Do not set if [price][google.cloud.retail.v2.PriceInfo.price] is always
+   * effective because it will cause additional latency during search.
+   * 
+ * + * .google.protobuf.Timestamp price_expire_time = 6; + * + * @return The priceExpireTime. + */ + com.google.protobuf.Timestamp getPriceExpireTime(); + /** + * + * + *
+   * The timestamp when the [price][google.cloud.retail.v2.PriceInfo.price]
+   * stops to be effective. The [price][google.cloud.retail.v2.PriceInfo.price]
+   * is used for search before
+   * [price_expire_time][google.cloud.retail.v2.PriceInfo.price_expire_time]. If
+   * this field is set, the
+   * [original_price][google.cloud.retail.v2.PriceInfo.original_price] must be
+   * set and [original_price][google.cloud.retail.v2.PriceInfo.original_price]
+   * is used after
+   * [price_expire_time][google.cloud.retail.v2.PriceInfo.price_expire_time].
+   * Do not set if [price][google.cloud.retail.v2.PriceInfo.price] is always
+   * effective because it will cause additional latency during search.
+   * 
+ * + * .google.protobuf.Timestamp price_expire_time = 6; + */ + com.google.protobuf.TimestampOrBuilder getPriceExpireTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The price range of all the child
+   * [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2.Product]s grouped together on the
+   * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2.Product]. Only populated for
+   * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2.Product]s.
+   * Note: This field is OUTPUT_ONLY for
+   * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct].
+   * Do not set this field in API requests.
+   * 
+ * + * + * .google.cloud.retail.v2.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the priceRange field is set. + */ + boolean hasPriceRange(); + /** + * + * + *
+   * Output only. The price range of all the child
+   * [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2.Product]s grouped together on the
+   * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2.Product]. Only populated for
+   * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2.Product]s.
+   * Note: This field is OUTPUT_ONLY for
+   * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct].
+   * Do not set this field in API requests.
+   * 
+ * + * + * .google.cloud.retail.v2.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The priceRange. + */ + com.google.cloud.retail.v2.PriceInfo.PriceRange getPriceRange(); + /** + * + * + *
+   * Output only. The price range of all the child
+   * [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2.Product]s grouped together on the
+   * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2.Product]. Only populated for
+   * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2.Product]s.
+   * Note: This field is OUTPUT_ONLY for
+   * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct].
+   * Do not set this field in API requests.
+   * 
+ * + * + * .google.cloud.retail.v2.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.retail.v2.PriceInfo.PriceRangeOrBuilder getPriceRangeOrBuilder(); } diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/Product.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/Product.java index 115ca62b..a4ed14a2 100644 --- a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/Product.java +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/Product.java @@ -43,13 +43,24 @@ private Product() { id_ = ""; type_ = 0; primaryProductId_ = ""; + collectionMemberIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + gtin_ = ""; categories_ = com.google.protobuf.LazyStringArrayList.EMPTY; title_ = ""; + brands_ = com.google.protobuf.LazyStringArrayList.EMPTY; description_ = ""; + languageCode_ = ""; tags_ = com.google.protobuf.LazyStringArrayList.EMPTY; availability_ = 0; + fulfillmentInfo_ = java.util.Collections.emptyList(); uri_ = ""; images_ = java.util.Collections.emptyList(); + sizes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + materials_ = com.google.protobuf.LazyStringArrayList.EMPTY; + patterns_ = com.google.protobuf.LazyStringArrayList.EMPTY; + conditions_ = com.google.protobuf.LazyStringArrayList.EMPTY; + promotions_ = java.util.Collections.emptyList(); + variants_ = java.util.Collections.emptyList(); } @java.lang.Override @@ -110,13 +121,30 @@ private Product( primaryProductId_ = s; break; } - case 58: + case 42: { java.lang.String s = input.readStringRequireUtf8(); if (!((mutable_bitField0_ & 0x00000001) != 0)) { - categories_ = new com.google.protobuf.LazyStringArrayList(); + collectionMemberIds_ = new com.google.protobuf.LazyStringArrayList(); mutable_bitField0_ |= 0x00000001; } + collectionMemberIds_.add(s); + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + gtin_ = s; + break; + } + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + categories_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } categories_.add(s); break; } @@ -127,6 +155,16 @@ private Product( title_ = s; break; } + case 74: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + brands_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000004; + } + brands_.add(s); + break; + } case 82: { java.lang.String s = input.readStringRequireUtf8(); @@ -134,13 +172,20 @@ private Product( description_ = s; break; } + case 90: + { + java.lang.String s = input.readStringRequireUtf8(); + + languageCode_ = s; + break; + } case 98: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { + if (!((mutable_bitField0_ & 0x00000008) != 0)) { attributes_ = com.google.protobuf.MapField.newMapField( AttributesDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000002; + mutable_bitField0_ |= 0x00000008; } com.google.protobuf.MapEntry< java.lang.String, com.google.cloud.retail.v2.CustomAttribute> @@ -154,9 +199,9 @@ private Product( case 106: { java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000004) != 0)) { + if (!((mutable_bitField0_ & 0x00000010) != 0)) { tags_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000004; + mutable_bitField0_ |= 0x00000010; } tags_.add(s); break; @@ -175,6 +220,51 @@ private Product( priceInfo_ = subBuilder.buildPartial(); } + break; + } + case 122: + { + com.google.cloud.retail.v2.Rating.Builder subBuilder = null; + if (rating_ != null) { + subBuilder = rating_.toBuilder(); + } + rating_ = + input.readMessage(com.google.cloud.retail.v2.Rating.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(rating_); + rating_ = subBuilder.buildPartial(); + } + + break; + } + case 130: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (expirationCase_ == 16) { + subBuilder = ((com.google.protobuf.Timestamp) expiration_).toBuilder(); + } + expiration_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.protobuf.Timestamp) expiration_); + expiration_ = subBuilder.buildPartial(); + } + expirationCase_ = 16; + break; + } + case 138: + { + com.google.protobuf.Duration.Builder subBuilder = null; + if (expirationCase_ == 17) { + subBuilder = ((com.google.protobuf.Duration) expiration_).toBuilder(); + } + expiration_ = + input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.protobuf.Duration) expiration_); + expiration_ = subBuilder.buildPartial(); + } + expirationCase_ = 17; break; } case 146: @@ -214,6 +304,18 @@ private Product( break; } + case 170: + { + if (!((mutable_bitField0_ & 0x00000020) != 0)) { + fulfillmentInfo_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000020; + } + fulfillmentInfo_.add( + input.readMessage( + com.google.cloud.retail.v2.FulfillmentInfo.parser(), extensionRegistry)); + break; + } case 178: { java.lang.String s = input.readStringRequireUtf8(); @@ -223,14 +325,138 @@ private Product( } case 186: { - if (!((mutable_bitField0_ & 0x00000008) != 0)) { + if (!((mutable_bitField0_ & 0x00000040) != 0)) { images_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000008; + mutable_bitField0_ |= 0x00000040; } images_.add( input.readMessage(com.google.cloud.retail.v2.Image.parser(), extensionRegistry)); break; } + case 194: + { + com.google.cloud.retail.v2.Audience.Builder subBuilder = null; + if (audience_ != null) { + subBuilder = audience_.toBuilder(); + } + audience_ = + input.readMessage( + com.google.cloud.retail.v2.Audience.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(audience_); + audience_ = subBuilder.buildPartial(); + } + + break; + } + case 202: + { + com.google.cloud.retail.v2.ColorInfo.Builder subBuilder = null; + if (colorInfo_ != null) { + subBuilder = colorInfo_.toBuilder(); + } + colorInfo_ = + input.readMessage( + com.google.cloud.retail.v2.ColorInfo.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(colorInfo_); + colorInfo_ = subBuilder.buildPartial(); + } + + break; + } + case 210: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000080) != 0)) { + sizes_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000080; + } + sizes_.add(s); + break; + } + case 218: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000100) != 0)) { + materials_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000100; + } + materials_.add(s); + break; + } + case 226: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000200) != 0)) { + patterns_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000200; + } + patterns_.add(s); + break; + } + case 234: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000400) != 0)) { + conditions_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000400; + } + conditions_.add(s); + break; + } + case 242: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (retrievableFields_ != null) { + subBuilder = retrievableFields_.toBuilder(); + } + retrievableFields_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(retrievableFields_); + retrievableFields_ = subBuilder.buildPartial(); + } + + break; + } + case 250: + { + if (!((mutable_bitField0_ & 0x00001000) != 0)) { + variants_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00001000; + } + variants_.add( + input.readMessage( + com.google.cloud.retail.v2.Product.parser(), extensionRegistry)); + break; + } + case 266: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (publishTime_ != null) { + subBuilder = publishTime_.toBuilder(); + } + publishTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(publishTime_); + publishTime_ = subBuilder.buildPartial(); + } + + break; + } + case 274: + { + if (!((mutable_bitField0_ & 0x00000800) != 0)) { + promotions_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000800; + } + promotions_.add( + input.readMessage( + com.google.cloud.retail.v2.Promotion.parser(), extensionRegistry)); + break; + } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -246,14 +472,41 @@ private Product( throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000001) != 0)) { + collectionMemberIds_ = collectionMemberIds_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { categories_ = categories_.getUnmodifiableView(); } if (((mutable_bitField0_ & 0x00000004) != 0)) { + brands_ = brands_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000010) != 0)) { tags_ = tags_.getUnmodifiableView(); } - if (((mutable_bitField0_ & 0x00000008) != 0)) { + if (((mutable_bitField0_ & 0x00000020) != 0)) { + fulfillmentInfo_ = java.util.Collections.unmodifiableList(fulfillmentInfo_); + } + if (((mutable_bitField0_ & 0x00000040) != 0)) { images_ = java.util.Collections.unmodifiableList(images_); } + if (((mutable_bitField0_ & 0x00000080) != 0)) { + sizes_ = sizes_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000100) != 0)) { + materials_ = materials_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000200) != 0)) { + patterns_ = patterns_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000400) != 0)) { + conditions_ = conditions_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00001000) != 0)) { + variants_ = java.util.Collections.unmodifiableList(variants_); + } + if (((mutable_bitField0_ & 0x00000800) != 0)) { + promotions_ = java.util.Collections.unmodifiableList(promotions_); + } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } @@ -300,7 +553,8 @@ public enum Type implements com.google.protobuf.ProtocolMessageEnum { * *
      * Default value. Default to
-     * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] if unset.
+     * [Catalog.product_level_config.ingestion_product_type][google.cloud.retail.v2.ProductLevelConfig.ingestion_product_type]
+     * if unset.
      * 
* * TYPE_UNSPECIFIED = 0; @@ -360,7 +614,8 @@ public enum Type implements com.google.protobuf.ProtocolMessageEnum { * *
      * Default value. Default to
-     * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] if unset.
+     * [Catalog.product_level_config.ingestion_product_type][google.cloud.retail.v2.ProductLevelConfig.ingestion_product_type]
+     * if unset.
      * 
* * TYPE_UNSPECIFIED = 0; @@ -704,6 +959,227 @@ private Availability(int value) { // @@protoc_insertion_point(enum_scope:google.cloud.retail.v2.Product.Availability) } + private int expirationCase_ = 0; + private java.lang.Object expiration_; + + public enum ExpirationCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + EXPIRE_TIME(16), + TTL(17), + EXPIRATION_NOT_SET(0); + private final int value; + + private ExpirationCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ExpirationCase valueOf(int value) { + return forNumber(value); + } + + public static ExpirationCase forNumber(int value) { + switch (value) { + case 16: + return EXPIRE_TIME; + case 17: + return TTL; + case 0: + return EXPIRATION_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ExpirationCase getExpirationCase() { + return ExpirationCase.forNumber(expirationCase_); + } + + public static final int EXPIRE_TIME_FIELD_NUMBER = 16; + /** + * + * + *
+   * The timestamp when this product becomes unavailable for
+   * [SearchService.Search][google.cloud.retail.v2.SearchService.Search].
+   * If it is set, the [Product][google.cloud.retail.v2.Product] is not
+   * available for
+   * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] after
+   * [expire_time][google.cloud.retail.v2.Product.expire_time]. However, the
+   * product can still be retrieved by
+   * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]
+   * and
+   * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].
+   * Google Merchant Center property
+   * [expiration_date](https://support.google.com/merchants/answer/6324499).
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 16; + * + * @return Whether the expireTime field is set. + */ + @java.lang.Override + public boolean hasExpireTime() { + return expirationCase_ == 16; + } + /** + * + * + *
+   * The timestamp when this product becomes unavailable for
+   * [SearchService.Search][google.cloud.retail.v2.SearchService.Search].
+   * If it is set, the [Product][google.cloud.retail.v2.Product] is not
+   * available for
+   * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] after
+   * [expire_time][google.cloud.retail.v2.Product.expire_time]. However, the
+   * product can still be retrieved by
+   * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]
+   * and
+   * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].
+   * Google Merchant Center property
+   * [expiration_date](https://support.google.com/merchants/answer/6324499).
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 16; + * + * @return The expireTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getExpireTime() { + if (expirationCase_ == 16) { + return (com.google.protobuf.Timestamp) expiration_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + /** + * + * + *
+   * The timestamp when this product becomes unavailable for
+   * [SearchService.Search][google.cloud.retail.v2.SearchService.Search].
+   * If it is set, the [Product][google.cloud.retail.v2.Product] is not
+   * available for
+   * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] after
+   * [expire_time][google.cloud.retail.v2.Product.expire_time]. However, the
+   * product can still be retrieved by
+   * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]
+   * and
+   * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].
+   * Google Merchant Center property
+   * [expiration_date](https://support.google.com/merchants/answer/6324499).
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 16; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { + if (expirationCase_ == 16) { + return (com.google.protobuf.Timestamp) expiration_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + + public static final int TTL_FIELD_NUMBER = 17; + /** + * + * + *
+   * Input only. The TTL (time to live) of the product.
+   * If it is set, [expire_time][google.cloud.retail.v2.Product.expire_time]
+   * is set as current timestamp plus
+   * [ttl][google.cloud.retail.v2.Product.ttl]. The derived
+   * [expire_time][google.cloud.retail.v2.Product.expire_time] is returned in
+   * the output and [ttl][google.cloud.retail.v2.Product.ttl] is left blank
+   * when retrieving the [Product][google.cloud.retail.v2.Product].
+   * If it is set, the product is not available for
+   * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] after
+   * current timestamp plus [ttl][google.cloud.retail.v2.Product.ttl].
+   * However, the product can still be retrieved by
+   * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]
+   * and
+   * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].
+   * 
+ * + * .google.protobuf.Duration ttl = 17 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return Whether the ttl field is set. + */ + @java.lang.Override + public boolean hasTtl() { + return expirationCase_ == 17; + } + /** + * + * + *
+   * Input only. The TTL (time to live) of the product.
+   * If it is set, [expire_time][google.cloud.retail.v2.Product.expire_time]
+   * is set as current timestamp plus
+   * [ttl][google.cloud.retail.v2.Product.ttl]. The derived
+   * [expire_time][google.cloud.retail.v2.Product.expire_time] is returned in
+   * the output and [ttl][google.cloud.retail.v2.Product.ttl] is left blank
+   * when retrieving the [Product][google.cloud.retail.v2.Product].
+   * If it is set, the product is not available for
+   * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] after
+   * current timestamp plus [ttl][google.cloud.retail.v2.Product.ttl].
+   * However, the product can still be retrieved by
+   * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]
+   * and
+   * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].
+   * 
+ * + * .google.protobuf.Duration ttl = 17 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return The ttl. + */ + @java.lang.Override + public com.google.protobuf.Duration getTtl() { + if (expirationCase_ == 17) { + return (com.google.protobuf.Duration) expiration_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + /** + * + * + *
+   * Input only. The TTL (time to live) of the product.
+   * If it is set, [expire_time][google.cloud.retail.v2.Product.expire_time]
+   * is set as current timestamp plus
+   * [ttl][google.cloud.retail.v2.Product.ttl]. The derived
+   * [expire_time][google.cloud.retail.v2.Product.expire_time] is returned in
+   * the output and [ttl][google.cloud.retail.v2.Product.ttl] is left blank
+   * when retrieving the [Product][google.cloud.retail.v2.Product].
+   * If it is set, the product is not available for
+   * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] after
+   * current timestamp plus [ttl][google.cloud.retail.v2.Product.ttl].
+   * However, the product can still be retrieved by
+   * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]
+   * and
+   * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].
+   * 
+ * + * .google.protobuf.Duration ttl = 17 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getTtlOrBuilder() { + if (expirationCase_ == 17) { + return (com.google.protobuf.Duration) expiration_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + public static final int NAME_FIELD_NUMBER = 1; private volatile java.lang.Object name_; /** @@ -830,7 +1306,9 @@ public com.google.protobuf.ByteString getIdBytes() { * * *
-   * Immutable. The type of the product. This field is output-only.
+   * Immutable. The type of the product. Default to
+   * [Catalog.product_level_config.ingestion_product_type][google.cloud.retail.v2.ProductLevelConfig.ingestion_product_type]
+   * if unset.
    * 
* * .google.cloud.retail.v2.Product.Type type = 3 [(.google.api.field_behavior) = IMMUTABLE]; @@ -846,7 +1324,9 @@ public int getTypeValue() { * * *
-   * Immutable. The type of the product. This field is output-only.
+   * Immutable. The type of the product. Default to
+   * [Catalog.product_level_config.ingestion_product_type][google.cloud.retail.v2.ProductLevelConfig.ingestion_product_type]
+   * if unset.
    * 
* * .google.cloud.retail.v2.Product.Type type = 3 [(.google.api.field_behavior) = IMMUTABLE]; @@ -943,43 +1423,191 @@ public com.google.protobuf.ByteString getPrimaryProductIdBytes() { } } - public static final int CATEGORIES_FIELD_NUMBER = 7; - private com.google.protobuf.LazyStringList categories_; + public static final int COLLECTION_MEMBER_IDS_FIELD_NUMBER = 5; + private com.google.protobuf.LazyStringList collectionMemberIds_; /** * * *
-   * Product categories. This field is repeated for supporting one product
-   * belonging to several parallel categories. Strongly recommended using the
-   * full path for better search / recommendation quality.
-   * To represent full path of category, use '>' sign to separate different
-   * hierarchies. If '>' is part of the category name, please replace it with
-   * other character(s).
-   * For example, if a shoes product belongs to both
-   * ["Shoes & Accessories" -> "Shoes"] and
-   * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
-   * represented as:
-   *      "categories": [
-   *        "Shoes & Accessories > Shoes",
-   *        "Sports & Fitness > Athletic Clothing > Shoes"
-   *      ]
-   * Must be set for [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
-   * [Product][google.cloud.retail.v2.Product] otherwise an INVALID_ARGUMENT
-   * error is returned.
-   * At most 250 values are allowed per
-   * [Product][google.cloud.retail.v2.Product]. Empty values are not allowed.
-   * 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
-   * [google_product_category][mc_google_product_category]. Schema.org property
-   * [Product.category] (https://schema.org/category).
-   * [mc_google_product_category]:
-   * https://support.google.com/merchants/answer/6324436
+   * 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.
    * 
* - * repeated string categories = 7; + * repeated string collection_member_ids = 5; * - * @return A list containing the categories. + * @return A list containing the collectionMemberIds. + */ + public com.google.protobuf.ProtocolStringList getCollectionMemberIdsList() { + return collectionMemberIds_; + } + /** + * + * + *
+   * 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.
+   * 
+ * + * repeated string collection_member_ids = 5; + * + * @return The count of collectionMemberIds. + */ + public int getCollectionMemberIdsCount() { + return collectionMemberIds_.size(); + } + /** + * + * + *
+   * 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.
+   * 
+ * + * repeated string collection_member_ids = 5; + * + * @param index The index of the element to return. + * @return The collectionMemberIds at the given index. + */ + public java.lang.String getCollectionMemberIds(int index) { + return collectionMemberIds_.get(index); + } + /** + * + * + *
+   * 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.
+   * 
+ * + * repeated string collection_member_ids = 5; + * + * @param index The index of the value to return. + * @return The bytes of the collectionMemberIds at the given index. + */ + public com.google.protobuf.ByteString getCollectionMemberIdsBytes(int index) { + return collectionMemberIds_.getByteString(index); + } + + public static final int GTIN_FIELD_NUMBER = 6; + private volatile java.lang.Object gtin_; + /** + * + * + *
+   * The Global Trade Item Number (GTIN) of the 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
+   * [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.gtin14](https://schema.org/gtin14).
+   * If the value is not a valid GTIN, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string gtin = 6; + * + * @return The gtin. + */ + @java.lang.Override + public java.lang.String getGtin() { + java.lang.Object ref = gtin_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + gtin_ = s; + return s; + } + } + /** + * + * + *
+   * The Global Trade Item Number (GTIN) of the 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
+   * [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.gtin14](https://schema.org/gtin14).
+   * If the value is not a valid GTIN, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string gtin = 6; + * + * @return The bytes for gtin. + */ + @java.lang.Override + public com.google.protobuf.ByteString getGtinBytes() { + java.lang.Object ref = gtin_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + gtin_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CATEGORIES_FIELD_NUMBER = 7; + private com.google.protobuf.LazyStringList categories_; + /** + * + * + *
+   * Product categories. This field is repeated for supporting one product
+   * belonging to several parallel categories. Strongly recommended using the
+   * full path for better search / recommendation quality.
+   * To represent full path of category, use '>' sign to separate different
+   * hierarchies. If '>' is part of the category name, please replace it with
+   * other character(s).
+   * For example, if a shoes product belongs to both
+   * ["Shoes & Accessories" -> "Shoes"] and
+   * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+   * represented as:
+   *      "categories": [
+   *        "Shoes & Accessories > Shoes",
+   *        "Sports & Fitness > Athletic Clothing > Shoes"
+   *      ]
+   * Must be set for [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2.Product] otherwise an INVALID_ARGUMENT
+   * error is returned.
+   * At most 250 values are allowed per
+   * [Product][google.cloud.retail.v2.Product]. Empty values are not allowed.
+   * 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
+   * [google_product_category][mc_google_product_category]. Schema.org property
+   * [Product.category] (https://schema.org/category).
+   * [mc_google_product_category]:
+   * https://support.google.com/merchants/answer/6324436
+   * 
+ * + * repeated string categories = 7; + * + * @return A list containing the categories. */ public com.google.protobuf.ProtocolStringList getCategoriesList() { return categories_; @@ -1111,7 +1739,7 @@ public com.google.protobuf.ByteString getCategoriesBytes(int index) { * *
    * Required. Product title.
-   * This field must be a UTF-8 encoded string with a length limit of 128
+   * 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
    * [title](https://support.google.com/merchants/answer/6324415). Schema.org
@@ -1139,7 +1767,7 @@ public java.lang.String getTitle() {
    *
    * 
    * Required. Product title.
-   * This field must be a UTF-8 encoded string with a length limit of 128
+   * 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
    * [title](https://support.google.com/merchants/answer/6324415). Schema.org
@@ -1163,6 +1791,91 @@ public com.google.protobuf.ByteString getTitleBytes() {
     }
   }
 
+  public static final int BRANDS_FIELD_NUMBER = 9;
+  private com.google.protobuf.LazyStringList brands_;
+  /**
+   *
+   *
+   * 
+   * The brands of the product.
+   * A maximum of 30 brands are allowed. Each brand 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
+   * [brand](https://support.google.com/merchants/answer/6324351). Schema.org
+   * property [Product.brand](https://schema.org/brand).
+   * 
+ * + * repeated string brands = 9; + * + * @return A list containing the brands. + */ + public com.google.protobuf.ProtocolStringList getBrandsList() { + return brands_; + } + /** + * + * + *
+   * The brands of the product.
+   * A maximum of 30 brands are allowed. Each brand 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
+   * [brand](https://support.google.com/merchants/answer/6324351). Schema.org
+   * property [Product.brand](https://schema.org/brand).
+   * 
+ * + * repeated string brands = 9; + * + * @return The count of brands. + */ + public int getBrandsCount() { + return brands_.size(); + } + /** + * + * + *
+   * The brands of the product.
+   * A maximum of 30 brands are allowed. Each brand 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
+   * [brand](https://support.google.com/merchants/answer/6324351). Schema.org
+   * property [Product.brand](https://schema.org/brand).
+   * 
+ * + * repeated string brands = 9; + * + * @param index The index of the element to return. + * @return The brands at the given index. + */ + public java.lang.String getBrands(int index) { + return brands_.get(index); + } + /** + * + * + *
+   * The brands of the product.
+   * A maximum of 30 brands are allowed. Each brand 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
+   * [brand](https://support.google.com/merchants/answer/6324351). Schema.org
+   * property [Product.brand](https://schema.org/brand).
+   * 
+ * + * repeated string brands = 9; + * + * @param index The index of the value to return. + * @return The bytes of the brands at the given index. + */ + public com.google.protobuf.ByteString getBrandsBytes(int index) { + return brands_.getByteString(index); + } + public static final int DESCRIPTION_FIELD_NUMBER = 10; private volatile java.lang.Object description_; /** @@ -1222,6 +1935,69 @@ public com.google.protobuf.ByteString getDescriptionBytes() { } } + public static final int LANGUAGE_CODE_FIELD_NUMBER = 11; + private volatile java.lang.Object languageCode_; + /** + * + * + *
+   * 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].
+   * For product prediction, this field is ignored and the model automatically
+   * detects the text language. The [Product][google.cloud.retail.v2.Product]
+   * can include text in different languages, but duplicating
+   * [Product][google.cloud.retail.v2.Product]s to provide text in multiple
+   * languages can result in degraded model performance.
+   * For product search this field is in use. It defaults to "en-US" if unset.
+   * 
+ * + * string language_code = 11; + * + * @return The languageCode. + */ + @java.lang.Override + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } + } + /** + * + * + *
+   * 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].
+   * For product prediction, this field is ignored and the model automatically
+   * detects the text language. The [Product][google.cloud.retail.v2.Product]
+   * can include text in different languages, but duplicating
+   * [Product][google.cloud.retail.v2.Product]s to provide text in multiple
+   * languages can result in degraded model performance.
+   * For product search this field is in use. It defaults to "en-US" if unset.
+   * 
+ * + * string language_code = 11; + * + * @return The bytes for languageCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + public static final int ATTRIBUTES_FIELD_NUMBER = 12; private static final class AttributesDefaultEntryHolder { @@ -1268,10 +2044,17 @@ public int getAttributesCount() { * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]}, * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]} * }`. - * A maximum of 150 attributes are allowed. Otherwise, an INVALID_ARGUMENT - * error is returned. - * The key must be a UTF-8 encoded string with a length limit of 5,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT + * error is returned: + * * Max entries count: 200 by default; 100 for + * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]. + * * The key must be a UTF-8 encoded string with a length limit of 128 + * characters. + * * Max indexable entries count: 200 by default; 40 for + * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]. + * * Max searchable entries count: 30. + * * 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. *
* * map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 12; @@ -1306,10 +2089,17 @@ public boolean containsAttributes(java.lang.String key) { * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]}, * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]} * }`. - * A maximum of 150 attributes are allowed. Otherwise, an INVALID_ARGUMENT - * error is returned. - * The key must be a UTF-8 encoded string with a length limit of 5,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT + * error is returned: + * * Max entries count: 200 by default; 100 for + * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]. + * * The key must be a UTF-8 encoded string with a length limit of 128 + * characters. + * * Max indexable entries count: 200 by default; 40 for + * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]. + * * Max searchable entries count: 30. + * * 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. *
* * map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 12; @@ -1335,10 +2125,17 @@ public boolean containsAttributes(java.lang.String key) { * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]}, * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]} * }`. - * A maximum of 150 attributes are allowed. Otherwise, an INVALID_ARGUMENT - * error is returned. - * The key must be a UTF-8 encoded string with a length limit of 5,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT + * error is returned: + * * Max entries count: 200 by default; 100 for + * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]. + * * The key must be a UTF-8 encoded string with a length limit of 128 + * characters. + * * Max indexable entries count: 200 by default; 40 for + * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]. + * * Max searchable entries count: 30. + * * 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. * * * map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 12; @@ -1369,10 +2166,17 @@ public com.google.cloud.retail.v2.CustomAttribute getAttributesOrDefault( * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]}, * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]} * }`. - * A maximum of 150 attributes are allowed. Otherwise, an INVALID_ARGUMENT - * error is returned. - * The key must be a UTF-8 encoded string with a length limit of 5,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT + * error is returned: + * * Max entries count: 200 by default; 100 for + * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]. + * * The key must be a UTF-8 encoded string with a length limit of 128 + * characters. + * * Max indexable entries count: 200 by default; 40 for + * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]. + * * Max searchable entries count: 30. + * * 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. * * * map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 12; @@ -1541,6 +2345,52 @@ public com.google.cloud.retail.v2.PriceInfoOrBuilder getPriceInfoOrBuilder() { return getPriceInfo(); } + public static final int RATING_FIELD_NUMBER = 15; + private com.google.cloud.retail.v2.Rating rating_; + /** + * + * + *
+   * The rating of this product.
+   * 
+ * + * .google.cloud.retail.v2.Rating rating = 15; + * + * @return Whether the rating field is set. + */ + @java.lang.Override + public boolean hasRating() { + return rating_ != null; + } + /** + * + * + *
+   * The rating of this product.
+   * 
+ * + * .google.cloud.retail.v2.Rating rating = 15; + * + * @return The rating. + */ + @java.lang.Override + public com.google.cloud.retail.v2.Rating getRating() { + return rating_ == null ? com.google.cloud.retail.v2.Rating.getDefaultInstance() : rating_; + } + /** + * + * + *
+   * The rating of this product.
+   * 
+ * + * .google.cloud.retail.v2.Rating rating = 15; + */ + @java.lang.Override + public com.google.cloud.retail.v2.RatingOrBuilder getRatingOrBuilder() { + return getRating(); + } + public static final int AVAILABLE_TIME_FIELD_NUMBER = 18; private com.google.protobuf.Timestamp availableTime_; /** @@ -1548,7 +2398,8 @@ public com.google.cloud.retail.v2.PriceInfoOrBuilder getPriceInfoOrBuilder() { * *
    * The timestamp when this [Product][google.cloud.retail.v2.Product] becomes
-   * available recommendation and search.
+   * available for
+   * [SearchService.Search][google.cloud.retail.v2.SearchService.Search].
    * 
* * .google.protobuf.Timestamp available_time = 18; @@ -1564,7 +2415,8 @@ public boolean hasAvailableTime() { * *
    * The timestamp when this [Product][google.cloud.retail.v2.Product] becomes
-   * available recommendation and search.
+   * available for
+   * [SearchService.Search][google.cloud.retail.v2.SearchService.Search].
    * 
* * .google.protobuf.Timestamp available_time = 18; @@ -1582,7 +2434,8 @@ public com.google.protobuf.Timestamp getAvailableTime() { * *
    * The timestamp when this [Product][google.cloud.retail.v2.Product] becomes
-   * available recommendation and search.
+   * available for
+   * [SearchService.Search][google.cloud.retail.v2.SearchService.Search].
    * 
* * .google.protobuf.Timestamp available_time = 18; @@ -1686,43 +2539,137 @@ public com.google.protobuf.Int32ValueOrBuilder getAvailableQuantityOrBuilder() { return getAvailableQuantity(); } - public static final int URI_FIELD_NUMBER = 22; - private volatile java.lang.Object uri_; + public static final int FULFILLMENT_INFO_FIELD_NUMBER = 21; + private java.util.List fulfillmentInfo_; /** * * *
-   * Canonical URL directly linking to the product detail page.
-   * 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
-   * [link](https://support.google.com/merchants/answer/6324416). Schema.org
-   * property [Offer.url](https://schema.org/url).
+   * Fulfillment information, such as the store IDs for in-store pickup or
+   * region IDs for different shipping methods.
+   * All the elements must have distinct
+   * [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type].
+   * Otherwise, an INVALID_ARGUMENT error is returned.
    * 
* - * string uri = 22; - * - * @return The uri. + * repeated .google.cloud.retail.v2.FulfillmentInfo fulfillment_info = 21; */ @java.lang.Override - public java.lang.String getUri() { - java.lang.Object ref = uri_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - uri_ = s; - return s; - } + public java.util.List getFulfillmentInfoList() { + return fulfillmentInfo_; } /** * * *
-   * Canonical URL directly linking to the product detail page.
-   * This field must be a UTF-8 encoded string with a length limit of 5,000
-   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * Fulfillment information, such as the store IDs for in-store pickup or
+   * region IDs for different shipping methods.
+   * All the elements must have distinct
+   * [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type].
+   * Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2.FulfillmentInfo fulfillment_info = 21; + */ + @java.lang.Override + public java.util.List + getFulfillmentInfoOrBuilderList() { + return fulfillmentInfo_; + } + /** + * + * + *
+   * Fulfillment information, such as the store IDs for in-store pickup or
+   * region IDs for different shipping methods.
+   * All the elements must have distinct
+   * [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type].
+   * Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2.FulfillmentInfo fulfillment_info = 21; + */ + @java.lang.Override + public int getFulfillmentInfoCount() { + return fulfillmentInfo_.size(); + } + /** + * + * + *
+   * Fulfillment information, such as the store IDs for in-store pickup or
+   * region IDs for different shipping methods.
+   * All the elements must have distinct
+   * [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type].
+   * Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2.FulfillmentInfo fulfillment_info = 21; + */ + @java.lang.Override + public com.google.cloud.retail.v2.FulfillmentInfo getFulfillmentInfo(int index) { + return fulfillmentInfo_.get(index); + } + /** + * + * + *
+   * Fulfillment information, such as the store IDs for in-store pickup or
+   * region IDs for different shipping methods.
+   * All the elements must have distinct
+   * [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type].
+   * Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2.FulfillmentInfo fulfillment_info = 21; + */ + @java.lang.Override + public com.google.cloud.retail.v2.FulfillmentInfoOrBuilder getFulfillmentInfoOrBuilder( + int index) { + return fulfillmentInfo_.get(index); + } + + public static final int URI_FIELD_NUMBER = 22; + private volatile java.lang.Object uri_; + /** + * + * + *
+   * Canonical URL directly linking to the product detail page.
+   * It is strongly recommended to provide a valid uri for the product,
+   * otherwise the service performance could be significantly degraded.
+   * 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
+   * [link](https://support.google.com/merchants/answer/6324416). Schema.org
+   * property [Offer.url](https://schema.org/url).
+   * 
+ * + * string uri = 22; + * + * @return The uri. + */ + @java.lang.Override + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } + } + /** + * + * + *
+   * Canonical URL directly linking to the product detail page.
+   * It is strongly recommended to provide a valid uri for the product,
+   * otherwise the service performance could be significantly degraded.
+   * 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
    * [link](https://support.google.com/merchants/answer/6324416). Schema.org
    * property [Offer.url](https://schema.org/url).
@@ -1751,7 +2698,8 @@ public com.google.protobuf.ByteString getUriBytes() {
    *
    *
    * 
-   * Product images for the product.
+   * Product images for the product.Highly recommended to put the main image
+   * to the first.
    * A maximum of 300 images are allowed.
    * Google Merchant Center property
    * [image_link](https://support.google.com/merchants/answer/6324350).
@@ -1768,7 +2716,8 @@ public java.util.List getImagesList() {
    *
    *
    * 
-   * Product images for the product.
+   * Product images for the product.Highly recommended to put the main image
+   * to the first.
    * A maximum of 300 images are allowed.
    * Google Merchant Center property
    * [image_link](https://support.google.com/merchants/answer/6324350).
@@ -1786,7 +2735,8 @@ public java.util.List getImagesList() {
    *
    *
    * 
-   * Product images for the product.
+   * Product images for the product.Highly recommended to put the main image
+   * to the first.
    * A maximum of 300 images are allowed.
    * Google Merchant Center property
    * [image_link](https://support.google.com/merchants/answer/6324350).
@@ -1803,7 +2753,8 @@ public int getImagesCount() {
    *
    *
    * 
-   * Product images for the product.
+   * Product images for the product.Highly recommended to put the main image
+   * to the first.
    * A maximum of 300 images are allowed.
    * Google Merchant Center property
    * [image_link](https://support.google.com/merchants/answer/6324350).
@@ -1820,7 +2771,8 @@ public com.google.cloud.retail.v2.Image getImages(int index) {
    *
    *
    * 
-   * Product images for the product.
+   * Product images for the product.Highly recommended to put the main image
+   * to the first.
    * A maximum of 300 images are allowed.
    * Google Merchant Center property
    * [image_link](https://support.google.com/merchants/answer/6324350).
@@ -1834,340 +2786,1516 @@ public com.google.cloud.retail.v2.ImageOrBuilder getImagesOrBuilder(int index) {
     return images_.get(index);
   }
 
-  private byte memoizedIsInitialized = -1;
-
+  public static final int AUDIENCE_FIELD_NUMBER = 24;
+  private com.google.cloud.retail.v2.Audience audience_;
+  /**
+   *
+   *
+   * 
+   * The target group associated with a given audience (e.g. male, veterans,
+   * car owners, musicians, etc.) of the product.
+   * 
+ * + * .google.cloud.retail.v2.Audience audience = 24; + * + * @return Whether the audience field is set. + */ @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; + public boolean hasAudience() { + return audience_ != null; } - + /** + * + * + *
+   * The target group associated with a given audience (e.g. male, veterans,
+   * car owners, musicians, etc.) of the product.
+   * 
+ * + * .google.cloud.retail.v2.Audience audience = 24; + * + * @return The audience. + */ @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - if (!getIdBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, id_); - } - if (type_ != com.google.cloud.retail.v2.Product.Type.TYPE_UNSPECIFIED.getNumber()) { - output.writeEnum(3, type_); - } - if (!getPrimaryProductIdBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, primaryProductId_); - } - for (int i = 0; i < categories_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 7, categories_.getRaw(i)); - } - if (!getTitleBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 8, title_); - } - if (!getDescriptionBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 10, description_); - } - com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( - output, internalGetAttributes(), AttributesDefaultEntryHolder.defaultEntry, 12); - for (int i = 0; i < tags_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 13, tags_.getRaw(i)); - } - if (priceInfo_ != null) { - output.writeMessage(14, getPriceInfo()); - } - if (availableTime_ != null) { - output.writeMessage(18, getAvailableTime()); - } - if (availability_ - != com.google.cloud.retail.v2.Product.Availability.AVAILABILITY_UNSPECIFIED.getNumber()) { - output.writeEnum(19, availability_); - } - if (availableQuantity_ != null) { - output.writeMessage(20, getAvailableQuantity()); - } - if (!getUriBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 22, uri_); - } - for (int i = 0; i < images_.size(); i++) { - output.writeMessage(23, images_.get(i)); - } - unknownFields.writeTo(output); + public com.google.cloud.retail.v2.Audience getAudience() { + return audience_ == null ? com.google.cloud.retail.v2.Audience.getDefaultInstance() : audience_; } - + /** + * + * + *
+   * The target group associated with a given audience (e.g. male, veterans,
+   * car owners, musicians, etc.) of the product.
+   * 
+ * + * .google.cloud.retail.v2.Audience audience = 24; + */ @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); - } - if (!getIdBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, id_); - } - if (type_ != com.google.cloud.retail.v2.Product.Type.TYPE_UNSPECIFIED.getNumber()) { - size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, type_); - } - if (!getPrimaryProductIdBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, primaryProductId_); - } - { - int dataSize = 0; - for (int i = 0; i < categories_.size(); i++) { - dataSize += computeStringSizeNoTag(categories_.getRaw(i)); - } - size += dataSize; - size += 1 * getCategoriesList().size(); - } - if (!getTitleBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, title_); - } - if (!getDescriptionBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, description_); - } - for (java.util.Map.Entry entry : - internalGetAttributes().getMap().entrySet()) { - com.google.protobuf.MapEntry - attributes__ = - AttributesDefaultEntryHolder.defaultEntry - .newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, attributes__); - } - { - int dataSize = 0; - for (int i = 0; i < tags_.size(); i++) { - dataSize += computeStringSizeNoTag(tags_.getRaw(i)); - } - size += dataSize; - size += 1 * getTagsList().size(); - } - if (priceInfo_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(14, getPriceInfo()); - } - if (availableTime_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(18, getAvailableTime()); - } - if (availability_ - != com.google.cloud.retail.v2.Product.Availability.AVAILABILITY_UNSPECIFIED.getNumber()) { - size += com.google.protobuf.CodedOutputStream.computeEnumSize(19, availability_); - } - if (availableQuantity_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(20, getAvailableQuantity()); - } - if (!getUriBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(22, uri_); - } - for (int i = 0; i < images_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(23, images_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; + public com.google.cloud.retail.v2.AudienceOrBuilder getAudienceOrBuilder() { + return getAudience(); } + public static final int COLOR_INFO_FIELD_NUMBER = 25; + private com.google.cloud.retail.v2.ColorInfo colorInfo_; + /** + * + * + *
+   * The color of the product.
+   * Google Merchant Center property
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * .google.cloud.retail.v2.ColorInfo color_info = 25; + * + * @return Whether the colorInfo field is set. + */ @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.retail.v2.Product)) { - return super.equals(obj); - } - com.google.cloud.retail.v2.Product other = (com.google.cloud.retail.v2.Product) obj; - - if (!getName().equals(other.getName())) return false; - if (!getId().equals(other.getId())) return false; - if (type_ != other.type_) return false; - if (!getPrimaryProductId().equals(other.getPrimaryProductId())) return false; - if (!getCategoriesList().equals(other.getCategoriesList())) return false; - if (!getTitle().equals(other.getTitle())) return false; - if (!getDescription().equals(other.getDescription())) return false; - if (!internalGetAttributes().equals(other.internalGetAttributes())) return false; - if (!getTagsList().equals(other.getTagsList())) return false; - if (hasPriceInfo() != other.hasPriceInfo()) return false; - if (hasPriceInfo()) { - if (!getPriceInfo().equals(other.getPriceInfo())) return false; - } - if (hasAvailableTime() != other.hasAvailableTime()) return false; - if (hasAvailableTime()) { - if (!getAvailableTime().equals(other.getAvailableTime())) return false; - } - if (availability_ != other.availability_) return false; - if (hasAvailableQuantity() != other.hasAvailableQuantity()) return false; - if (hasAvailableQuantity()) { - if (!getAvailableQuantity().equals(other.getAvailableQuantity())) return false; - } - if (!getUri().equals(other.getUri())) return false; - if (!getImagesList().equals(other.getImagesList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; + public boolean hasColorInfo() { + return colorInfo_ != null; } - + /** + * + * + *
+   * The color of the product.
+   * Google Merchant Center property
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * .google.cloud.retail.v2.ColorInfo color_info = 25; + * + * @return The colorInfo. + */ @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (37 * hash) + ID_FIELD_NUMBER; - hash = (53 * hash) + getId().hashCode(); - hash = (37 * hash) + TYPE_FIELD_NUMBER; - hash = (53 * hash) + type_; - hash = (37 * hash) + PRIMARY_PRODUCT_ID_FIELD_NUMBER; - hash = (53 * hash) + getPrimaryProductId().hashCode(); - if (getCategoriesCount() > 0) { - hash = (37 * hash) + CATEGORIES_FIELD_NUMBER; - hash = (53 * hash) + getCategoriesList().hashCode(); - } - hash = (37 * hash) + TITLE_FIELD_NUMBER; - hash = (53 * hash) + getTitle().hashCode(); - hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; - hash = (53 * hash) + getDescription().hashCode(); - if (!internalGetAttributes().getMap().isEmpty()) { - hash = (37 * hash) + ATTRIBUTES_FIELD_NUMBER; - hash = (53 * hash) + internalGetAttributes().hashCode(); - } - if (getTagsCount() > 0) { - hash = (37 * hash) + TAGS_FIELD_NUMBER; - hash = (53 * hash) + getTagsList().hashCode(); - } - if (hasPriceInfo()) { - hash = (37 * hash) + PRICE_INFO_FIELD_NUMBER; - hash = (53 * hash) + getPriceInfo().hashCode(); - } - if (hasAvailableTime()) { - hash = (37 * hash) + AVAILABLE_TIME_FIELD_NUMBER; - hash = (53 * hash) + getAvailableTime().hashCode(); - } - hash = (37 * hash) + AVAILABILITY_FIELD_NUMBER; - hash = (53 * hash) + availability_; - if (hasAvailableQuantity()) { - hash = (37 * hash) + AVAILABLE_QUANTITY_FIELD_NUMBER; - hash = (53 * hash) + getAvailableQuantity().hashCode(); - } - hash = (37 * hash) + URI_FIELD_NUMBER; - hash = (53 * hash) + getUri().hashCode(); - if (getImagesCount() > 0) { - hash = (37 * hash) + IMAGES_FIELD_NUMBER; - hash = (53 * hash) + getImagesList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.retail.v2.Product parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.retail.v2.Product parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.retail.v2.Product parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.retail.v2.Product parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.retail.v2.Product parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.retail.v2.Product parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.retail.v2.Product parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + public com.google.cloud.retail.v2.ColorInfo getColorInfo() { + return colorInfo_ == null + ? com.google.cloud.retail.v2.ColorInfo.getDefaultInstance() + : colorInfo_; } - - public static com.google.cloud.retail.v2.Product parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); + /** + * + * + *
+   * The color of the product.
+   * Google Merchant Center property
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * .google.cloud.retail.v2.ColorInfo color_info = 25; + */ + @java.lang.Override + public com.google.cloud.retail.v2.ColorInfoOrBuilder getColorInfoOrBuilder() { + return getColorInfo(); } - public static com.google.cloud.retail.v2.Product parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + public static final int SIZES_FIELD_NUMBER = 26; + private com.google.protobuf.LazyStringList sizes_; + /** + * + * + *
+   * The size of the product. To represent different size systems or size types,
+   * consider using this format: [[[size_system:]size_type:]size_value].
+   * For example, in "US:MENS:M", "US" represents size system; "MENS" represents
+   * size type; "M" represents size value. In "GIRLS:27", size system is empty;
+   * "GIRLS" represents size type; "27" represents size value. In "32 inches",
+   * both size system and size type are empty, while size value is "32 inches".
+   * A maximum of 20 values are 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
+   * [size](https://support.google.com/merchants/answer/6324492),
+   * [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; + * + * @return A list containing the sizes. + */ + public com.google.protobuf.ProtocolStringList getSizesList() { + return sizes_; } - - public static com.google.cloud.retail.v2.Product parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); + /** + * + * + *
+   * The size of the product. To represent different size systems or size types,
+   * consider using this format: [[[size_system:]size_type:]size_value].
+   * For example, in "US:MENS:M", "US" represents size system; "MENS" represents
+   * size type; "M" represents size value. In "GIRLS:27", size system is empty;
+   * "GIRLS" represents size type; "27" represents size value. In "32 inches",
+   * both size system and size type are empty, while size value is "32 inches".
+   * A maximum of 20 values are 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
+   * [size](https://support.google.com/merchants/answer/6324492),
+   * [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; + * + * @return The count of sizes. + */ + public int getSizesCount() { + return sizes_.size(); } - - public static com.google.cloud.retail.v2.Product parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + /** + * + * + *
+   * The size of the product. To represent different size systems or size types,
+   * consider using this format: [[[size_system:]size_type:]size_value].
+   * For example, in "US:MENS:M", "US" represents size system; "MENS" represents
+   * size type; "M" represents size value. In "GIRLS:27", size system is empty;
+   * "GIRLS" represents size type; "27" represents size value. In "32 inches",
+   * both size system and size type are empty, while size value is "32 inches".
+   * A maximum of 20 values are 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
+   * [size](https://support.google.com/merchants/answer/6324492),
+   * [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; + * + * @param index The index of the element to return. + * @return The sizes at the given index. + */ + public java.lang.String getSizes(int index) { + return sizes_.get(index); } - - public static com.google.cloud.retail.v2.Product parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); + /** + * + * + *
+   * The size of the product. To represent different size systems or size types,
+   * consider using this format: [[[size_system:]size_type:]size_value].
+   * For example, in "US:MENS:M", "US" represents size system; "MENS" represents
+   * size type; "M" represents size value. In "GIRLS:27", size system is empty;
+   * "GIRLS" represents size type; "27" represents size value. In "32 inches",
+   * both size system and size type are empty, while size value is "32 inches".
+   * A maximum of 20 values are 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
+   * [size](https://support.google.com/merchants/answer/6324492),
+   * [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; + * + * @param index The index of the value to return. + * @return The bytes of the sizes at the given index. + */ + public com.google.protobuf.ByteString getSizesBytes(int index) { + return sizes_.getByteString(index); } - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); + public static final int MATERIALS_FIELD_NUMBER = 27; + private com.google.protobuf.LazyStringList materials_; + /** + * + * + *
+   * The material of the product. For example, "leather", "wooden".
+   * A maximum of 5 values are allowed. 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
+   * [material](https://support.google.com/merchants/answer/6324410). Schema.org
+   * property [Product.material](https://schema.org/material).
+   * 
+ * + * repeated string materials = 27; + * + * @return A list containing the materials. + */ + public com.google.protobuf.ProtocolStringList getMaterialsList() { + return materials_; } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); + /** + * + * + *
+   * The material of the product. For example, "leather", "wooden".
+   * A maximum of 5 values are allowed. 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
+   * [material](https://support.google.com/merchants/answer/6324410). Schema.org
+   * property [Product.material](https://schema.org/material).
+   * 
+ * + * repeated string materials = 27; + * + * @return The count of materials. + */ + public int getMaterialsCount() { + return materials_.size(); } - - public static Builder newBuilder(com.google.cloud.retail.v2.Product prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + /** + * + * + *
+   * The material of the product. For example, "leather", "wooden".
+   * A maximum of 5 values are allowed. 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
+   * [material](https://support.google.com/merchants/answer/6324410). Schema.org
+   * property [Product.material](https://schema.org/material).
+   * 
+ * + * repeated string materials = 27; + * + * @param index The index of the element to return. + * @return The materials at the given index. + */ + public java.lang.String getMaterials(int index) { + return materials_.get(index); } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + /** + * + * + *
+   * The material of the product. For example, "leather", "wooden".
+   * A maximum of 5 values are allowed. 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
+   * [material](https://support.google.com/merchants/answer/6324410). Schema.org
+   * property [Product.material](https://schema.org/material).
+   * 
+ * + * repeated string materials = 27; + * + * @param index The index of the value to return. + * @return The bytes of the materials at the given index. + */ + public com.google.protobuf.ByteString getMaterialsBytes(int index) { + return materials_.getByteString(index); } - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } + public static final int PATTERNS_FIELD_NUMBER = 28; + private com.google.protobuf.LazyStringList patterns_; /** * * *
-   * Product captures all metadata information of items to be recommended or
-   * searched.
+   * The pattern or graphic print of the product. For example, "striped", "polka
+   * dot", "paisley".
+   * A maximum of 5 values are 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
+   * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org
+   * property [Product.pattern](https://schema.org/pattern).
    * 
* - * Protobuf type {@code google.cloud.retail.v2.Product} + * repeated string patterns = 28; + * + * @return A list containing the patterns. + */ + public com.google.protobuf.ProtocolStringList getPatternsList() { + return patterns_; + } + /** + * + * + *
+   * The pattern or graphic print of the product. For example, "striped", "polka
+   * dot", "paisley".
+   * A maximum of 5 values are 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
+   * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org
+   * property [Product.pattern](https://schema.org/pattern).
+   * 
+ * + * repeated string patterns = 28; + * + * @return The count of patterns. + */ + public int getPatternsCount() { + return patterns_.size(); + } + /** + * + * + *
+   * The pattern or graphic print of the product. For example, "striped", "polka
+   * dot", "paisley".
+   * A maximum of 5 values are 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
+   * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org
+   * property [Product.pattern](https://schema.org/pattern).
+   * 
+ * + * repeated string patterns = 28; + * + * @param index The index of the element to return. + * @return The patterns at the given index. + */ + public java.lang.String getPatterns(int index) { + return patterns_.get(index); + } + /** + * + * + *
+   * The pattern or graphic print of the product. For example, "striped", "polka
+   * dot", "paisley".
+   * A maximum of 5 values are 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
+   * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org
+   * property [Product.pattern](https://schema.org/pattern).
+   * 
+ * + * repeated string patterns = 28; + * + * @param index The index of the value to return. + * @return The bytes of the patterns at the given index. + */ + public com.google.protobuf.ByteString getPatternsBytes(int index) { + return patterns_.getByteString(index); + } + + public static final int CONDITIONS_FIELD_NUMBER = 29; + private com.google.protobuf.LazyStringList conditions_; + /** + * + * + *
+   * The condition of the product. Strongly encouraged to use the standard
+   * values: "new", "refurbished", "used".
+   * A maximum of 5 values are 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
+   * [condition](https://support.google.com/merchants/answer/6324469).
+   * Schema.org property
+   * [Offer.itemCondition](https://schema.org/itemCondition).
+   * 
+ * + * repeated string conditions = 29; + * + * @return A list containing the conditions. + */ + public com.google.protobuf.ProtocolStringList getConditionsList() { + return conditions_; + } + /** + * + * + *
+   * The condition of the product. Strongly encouraged to use the standard
+   * values: "new", "refurbished", "used".
+   * A maximum of 5 values are 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
+   * [condition](https://support.google.com/merchants/answer/6324469).
+   * Schema.org property
+   * [Offer.itemCondition](https://schema.org/itemCondition).
+   * 
+ * + * repeated string conditions = 29; + * + * @return The count of conditions. + */ + public int getConditionsCount() { + return conditions_.size(); + } + /** + * + * + *
+   * The condition of the product. Strongly encouraged to use the standard
+   * values: "new", "refurbished", "used".
+   * A maximum of 5 values are 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
+   * [condition](https://support.google.com/merchants/answer/6324469).
+   * Schema.org property
+   * [Offer.itemCondition](https://schema.org/itemCondition).
+   * 
+ * + * repeated string conditions = 29; + * + * @param index The index of the element to return. + * @return The conditions at the given index. + */ + public java.lang.String getConditions(int index) { + return conditions_.get(index); + } + /** + * + * + *
+   * The condition of the product. Strongly encouraged to use the standard
+   * values: "new", "refurbished", "used".
+   * A maximum of 5 values are 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
+   * [condition](https://support.google.com/merchants/answer/6324469).
+   * Schema.org property
+   * [Offer.itemCondition](https://schema.org/itemCondition).
+   * 
+ * + * repeated string conditions = 29; + * + * @param index The index of the value to return. + * @return The bytes of the conditions at the given index. + */ + public com.google.protobuf.ByteString getConditionsBytes(int index) { + return conditions_.getByteString(index); + } + + public static final int PROMOTIONS_FIELD_NUMBER = 34; + private java.util.List promotions_; + /** + * + * + *
+   * The promotions applied to the product. A maximum of 10 values are allowed
+   * per [Product][google.cloud.retail.v2.Product].
+   * 
+ * + * repeated .google.cloud.retail.v2.Promotion promotions = 34; + */ + @java.lang.Override + public java.util.List getPromotionsList() { + return promotions_; + } + /** + * + * + *
+   * The promotions applied to the product. A maximum of 10 values are allowed
+   * per [Product][google.cloud.retail.v2.Product].
+   * 
+ * + * repeated .google.cloud.retail.v2.Promotion promotions = 34; + */ + @java.lang.Override + public java.util.List + getPromotionsOrBuilderList() { + return promotions_; + } + /** + * + * + *
+   * The promotions applied to the product. A maximum of 10 values are allowed
+   * per [Product][google.cloud.retail.v2.Product].
+   * 
+ * + * repeated .google.cloud.retail.v2.Promotion promotions = 34; + */ + @java.lang.Override + public int getPromotionsCount() { + return promotions_.size(); + } + /** + * + * + *
+   * The promotions applied to the product. A maximum of 10 values are allowed
+   * per [Product][google.cloud.retail.v2.Product].
+   * 
+ * + * repeated .google.cloud.retail.v2.Promotion promotions = 34; + */ + @java.lang.Override + public com.google.cloud.retail.v2.Promotion getPromotions(int index) { + return promotions_.get(index); + } + /** + * + * + *
+   * The promotions applied to the product. A maximum of 10 values are allowed
+   * per [Product][google.cloud.retail.v2.Product].
+   * 
+ * + * repeated .google.cloud.retail.v2.Promotion promotions = 34; + */ + @java.lang.Override + public com.google.cloud.retail.v2.PromotionOrBuilder getPromotionsOrBuilder(int index) { + return promotions_.get(index); + } + + public static final int PUBLISH_TIME_FIELD_NUMBER = 33; + private com.google.protobuf.Timestamp publishTime_; + /** + * + * + *
+   * The timestamp when the product is published by the retailer for the first
+   * time, which indicates the freshness of the products. Note that this field
+   * is different from
+   * [available_time][google.cloud.retail.v2.Product.available_time], given it
+   * purely describes product freshness regardless of when it is available on
+   * search and recommendation.
+   * 
+ * + * .google.protobuf.Timestamp publish_time = 33; + * + * @return Whether the publishTime field is set. + */ + @java.lang.Override + public boolean hasPublishTime() { + return publishTime_ != null; + } + /** + * + * + *
+   * The timestamp when the product is published by the retailer for the first
+   * time, which indicates the freshness of the products. Note that this field
+   * is different from
+   * [available_time][google.cloud.retail.v2.Product.available_time], given it
+   * purely describes product freshness regardless of when it is available on
+   * search and recommendation.
+   * 
+ * + * .google.protobuf.Timestamp publish_time = 33; + * + * @return The publishTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getPublishTime() { + return publishTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : publishTime_; + } + /** + * + * + *
+   * The timestamp when the product is published by the retailer for the first
+   * time, which indicates the freshness of the products. Note that this field
+   * is different from
+   * [available_time][google.cloud.retail.v2.Product.available_time], given it
+   * purely describes product freshness regardless of when it is available on
+   * search and recommendation.
+   * 
+ * + * .google.protobuf.Timestamp publish_time = 33; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getPublishTimeOrBuilder() { + return getPublishTime(); + } + + public static final int RETRIEVABLE_FIELDS_FIELD_NUMBER = 30; + private com.google.protobuf.FieldMask retrievableFields_; + /** + * + * + *
+   * Indicates which fields in the [Product][google.cloud.retail.v2.Product]s
+   * are returned in [SearchResponse][google.cloud.retail.v2.SearchResponse].
+   * Supported fields for all [type][google.cloud.retail.v2.Product.type]s:
+   * * [audience][google.cloud.retail.v2.Product.audience]
+   * * [availability][google.cloud.retail.v2.Product.availability]
+   * * [brands][google.cloud.retail.v2.Product.brands]
+   * * [color_info][google.cloud.retail.v2.Product.color_info]
+   * * [conditions][google.cloud.retail.v2.Product.conditions]
+   * * [gtin][google.cloud.retail.v2.Product.gtin]
+   * * [materials][google.cloud.retail.v2.Product.materials]
+   * * [name][google.cloud.retail.v2.Product.name]
+   * * [patterns][google.cloud.retail.v2.Product.patterns]
+   * * [price_info][google.cloud.retail.v2.Product.price_info]
+   * * [rating][google.cloud.retail.v2.Product.rating]
+   * * [sizes][google.cloud.retail.v2.Product.sizes]
+   * * [title][google.cloud.retail.v2.Product.title]
+   * * [uri][google.cloud.retail.v2.Product.uri]
+   * Supported fields only for
+   * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and
+   * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]:
+   * * [categories][google.cloud.retail.v2.Product.categories]
+   * * [description][google.cloud.retail.v2.Product.description]
+   * * [images][google.cloud.retail.v2.Product.images]
+   * Supported fields only for
+   * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]:
+   * * Only the first image in [images][google.cloud.retail.v2.Product.images]
+   * To mark [attributes][google.cloud.retail.v2.Product.attributes] as
+   * retrievable, include paths of the form "attributes.key" where "key" is the
+   * key of a custom attribute, as specified in
+   * [attributes][google.cloud.retail.v2.Product.attributes].
+   * For [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and
+   * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION], the
+   * following fields are always returned in
+   * [SearchResponse][google.cloud.retail.v2.SearchResponse] by default:
+   * * [name][google.cloud.retail.v2.Product.name]
+   * For [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT], the
+   * following fields are always returned in by default:
+   * * [name][google.cloud.retail.v2.Product.name]
+   * * [color_info][google.cloud.retail.v2.Product.color_info]
+   * Maximum number of paths is 20. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * .google.protobuf.FieldMask retrievable_fields = 30; + * + * @return Whether the retrievableFields field is set. + */ + @java.lang.Override + public boolean hasRetrievableFields() { + return retrievableFields_ != null; + } + /** + * + * + *
+   * Indicates which fields in the [Product][google.cloud.retail.v2.Product]s
+   * are returned in [SearchResponse][google.cloud.retail.v2.SearchResponse].
+   * Supported fields for all [type][google.cloud.retail.v2.Product.type]s:
+   * * [audience][google.cloud.retail.v2.Product.audience]
+   * * [availability][google.cloud.retail.v2.Product.availability]
+   * * [brands][google.cloud.retail.v2.Product.brands]
+   * * [color_info][google.cloud.retail.v2.Product.color_info]
+   * * [conditions][google.cloud.retail.v2.Product.conditions]
+   * * [gtin][google.cloud.retail.v2.Product.gtin]
+   * * [materials][google.cloud.retail.v2.Product.materials]
+   * * [name][google.cloud.retail.v2.Product.name]
+   * * [patterns][google.cloud.retail.v2.Product.patterns]
+   * * [price_info][google.cloud.retail.v2.Product.price_info]
+   * * [rating][google.cloud.retail.v2.Product.rating]
+   * * [sizes][google.cloud.retail.v2.Product.sizes]
+   * * [title][google.cloud.retail.v2.Product.title]
+   * * [uri][google.cloud.retail.v2.Product.uri]
+   * Supported fields only for
+   * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and
+   * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]:
+   * * [categories][google.cloud.retail.v2.Product.categories]
+   * * [description][google.cloud.retail.v2.Product.description]
+   * * [images][google.cloud.retail.v2.Product.images]
+   * Supported fields only for
+   * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]:
+   * * Only the first image in [images][google.cloud.retail.v2.Product.images]
+   * To mark [attributes][google.cloud.retail.v2.Product.attributes] as
+   * retrievable, include paths of the form "attributes.key" where "key" is the
+   * key of a custom attribute, as specified in
+   * [attributes][google.cloud.retail.v2.Product.attributes].
+   * For [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and
+   * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION], the
+   * following fields are always returned in
+   * [SearchResponse][google.cloud.retail.v2.SearchResponse] by default:
+   * * [name][google.cloud.retail.v2.Product.name]
+   * For [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT], the
+   * following fields are always returned in by default:
+   * * [name][google.cloud.retail.v2.Product.name]
+   * * [color_info][google.cloud.retail.v2.Product.color_info]
+   * Maximum number of paths is 20. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * .google.protobuf.FieldMask retrievable_fields = 30; + * + * @return The retrievableFields. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getRetrievableFields() { + return retrievableFields_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : retrievableFields_; + } + /** + * + * + *
+   * Indicates which fields in the [Product][google.cloud.retail.v2.Product]s
+   * are returned in [SearchResponse][google.cloud.retail.v2.SearchResponse].
+   * Supported fields for all [type][google.cloud.retail.v2.Product.type]s:
+   * * [audience][google.cloud.retail.v2.Product.audience]
+   * * [availability][google.cloud.retail.v2.Product.availability]
+   * * [brands][google.cloud.retail.v2.Product.brands]
+   * * [color_info][google.cloud.retail.v2.Product.color_info]
+   * * [conditions][google.cloud.retail.v2.Product.conditions]
+   * * [gtin][google.cloud.retail.v2.Product.gtin]
+   * * [materials][google.cloud.retail.v2.Product.materials]
+   * * [name][google.cloud.retail.v2.Product.name]
+   * * [patterns][google.cloud.retail.v2.Product.patterns]
+   * * [price_info][google.cloud.retail.v2.Product.price_info]
+   * * [rating][google.cloud.retail.v2.Product.rating]
+   * * [sizes][google.cloud.retail.v2.Product.sizes]
+   * * [title][google.cloud.retail.v2.Product.title]
+   * * [uri][google.cloud.retail.v2.Product.uri]
+   * Supported fields only for
+   * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and
+   * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]:
+   * * [categories][google.cloud.retail.v2.Product.categories]
+   * * [description][google.cloud.retail.v2.Product.description]
+   * * [images][google.cloud.retail.v2.Product.images]
+   * Supported fields only for
+   * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]:
+   * * Only the first image in [images][google.cloud.retail.v2.Product.images]
+   * To mark [attributes][google.cloud.retail.v2.Product.attributes] as
+   * retrievable, include paths of the form "attributes.key" where "key" is the
+   * key of a custom attribute, as specified in
+   * [attributes][google.cloud.retail.v2.Product.attributes].
+   * For [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and
+   * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION], the
+   * following fields are always returned in
+   * [SearchResponse][google.cloud.retail.v2.SearchResponse] by default:
+   * * [name][google.cloud.retail.v2.Product.name]
+   * For [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT], the
+   * following fields are always returned in by default:
+   * * [name][google.cloud.retail.v2.Product.name]
+   * * [color_info][google.cloud.retail.v2.Product.color_info]
+   * Maximum number of paths is 20. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * .google.protobuf.FieldMask retrievable_fields = 30; + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getRetrievableFieldsOrBuilder() { + return getRetrievableFields(); + } + + public static final int VARIANTS_FIELD_NUMBER = 31; + private java.util.List variants_; + /** + * + * + *
+   * Output only. Product variants grouped together on primary product which
+   * share similar product attributes. It's automatically grouped by
+   * [primary_product_id][google.cloud.retail.v2.Product.primary_product_id] for
+   * all the product variants. Only populated for
+   * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2.Product]s.
+   * Note: This field is OUTPUT_ONLY for
+   * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct].
+   * Do not set this field in API requests.
+   * 
+ * + * + * repeated .google.cloud.retail.v2.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getVariantsList() { + return variants_; + } + /** + * + * + *
+   * Output only. Product variants grouped together on primary product which
+   * share similar product attributes. It's automatically grouped by
+   * [primary_product_id][google.cloud.retail.v2.Product.primary_product_id] for
+   * all the product variants. Only populated for
+   * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2.Product]s.
+   * Note: This field is OUTPUT_ONLY for
+   * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct].
+   * Do not set this field in API requests.
+   * 
+ * + * + * repeated .google.cloud.retail.v2.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getVariantsOrBuilderList() { + return variants_; + } + /** + * + * + *
+   * Output only. Product variants grouped together on primary product which
+   * share similar product attributes. It's automatically grouped by
+   * [primary_product_id][google.cloud.retail.v2.Product.primary_product_id] for
+   * all the product variants. Only populated for
+   * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2.Product]s.
+   * Note: This field is OUTPUT_ONLY for
+   * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct].
+   * Do not set this field in API requests.
+   * 
+ * + * + * repeated .google.cloud.retail.v2.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getVariantsCount() { + return variants_.size(); + } + /** + * + * + *
+   * Output only. Product variants grouped together on primary product which
+   * share similar product attributes. It's automatically grouped by
+   * [primary_product_id][google.cloud.retail.v2.Product.primary_product_id] for
+   * all the product variants. Only populated for
+   * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2.Product]s.
+   * Note: This field is OUTPUT_ONLY for
+   * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct].
+   * Do not set this field in API requests.
+   * 
+ * + * + * repeated .google.cloud.retail.v2.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2.Product getVariants(int index) { + return variants_.get(index); + } + /** + * + * + *
+   * Output only. Product variants grouped together on primary product which
+   * share similar product attributes. It's automatically grouped by
+   * [primary_product_id][google.cloud.retail.v2.Product.primary_product_id] for
+   * all the product variants. Only populated for
+   * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2.Product]s.
+   * Note: This field is OUTPUT_ONLY for
+   * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct].
+   * Do not set this field in API requests.
+   * 
+ * + * + * repeated .google.cloud.retail.v2.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2.ProductOrBuilder getVariantsOrBuilder(int index) { + return variants_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, id_); + } + if (type_ != com.google.cloud.retail.v2.Product.Type.TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(3, type_); + } + if (!getPrimaryProductIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, primaryProductId_); + } + for (int i = 0; i < collectionMemberIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, collectionMemberIds_.getRaw(i)); + } + if (!getGtinBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, gtin_); + } + for (int i = 0; i < categories_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, categories_.getRaw(i)); + } + if (!getTitleBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, title_); + } + for (int i = 0; i < brands_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 9, brands_.getRaw(i)); + } + if (!getDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, description_); + } + if (!getLanguageCodeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 11, languageCode_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetAttributes(), AttributesDefaultEntryHolder.defaultEntry, 12); + for (int i = 0; i < tags_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 13, tags_.getRaw(i)); + } + if (priceInfo_ != null) { + output.writeMessage(14, getPriceInfo()); + } + if (rating_ != null) { + output.writeMessage(15, getRating()); + } + if (expirationCase_ == 16) { + output.writeMessage(16, (com.google.protobuf.Timestamp) expiration_); + } + if (expirationCase_ == 17) { + output.writeMessage(17, (com.google.protobuf.Duration) expiration_); + } + if (availableTime_ != null) { + output.writeMessage(18, getAvailableTime()); + } + if (availability_ + != com.google.cloud.retail.v2.Product.Availability.AVAILABILITY_UNSPECIFIED.getNumber()) { + output.writeEnum(19, availability_); + } + if (availableQuantity_ != null) { + output.writeMessage(20, getAvailableQuantity()); + } + for (int i = 0; i < fulfillmentInfo_.size(); i++) { + output.writeMessage(21, fulfillmentInfo_.get(i)); + } + if (!getUriBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 22, uri_); + } + for (int i = 0; i < images_.size(); i++) { + output.writeMessage(23, images_.get(i)); + } + if (audience_ != null) { + output.writeMessage(24, getAudience()); + } + if (colorInfo_ != null) { + output.writeMessage(25, getColorInfo()); + } + for (int i = 0; i < sizes_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 26, sizes_.getRaw(i)); + } + for (int i = 0; i < materials_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 27, materials_.getRaw(i)); + } + for (int i = 0; i < patterns_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 28, patterns_.getRaw(i)); + } + for (int i = 0; i < conditions_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 29, conditions_.getRaw(i)); + } + if (retrievableFields_ != null) { + output.writeMessage(30, getRetrievableFields()); + } + for (int i = 0; i < variants_.size(); i++) { + output.writeMessage(31, variants_.get(i)); + } + if (publishTime_ != null) { + output.writeMessage(33, getPublishTime()); + } + for (int i = 0; i < promotions_.size(); i++) { + output.writeMessage(34, promotions_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, id_); + } + if (type_ != com.google.cloud.retail.v2.Product.Type.TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, type_); + } + if (!getPrimaryProductIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, primaryProductId_); + } + { + int dataSize = 0; + for (int i = 0; i < collectionMemberIds_.size(); i++) { + dataSize += computeStringSizeNoTag(collectionMemberIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getCollectionMemberIdsList().size(); + } + if (!getGtinBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, gtin_); + } + { + int dataSize = 0; + for (int i = 0; i < categories_.size(); i++) { + dataSize += computeStringSizeNoTag(categories_.getRaw(i)); + } + size += dataSize; + size += 1 * getCategoriesList().size(); + } + if (!getTitleBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, title_); + } + { + int dataSize = 0; + for (int i = 0; i < brands_.size(); i++) { + dataSize += computeStringSizeNoTag(brands_.getRaw(i)); + } + size += dataSize; + size += 1 * getBrandsList().size(); + } + if (!getDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, description_); + } + if (!getLanguageCodeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, languageCode_); + } + for (java.util.Map.Entry entry : + internalGetAttributes().getMap().entrySet()) { + com.google.protobuf.MapEntry + attributes__ = + AttributesDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, attributes__); + } + { + int dataSize = 0; + for (int i = 0; i < tags_.size(); i++) { + dataSize += computeStringSizeNoTag(tags_.getRaw(i)); + } + size += dataSize; + size += 1 * getTagsList().size(); + } + if (priceInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(14, getPriceInfo()); + } + if (rating_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(15, getRating()); + } + if (expirationCase_ == 16) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 16, (com.google.protobuf.Timestamp) expiration_); + } + if (expirationCase_ == 17) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 17, (com.google.protobuf.Duration) expiration_); + } + if (availableTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(18, getAvailableTime()); + } + if (availability_ + != com.google.cloud.retail.v2.Product.Availability.AVAILABILITY_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(19, availability_); + } + if (availableQuantity_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(20, getAvailableQuantity()); + } + for (int i = 0; i < fulfillmentInfo_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(21, fulfillmentInfo_.get(i)); + } + if (!getUriBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(22, uri_); + } + for (int i = 0; i < images_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(23, images_.get(i)); + } + if (audience_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(24, getAudience()); + } + if (colorInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(25, getColorInfo()); + } + { + int dataSize = 0; + for (int i = 0; i < sizes_.size(); i++) { + dataSize += computeStringSizeNoTag(sizes_.getRaw(i)); + } + size += dataSize; + size += 2 * getSizesList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < materials_.size(); i++) { + dataSize += computeStringSizeNoTag(materials_.getRaw(i)); + } + size += dataSize; + size += 2 * getMaterialsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < patterns_.size(); i++) { + dataSize += computeStringSizeNoTag(patterns_.getRaw(i)); + } + size += dataSize; + size += 2 * getPatternsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < conditions_.size(); i++) { + dataSize += computeStringSizeNoTag(conditions_.getRaw(i)); + } + size += dataSize; + size += 2 * getConditionsList().size(); + } + if (retrievableFields_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(30, getRetrievableFields()); + } + for (int i = 0; i < variants_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(31, variants_.get(i)); + } + if (publishTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(33, getPublishTime()); + } + for (int i = 0; i < promotions_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(34, promotions_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.retail.v2.Product)) { + return super.equals(obj); + } + com.google.cloud.retail.v2.Product other = (com.google.cloud.retail.v2.Product) obj; + + if (!getName().equals(other.getName())) return false; + if (!getId().equals(other.getId())) return false; + if (type_ != other.type_) return false; + if (!getPrimaryProductId().equals(other.getPrimaryProductId())) return false; + if (!getCollectionMemberIdsList().equals(other.getCollectionMemberIdsList())) return false; + if (!getGtin().equals(other.getGtin())) return false; + if (!getCategoriesList().equals(other.getCategoriesList())) return false; + if (!getTitle().equals(other.getTitle())) return false; + if (!getBrandsList().equals(other.getBrandsList())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (!getLanguageCode().equals(other.getLanguageCode())) return false; + if (!internalGetAttributes().equals(other.internalGetAttributes())) return false; + if (!getTagsList().equals(other.getTagsList())) return false; + if (hasPriceInfo() != other.hasPriceInfo()) return false; + if (hasPriceInfo()) { + if (!getPriceInfo().equals(other.getPriceInfo())) return false; + } + if (hasRating() != other.hasRating()) return false; + if (hasRating()) { + if (!getRating().equals(other.getRating())) return false; + } + if (hasAvailableTime() != other.hasAvailableTime()) return false; + if (hasAvailableTime()) { + if (!getAvailableTime().equals(other.getAvailableTime())) return false; + } + if (availability_ != other.availability_) return false; + if (hasAvailableQuantity() != other.hasAvailableQuantity()) return false; + if (hasAvailableQuantity()) { + if (!getAvailableQuantity().equals(other.getAvailableQuantity())) return false; + } + if (!getFulfillmentInfoList().equals(other.getFulfillmentInfoList())) return false; + if (!getUri().equals(other.getUri())) return false; + if (!getImagesList().equals(other.getImagesList())) return false; + if (hasAudience() != other.hasAudience()) return false; + if (hasAudience()) { + if (!getAudience().equals(other.getAudience())) return false; + } + if (hasColorInfo() != other.hasColorInfo()) return false; + if (hasColorInfo()) { + if (!getColorInfo().equals(other.getColorInfo())) return false; + } + if (!getSizesList().equals(other.getSizesList())) return false; + if (!getMaterialsList().equals(other.getMaterialsList())) return false; + if (!getPatternsList().equals(other.getPatternsList())) return false; + if (!getConditionsList().equals(other.getConditionsList())) return false; + if (!getPromotionsList().equals(other.getPromotionsList())) return false; + if (hasPublishTime() != other.hasPublishTime()) return false; + if (hasPublishTime()) { + if (!getPublishTime().equals(other.getPublishTime())) return false; + } + if (hasRetrievableFields() != other.hasRetrievableFields()) return false; + if (hasRetrievableFields()) { + if (!getRetrievableFields().equals(other.getRetrievableFields())) return false; + } + if (!getVariantsList().equals(other.getVariantsList())) return false; + if (!getExpirationCase().equals(other.getExpirationCase())) return false; + switch (expirationCase_) { + case 16: + if (!getExpireTime().equals(other.getExpireTime())) return false; + break; + case 17: + if (!getTtl().equals(other.getTtl())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + hash = (37 * hash) + PRIMARY_PRODUCT_ID_FIELD_NUMBER; + hash = (53 * hash) + getPrimaryProductId().hashCode(); + if (getCollectionMemberIdsCount() > 0) { + hash = (37 * hash) + COLLECTION_MEMBER_IDS_FIELD_NUMBER; + hash = (53 * hash) + getCollectionMemberIdsList().hashCode(); + } + hash = (37 * hash) + GTIN_FIELD_NUMBER; + hash = (53 * hash) + getGtin().hashCode(); + if (getCategoriesCount() > 0) { + hash = (37 * hash) + CATEGORIES_FIELD_NUMBER; + hash = (53 * hash) + getCategoriesList().hashCode(); + } + hash = (37 * hash) + TITLE_FIELD_NUMBER; + hash = (53 * hash) + getTitle().hashCode(); + if (getBrandsCount() > 0) { + hash = (37 * hash) + BRANDS_FIELD_NUMBER; + hash = (53 * hash) + getBrandsList().hashCode(); + } + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + LANGUAGE_CODE_FIELD_NUMBER; + hash = (53 * hash) + getLanguageCode().hashCode(); + if (!internalGetAttributes().getMap().isEmpty()) { + hash = (37 * hash) + ATTRIBUTES_FIELD_NUMBER; + hash = (53 * hash) + internalGetAttributes().hashCode(); + } + if (getTagsCount() > 0) { + hash = (37 * hash) + TAGS_FIELD_NUMBER; + hash = (53 * hash) + getTagsList().hashCode(); + } + if (hasPriceInfo()) { + hash = (37 * hash) + PRICE_INFO_FIELD_NUMBER; + hash = (53 * hash) + getPriceInfo().hashCode(); + } + if (hasRating()) { + hash = (37 * hash) + RATING_FIELD_NUMBER; + hash = (53 * hash) + getRating().hashCode(); + } + if (hasAvailableTime()) { + hash = (37 * hash) + AVAILABLE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getAvailableTime().hashCode(); + } + hash = (37 * hash) + AVAILABILITY_FIELD_NUMBER; + hash = (53 * hash) + availability_; + if (hasAvailableQuantity()) { + hash = (37 * hash) + AVAILABLE_QUANTITY_FIELD_NUMBER; + hash = (53 * hash) + getAvailableQuantity().hashCode(); + } + if (getFulfillmentInfoCount() > 0) { + hash = (37 * hash) + FULFILLMENT_INFO_FIELD_NUMBER; + hash = (53 * hash) + getFulfillmentInfoList().hashCode(); + } + hash = (37 * hash) + URI_FIELD_NUMBER; + hash = (53 * hash) + getUri().hashCode(); + if (getImagesCount() > 0) { + hash = (37 * hash) + IMAGES_FIELD_NUMBER; + hash = (53 * hash) + getImagesList().hashCode(); + } + if (hasAudience()) { + hash = (37 * hash) + AUDIENCE_FIELD_NUMBER; + hash = (53 * hash) + getAudience().hashCode(); + } + if (hasColorInfo()) { + hash = (37 * hash) + COLOR_INFO_FIELD_NUMBER; + hash = (53 * hash) + getColorInfo().hashCode(); + } + if (getSizesCount() > 0) { + hash = (37 * hash) + SIZES_FIELD_NUMBER; + hash = (53 * hash) + getSizesList().hashCode(); + } + if (getMaterialsCount() > 0) { + hash = (37 * hash) + MATERIALS_FIELD_NUMBER; + hash = (53 * hash) + getMaterialsList().hashCode(); + } + if (getPatternsCount() > 0) { + hash = (37 * hash) + PATTERNS_FIELD_NUMBER; + hash = (53 * hash) + getPatternsList().hashCode(); + } + if (getConditionsCount() > 0) { + hash = (37 * hash) + CONDITIONS_FIELD_NUMBER; + hash = (53 * hash) + getConditionsList().hashCode(); + } + if (getPromotionsCount() > 0) { + hash = (37 * hash) + PROMOTIONS_FIELD_NUMBER; + hash = (53 * hash) + getPromotionsList().hashCode(); + } + if (hasPublishTime()) { + hash = (37 * hash) + PUBLISH_TIME_FIELD_NUMBER; + hash = (53 * hash) + getPublishTime().hashCode(); + } + if (hasRetrievableFields()) { + hash = (37 * hash) + RETRIEVABLE_FIELDS_FIELD_NUMBER; + hash = (53 * hash) + getRetrievableFields().hashCode(); + } + if (getVariantsCount() > 0) { + hash = (37 * hash) + VARIANTS_FIELD_NUMBER; + hash = (53 * hash) + getVariantsList().hashCode(); + } + switch (expirationCase_) { + case 16: + hash = (37 * hash) + EXPIRE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getExpireTime().hashCode(); + break; + case 17: + hash = (37 * hash) + TTL_FIELD_NUMBER; + hash = (53 * hash) + getTtl().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2.Product parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.Product parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.Product parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.Product parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.Product parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.Product parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.Product parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.Product parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.Product parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.Product parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.Product parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.Product parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2.Product prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Product captures all metadata information of items to be recommended or
+   * searched.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2.Product} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements @@ -2178,1494 +4306,6334 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { .internal_static_google_cloud_retail_v2_Product_descriptor; } - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField(int number) { - switch (number) { - case 12: - return internalGetAttributes(); - default: - throw new RuntimeException("Invalid map field number: " + number); + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 12: + return internalGetAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 12: + return internalGetMutableAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.ProductProto + .internal_static_google_cloud_retail_v2_Product_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.Product.class, + com.google.cloud.retail.v2.Product.Builder.class); + } + + // Construct using com.google.cloud.retail.v2.Product.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getFulfillmentInfoFieldBuilder(); + getImagesFieldBuilder(); + getPromotionsFieldBuilder(); + getVariantsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + id_ = ""; + + type_ = 0; + + primaryProductId_ = ""; + + collectionMemberIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + gtin_ = ""; + + categories_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + title_ = ""; + + brands_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + description_ = ""; + + languageCode_ = ""; + + internalGetMutableAttributes().clear(); + tags_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000010); + if (priceInfoBuilder_ == null) { + priceInfo_ = null; + } else { + priceInfo_ = null; + priceInfoBuilder_ = null; + } + if (ratingBuilder_ == null) { + rating_ = null; + } else { + rating_ = null; + ratingBuilder_ = null; + } + if (availableTimeBuilder_ == null) { + availableTime_ = null; + } else { + availableTime_ = null; + availableTimeBuilder_ = null; + } + availability_ = 0; + + if (availableQuantityBuilder_ == null) { + availableQuantity_ = null; + } else { + availableQuantity_ = null; + availableQuantityBuilder_ = null; + } + if (fulfillmentInfoBuilder_ == null) { + fulfillmentInfo_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + } else { + fulfillmentInfoBuilder_.clear(); + } + uri_ = ""; + + if (imagesBuilder_ == null) { + images_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040); + } else { + imagesBuilder_.clear(); + } + if (audienceBuilder_ == null) { + audience_ = null; + } else { + audience_ = null; + audienceBuilder_ = null; + } + if (colorInfoBuilder_ == null) { + colorInfo_ = null; + } else { + colorInfo_ = null; + colorInfoBuilder_ = null; + } + sizes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000080); + materials_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000100); + patterns_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000200); + conditions_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000400); + if (promotionsBuilder_ == null) { + promotions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000800); + } else { + promotionsBuilder_.clear(); + } + if (publishTimeBuilder_ == null) { + publishTime_ = null; + } else { + publishTime_ = null; + publishTimeBuilder_ = null; + } + if (retrievableFieldsBuilder_ == null) { + retrievableFields_ = null; + } else { + retrievableFields_ = null; + retrievableFieldsBuilder_ = null; + } + if (variantsBuilder_ == null) { + variants_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00001000); + } else { + variantsBuilder_.clear(); + } + expirationCase_ = 0; + expiration_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2.ProductProto + .internal_static_google_cloud_retail_v2_Product_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2.Product getDefaultInstanceForType() { + return com.google.cloud.retail.v2.Product.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2.Product build() { + com.google.cloud.retail.v2.Product result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2.Product buildPartial() { + com.google.cloud.retail.v2.Product result = new com.google.cloud.retail.v2.Product(this); + int from_bitField0_ = bitField0_; + if (expirationCase_ == 16) { + if (expireTimeBuilder_ == null) { + result.expiration_ = expiration_; + } else { + result.expiration_ = expireTimeBuilder_.build(); + } + } + if (expirationCase_ == 17) { + if (ttlBuilder_ == null) { + result.expiration_ = expiration_; + } else { + result.expiration_ = ttlBuilder_.build(); + } + } + result.name_ = name_; + result.id_ = id_; + result.type_ = type_; + result.primaryProductId_ = primaryProductId_; + if (((bitField0_ & 0x00000001) != 0)) { + collectionMemberIds_ = collectionMemberIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.collectionMemberIds_ = collectionMemberIds_; + result.gtin_ = gtin_; + if (((bitField0_ & 0x00000002) != 0)) { + categories_ = categories_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.categories_ = categories_; + result.title_ = title_; + if (((bitField0_ & 0x00000004) != 0)) { + brands_ = brands_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.brands_ = brands_; + result.description_ = description_; + result.languageCode_ = languageCode_; + result.attributes_ = internalGetAttributes(); + result.attributes_.makeImmutable(); + if (((bitField0_ & 0x00000010) != 0)) { + tags_ = tags_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.tags_ = tags_; + if (priceInfoBuilder_ == null) { + result.priceInfo_ = priceInfo_; + } else { + result.priceInfo_ = priceInfoBuilder_.build(); + } + if (ratingBuilder_ == null) { + result.rating_ = rating_; + } else { + result.rating_ = ratingBuilder_.build(); + } + if (availableTimeBuilder_ == null) { + result.availableTime_ = availableTime_; + } else { + result.availableTime_ = availableTimeBuilder_.build(); + } + result.availability_ = availability_; + if (availableQuantityBuilder_ == null) { + result.availableQuantity_ = availableQuantity_; + } else { + result.availableQuantity_ = availableQuantityBuilder_.build(); + } + if (fulfillmentInfoBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0)) { + fulfillmentInfo_ = java.util.Collections.unmodifiableList(fulfillmentInfo_); + bitField0_ = (bitField0_ & ~0x00000020); + } + result.fulfillmentInfo_ = fulfillmentInfo_; + } else { + result.fulfillmentInfo_ = fulfillmentInfoBuilder_.build(); + } + result.uri_ = uri_; + if (imagesBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0)) { + images_ = java.util.Collections.unmodifiableList(images_); + bitField0_ = (bitField0_ & ~0x00000040); + } + result.images_ = images_; + } else { + result.images_ = imagesBuilder_.build(); + } + if (audienceBuilder_ == null) { + result.audience_ = audience_; + } else { + result.audience_ = audienceBuilder_.build(); + } + if (colorInfoBuilder_ == null) { + result.colorInfo_ = colorInfo_; + } else { + result.colorInfo_ = colorInfoBuilder_.build(); + } + if (((bitField0_ & 0x00000080) != 0)) { + sizes_ = sizes_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000080); + } + result.sizes_ = sizes_; + if (((bitField0_ & 0x00000100) != 0)) { + materials_ = materials_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000100); + } + result.materials_ = materials_; + if (((bitField0_ & 0x00000200) != 0)) { + patterns_ = patterns_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000200); + } + result.patterns_ = patterns_; + if (((bitField0_ & 0x00000400) != 0)) { + conditions_ = conditions_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000400); + } + result.conditions_ = conditions_; + if (promotionsBuilder_ == null) { + if (((bitField0_ & 0x00000800) != 0)) { + promotions_ = java.util.Collections.unmodifiableList(promotions_); + bitField0_ = (bitField0_ & ~0x00000800); + } + result.promotions_ = promotions_; + } else { + result.promotions_ = promotionsBuilder_.build(); + } + if (publishTimeBuilder_ == null) { + result.publishTime_ = publishTime_; + } else { + result.publishTime_ = publishTimeBuilder_.build(); + } + if (retrievableFieldsBuilder_ == null) { + result.retrievableFields_ = retrievableFields_; + } else { + result.retrievableFields_ = retrievableFieldsBuilder_.build(); + } + if (variantsBuilder_ == null) { + if (((bitField0_ & 0x00001000) != 0)) { + variants_ = java.util.Collections.unmodifiableList(variants_); + bitField0_ = (bitField0_ & ~0x00001000); + } + result.variants_ = variants_; + } else { + result.variants_ = variantsBuilder_.build(); + } + result.expirationCase_ = expirationCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.retail.v2.Product) { + return mergeFrom((com.google.cloud.retail.v2.Product) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2.Product other) { + if (other == com.google.cloud.retail.v2.Product.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getId().isEmpty()) { + id_ = other.id_; + onChanged(); + } + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (!other.getPrimaryProductId().isEmpty()) { + primaryProductId_ = other.primaryProductId_; + onChanged(); + } + if (!other.collectionMemberIds_.isEmpty()) { + if (collectionMemberIds_.isEmpty()) { + collectionMemberIds_ = other.collectionMemberIds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureCollectionMemberIdsIsMutable(); + collectionMemberIds_.addAll(other.collectionMemberIds_); + } + onChanged(); + } + if (!other.getGtin().isEmpty()) { + gtin_ = other.gtin_; + onChanged(); + } + if (!other.categories_.isEmpty()) { + if (categories_.isEmpty()) { + categories_ = other.categories_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureCategoriesIsMutable(); + categories_.addAll(other.categories_); + } + onChanged(); + } + if (!other.getTitle().isEmpty()) { + title_ = other.title_; + onChanged(); + } + if (!other.brands_.isEmpty()) { + if (brands_.isEmpty()) { + brands_ = other.brands_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureBrandsIsMutable(); + brands_.addAll(other.brands_); + } + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (!other.getLanguageCode().isEmpty()) { + languageCode_ = other.languageCode_; + onChanged(); + } + internalGetMutableAttributes().mergeFrom(other.internalGetAttributes()); + if (!other.tags_.isEmpty()) { + if (tags_.isEmpty()) { + tags_ = other.tags_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureTagsIsMutable(); + tags_.addAll(other.tags_); + } + onChanged(); + } + if (other.hasPriceInfo()) { + mergePriceInfo(other.getPriceInfo()); + } + if (other.hasRating()) { + mergeRating(other.getRating()); + } + if (other.hasAvailableTime()) { + mergeAvailableTime(other.getAvailableTime()); + } + if (other.availability_ != 0) { + setAvailabilityValue(other.getAvailabilityValue()); + } + if (other.hasAvailableQuantity()) { + mergeAvailableQuantity(other.getAvailableQuantity()); + } + if (fulfillmentInfoBuilder_ == null) { + if (!other.fulfillmentInfo_.isEmpty()) { + if (fulfillmentInfo_.isEmpty()) { + fulfillmentInfo_ = other.fulfillmentInfo_; + bitField0_ = (bitField0_ & ~0x00000020); + } else { + ensureFulfillmentInfoIsMutable(); + fulfillmentInfo_.addAll(other.fulfillmentInfo_); + } + onChanged(); + } + } else { + if (!other.fulfillmentInfo_.isEmpty()) { + if (fulfillmentInfoBuilder_.isEmpty()) { + fulfillmentInfoBuilder_.dispose(); + fulfillmentInfoBuilder_ = null; + fulfillmentInfo_ = other.fulfillmentInfo_; + bitField0_ = (bitField0_ & ~0x00000020); + fulfillmentInfoBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getFulfillmentInfoFieldBuilder() + : null; + } else { + fulfillmentInfoBuilder_.addAllMessages(other.fulfillmentInfo_); + } + } + } + if (!other.getUri().isEmpty()) { + uri_ = other.uri_; + onChanged(); + } + if (imagesBuilder_ == null) { + if (!other.images_.isEmpty()) { + if (images_.isEmpty()) { + images_ = other.images_; + bitField0_ = (bitField0_ & ~0x00000040); + } else { + ensureImagesIsMutable(); + images_.addAll(other.images_); + } + onChanged(); + } + } else { + if (!other.images_.isEmpty()) { + if (imagesBuilder_.isEmpty()) { + imagesBuilder_.dispose(); + imagesBuilder_ = null; + images_ = other.images_; + bitField0_ = (bitField0_ & ~0x00000040); + imagesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getImagesFieldBuilder() + : null; + } else { + imagesBuilder_.addAllMessages(other.images_); + } + } + } + if (other.hasAudience()) { + mergeAudience(other.getAudience()); + } + if (other.hasColorInfo()) { + mergeColorInfo(other.getColorInfo()); + } + if (!other.sizes_.isEmpty()) { + if (sizes_.isEmpty()) { + sizes_ = other.sizes_; + bitField0_ = (bitField0_ & ~0x00000080); + } else { + ensureSizesIsMutable(); + sizes_.addAll(other.sizes_); + } + onChanged(); + } + if (!other.materials_.isEmpty()) { + if (materials_.isEmpty()) { + materials_ = other.materials_; + bitField0_ = (bitField0_ & ~0x00000100); + } else { + ensureMaterialsIsMutable(); + materials_.addAll(other.materials_); + } + onChanged(); + } + if (!other.patterns_.isEmpty()) { + if (patterns_.isEmpty()) { + patterns_ = other.patterns_; + bitField0_ = (bitField0_ & ~0x00000200); + } else { + ensurePatternsIsMutable(); + patterns_.addAll(other.patterns_); + } + onChanged(); + } + if (!other.conditions_.isEmpty()) { + if (conditions_.isEmpty()) { + conditions_ = other.conditions_; + bitField0_ = (bitField0_ & ~0x00000400); + } else { + ensureConditionsIsMutable(); + conditions_.addAll(other.conditions_); + } + onChanged(); + } + if (promotionsBuilder_ == null) { + if (!other.promotions_.isEmpty()) { + if (promotions_.isEmpty()) { + promotions_ = other.promotions_; + bitField0_ = (bitField0_ & ~0x00000800); + } else { + ensurePromotionsIsMutable(); + promotions_.addAll(other.promotions_); + } + onChanged(); + } + } else { + if (!other.promotions_.isEmpty()) { + if (promotionsBuilder_.isEmpty()) { + promotionsBuilder_.dispose(); + promotionsBuilder_ = null; + promotions_ = other.promotions_; + bitField0_ = (bitField0_ & ~0x00000800); + promotionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getPromotionsFieldBuilder() + : null; + } else { + promotionsBuilder_.addAllMessages(other.promotions_); + } + } + } + if (other.hasPublishTime()) { + mergePublishTime(other.getPublishTime()); + } + if (other.hasRetrievableFields()) { + mergeRetrievableFields(other.getRetrievableFields()); + } + if (variantsBuilder_ == null) { + if (!other.variants_.isEmpty()) { + if (variants_.isEmpty()) { + variants_ = other.variants_; + bitField0_ = (bitField0_ & ~0x00001000); + } else { + ensureVariantsIsMutable(); + variants_.addAll(other.variants_); + } + onChanged(); + } + } else { + if (!other.variants_.isEmpty()) { + if (variantsBuilder_.isEmpty()) { + variantsBuilder_.dispose(); + variantsBuilder_ = null; + variants_ = other.variants_; + bitField0_ = (bitField0_ & ~0x00001000); + variantsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getVariantsFieldBuilder() + : null; + } else { + variantsBuilder_.addAllMessages(other.variants_); + } + } + } + switch (other.getExpirationCase()) { + case EXPIRE_TIME: + { + mergeExpireTime(other.getExpireTime()); + break; + } + case TTL: + { + mergeTtl(other.getTtl()); + break; + } + case EXPIRATION_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.retail.v2.Product parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2.Product) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int expirationCase_ = 0; + private java.lang.Object expiration_; + + public ExpirationCase getExpirationCase() { + return ExpirationCase.forNumber(expirationCase_); + } + + public Builder clearExpiration() { + expirationCase_ = 0; + expiration_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + expireTimeBuilder_; + /** + * + * + *
+     * The timestamp when this product becomes unavailable for
+     * [SearchService.Search][google.cloud.retail.v2.SearchService.Search].
+     * If it is set, the [Product][google.cloud.retail.v2.Product] is not
+     * available for
+     * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] after
+     * [expire_time][google.cloud.retail.v2.Product.expire_time]. However, the
+     * product can still be retrieved by
+     * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]
+     * and
+     * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].
+     * Google Merchant Center property
+     * [expiration_date](https://support.google.com/merchants/answer/6324499).
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 16; + * + * @return Whether the expireTime field is set. + */ + @java.lang.Override + public boolean hasExpireTime() { + return expirationCase_ == 16; + } + /** + * + * + *
+     * The timestamp when this product becomes unavailable for
+     * [SearchService.Search][google.cloud.retail.v2.SearchService.Search].
+     * If it is set, the [Product][google.cloud.retail.v2.Product] is not
+     * available for
+     * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] after
+     * [expire_time][google.cloud.retail.v2.Product.expire_time]. However, the
+     * product can still be retrieved by
+     * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]
+     * and
+     * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].
+     * Google Merchant Center property
+     * [expiration_date](https://support.google.com/merchants/answer/6324499).
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 16; + * + * @return The expireTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getExpireTime() { + if (expireTimeBuilder_ == null) { + if (expirationCase_ == 16) { + return (com.google.protobuf.Timestamp) expiration_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } else { + if (expirationCase_ == 16) { + return expireTimeBuilder_.getMessage(); + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + } + /** + * + * + *
+     * The timestamp when this product becomes unavailable for
+     * [SearchService.Search][google.cloud.retail.v2.SearchService.Search].
+     * If it is set, the [Product][google.cloud.retail.v2.Product] is not
+     * available for
+     * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] after
+     * [expire_time][google.cloud.retail.v2.Product.expire_time]. However, the
+     * product can still be retrieved by
+     * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]
+     * and
+     * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].
+     * Google Merchant Center property
+     * [expiration_date](https://support.google.com/merchants/answer/6324499).
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 16; + */ + public Builder setExpireTime(com.google.protobuf.Timestamp value) { + if (expireTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + expiration_ = value; + onChanged(); + } else { + expireTimeBuilder_.setMessage(value); + } + expirationCase_ = 16; + return this; + } + /** + * + * + *
+     * The timestamp when this product becomes unavailable for
+     * [SearchService.Search][google.cloud.retail.v2.SearchService.Search].
+     * If it is set, the [Product][google.cloud.retail.v2.Product] is not
+     * available for
+     * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] after
+     * [expire_time][google.cloud.retail.v2.Product.expire_time]. However, the
+     * product can still be retrieved by
+     * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]
+     * and
+     * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].
+     * Google Merchant Center property
+     * [expiration_date](https://support.google.com/merchants/answer/6324499).
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 16; + */ + public Builder setExpireTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (expireTimeBuilder_ == null) { + expiration_ = builderForValue.build(); + onChanged(); + } else { + expireTimeBuilder_.setMessage(builderForValue.build()); + } + expirationCase_ = 16; + return this; + } + /** + * + * + *
+     * The timestamp when this product becomes unavailable for
+     * [SearchService.Search][google.cloud.retail.v2.SearchService.Search].
+     * If it is set, the [Product][google.cloud.retail.v2.Product] is not
+     * available for
+     * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] after
+     * [expire_time][google.cloud.retail.v2.Product.expire_time]. However, the
+     * product can still be retrieved by
+     * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]
+     * and
+     * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].
+     * Google Merchant Center property
+     * [expiration_date](https://support.google.com/merchants/answer/6324499).
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 16; + */ + public Builder mergeExpireTime(com.google.protobuf.Timestamp value) { + if (expireTimeBuilder_ == null) { + if (expirationCase_ == 16 + && expiration_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + expiration_ = + com.google.protobuf.Timestamp.newBuilder((com.google.protobuf.Timestamp) expiration_) + .mergeFrom(value) + .buildPartial(); + } else { + expiration_ = value; + } + onChanged(); + } else { + if (expirationCase_ == 16) { + expireTimeBuilder_.mergeFrom(value); + } + expireTimeBuilder_.setMessage(value); + } + expirationCase_ = 16; + return this; + } + /** + * + * + *
+     * The timestamp when this product becomes unavailable for
+     * [SearchService.Search][google.cloud.retail.v2.SearchService.Search].
+     * If it is set, the [Product][google.cloud.retail.v2.Product] is not
+     * available for
+     * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] after
+     * [expire_time][google.cloud.retail.v2.Product.expire_time]. However, the
+     * product can still be retrieved by
+     * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]
+     * and
+     * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].
+     * Google Merchant Center property
+     * [expiration_date](https://support.google.com/merchants/answer/6324499).
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 16; + */ + public Builder clearExpireTime() { + if (expireTimeBuilder_ == null) { + if (expirationCase_ == 16) { + expirationCase_ = 0; + expiration_ = null; + onChanged(); + } + } else { + if (expirationCase_ == 16) { + expirationCase_ = 0; + expiration_ = null; + } + expireTimeBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The timestamp when this product becomes unavailable for
+     * [SearchService.Search][google.cloud.retail.v2.SearchService.Search].
+     * If it is set, the [Product][google.cloud.retail.v2.Product] is not
+     * available for
+     * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] after
+     * [expire_time][google.cloud.retail.v2.Product.expire_time]. However, the
+     * product can still be retrieved by
+     * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]
+     * and
+     * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].
+     * Google Merchant Center property
+     * [expiration_date](https://support.google.com/merchants/answer/6324499).
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 16; + */ + public com.google.protobuf.Timestamp.Builder getExpireTimeBuilder() { + return getExpireTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The timestamp when this product becomes unavailable for
+     * [SearchService.Search][google.cloud.retail.v2.SearchService.Search].
+     * If it is set, the [Product][google.cloud.retail.v2.Product] is not
+     * available for
+     * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] after
+     * [expire_time][google.cloud.retail.v2.Product.expire_time]. However, the
+     * product can still be retrieved by
+     * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]
+     * and
+     * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].
+     * Google Merchant Center property
+     * [expiration_date](https://support.google.com/merchants/answer/6324499).
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 16; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { + if ((expirationCase_ == 16) && (expireTimeBuilder_ != null)) { + return expireTimeBuilder_.getMessageOrBuilder(); + } else { + if (expirationCase_ == 16) { + return (com.google.protobuf.Timestamp) expiration_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + } + /** + * + * + *
+     * The timestamp when this product becomes unavailable for
+     * [SearchService.Search][google.cloud.retail.v2.SearchService.Search].
+     * If it is set, the [Product][google.cloud.retail.v2.Product] is not
+     * available for
+     * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] after
+     * [expire_time][google.cloud.retail.v2.Product.expire_time]. However, the
+     * product can still be retrieved by
+     * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]
+     * and
+     * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].
+     * Google Merchant Center property
+     * [expiration_date](https://support.google.com/merchants/answer/6324499).
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 16; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getExpireTimeFieldBuilder() { + if (expireTimeBuilder_ == null) { + if (!(expirationCase_ == 16)) { + expiration_ = com.google.protobuf.Timestamp.getDefaultInstance(); + } + expireTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + (com.google.protobuf.Timestamp) expiration_, getParentForChildren(), isClean()); + expiration_ = null; + } + expirationCase_ = 16; + onChanged(); + ; + return expireTimeBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + ttlBuilder_; + /** + * + * + *
+     * Input only. The TTL (time to live) of the product.
+     * If it is set, [expire_time][google.cloud.retail.v2.Product.expire_time]
+     * is set as current timestamp plus
+     * [ttl][google.cloud.retail.v2.Product.ttl]. The derived
+     * [expire_time][google.cloud.retail.v2.Product.expire_time] is returned in
+     * the output and [ttl][google.cloud.retail.v2.Product.ttl] is left blank
+     * when retrieving the [Product][google.cloud.retail.v2.Product].
+     * If it is set, the product is not available for
+     * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] after
+     * current timestamp plus [ttl][google.cloud.retail.v2.Product.ttl].
+     * However, the product can still be retrieved by
+     * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]
+     * and
+     * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].
+     * 
+ * + * .google.protobuf.Duration ttl = 17 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return Whether the ttl field is set. + */ + @java.lang.Override + public boolean hasTtl() { + return expirationCase_ == 17; + } + /** + * + * + *
+     * Input only. The TTL (time to live) of the product.
+     * If it is set, [expire_time][google.cloud.retail.v2.Product.expire_time]
+     * is set as current timestamp plus
+     * [ttl][google.cloud.retail.v2.Product.ttl]. The derived
+     * [expire_time][google.cloud.retail.v2.Product.expire_time] is returned in
+     * the output and [ttl][google.cloud.retail.v2.Product.ttl] is left blank
+     * when retrieving the [Product][google.cloud.retail.v2.Product].
+     * If it is set, the product is not available for
+     * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] after
+     * current timestamp plus [ttl][google.cloud.retail.v2.Product.ttl].
+     * However, the product can still be retrieved by
+     * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]
+     * and
+     * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].
+     * 
+ * + * .google.protobuf.Duration ttl = 17 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return The ttl. + */ + @java.lang.Override + public com.google.protobuf.Duration getTtl() { + if (ttlBuilder_ == null) { + if (expirationCase_ == 17) { + return (com.google.protobuf.Duration) expiration_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } else { + if (expirationCase_ == 17) { + return ttlBuilder_.getMessage(); + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + } + /** + * + * + *
+     * Input only. The TTL (time to live) of the product.
+     * If it is set, [expire_time][google.cloud.retail.v2.Product.expire_time]
+     * is set as current timestamp plus
+     * [ttl][google.cloud.retail.v2.Product.ttl]. The derived
+     * [expire_time][google.cloud.retail.v2.Product.expire_time] is returned in
+     * the output and [ttl][google.cloud.retail.v2.Product.ttl] is left blank
+     * when retrieving the [Product][google.cloud.retail.v2.Product].
+     * If it is set, the product is not available for
+     * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] after
+     * current timestamp plus [ttl][google.cloud.retail.v2.Product.ttl].
+     * However, the product can still be retrieved by
+     * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]
+     * and
+     * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].
+     * 
+ * + * .google.protobuf.Duration ttl = 17 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + public Builder setTtl(com.google.protobuf.Duration value) { + if (ttlBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + expiration_ = value; + onChanged(); + } else { + ttlBuilder_.setMessage(value); + } + expirationCase_ = 17; + return this; + } + /** + * + * + *
+     * Input only. The TTL (time to live) of the product.
+     * If it is set, [expire_time][google.cloud.retail.v2.Product.expire_time]
+     * is set as current timestamp plus
+     * [ttl][google.cloud.retail.v2.Product.ttl]. The derived
+     * [expire_time][google.cloud.retail.v2.Product.expire_time] is returned in
+     * the output and [ttl][google.cloud.retail.v2.Product.ttl] is left blank
+     * when retrieving the [Product][google.cloud.retail.v2.Product].
+     * If it is set, the product is not available for
+     * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] after
+     * current timestamp plus [ttl][google.cloud.retail.v2.Product.ttl].
+     * However, the product can still be retrieved by
+     * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]
+     * and
+     * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].
+     * 
+ * + * .google.protobuf.Duration ttl = 17 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + public Builder setTtl(com.google.protobuf.Duration.Builder builderForValue) { + if (ttlBuilder_ == null) { + expiration_ = builderForValue.build(); + onChanged(); + } else { + ttlBuilder_.setMessage(builderForValue.build()); + } + expirationCase_ = 17; + return this; + } + /** + * + * + *
+     * Input only. The TTL (time to live) of the product.
+     * If it is set, [expire_time][google.cloud.retail.v2.Product.expire_time]
+     * is set as current timestamp plus
+     * [ttl][google.cloud.retail.v2.Product.ttl]. The derived
+     * [expire_time][google.cloud.retail.v2.Product.expire_time] is returned in
+     * the output and [ttl][google.cloud.retail.v2.Product.ttl] is left blank
+     * when retrieving the [Product][google.cloud.retail.v2.Product].
+     * If it is set, the product is not available for
+     * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] after
+     * current timestamp plus [ttl][google.cloud.retail.v2.Product.ttl].
+     * However, the product can still be retrieved by
+     * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]
+     * and
+     * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].
+     * 
+ * + * .google.protobuf.Duration ttl = 17 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + public Builder mergeTtl(com.google.protobuf.Duration value) { + if (ttlBuilder_ == null) { + if (expirationCase_ == 17 + && expiration_ != com.google.protobuf.Duration.getDefaultInstance()) { + expiration_ = + com.google.protobuf.Duration.newBuilder((com.google.protobuf.Duration) expiration_) + .mergeFrom(value) + .buildPartial(); + } else { + expiration_ = value; + } + onChanged(); + } else { + if (expirationCase_ == 17) { + ttlBuilder_.mergeFrom(value); + } + ttlBuilder_.setMessage(value); + } + expirationCase_ = 17; + return this; + } + /** + * + * + *
+     * Input only. The TTL (time to live) of the product.
+     * If it is set, [expire_time][google.cloud.retail.v2.Product.expire_time]
+     * is set as current timestamp plus
+     * [ttl][google.cloud.retail.v2.Product.ttl]. The derived
+     * [expire_time][google.cloud.retail.v2.Product.expire_time] is returned in
+     * the output and [ttl][google.cloud.retail.v2.Product.ttl] is left blank
+     * when retrieving the [Product][google.cloud.retail.v2.Product].
+     * If it is set, the product is not available for
+     * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] after
+     * current timestamp plus [ttl][google.cloud.retail.v2.Product.ttl].
+     * However, the product can still be retrieved by
+     * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]
+     * and
+     * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].
+     * 
+ * + * .google.protobuf.Duration ttl = 17 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + public Builder clearTtl() { + if (ttlBuilder_ == null) { + if (expirationCase_ == 17) { + expirationCase_ = 0; + expiration_ = null; + onChanged(); + } + } else { + if (expirationCase_ == 17) { + expirationCase_ = 0; + expiration_ = null; + } + ttlBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Input only. The TTL (time to live) of the product.
+     * If it is set, [expire_time][google.cloud.retail.v2.Product.expire_time]
+     * is set as current timestamp plus
+     * [ttl][google.cloud.retail.v2.Product.ttl]. The derived
+     * [expire_time][google.cloud.retail.v2.Product.expire_time] is returned in
+     * the output and [ttl][google.cloud.retail.v2.Product.ttl] is left blank
+     * when retrieving the [Product][google.cloud.retail.v2.Product].
+     * If it is set, the product is not available for
+     * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] after
+     * current timestamp plus [ttl][google.cloud.retail.v2.Product.ttl].
+     * However, the product can still be retrieved by
+     * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]
+     * and
+     * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].
+     * 
+ * + * .google.protobuf.Duration ttl = 17 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + public com.google.protobuf.Duration.Builder getTtlBuilder() { + return getTtlFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Input only. The TTL (time to live) of the product.
+     * If it is set, [expire_time][google.cloud.retail.v2.Product.expire_time]
+     * is set as current timestamp plus
+     * [ttl][google.cloud.retail.v2.Product.ttl]. The derived
+     * [expire_time][google.cloud.retail.v2.Product.expire_time] is returned in
+     * the output and [ttl][google.cloud.retail.v2.Product.ttl] is left blank
+     * when retrieving the [Product][google.cloud.retail.v2.Product].
+     * If it is set, the product is not available for
+     * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] after
+     * current timestamp plus [ttl][google.cloud.retail.v2.Product.ttl].
+     * However, the product can still be retrieved by
+     * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]
+     * and
+     * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].
+     * 
+ * + * .google.protobuf.Duration ttl = 17 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getTtlOrBuilder() { + if ((expirationCase_ == 17) && (ttlBuilder_ != null)) { + return ttlBuilder_.getMessageOrBuilder(); + } else { + if (expirationCase_ == 17) { + return (com.google.protobuf.Duration) expiration_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + } + /** + * + * + *
+     * Input only. The TTL (time to live) of the product.
+     * If it is set, [expire_time][google.cloud.retail.v2.Product.expire_time]
+     * is set as current timestamp plus
+     * [ttl][google.cloud.retail.v2.Product.ttl]. The derived
+     * [expire_time][google.cloud.retail.v2.Product.expire_time] is returned in
+     * the output and [ttl][google.cloud.retail.v2.Product.ttl] is left blank
+     * when retrieving the [Product][google.cloud.retail.v2.Product].
+     * If it is set, the product is not available for
+     * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] after
+     * current timestamp plus [ttl][google.cloud.retail.v2.Product.ttl].
+     * However, the product can still be retrieved by
+     * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]
+     * and
+     * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].
+     * 
+ * + * .google.protobuf.Duration ttl = 17 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getTtlFieldBuilder() { + if (ttlBuilder_ == null) { + if (!(expirationCase_ == 17)) { + expiration_ = com.google.protobuf.Duration.getDefaultInstance(); + } + ttlBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + (com.google.protobuf.Duration) expiration_, getParentForChildren(), isClean()); + expiration_ = null; + } + expirationCase_ = 17; + onChanged(); + ; + return ttlBuilder_; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Immutable. Full resource name of the product, such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/product_id`.
+     * The branch ID must be "default_branch".
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Immutable. Full resource name of the product, such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/product_id`.
+     * The branch ID must be "default_branch".
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Immutable. Full resource name of the product, such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/product_id`.
+     * The branch ID must be "default_branch".
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. Full resource name of the product, such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/product_id`.
+     * The branch ID must be "default_branch".
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. Full resource name of the product, such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/product_id`.
+     * The branch ID must be "default_branch".
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object id_ = ""; + /** + * + * + *
+     * Immutable. [Product][google.cloud.retail.v2.Product] identifier, which is
+     * the final component of [name][google.cloud.retail.v2.Product.name]. For
+     * example, this field is "id_1", if
+     * [name][google.cloud.retail.v2.Product.name] is
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/id_1`.
+     * 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
+     * [id](https://support.google.com/merchants/answer/6324405). Schema.org
+     * Property [Product.sku](https://schema.org/sku).
+     * 
+ * + * string id = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The id. + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Immutable. [Product][google.cloud.retail.v2.Product] identifier, which is
+     * the final component of [name][google.cloud.retail.v2.Product.name]. For
+     * example, this field is "id_1", if
+     * [name][google.cloud.retail.v2.Product.name] is
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/id_1`.
+     * 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
+     * [id](https://support.google.com/merchants/answer/6324405). Schema.org
+     * Property [Product.sku](https://schema.org/sku).
+     * 
+ * + * string id = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for id. + */ + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Immutable. [Product][google.cloud.retail.v2.Product] identifier, which is
+     * the final component of [name][google.cloud.retail.v2.Product.name]. For
+     * example, this field is "id_1", if
+     * [name][google.cloud.retail.v2.Product.name] is
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/id_1`.
+     * 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
+     * [id](https://support.google.com/merchants/answer/6324405). Schema.org
+     * Property [Product.sku](https://schema.org/sku).
+     * 
+ * + * string id = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + id_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. [Product][google.cloud.retail.v2.Product] identifier, which is
+     * the final component of [name][google.cloud.retail.v2.Product.name]. For
+     * example, this field is "id_1", if
+     * [name][google.cloud.retail.v2.Product.name] is
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/id_1`.
+     * 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
+     * [id](https://support.google.com/merchants/answer/6324405). Schema.org
+     * Property [Product.sku](https://schema.org/sku).
+     * 
+ * + * string id = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearId() { + + id_ = getDefaultInstance().getId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. [Product][google.cloud.retail.v2.Product] identifier, which is
+     * the final component of [name][google.cloud.retail.v2.Product.name]. For
+     * example, this field is "id_1", if
+     * [name][google.cloud.retail.v2.Product.name] is
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/id_1`.
+     * 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
+     * [id](https://support.google.com/merchants/answer/6324405). Schema.org
+     * Property [Product.sku](https://schema.org/sku).
+     * 
+ * + * string id = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The bytes for id to set. + * @return This builder for chaining. + */ + public Builder setIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + id_ = value; + onChanged(); + return this; + } + + private int type_ = 0; + /** + * + * + *
+     * Immutable. The type of the product. Default to
+     * [Catalog.product_level_config.ingestion_product_type][google.cloud.retail.v2.ProductLevelConfig.ingestion_product_type]
+     * if unset.
+     * 
+ * + * + * .google.cloud.retail.v2.Product.Type type = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + /** + * + * + *
+     * Immutable. The type of the product. Default to
+     * [Catalog.product_level_config.ingestion_product_type][google.cloud.retail.v2.ProductLevelConfig.ingestion_product_type]
+     * if unset.
+     * 
+ * + * + * .google.cloud.retail.v2.Product.Type type = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + + type_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The type of the product. Default to
+     * [Catalog.product_level_config.ingestion_product_type][google.cloud.retail.v2.ProductLevelConfig.ingestion_product_type]
+     * if unset.
+     * 
+ * + * + * .google.cloud.retail.v2.Product.Type type = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.retail.v2.Product.Type getType() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2.Product.Type result = + com.google.cloud.retail.v2.Product.Type.valueOf(type_); + return result == null ? com.google.cloud.retail.v2.Product.Type.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Immutable. The type of the product. Default to
+     * [Catalog.product_level_config.ingestion_product_type][google.cloud.retail.v2.ProductLevelConfig.ingestion_product_type]
+     * if unset.
+     * 
+ * + * + * .google.cloud.retail.v2.Product.Type type = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(com.google.cloud.retail.v2.Product.Type value) { + if (value == null) { + throw new NullPointerException(); + } + + type_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The type of the product. Default to
+     * [Catalog.product_level_config.ingestion_product_type][google.cloud.retail.v2.ProductLevelConfig.ingestion_product_type]
+     * if unset.
+     * 
+ * + * + * .google.cloud.retail.v2.Product.Type type = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearType() { + + type_ = 0; + onChanged(); + return this; + } + + private java.lang.Object primaryProductId_ = ""; + /** + * + * + *
+     * Variant group identifier. Must be an
+     * [id][google.cloud.retail.v2.Product.id], with the same parent branch with
+     * this product. Otherwise, an error is thrown.
+     * For [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product]s, this field can only be empty or
+     * set to the same value as [id][google.cloud.retail.v2.Product.id].
+     * For VARIANT [Product][google.cloud.retail.v2.Product]s, this field cannot
+     * be empty. A maximum of 2,000 products are allowed to share the same
+     * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product]. Otherwise, an INVALID_ARGUMENT
+     * error is returned.
+     * Google Merchant Center Property
+     * [item_group_id](https://support.google.com/merchants/answer/6324507).
+     * 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; + * + * @return The primaryProductId. + */ + public java.lang.String getPrimaryProductId() { + java.lang.Object ref = primaryProductId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + primaryProductId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Variant group identifier. Must be an
+     * [id][google.cloud.retail.v2.Product.id], with the same parent branch with
+     * this product. Otherwise, an error is thrown.
+     * For [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product]s, this field can only be empty or
+     * set to the same value as [id][google.cloud.retail.v2.Product.id].
+     * For VARIANT [Product][google.cloud.retail.v2.Product]s, this field cannot
+     * be empty. A maximum of 2,000 products are allowed to share the same
+     * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product]. Otherwise, an INVALID_ARGUMENT
+     * error is returned.
+     * Google Merchant Center Property
+     * [item_group_id](https://support.google.com/merchants/answer/6324507).
+     * 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; + * + * @return The bytes for primaryProductId. + */ + public com.google.protobuf.ByteString getPrimaryProductIdBytes() { + java.lang.Object ref = primaryProductId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + primaryProductId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Variant group identifier. Must be an
+     * [id][google.cloud.retail.v2.Product.id], with the same parent branch with
+     * this product. Otherwise, an error is thrown.
+     * For [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product]s, this field can only be empty or
+     * set to the same value as [id][google.cloud.retail.v2.Product.id].
+     * For VARIANT [Product][google.cloud.retail.v2.Product]s, this field cannot
+     * be empty. A maximum of 2,000 products are allowed to share the same
+     * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product]. Otherwise, an INVALID_ARGUMENT
+     * error is returned.
+     * Google Merchant Center Property
+     * [item_group_id](https://support.google.com/merchants/answer/6324507).
+     * 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; + * + * @param value The primaryProductId to set. + * @return This builder for chaining. + */ + public Builder setPrimaryProductId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + primaryProductId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Variant group identifier. Must be an
+     * [id][google.cloud.retail.v2.Product.id], with the same parent branch with
+     * this product. Otherwise, an error is thrown.
+     * For [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product]s, this field can only be empty or
+     * set to the same value as [id][google.cloud.retail.v2.Product.id].
+     * For VARIANT [Product][google.cloud.retail.v2.Product]s, this field cannot
+     * be empty. A maximum of 2,000 products are allowed to share the same
+     * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product]. Otherwise, an INVALID_ARGUMENT
+     * error is returned.
+     * Google Merchant Center Property
+     * [item_group_id](https://support.google.com/merchants/answer/6324507).
+     * 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; + * + * @return This builder for chaining. + */ + public Builder clearPrimaryProductId() { + + primaryProductId_ = getDefaultInstance().getPrimaryProductId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Variant group identifier. Must be an
+     * [id][google.cloud.retail.v2.Product.id], with the same parent branch with
+     * this product. Otherwise, an error is thrown.
+     * For [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product]s, this field can only be empty or
+     * set to the same value as [id][google.cloud.retail.v2.Product.id].
+     * For VARIANT [Product][google.cloud.retail.v2.Product]s, this field cannot
+     * be empty. A maximum of 2,000 products are allowed to share the same
+     * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product]. Otherwise, an INVALID_ARGUMENT
+     * error is returned.
+     * Google Merchant Center Property
+     * [item_group_id](https://support.google.com/merchants/answer/6324507).
+     * 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; + * + * @param value The bytes for primaryProductId to set. + * @return This builder for chaining. + */ + public Builder setPrimaryProductIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + primaryProductId_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList collectionMemberIds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureCollectionMemberIdsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + collectionMemberIds_ = new com.google.protobuf.LazyStringArrayList(collectionMemberIds_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * repeated string collection_member_ids = 5; + * + * @return A list containing the collectionMemberIds. + */ + public com.google.protobuf.ProtocolStringList getCollectionMemberIdsList() { + return collectionMemberIds_.getUnmodifiableView(); + } + /** + * + * + *
+     * 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.
+     * 
+ * + * repeated string collection_member_ids = 5; + * + * @return The count of collectionMemberIds. + */ + public int getCollectionMemberIdsCount() { + return collectionMemberIds_.size(); + } + /** + * + * + *
+     * 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.
+     * 
+ * + * repeated string collection_member_ids = 5; + * + * @param index The index of the element to return. + * @return The collectionMemberIds at the given index. + */ + public java.lang.String getCollectionMemberIds(int index) { + return collectionMemberIds_.get(index); + } + /** + * + * + *
+     * 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.
+     * 
+ * + * repeated string collection_member_ids = 5; + * + * @param index The index of the value to return. + * @return The bytes of the collectionMemberIds at the given index. + */ + public com.google.protobuf.ByteString getCollectionMemberIdsBytes(int index) { + return collectionMemberIds_.getByteString(index); + } + /** + * + * + *
+     * 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.
+     * 
+ * + * repeated string collection_member_ids = 5; + * + * @param index The index to set the value at. + * @param value The collectionMemberIds to set. + * @return This builder for chaining. + */ + public Builder setCollectionMemberIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCollectionMemberIdsIsMutable(); + collectionMemberIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * repeated string collection_member_ids = 5; + * + * @param value The collectionMemberIds to add. + * @return This builder for chaining. + */ + public Builder addCollectionMemberIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCollectionMemberIdsIsMutable(); + collectionMemberIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * repeated string collection_member_ids = 5; + * + * @param values The collectionMemberIds to add. + * @return This builder for chaining. + */ + public Builder addAllCollectionMemberIds(java.lang.Iterable values) { + ensureCollectionMemberIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, collectionMemberIds_); + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * repeated string collection_member_ids = 5; + * + * @return This builder for chaining. + */ + public Builder clearCollectionMemberIds() { + collectionMemberIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * repeated string collection_member_ids = 5; + * + * @param value The bytes of the collectionMemberIds to add. + * @return This builder for chaining. + */ + public Builder addCollectionMemberIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureCollectionMemberIdsIsMutable(); + collectionMemberIds_.add(value); + onChanged(); + return this; + } + + private java.lang.Object gtin_ = ""; + /** + * + * + *
+     * The Global Trade Item Number (GTIN) of the 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
+     * [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.gtin14](https://schema.org/gtin14).
+     * If the value is not a valid GTIN, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string gtin = 6; + * + * @return The gtin. + */ + public java.lang.String getGtin() { + java.lang.Object ref = gtin_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + gtin_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The Global Trade Item Number (GTIN) of the 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
+     * [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.gtin14](https://schema.org/gtin14).
+     * If the value is not a valid GTIN, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string gtin = 6; + * + * @return The bytes for gtin. + */ + public com.google.protobuf.ByteString getGtinBytes() { + java.lang.Object ref = gtin_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + gtin_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The Global Trade Item Number (GTIN) of the 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
+     * [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.gtin14](https://schema.org/gtin14).
+     * If the value is not a valid GTIN, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string gtin = 6; + * + * @param value The gtin to set. + * @return This builder for chaining. + */ + public Builder setGtin(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + gtin_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The Global Trade Item Number (GTIN) of the 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
+     * [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.gtin14](https://schema.org/gtin14).
+     * If the value is not a valid GTIN, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string gtin = 6; + * + * @return This builder for chaining. + */ + public Builder clearGtin() { + + gtin_ = getDefaultInstance().getGtin(); + onChanged(); + return this; + } + /** + * + * + *
+     * The Global Trade Item Number (GTIN) of the 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
+     * [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.gtin14](https://schema.org/gtin14).
+     * If the value is not a valid GTIN, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string gtin = 6; + * + * @param value The bytes for gtin to set. + * @return This builder for chaining. + */ + public Builder setGtinBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + gtin_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList categories_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureCategoriesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + categories_ = new com.google.protobuf.LazyStringArrayList(categories_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * Product categories. This field is repeated for supporting one product
+     * belonging to several parallel categories. Strongly recommended using the
+     * full path for better search / recommendation quality.
+     * To represent full path of category, use '>' sign to separate different
+     * hierarchies. If '>' is part of the category name, please replace it with
+     * other character(s).
+     * For example, if a shoes product belongs to both
+     * ["Shoes & Accessories" -> "Shoes"] and
+     * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+     * represented as:
+     *      "categories": [
+     *        "Shoes & Accessories > Shoes",
+     *        "Sports & Fitness > Athletic Clothing > Shoes"
+     *      ]
+     * Must be set for [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product] otherwise an INVALID_ARGUMENT
+     * error is returned.
+     * At most 250 values are allowed per
+     * [Product][google.cloud.retail.v2.Product]. Empty values are not allowed.
+     * 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
+     * [google_product_category][mc_google_product_category]. Schema.org property
+     * [Product.category] (https://schema.org/category).
+     * [mc_google_product_category]:
+     * https://support.google.com/merchants/answer/6324436
+     * 
+ * + * repeated string categories = 7; + * + * @return A list containing the categories. + */ + public com.google.protobuf.ProtocolStringList getCategoriesList() { + return categories_.getUnmodifiableView(); + } + /** + * + * + *
+     * Product categories. This field is repeated for supporting one product
+     * belonging to several parallel categories. Strongly recommended using the
+     * full path for better search / recommendation quality.
+     * To represent full path of category, use '>' sign to separate different
+     * hierarchies. If '>' is part of the category name, please replace it with
+     * other character(s).
+     * For example, if a shoes product belongs to both
+     * ["Shoes & Accessories" -> "Shoes"] and
+     * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+     * represented as:
+     *      "categories": [
+     *        "Shoes & Accessories > Shoes",
+     *        "Sports & Fitness > Athletic Clothing > Shoes"
+     *      ]
+     * Must be set for [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product] otherwise an INVALID_ARGUMENT
+     * error is returned.
+     * At most 250 values are allowed per
+     * [Product][google.cloud.retail.v2.Product]. Empty values are not allowed.
+     * 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
+     * [google_product_category][mc_google_product_category]. Schema.org property
+     * [Product.category] (https://schema.org/category).
+     * [mc_google_product_category]:
+     * https://support.google.com/merchants/answer/6324436
+     * 
+ * + * repeated string categories = 7; + * + * @return The count of categories. + */ + public int getCategoriesCount() { + return categories_.size(); + } + /** + * + * + *
+     * Product categories. This field is repeated for supporting one product
+     * belonging to several parallel categories. Strongly recommended using the
+     * full path for better search / recommendation quality.
+     * To represent full path of category, use '>' sign to separate different
+     * hierarchies. If '>' is part of the category name, please replace it with
+     * other character(s).
+     * For example, if a shoes product belongs to both
+     * ["Shoes & Accessories" -> "Shoes"] and
+     * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+     * represented as:
+     *      "categories": [
+     *        "Shoes & Accessories > Shoes",
+     *        "Sports & Fitness > Athletic Clothing > Shoes"
+     *      ]
+     * Must be set for [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product] otherwise an INVALID_ARGUMENT
+     * error is returned.
+     * At most 250 values are allowed per
+     * [Product][google.cloud.retail.v2.Product]. Empty values are not allowed.
+     * 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
+     * [google_product_category][mc_google_product_category]. Schema.org property
+     * [Product.category] (https://schema.org/category).
+     * [mc_google_product_category]:
+     * https://support.google.com/merchants/answer/6324436
+     * 
+ * + * repeated string categories = 7; + * + * @param index The index of the element to return. + * @return The categories at the given index. + */ + public java.lang.String getCategories(int index) { + return categories_.get(index); + } + /** + * + * + *
+     * Product categories. This field is repeated for supporting one product
+     * belonging to several parallel categories. Strongly recommended using the
+     * full path for better search / recommendation quality.
+     * To represent full path of category, use '>' sign to separate different
+     * hierarchies. If '>' is part of the category name, please replace it with
+     * other character(s).
+     * For example, if a shoes product belongs to both
+     * ["Shoes & Accessories" -> "Shoes"] and
+     * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+     * represented as:
+     *      "categories": [
+     *        "Shoes & Accessories > Shoes",
+     *        "Sports & Fitness > Athletic Clothing > Shoes"
+     *      ]
+     * Must be set for [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product] otherwise an INVALID_ARGUMENT
+     * error is returned.
+     * At most 250 values are allowed per
+     * [Product][google.cloud.retail.v2.Product]. Empty values are not allowed.
+     * 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
+     * [google_product_category][mc_google_product_category]. Schema.org property
+     * [Product.category] (https://schema.org/category).
+     * [mc_google_product_category]:
+     * https://support.google.com/merchants/answer/6324436
+     * 
+ * + * repeated string categories = 7; + * + * @param index The index of the value to return. + * @return The bytes of the categories at the given index. + */ + public com.google.protobuf.ByteString getCategoriesBytes(int index) { + return categories_.getByteString(index); + } + /** + * + * + *
+     * Product categories. This field is repeated for supporting one product
+     * belonging to several parallel categories. Strongly recommended using the
+     * full path for better search / recommendation quality.
+     * To represent full path of category, use '>' sign to separate different
+     * hierarchies. If '>' is part of the category name, please replace it with
+     * other character(s).
+     * For example, if a shoes product belongs to both
+     * ["Shoes & Accessories" -> "Shoes"] and
+     * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+     * represented as:
+     *      "categories": [
+     *        "Shoes & Accessories > Shoes",
+     *        "Sports & Fitness > Athletic Clothing > Shoes"
+     *      ]
+     * Must be set for [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product] otherwise an INVALID_ARGUMENT
+     * error is returned.
+     * At most 250 values are allowed per
+     * [Product][google.cloud.retail.v2.Product]. Empty values are not allowed.
+     * 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
+     * [google_product_category][mc_google_product_category]. Schema.org property
+     * [Product.category] (https://schema.org/category).
+     * [mc_google_product_category]:
+     * https://support.google.com/merchants/answer/6324436
+     * 
+ * + * repeated string categories = 7; + * + * @param index The index to set the value at. + * @param value The categories to set. + * @return This builder for chaining. + */ + public Builder setCategories(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCategoriesIsMutable(); + categories_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Product categories. This field is repeated for supporting one product
+     * belonging to several parallel categories. Strongly recommended using the
+     * full path for better search / recommendation quality.
+     * To represent full path of category, use '>' sign to separate different
+     * hierarchies. If '>' is part of the category name, please replace it with
+     * other character(s).
+     * For example, if a shoes product belongs to both
+     * ["Shoes & Accessories" -> "Shoes"] and
+     * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+     * represented as:
+     *      "categories": [
+     *        "Shoes & Accessories > Shoes",
+     *        "Sports & Fitness > Athletic Clothing > Shoes"
+     *      ]
+     * Must be set for [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product] otherwise an INVALID_ARGUMENT
+     * error is returned.
+     * At most 250 values are allowed per
+     * [Product][google.cloud.retail.v2.Product]. Empty values are not allowed.
+     * 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
+     * [google_product_category][mc_google_product_category]. Schema.org property
+     * [Product.category] (https://schema.org/category).
+     * [mc_google_product_category]:
+     * https://support.google.com/merchants/answer/6324436
+     * 
+ * + * repeated string categories = 7; + * + * @param value The categories to add. + * @return This builder for chaining. + */ + public Builder addCategories(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCategoriesIsMutable(); + categories_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Product categories. This field is repeated for supporting one product
+     * belonging to several parallel categories. Strongly recommended using the
+     * full path for better search / recommendation quality.
+     * To represent full path of category, use '>' sign to separate different
+     * hierarchies. If '>' is part of the category name, please replace it with
+     * other character(s).
+     * For example, if a shoes product belongs to both
+     * ["Shoes & Accessories" -> "Shoes"] and
+     * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+     * represented as:
+     *      "categories": [
+     *        "Shoes & Accessories > Shoes",
+     *        "Sports & Fitness > Athletic Clothing > Shoes"
+     *      ]
+     * Must be set for [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product] otherwise an INVALID_ARGUMENT
+     * error is returned.
+     * At most 250 values are allowed per
+     * [Product][google.cloud.retail.v2.Product]. Empty values are not allowed.
+     * 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
+     * [google_product_category][mc_google_product_category]. Schema.org property
+     * [Product.category] (https://schema.org/category).
+     * [mc_google_product_category]:
+     * https://support.google.com/merchants/answer/6324436
+     * 
+ * + * repeated string categories = 7; + * + * @param values The categories to add. + * @return This builder for chaining. + */ + public Builder addAllCategories(java.lang.Iterable values) { + ensureCategoriesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, categories_); + onChanged(); + return this; + } + /** + * + * + *
+     * Product categories. This field is repeated for supporting one product
+     * belonging to several parallel categories. Strongly recommended using the
+     * full path for better search / recommendation quality.
+     * To represent full path of category, use '>' sign to separate different
+     * hierarchies. If '>' is part of the category name, please replace it with
+     * other character(s).
+     * For example, if a shoes product belongs to both
+     * ["Shoes & Accessories" -> "Shoes"] and
+     * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+     * represented as:
+     *      "categories": [
+     *        "Shoes & Accessories > Shoes",
+     *        "Sports & Fitness > Athletic Clothing > Shoes"
+     *      ]
+     * Must be set for [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product] otherwise an INVALID_ARGUMENT
+     * error is returned.
+     * At most 250 values are allowed per
+     * [Product][google.cloud.retail.v2.Product]. Empty values are not allowed.
+     * 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
+     * [google_product_category][mc_google_product_category]. Schema.org property
+     * [Product.category] (https://schema.org/category).
+     * [mc_google_product_category]:
+     * https://support.google.com/merchants/answer/6324436
+     * 
+ * + * repeated string categories = 7; + * + * @return This builder for chaining. + */ + public Builder clearCategories() { + categories_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Product categories. This field is repeated for supporting one product
+     * belonging to several parallel categories. Strongly recommended using the
+     * full path for better search / recommendation quality.
+     * To represent full path of category, use '>' sign to separate different
+     * hierarchies. If '>' is part of the category name, please replace it with
+     * other character(s).
+     * For example, if a shoes product belongs to both
+     * ["Shoes & Accessories" -> "Shoes"] and
+     * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+     * represented as:
+     *      "categories": [
+     *        "Shoes & Accessories > Shoes",
+     *        "Sports & Fitness > Athletic Clothing > Shoes"
+     *      ]
+     * Must be set for [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product] otherwise an INVALID_ARGUMENT
+     * error is returned.
+     * At most 250 values are allowed per
+     * [Product][google.cloud.retail.v2.Product]. Empty values are not allowed.
+     * 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
+     * [google_product_category][mc_google_product_category]. Schema.org property
+     * [Product.category] (https://schema.org/category).
+     * [mc_google_product_category]:
+     * https://support.google.com/merchants/answer/6324436
+     * 
+ * + * repeated string categories = 7; + * + * @param value The bytes of the categories to add. + * @return This builder for chaining. + */ + public Builder addCategoriesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureCategoriesIsMutable(); + categories_.add(value); + onChanged(); + return this; + } + + private java.lang.Object title_ = ""; + /** + * + * + *
+     * Required. Product title.
+     * 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
+     * [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]; + * + * @return The title. + */ + public java.lang.String getTitle() { + java.lang.Object ref = title_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + title_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Product title.
+     * 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
+     * [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]; + * + * @return The bytes for title. + */ + public com.google.protobuf.ByteString getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Product title.
+     * 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
+     * [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]; + * + * @param value The title to set. + * @return This builder for chaining. + */ + public Builder setTitle(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + title_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Product title.
+     * 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
+     * [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]; + * + * @return This builder for chaining. + */ + public Builder clearTitle() { + + title_ = getDefaultInstance().getTitle(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Product title.
+     * 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
+     * [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]; + * + * @param value The bytes for title to set. + * @return This builder for chaining. + */ + public Builder setTitleBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + title_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList brands_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureBrandsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + brands_ = new com.google.protobuf.LazyStringArrayList(brands_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+     * The brands of the product.
+     * A maximum of 30 brands are allowed. Each brand 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
+     * [brand](https://support.google.com/merchants/answer/6324351). Schema.org
+     * property [Product.brand](https://schema.org/brand).
+     * 
+ * + * repeated string brands = 9; + * + * @return A list containing the brands. + */ + public com.google.protobuf.ProtocolStringList getBrandsList() { + return brands_.getUnmodifiableView(); + } + /** + * + * + *
+     * The brands of the product.
+     * A maximum of 30 brands are allowed. Each brand 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
+     * [brand](https://support.google.com/merchants/answer/6324351). Schema.org
+     * property [Product.brand](https://schema.org/brand).
+     * 
+ * + * repeated string brands = 9; + * + * @return The count of brands. + */ + public int getBrandsCount() { + return brands_.size(); + } + /** + * + * + *
+     * The brands of the product.
+     * A maximum of 30 brands are allowed. Each brand 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
+     * [brand](https://support.google.com/merchants/answer/6324351). Schema.org
+     * property [Product.brand](https://schema.org/brand).
+     * 
+ * + * repeated string brands = 9; + * + * @param index The index of the element to return. + * @return The brands at the given index. + */ + public java.lang.String getBrands(int index) { + return brands_.get(index); + } + /** + * + * + *
+     * The brands of the product.
+     * A maximum of 30 brands are allowed. Each brand 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
+     * [brand](https://support.google.com/merchants/answer/6324351). Schema.org
+     * property [Product.brand](https://schema.org/brand).
+     * 
+ * + * repeated string brands = 9; + * + * @param index The index of the value to return. + * @return The bytes of the brands at the given index. + */ + public com.google.protobuf.ByteString getBrandsBytes(int index) { + return brands_.getByteString(index); + } + /** + * + * + *
+     * The brands of the product.
+     * A maximum of 30 brands are allowed. Each brand 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
+     * [brand](https://support.google.com/merchants/answer/6324351). Schema.org
+     * property [Product.brand](https://schema.org/brand).
+     * 
+ * + * repeated string brands = 9; + * + * @param index The index to set the value at. + * @param value The brands to set. + * @return This builder for chaining. + */ + public Builder setBrands(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureBrandsIsMutable(); + brands_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The brands of the product.
+     * A maximum of 30 brands are allowed. Each brand 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
+     * [brand](https://support.google.com/merchants/answer/6324351). Schema.org
+     * property [Product.brand](https://schema.org/brand).
+     * 
+ * + * repeated string brands = 9; + * + * @param value The brands to add. + * @return This builder for chaining. + */ + public Builder addBrands(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureBrandsIsMutable(); + brands_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The brands of the product.
+     * A maximum of 30 brands are allowed. Each brand 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
+     * [brand](https://support.google.com/merchants/answer/6324351). Schema.org
+     * property [Product.brand](https://schema.org/brand).
+     * 
+ * + * repeated string brands = 9; + * + * @param values The brands to add. + * @return This builder for chaining. + */ + public Builder addAllBrands(java.lang.Iterable values) { + ensureBrandsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, brands_); + onChanged(); + return this; + } + /** + * + * + *
+     * The brands of the product.
+     * A maximum of 30 brands are allowed. Each brand 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
+     * [brand](https://support.google.com/merchants/answer/6324351). Schema.org
+     * property [Product.brand](https://schema.org/brand).
+     * 
+ * + * repeated string brands = 9; + * + * @return This builder for chaining. + */ + public Builder clearBrands() { + brands_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * The brands of the product.
+     * A maximum of 30 brands are allowed. Each brand 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
+     * [brand](https://support.google.com/merchants/answer/6324351). Schema.org
+     * property [Product.brand](https://schema.org/brand).
+     * 
+ * + * repeated string brands = 9; + * + * @param value The bytes of the brands to add. + * @return This builder for chaining. + */ + public Builder addBrandsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureBrandsIsMutable(); + brands_.add(value); + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * Product description.
+     * 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
+     * [description](https://support.google.com/merchants/answer/6324468).
+     * schema.org property [Product.description](https://schema.org/description).
+     * 
+ * + * string description = 10; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Product description.
+     * 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
+     * [description](https://support.google.com/merchants/answer/6324468).
+     * schema.org property [Product.description](https://schema.org/description).
+     * 
+ * + * string description = 10; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Product description.
+     * 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
+     * [description](https://support.google.com/merchants/answer/6324468).
+     * schema.org property [Product.description](https://schema.org/description).
+     * 
+ * + * string description = 10; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Product description.
+     * 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
+     * [description](https://support.google.com/merchants/answer/6324468).
+     * schema.org property [Product.description](https://schema.org/description).
+     * 
+ * + * string description = 10; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+     * Product description.
+     * 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
+     * [description](https://support.google.com/merchants/answer/6324468).
+     * schema.org property [Product.description](https://schema.org/description).
+     * 
+ * + * string description = 10; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + private java.lang.Object languageCode_ = ""; + /** + * + * + *
+     * 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].
+     * For product prediction, this field is ignored and the model automatically
+     * detects the text language. The [Product][google.cloud.retail.v2.Product]
+     * can include text in different languages, but duplicating
+     * [Product][google.cloud.retail.v2.Product]s to provide text in multiple
+     * languages can result in degraded model performance.
+     * For product search this field is in use. It defaults to "en-US" if unset.
+     * 
+ * + * string language_code = 11; + * + * @return The languageCode. + */ + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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].
+     * For product prediction, this field is ignored and the model automatically
+     * detects the text language. The [Product][google.cloud.retail.v2.Product]
+     * can include text in different languages, but duplicating
+     * [Product][google.cloud.retail.v2.Product]s to provide text in multiple
+     * languages can result in degraded model performance.
+     * For product search this field is in use. It defaults to "en-US" if unset.
+     * 
+ * + * string language_code = 11; + * + * @return The bytes for languageCode. + */ + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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].
+     * For product prediction, this field is ignored and the model automatically
+     * detects the text language. The [Product][google.cloud.retail.v2.Product]
+     * can include text in different languages, but duplicating
+     * [Product][google.cloud.retail.v2.Product]s to provide text in multiple
+     * languages can result in degraded model performance.
+     * For product search this field is in use. It defaults to "en-US" if unset.
+     * 
+ * + * string language_code = 11; + * + * @param value The languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + languageCode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 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].
+     * For product prediction, this field is ignored and the model automatically
+     * detects the text language. The [Product][google.cloud.retail.v2.Product]
+     * can include text in different languages, but duplicating
+     * [Product][google.cloud.retail.v2.Product]s to provide text in multiple
+     * languages can result in degraded model performance.
+     * For product search this field is in use. It defaults to "en-US" if unset.
+     * 
+ * + * string language_code = 11; + * + * @return This builder for chaining. + */ + public Builder clearLanguageCode() { + + languageCode_ = getDefaultInstance().getLanguageCode(); + onChanged(); + return this; + } + /** + * + * + *
+     * 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].
+     * For product prediction, this field is ignored and the model automatically
+     * detects the text language. The [Product][google.cloud.retail.v2.Product]
+     * can include text in different languages, but duplicating
+     * [Product][google.cloud.retail.v2.Product]s to provide text in multiple
+     * languages can result in degraded model performance.
+     * For product search this field is in use. It defaults to "en-US" if unset.
+     * 
+ * + * string language_code = 11; + * + * @param value The bytes for languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + languageCode_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2.CustomAttribute> + attributes_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2.CustomAttribute> + internalGetAttributes() { + if (attributes_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AttributesDefaultEntryHolder.defaultEntry); + } + return attributes_; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2.CustomAttribute> + internalGetMutableAttributes() { + onChanged(); + ; + if (attributes_ == null) { + attributes_ = + com.google.protobuf.MapField.newMapField(AttributesDefaultEntryHolder.defaultEntry); + } + if (!attributes_.isMutable()) { + attributes_ = attributes_.copy(); + } + return attributes_; + } + + public int getAttributesCount() { + return internalGetAttributes().getMap().size(); + } + /** + * + * + *
+     * Highly encouraged. Extra product attributes to be included. For example,
+     * for products, this could include the store name, vendor, style, color, etc.
+     * These are very strong signals for recommendation model, thus we highly
+     * recommend providing the attributes here.
+     * Features that can take on one of a limited number of possible values. Two
+     * types of features can be set are:
+     * Textual features. some examples would be the brand/maker of a product, or
+     * country of a customer. Numerical features. Some examples would be the
+     * height/weight of a product, or age of a customer.
+     * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]},
+     * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]}
+     * }`.
+     * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+     * error is returned:
+     * * Max entries count: 200 by default; 100 for
+     * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT].
+     * * The key must be a UTF-8 encoded string with a length limit of 128
+     *   characters.
+     * * Max indexable entries count: 200 by default; 40 for
+     * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT].
+     * * Max searchable entries count: 30.
+     * * 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.
+     * 
+ * + * map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 12; + */ + @java.lang.Override + public boolean containsAttributes(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetAttributes().getMap().containsKey(key); + } + /** Use {@link #getAttributesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getAttributes() { + return getAttributesMap(); + } + /** + * + * + *
+     * Highly encouraged. Extra product attributes to be included. For example,
+     * for products, this could include the store name, vendor, style, color, etc.
+     * These are very strong signals for recommendation model, thus we highly
+     * recommend providing the attributes here.
+     * Features that can take on one of a limited number of possible values. Two
+     * types of features can be set are:
+     * Textual features. some examples would be the brand/maker of a product, or
+     * country of a customer. Numerical features. Some examples would be the
+     * height/weight of a product, or age of a customer.
+     * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]},
+     * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]}
+     * }`.
+     * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+     * error is returned:
+     * * Max entries count: 200 by default; 100 for
+     * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT].
+     * * The key must be a UTF-8 encoded string with a length limit of 128
+     *   characters.
+     * * Max indexable entries count: 200 by default; 40 for
+     * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT].
+     * * Max searchable entries count: 30.
+     * * 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.
+     * 
+ * + * map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 12; + */ + @java.lang.Override + public java.util.Map + getAttributesMap() { + return internalGetAttributes().getMap(); + } + /** + * + * + *
+     * Highly encouraged. Extra product attributes to be included. For example,
+     * for products, this could include the store name, vendor, style, color, etc.
+     * These are very strong signals for recommendation model, thus we highly
+     * recommend providing the attributes here.
+     * Features that can take on one of a limited number of possible values. Two
+     * types of features can be set are:
+     * Textual features. some examples would be the brand/maker of a product, or
+     * country of a customer. Numerical features. Some examples would be the
+     * height/weight of a product, or age of a customer.
+     * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]},
+     * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]}
+     * }`.
+     * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+     * error is returned:
+     * * Max entries count: 200 by default; 100 for
+     * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT].
+     * * The key must be a UTF-8 encoded string with a length limit of 128
+     *   characters.
+     * * Max indexable entries count: 200 by default; 40 for
+     * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT].
+     * * Max searchable entries count: 30.
+     * * 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.
+     * 
+ * + * map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 12; + */ + @java.lang.Override + public com.google.cloud.retail.v2.CustomAttribute getAttributesOrDefault( + java.lang.String key, com.google.cloud.retail.v2.CustomAttribute defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetAttributes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Highly encouraged. Extra product attributes to be included. For example,
+     * for products, this could include the store name, vendor, style, color, etc.
+     * These are very strong signals for recommendation model, thus we highly
+     * recommend providing the attributes here.
+     * Features that can take on one of a limited number of possible values. Two
+     * types of features can be set are:
+     * Textual features. some examples would be the brand/maker of a product, or
+     * country of a customer. Numerical features. Some examples would be the
+     * height/weight of a product, or age of a customer.
+     * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]},
+     * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]}
+     * }`.
+     * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+     * error is returned:
+     * * Max entries count: 200 by default; 100 for
+     * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT].
+     * * The key must be a UTF-8 encoded string with a length limit of 128
+     *   characters.
+     * * Max indexable entries count: 200 by default; 40 for
+     * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT].
+     * * Max searchable entries count: 30.
+     * * 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.
+     * 
+ * + * map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 12; + */ + @java.lang.Override + public com.google.cloud.retail.v2.CustomAttribute getAttributesOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetAttributes().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearAttributes() { + internalGetMutableAttributes().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Highly encouraged. Extra product attributes to be included. For example,
+     * for products, this could include the store name, vendor, style, color, etc.
+     * These are very strong signals for recommendation model, thus we highly
+     * recommend providing the attributes here.
+     * Features that can take on one of a limited number of possible values. Two
+     * types of features can be set are:
+     * Textual features. some examples would be the brand/maker of a product, or
+     * country of a customer. Numerical features. Some examples would be the
+     * height/weight of a product, or age of a customer.
+     * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]},
+     * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]}
+     * }`.
+     * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+     * error is returned:
+     * * Max entries count: 200 by default; 100 for
+     * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT].
+     * * The key must be a UTF-8 encoded string with a length limit of 128
+     *   characters.
+     * * Max indexable entries count: 200 by default; 40 for
+     * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT].
+     * * Max searchable entries count: 30.
+     * * 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.
+     * 
+ * + * map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 12; + */ + public Builder removeAttributes(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableAttributes().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableAttributes() { + return internalGetMutableAttributes().getMutableMap(); + } + /** + * + * + *
+     * Highly encouraged. Extra product attributes to be included. For example,
+     * for products, this could include the store name, vendor, style, color, etc.
+     * These are very strong signals for recommendation model, thus we highly
+     * recommend providing the attributes here.
+     * Features that can take on one of a limited number of possible values. Two
+     * types of features can be set are:
+     * Textual features. some examples would be the brand/maker of a product, or
+     * country of a customer. Numerical features. Some examples would be the
+     * height/weight of a product, or age of a customer.
+     * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]},
+     * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]}
+     * }`.
+     * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+     * error is returned:
+     * * Max entries count: 200 by default; 100 for
+     * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT].
+     * * The key must be a UTF-8 encoded string with a length limit of 128
+     *   characters.
+     * * Max indexable entries count: 200 by default; 40 for
+     * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT].
+     * * Max searchable entries count: 30.
+     * * 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.
+     * 
+ * + * map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 12; + */ + public Builder putAttributes( + java.lang.String key, com.google.cloud.retail.v2.CustomAttribute value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableAttributes().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Highly encouraged. Extra product attributes to be included. For example,
+     * for products, this could include the store name, vendor, style, color, etc.
+     * These are very strong signals for recommendation model, thus we highly
+     * recommend providing the attributes here.
+     * Features that can take on one of a limited number of possible values. Two
+     * types of features can be set are:
+     * Textual features. some examples would be the brand/maker of a product, or
+     * country of a customer. Numerical features. Some examples would be the
+     * height/weight of a product, or age of a customer.
+     * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]},
+     * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]}
+     * }`.
+     * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+     * error is returned:
+     * * Max entries count: 200 by default; 100 for
+     * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT].
+     * * The key must be a UTF-8 encoded string with a length limit of 128
+     *   characters.
+     * * Max indexable entries count: 200 by default; 40 for
+     * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT].
+     * * Max searchable entries count: 30.
+     * * 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.
+     * 
+ * + * map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 12; + */ + public Builder putAllAttributes( + java.util.Map values) { + internalGetMutableAttributes().getMutableMap().putAll(values); + return this; + } + + private com.google.protobuf.LazyStringList tags_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureTagsIsMutable() { + if (!((bitField0_ & 0x00000010) != 0)) { + tags_ = new com.google.protobuf.LazyStringArrayList(tags_); + bitField0_ |= 0x00000010; + } + } + /** + * + * + *
+     * Custom tags associated with the product.
+     * At most 250 values are allowed per
+     * [Product][google.cloud.retail.v2.Product]. This value must be a UTF-8
+     * encoded string with a length limit of 1,000 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * This tag can be used for filtering recommendation results by passing the
+     * tag as part of the
+     * [PredictRequest.filter][google.cloud.retail.v2.PredictRequest.filter].
+     * Google Merchant Center property
+     * [custom_label_0–4](https://support.google.com/merchants/answer/6324473).
+     * 
+ * + * repeated string tags = 13; + * + * @return A list containing the tags. + */ + public com.google.protobuf.ProtocolStringList getTagsList() { + return tags_.getUnmodifiableView(); + } + /** + * + * + *
+     * Custom tags associated with the product.
+     * At most 250 values are allowed per
+     * [Product][google.cloud.retail.v2.Product]. This value must be a UTF-8
+     * encoded string with a length limit of 1,000 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * This tag can be used for filtering recommendation results by passing the
+     * tag as part of the
+     * [PredictRequest.filter][google.cloud.retail.v2.PredictRequest.filter].
+     * Google Merchant Center property
+     * [custom_label_0–4](https://support.google.com/merchants/answer/6324473).
+     * 
+ * + * repeated string tags = 13; + * + * @return The count of tags. + */ + public int getTagsCount() { + return tags_.size(); + } + /** + * + * + *
+     * Custom tags associated with the product.
+     * At most 250 values are allowed per
+     * [Product][google.cloud.retail.v2.Product]. This value must be a UTF-8
+     * encoded string with a length limit of 1,000 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * This tag can be used for filtering recommendation results by passing the
+     * tag as part of the
+     * [PredictRequest.filter][google.cloud.retail.v2.PredictRequest.filter].
+     * Google Merchant Center property
+     * [custom_label_0–4](https://support.google.com/merchants/answer/6324473).
+     * 
+ * + * repeated string tags = 13; + * + * @param index The index of the element to return. + * @return The tags at the given index. + */ + public java.lang.String getTags(int index) { + return tags_.get(index); + } + /** + * + * + *
+     * Custom tags associated with the product.
+     * At most 250 values are allowed per
+     * [Product][google.cloud.retail.v2.Product]. This value must be a UTF-8
+     * encoded string with a length limit of 1,000 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * This tag can be used for filtering recommendation results by passing the
+     * tag as part of the
+     * [PredictRequest.filter][google.cloud.retail.v2.PredictRequest.filter].
+     * Google Merchant Center property
+     * [custom_label_0–4](https://support.google.com/merchants/answer/6324473).
+     * 
+ * + * repeated string tags = 13; + * + * @param index The index of the value to return. + * @return The bytes of the tags at the given index. + */ + public com.google.protobuf.ByteString getTagsBytes(int index) { + return tags_.getByteString(index); + } + /** + * + * + *
+     * Custom tags associated with the product.
+     * At most 250 values are allowed per
+     * [Product][google.cloud.retail.v2.Product]. This value must be a UTF-8
+     * encoded string with a length limit of 1,000 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * This tag can be used for filtering recommendation results by passing the
+     * tag as part of the
+     * [PredictRequest.filter][google.cloud.retail.v2.PredictRequest.filter].
+     * Google Merchant Center property
+     * [custom_label_0–4](https://support.google.com/merchants/answer/6324473).
+     * 
+ * + * repeated string tags = 13; + * + * @param index The index to set the value at. + * @param value The tags to set. + * @return This builder for chaining. + */ + public Builder setTags(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTagsIsMutable(); + tags_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Custom tags associated with the product.
+     * At most 250 values are allowed per
+     * [Product][google.cloud.retail.v2.Product]. This value must be a UTF-8
+     * encoded string with a length limit of 1,000 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * This tag can be used for filtering recommendation results by passing the
+     * tag as part of the
+     * [PredictRequest.filter][google.cloud.retail.v2.PredictRequest.filter].
+     * Google Merchant Center property
+     * [custom_label_0–4](https://support.google.com/merchants/answer/6324473).
+     * 
+ * + * repeated string tags = 13; + * + * @param value The tags to add. + * @return This builder for chaining. + */ + public Builder addTags(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTagsIsMutable(); + tags_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Custom tags associated with the product.
+     * At most 250 values are allowed per
+     * [Product][google.cloud.retail.v2.Product]. This value must be a UTF-8
+     * encoded string with a length limit of 1,000 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * This tag can be used for filtering recommendation results by passing the
+     * tag as part of the
+     * [PredictRequest.filter][google.cloud.retail.v2.PredictRequest.filter].
+     * Google Merchant Center property
+     * [custom_label_0–4](https://support.google.com/merchants/answer/6324473).
+     * 
+ * + * repeated string tags = 13; + * + * @param values The tags to add. + * @return This builder for chaining. + */ + public Builder addAllTags(java.lang.Iterable values) { + ensureTagsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, tags_); + onChanged(); + return this; + } + /** + * + * + *
+     * Custom tags associated with the product.
+     * At most 250 values are allowed per
+     * [Product][google.cloud.retail.v2.Product]. This value must be a UTF-8
+     * encoded string with a length limit of 1,000 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * This tag can be used for filtering recommendation results by passing the
+     * tag as part of the
+     * [PredictRequest.filter][google.cloud.retail.v2.PredictRequest.filter].
+     * Google Merchant Center property
+     * [custom_label_0–4](https://support.google.com/merchants/answer/6324473).
+     * 
+ * + * repeated string tags = 13; + * + * @return This builder for chaining. + */ + public Builder clearTags() { + tags_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Custom tags associated with the product.
+     * At most 250 values are allowed per
+     * [Product][google.cloud.retail.v2.Product]. This value must be a UTF-8
+     * encoded string with a length limit of 1,000 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * This tag can be used for filtering recommendation results by passing the
+     * tag as part of the
+     * [PredictRequest.filter][google.cloud.retail.v2.PredictRequest.filter].
+     * Google Merchant Center property
+     * [custom_label_0–4](https://support.google.com/merchants/answer/6324473).
+     * 
+ * + * repeated string tags = 13; + * + * @param value The bytes of the tags to add. + * @return This builder for chaining. + */ + public Builder addTagsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureTagsIsMutable(); + tags_.add(value); + onChanged(); + return this; + } + + private com.google.cloud.retail.v2.PriceInfo priceInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2.PriceInfo, + com.google.cloud.retail.v2.PriceInfo.Builder, + com.google.cloud.retail.v2.PriceInfoOrBuilder> + priceInfoBuilder_; + /** + * + * + *
+     * Product price and cost information.
+     * Google Merchant Center property
+     * [price](https://support.google.com/merchants/answer/6324371).
+     * 
+ * + * .google.cloud.retail.v2.PriceInfo price_info = 14; + * + * @return Whether the priceInfo field is set. + */ + public boolean hasPriceInfo() { + return priceInfoBuilder_ != null || priceInfo_ != null; + } + /** + * + * + *
+     * Product price and cost information.
+     * Google Merchant Center property
+     * [price](https://support.google.com/merchants/answer/6324371).
+     * 
+ * + * .google.cloud.retail.v2.PriceInfo price_info = 14; + * + * @return The priceInfo. + */ + public com.google.cloud.retail.v2.PriceInfo getPriceInfo() { + if (priceInfoBuilder_ == null) { + return priceInfo_ == null + ? com.google.cloud.retail.v2.PriceInfo.getDefaultInstance() + : priceInfo_; + } else { + return priceInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Product price and cost information.
+     * Google Merchant Center property
+     * [price](https://support.google.com/merchants/answer/6324371).
+     * 
+ * + * .google.cloud.retail.v2.PriceInfo price_info = 14; + */ + public Builder setPriceInfo(com.google.cloud.retail.v2.PriceInfo value) { + if (priceInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + priceInfo_ = value; + onChanged(); + } else { + priceInfoBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Product price and cost information.
+     * Google Merchant Center property
+     * [price](https://support.google.com/merchants/answer/6324371).
+     * 
+ * + * .google.cloud.retail.v2.PriceInfo price_info = 14; + */ + public Builder setPriceInfo(com.google.cloud.retail.v2.PriceInfo.Builder builderForValue) { + if (priceInfoBuilder_ == null) { + priceInfo_ = builderForValue.build(); + onChanged(); + } else { + priceInfoBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Product price and cost information.
+     * Google Merchant Center property
+     * [price](https://support.google.com/merchants/answer/6324371).
+     * 
+ * + * .google.cloud.retail.v2.PriceInfo price_info = 14; + */ + public Builder mergePriceInfo(com.google.cloud.retail.v2.PriceInfo value) { + if (priceInfoBuilder_ == null) { + if (priceInfo_ != null) { + priceInfo_ = + com.google.cloud.retail.v2.PriceInfo.newBuilder(priceInfo_) + .mergeFrom(value) + .buildPartial(); + } else { + priceInfo_ = value; + } + onChanged(); + } else { + priceInfoBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Product price and cost information.
+     * Google Merchant Center property
+     * [price](https://support.google.com/merchants/answer/6324371).
+     * 
+ * + * .google.cloud.retail.v2.PriceInfo price_info = 14; + */ + public Builder clearPriceInfo() { + if (priceInfoBuilder_ == null) { + priceInfo_ = null; + onChanged(); + } else { + priceInfo_ = null; + priceInfoBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Product price and cost information.
+     * Google Merchant Center property
+     * [price](https://support.google.com/merchants/answer/6324371).
+     * 
+ * + * .google.cloud.retail.v2.PriceInfo price_info = 14; + */ + public com.google.cloud.retail.v2.PriceInfo.Builder getPriceInfoBuilder() { + + onChanged(); + return getPriceInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Product price and cost information.
+     * Google Merchant Center property
+     * [price](https://support.google.com/merchants/answer/6324371).
+     * 
+ * + * .google.cloud.retail.v2.PriceInfo price_info = 14; + */ + public com.google.cloud.retail.v2.PriceInfoOrBuilder getPriceInfoOrBuilder() { + if (priceInfoBuilder_ != null) { + return priceInfoBuilder_.getMessageOrBuilder(); + } else { + return priceInfo_ == null + ? com.google.cloud.retail.v2.PriceInfo.getDefaultInstance() + : priceInfo_; + } + } + /** + * + * + *
+     * Product price and cost information.
+     * Google Merchant Center property
+     * [price](https://support.google.com/merchants/answer/6324371).
+     * 
+ * + * .google.cloud.retail.v2.PriceInfo price_info = 14; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2.PriceInfo, + com.google.cloud.retail.v2.PriceInfo.Builder, + com.google.cloud.retail.v2.PriceInfoOrBuilder> + getPriceInfoFieldBuilder() { + if (priceInfoBuilder_ == null) { + priceInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2.PriceInfo, + com.google.cloud.retail.v2.PriceInfo.Builder, + com.google.cloud.retail.v2.PriceInfoOrBuilder>( + getPriceInfo(), getParentForChildren(), isClean()); + priceInfo_ = null; + } + return priceInfoBuilder_; + } + + private com.google.cloud.retail.v2.Rating rating_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2.Rating, + com.google.cloud.retail.v2.Rating.Builder, + com.google.cloud.retail.v2.RatingOrBuilder> + ratingBuilder_; + /** + * + * + *
+     * The rating of this product.
+     * 
+ * + * .google.cloud.retail.v2.Rating rating = 15; + * + * @return Whether the rating field is set. + */ + public boolean hasRating() { + return ratingBuilder_ != null || rating_ != null; + } + /** + * + * + *
+     * The rating of this product.
+     * 
+ * + * .google.cloud.retail.v2.Rating rating = 15; + * + * @return The rating. + */ + public com.google.cloud.retail.v2.Rating getRating() { + if (ratingBuilder_ == null) { + return rating_ == null ? com.google.cloud.retail.v2.Rating.getDefaultInstance() : rating_; + } else { + return ratingBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The rating of this product.
+     * 
+ * + * .google.cloud.retail.v2.Rating rating = 15; + */ + public Builder setRating(com.google.cloud.retail.v2.Rating value) { + if (ratingBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + rating_ = value; + onChanged(); + } else { + ratingBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The rating of this product.
+     * 
+ * + * .google.cloud.retail.v2.Rating rating = 15; + */ + public Builder setRating(com.google.cloud.retail.v2.Rating.Builder builderForValue) { + if (ratingBuilder_ == null) { + rating_ = builderForValue.build(); + onChanged(); + } else { + ratingBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The rating of this product.
+     * 
+ * + * .google.cloud.retail.v2.Rating rating = 15; + */ + public Builder mergeRating(com.google.cloud.retail.v2.Rating value) { + if (ratingBuilder_ == null) { + if (rating_ != null) { + rating_ = + com.google.cloud.retail.v2.Rating.newBuilder(rating_).mergeFrom(value).buildPartial(); + } else { + rating_ = value; + } + onChanged(); + } else { + ratingBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The rating of this product.
+     * 
+ * + * .google.cloud.retail.v2.Rating rating = 15; + */ + public Builder clearRating() { + if (ratingBuilder_ == null) { + rating_ = null; + onChanged(); + } else { + rating_ = null; + ratingBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The rating of this product.
+     * 
+ * + * .google.cloud.retail.v2.Rating rating = 15; + */ + public com.google.cloud.retail.v2.Rating.Builder getRatingBuilder() { + + onChanged(); + return getRatingFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The rating of this product.
+     * 
+ * + * .google.cloud.retail.v2.Rating rating = 15; + */ + public com.google.cloud.retail.v2.RatingOrBuilder getRatingOrBuilder() { + if (ratingBuilder_ != null) { + return ratingBuilder_.getMessageOrBuilder(); + } else { + return rating_ == null ? com.google.cloud.retail.v2.Rating.getDefaultInstance() : rating_; + } + } + /** + * + * + *
+     * The rating of this product.
+     * 
+ * + * .google.cloud.retail.v2.Rating rating = 15; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2.Rating, + com.google.cloud.retail.v2.Rating.Builder, + com.google.cloud.retail.v2.RatingOrBuilder> + getRatingFieldBuilder() { + if (ratingBuilder_ == null) { + ratingBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2.Rating, + com.google.cloud.retail.v2.Rating.Builder, + com.google.cloud.retail.v2.RatingOrBuilder>( + getRating(), getParentForChildren(), isClean()); + rating_ = null; + } + return ratingBuilder_; + } + + private com.google.protobuf.Timestamp availableTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + availableTimeBuilder_; + /** + * + * + *
+     * The timestamp when this [Product][google.cloud.retail.v2.Product] becomes
+     * available for
+     * [SearchService.Search][google.cloud.retail.v2.SearchService.Search].
+     * 
+ * + * .google.protobuf.Timestamp available_time = 18; + * + * @return Whether the availableTime field is set. + */ + public boolean hasAvailableTime() { + return availableTimeBuilder_ != null || availableTime_ != null; + } + /** + * + * + *
+     * The timestamp when this [Product][google.cloud.retail.v2.Product] becomes
+     * available for
+     * [SearchService.Search][google.cloud.retail.v2.SearchService.Search].
+     * 
+ * + * .google.protobuf.Timestamp available_time = 18; + * + * @return The availableTime. + */ + public com.google.protobuf.Timestamp getAvailableTime() { + if (availableTimeBuilder_ == null) { + return availableTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : availableTime_; + } else { + return availableTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The timestamp when this [Product][google.cloud.retail.v2.Product] becomes
+     * available for
+     * [SearchService.Search][google.cloud.retail.v2.SearchService.Search].
+     * 
+ * + * .google.protobuf.Timestamp available_time = 18; + */ + public Builder setAvailableTime(com.google.protobuf.Timestamp value) { + if (availableTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + availableTime_ = value; + onChanged(); + } else { + availableTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The timestamp when this [Product][google.cloud.retail.v2.Product] becomes
+     * available for
+     * [SearchService.Search][google.cloud.retail.v2.SearchService.Search].
+     * 
+ * + * .google.protobuf.Timestamp available_time = 18; + */ + public Builder setAvailableTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (availableTimeBuilder_ == null) { + availableTime_ = builderForValue.build(); + onChanged(); + } else { + availableTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The timestamp when this [Product][google.cloud.retail.v2.Product] becomes
+     * available for
+     * [SearchService.Search][google.cloud.retail.v2.SearchService.Search].
+     * 
+ * + * .google.protobuf.Timestamp available_time = 18; + */ + public Builder mergeAvailableTime(com.google.protobuf.Timestamp value) { + if (availableTimeBuilder_ == null) { + if (availableTime_ != null) { + availableTime_ = + com.google.protobuf.Timestamp.newBuilder(availableTime_) + .mergeFrom(value) + .buildPartial(); + } else { + availableTime_ = value; + } + onChanged(); + } else { + availableTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The timestamp when this [Product][google.cloud.retail.v2.Product] becomes
+     * available for
+     * [SearchService.Search][google.cloud.retail.v2.SearchService.Search].
+     * 
+ * + * .google.protobuf.Timestamp available_time = 18; + */ + public Builder clearAvailableTime() { + if (availableTimeBuilder_ == null) { + availableTime_ = null; + onChanged(); + } else { + availableTime_ = null; + availableTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The timestamp when this [Product][google.cloud.retail.v2.Product] becomes
+     * available for
+     * [SearchService.Search][google.cloud.retail.v2.SearchService.Search].
+     * 
+ * + * .google.protobuf.Timestamp available_time = 18; + */ + public com.google.protobuf.Timestamp.Builder getAvailableTimeBuilder() { + + onChanged(); + return getAvailableTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The timestamp when this [Product][google.cloud.retail.v2.Product] becomes
+     * available for
+     * [SearchService.Search][google.cloud.retail.v2.SearchService.Search].
+     * 
+ * + * .google.protobuf.Timestamp available_time = 18; + */ + public com.google.protobuf.TimestampOrBuilder getAvailableTimeOrBuilder() { + if (availableTimeBuilder_ != null) { + return availableTimeBuilder_.getMessageOrBuilder(); + } else { + return availableTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : availableTime_; + } + } + /** + * + * + *
+     * The timestamp when this [Product][google.cloud.retail.v2.Product] becomes
+     * available for
+     * [SearchService.Search][google.cloud.retail.v2.SearchService.Search].
+     * 
+ * + * .google.protobuf.Timestamp available_time = 18; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getAvailableTimeFieldBuilder() { + if (availableTimeBuilder_ == null) { + availableTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getAvailableTime(), getParentForChildren(), isClean()); + availableTime_ = null; + } + return availableTimeBuilder_; + } + + private int availability_ = 0; + /** + * + * + *
+     * The online availability of the [Product][google.cloud.retail.v2.Product].
+     * Default to
+     * [Availability.IN_STOCK][google.cloud.retail.v2.Product.Availability.IN_STOCK].
+     * Google Merchant Center Property
+     * [availability](https://support.google.com/merchants/answer/6324448).
+     * Schema.org Property [Offer.availability](https://schema.org/availability).
+     * 
+ * + * .google.cloud.retail.v2.Product.Availability availability = 19; + * + * @return The enum numeric value on the wire for availability. + */ + @java.lang.Override + public int getAvailabilityValue() { + return availability_; + } + /** + * + * + *
+     * The online availability of the [Product][google.cloud.retail.v2.Product].
+     * Default to
+     * [Availability.IN_STOCK][google.cloud.retail.v2.Product.Availability.IN_STOCK].
+     * Google Merchant Center Property
+     * [availability](https://support.google.com/merchants/answer/6324448).
+     * Schema.org Property [Offer.availability](https://schema.org/availability).
+     * 
+ * + * .google.cloud.retail.v2.Product.Availability availability = 19; + * + * @param value The enum numeric value on the wire for availability to set. + * @return This builder for chaining. + */ + public Builder setAvailabilityValue(int value) { + + availability_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The online availability of the [Product][google.cloud.retail.v2.Product].
+     * Default to
+     * [Availability.IN_STOCK][google.cloud.retail.v2.Product.Availability.IN_STOCK].
+     * Google Merchant Center Property
+     * [availability](https://support.google.com/merchants/answer/6324448).
+     * Schema.org Property [Offer.availability](https://schema.org/availability).
+     * 
+ * + * .google.cloud.retail.v2.Product.Availability availability = 19; + * + * @return The availability. + */ + @java.lang.Override + public com.google.cloud.retail.v2.Product.Availability getAvailability() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2.Product.Availability result = + com.google.cloud.retail.v2.Product.Availability.valueOf(availability_); + return result == null ? com.google.cloud.retail.v2.Product.Availability.UNRECOGNIZED : result; + } + /** + * + * + *
+     * The online availability of the [Product][google.cloud.retail.v2.Product].
+     * Default to
+     * [Availability.IN_STOCK][google.cloud.retail.v2.Product.Availability.IN_STOCK].
+     * Google Merchant Center Property
+     * [availability](https://support.google.com/merchants/answer/6324448).
+     * Schema.org Property [Offer.availability](https://schema.org/availability).
+     * 
+ * + * .google.cloud.retail.v2.Product.Availability availability = 19; + * + * @param value The availability to set. + * @return This builder for chaining. + */ + public Builder setAvailability(com.google.cloud.retail.v2.Product.Availability value) { + if (value == null) { + throw new NullPointerException(); + } + + availability_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The online availability of the [Product][google.cloud.retail.v2.Product].
+     * Default to
+     * [Availability.IN_STOCK][google.cloud.retail.v2.Product.Availability.IN_STOCK].
+     * Google Merchant Center Property
+     * [availability](https://support.google.com/merchants/answer/6324448).
+     * Schema.org Property [Offer.availability](https://schema.org/availability).
+     * 
+ * + * .google.cloud.retail.v2.Product.Availability availability = 19; + * + * @return This builder for chaining. + */ + public Builder clearAvailability() { + + availability_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Int32Value availableQuantity_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + availableQuantityBuilder_; + /** + * + * + *
+     * The available quantity of the item.
+     * 
+ * + * .google.protobuf.Int32Value available_quantity = 20; + * + * @return Whether the availableQuantity field is set. + */ + public boolean hasAvailableQuantity() { + return availableQuantityBuilder_ != null || availableQuantity_ != null; + } + /** + * + * + *
+     * The available quantity of the item.
+     * 
+ * + * .google.protobuf.Int32Value available_quantity = 20; + * + * @return The availableQuantity. + */ + public com.google.protobuf.Int32Value getAvailableQuantity() { + if (availableQuantityBuilder_ == null) { + return availableQuantity_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : availableQuantity_; + } else { + return availableQuantityBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The available quantity of the item.
+     * 
+ * + * .google.protobuf.Int32Value available_quantity = 20; + */ + public Builder setAvailableQuantity(com.google.protobuf.Int32Value value) { + if (availableQuantityBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + availableQuantity_ = value; + onChanged(); + } else { + availableQuantityBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The available quantity of the item.
+     * 
+ * + * .google.protobuf.Int32Value available_quantity = 20; + */ + public Builder setAvailableQuantity(com.google.protobuf.Int32Value.Builder builderForValue) { + if (availableQuantityBuilder_ == null) { + availableQuantity_ = builderForValue.build(); + onChanged(); + } else { + availableQuantityBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The available quantity of the item.
+     * 
+ * + * .google.protobuf.Int32Value available_quantity = 20; + */ + public Builder mergeAvailableQuantity(com.google.protobuf.Int32Value value) { + if (availableQuantityBuilder_ == null) { + if (availableQuantity_ != null) { + availableQuantity_ = + com.google.protobuf.Int32Value.newBuilder(availableQuantity_) + .mergeFrom(value) + .buildPartial(); + } else { + availableQuantity_ = value; + } + onChanged(); + } else { + availableQuantityBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The available quantity of the item.
+     * 
+ * + * .google.protobuf.Int32Value available_quantity = 20; + */ + public Builder clearAvailableQuantity() { + if (availableQuantityBuilder_ == null) { + availableQuantity_ = null; + onChanged(); + } else { + availableQuantity_ = null; + availableQuantityBuilder_ = null; } + + return this; } + /** + * + * + *
+     * The available quantity of the item.
+     * 
+ * + * .google.protobuf.Int32Value available_quantity = 20; + */ + public com.google.protobuf.Int32Value.Builder getAvailableQuantityBuilder() { - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField(int number) { - switch (number) { - case 12: - return internalGetMutableAttributes(); - default: - throw new RuntimeException("Invalid map field number: " + number); + onChanged(); + return getAvailableQuantityFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The available quantity of the item.
+     * 
+ * + * .google.protobuf.Int32Value available_quantity = 20; + */ + public com.google.protobuf.Int32ValueOrBuilder getAvailableQuantityOrBuilder() { + if (availableQuantityBuilder_ != null) { + return availableQuantityBuilder_.getMessageOrBuilder(); + } else { + return availableQuantity_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : availableQuantity_; } } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.retail.v2.ProductProto - .internal_static_google_cloud_retail_v2_Product_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.retail.v2.Product.class, - com.google.cloud.retail.v2.Product.Builder.class); + /** + * + * + *
+     * The available quantity of the item.
+     * 
+ * + * .google.protobuf.Int32Value available_quantity = 20; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + getAvailableQuantityFieldBuilder() { + if (availableQuantityBuilder_ == null) { + availableQuantityBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder>( + getAvailableQuantity(), getParentForChildren(), isClean()); + availableQuantity_ = null; + } + return availableQuantityBuilder_; } - // Construct using com.google.cloud.retail.v2.Product.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); + private java.util.List fulfillmentInfo_ = + java.util.Collections.emptyList(); + + private void ensureFulfillmentInfoIsMutable() { + if (!((bitField0_ & 0x00000020) != 0)) { + fulfillmentInfo_ = + new java.util.ArrayList(fulfillmentInfo_); + bitField0_ |= 0x00000020; + } } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2.FulfillmentInfo, + com.google.cloud.retail.v2.FulfillmentInfo.Builder, + com.google.cloud.retail.v2.FulfillmentInfoOrBuilder> + fulfillmentInfoBuilder_; + + /** + * + * + *
+     * Fulfillment information, such as the store IDs for in-store pickup or
+     * region IDs for different shipping methods.
+     * All the elements must have distinct
+     * [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type].
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2.FulfillmentInfo fulfillment_info = 21; + */ + public java.util.List getFulfillmentInfoList() { + if (fulfillmentInfoBuilder_ == null) { + return java.util.Collections.unmodifiableList(fulfillmentInfo_); + } else { + return fulfillmentInfoBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Fulfillment information, such as the store IDs for in-store pickup or
+     * region IDs for different shipping methods.
+     * All the elements must have distinct
+     * [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type].
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2.FulfillmentInfo fulfillment_info = 21; + */ + public int getFulfillmentInfoCount() { + if (fulfillmentInfoBuilder_ == null) { + return fulfillmentInfo_.size(); + } else { + return fulfillmentInfoBuilder_.getCount(); + } + } + /** + * + * + *
+     * Fulfillment information, such as the store IDs for in-store pickup or
+     * region IDs for different shipping methods.
+     * All the elements must have distinct
+     * [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type].
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2.FulfillmentInfo fulfillment_info = 21; + */ + public com.google.cloud.retail.v2.FulfillmentInfo getFulfillmentInfo(int index) { + if (fulfillmentInfoBuilder_ == null) { + return fulfillmentInfo_.get(index); + } else { + return fulfillmentInfoBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Fulfillment information, such as the store IDs for in-store pickup or
+     * region IDs for different shipping methods.
+     * All the elements must have distinct
+     * [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type].
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2.FulfillmentInfo fulfillment_info = 21; + */ + public Builder setFulfillmentInfo(int index, com.google.cloud.retail.v2.FulfillmentInfo value) { + if (fulfillmentInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFulfillmentInfoIsMutable(); + fulfillmentInfo_.set(index, value); + onChanged(); + } else { + fulfillmentInfoBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Fulfillment information, such as the store IDs for in-store pickup or
+     * region IDs for different shipping methods.
+     * All the elements must have distinct
+     * [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type].
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2.FulfillmentInfo fulfillment_info = 21; + */ + public Builder setFulfillmentInfo( + int index, com.google.cloud.retail.v2.FulfillmentInfo.Builder builderForValue) { + if (fulfillmentInfoBuilder_ == null) { + ensureFulfillmentInfoIsMutable(); + fulfillmentInfo_.set(index, builderForValue.build()); + onChanged(); + } else { + fulfillmentInfoBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Fulfillment information, such as the store IDs for in-store pickup or
+     * region IDs for different shipping methods.
+     * All the elements must have distinct
+     * [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type].
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2.FulfillmentInfo fulfillment_info = 21; + */ + public Builder addFulfillmentInfo(com.google.cloud.retail.v2.FulfillmentInfo value) { + if (fulfillmentInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFulfillmentInfoIsMutable(); + fulfillmentInfo_.add(value); + onChanged(); + } else { + fulfillmentInfoBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Fulfillment information, such as the store IDs for in-store pickup or
+     * region IDs for different shipping methods.
+     * All the elements must have distinct
+     * [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type].
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2.FulfillmentInfo fulfillment_info = 21; + */ + public Builder addFulfillmentInfo(int index, com.google.cloud.retail.v2.FulfillmentInfo value) { + if (fulfillmentInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFulfillmentInfoIsMutable(); + fulfillmentInfo_.add(index, value); + onChanged(); + } else { + fulfillmentInfoBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Fulfillment information, such as the store IDs for in-store pickup or
+     * region IDs for different shipping methods.
+     * All the elements must have distinct
+     * [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type].
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2.FulfillmentInfo fulfillment_info = 21; + */ + public Builder addFulfillmentInfo( + com.google.cloud.retail.v2.FulfillmentInfo.Builder builderForValue) { + if (fulfillmentInfoBuilder_ == null) { + ensureFulfillmentInfoIsMutable(); + fulfillmentInfo_.add(builderForValue.build()); + onChanged(); + } else { + fulfillmentInfoBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Fulfillment information, such as the store IDs for in-store pickup or
+     * region IDs for different shipping methods.
+     * All the elements must have distinct
+     * [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type].
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2.FulfillmentInfo fulfillment_info = 21; + */ + public Builder addFulfillmentInfo( + int index, com.google.cloud.retail.v2.FulfillmentInfo.Builder builderForValue) { + if (fulfillmentInfoBuilder_ == null) { + ensureFulfillmentInfoIsMutable(); + fulfillmentInfo_.add(index, builderForValue.build()); + onChanged(); + } else { + fulfillmentInfoBuilder_.addMessage(index, builderForValue.build()); + } + return this; } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getImagesFieldBuilder(); + /** + * + * + *
+     * Fulfillment information, such as the store IDs for in-store pickup or
+     * region IDs for different shipping methods.
+     * All the elements must have distinct
+     * [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type].
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2.FulfillmentInfo fulfillment_info = 21; + */ + public Builder addAllFulfillmentInfo( + java.lang.Iterable values) { + if (fulfillmentInfoBuilder_ == null) { + ensureFulfillmentInfoIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, fulfillmentInfo_); + onChanged(); + } else { + fulfillmentInfoBuilder_.addAllMessages(values); } + return this; } - - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - id_ = ""; - - type_ = 0; - - primaryProductId_ = ""; - - categories_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - title_ = ""; - - description_ = ""; - - internalGetMutableAttributes().clear(); - tags_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000004); - if (priceInfoBuilder_ == null) { - priceInfo_ = null; + /** + * + * + *
+     * Fulfillment information, such as the store IDs for in-store pickup or
+     * region IDs for different shipping methods.
+     * All the elements must have distinct
+     * [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type].
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2.FulfillmentInfo fulfillment_info = 21; + */ + public Builder clearFulfillmentInfo() { + if (fulfillmentInfoBuilder_ == null) { + fulfillmentInfo_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); } else { - priceInfo_ = null; - priceInfoBuilder_ = null; + fulfillmentInfoBuilder_.clear(); } - if (availableTimeBuilder_ == null) { - availableTime_ = null; + return this; + } + /** + * + * + *
+     * Fulfillment information, such as the store IDs for in-store pickup or
+     * region IDs for different shipping methods.
+     * All the elements must have distinct
+     * [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type].
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2.FulfillmentInfo fulfillment_info = 21; + */ + public Builder removeFulfillmentInfo(int index) { + if (fulfillmentInfoBuilder_ == null) { + ensureFulfillmentInfoIsMutable(); + fulfillmentInfo_.remove(index); + onChanged(); } else { - availableTime_ = null; - availableTimeBuilder_ = null; + fulfillmentInfoBuilder_.remove(index); } - availability_ = 0; - - if (availableQuantityBuilder_ == null) { - availableQuantity_ = null; + return this; + } + /** + * + * + *
+     * Fulfillment information, such as the store IDs for in-store pickup or
+     * region IDs for different shipping methods.
+     * All the elements must have distinct
+     * [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type].
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2.FulfillmentInfo fulfillment_info = 21; + */ + public com.google.cloud.retail.v2.FulfillmentInfo.Builder getFulfillmentInfoBuilder(int index) { + return getFulfillmentInfoFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Fulfillment information, such as the store IDs for in-store pickup or
+     * region IDs for different shipping methods.
+     * All the elements must have distinct
+     * [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type].
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2.FulfillmentInfo fulfillment_info = 21; + */ + public com.google.cloud.retail.v2.FulfillmentInfoOrBuilder getFulfillmentInfoOrBuilder( + int index) { + if (fulfillmentInfoBuilder_ == null) { + return fulfillmentInfo_.get(index); } else { - availableQuantity_ = null; - availableQuantityBuilder_ = null; + return fulfillmentInfoBuilder_.getMessageOrBuilder(index); } - uri_ = ""; - - if (imagesBuilder_ == null) { - images_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); + } + /** + * + * + *
+     * Fulfillment information, such as the store IDs for in-store pickup or
+     * region IDs for different shipping methods.
+     * All the elements must have distinct
+     * [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type].
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2.FulfillmentInfo fulfillment_info = 21; + */ + public java.util.List + getFulfillmentInfoOrBuilderList() { + if (fulfillmentInfoBuilder_ != null) { + return fulfillmentInfoBuilder_.getMessageOrBuilderList(); } else { - imagesBuilder_.clear(); + return java.util.Collections.unmodifiableList(fulfillmentInfo_); } - return this; } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.retail.v2.ProductProto - .internal_static_google_cloud_retail_v2_Product_descriptor; + /** + * + * + *
+     * Fulfillment information, such as the store IDs for in-store pickup or
+     * region IDs for different shipping methods.
+     * All the elements must have distinct
+     * [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type].
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2.FulfillmentInfo fulfillment_info = 21; + */ + public com.google.cloud.retail.v2.FulfillmentInfo.Builder addFulfillmentInfoBuilder() { + return getFulfillmentInfoFieldBuilder() + .addBuilder(com.google.cloud.retail.v2.FulfillmentInfo.getDefaultInstance()); } - - @java.lang.Override - public com.google.cloud.retail.v2.Product getDefaultInstanceForType() { - return com.google.cloud.retail.v2.Product.getDefaultInstance(); + /** + * + * + *
+     * Fulfillment information, such as the store IDs for in-store pickup or
+     * region IDs for different shipping methods.
+     * All the elements must have distinct
+     * [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type].
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2.FulfillmentInfo fulfillment_info = 21; + */ + public com.google.cloud.retail.v2.FulfillmentInfo.Builder addFulfillmentInfoBuilder(int index) { + return getFulfillmentInfoFieldBuilder() + .addBuilder(index, com.google.cloud.retail.v2.FulfillmentInfo.getDefaultInstance()); + } + /** + * + * + *
+     * Fulfillment information, such as the store IDs for in-store pickup or
+     * region IDs for different shipping methods.
+     * All the elements must have distinct
+     * [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type].
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2.FulfillmentInfo fulfillment_info = 21; + */ + public java.util.List + getFulfillmentInfoBuilderList() { + return getFulfillmentInfoFieldBuilder().getBuilderList(); } - @java.lang.Override - public com.google.cloud.retail.v2.Product build() { - com.google.cloud.retail.v2.Product result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2.FulfillmentInfo, + com.google.cloud.retail.v2.FulfillmentInfo.Builder, + com.google.cloud.retail.v2.FulfillmentInfoOrBuilder> + getFulfillmentInfoFieldBuilder() { + if (fulfillmentInfoBuilder_ == null) { + fulfillmentInfoBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2.FulfillmentInfo, + com.google.cloud.retail.v2.FulfillmentInfo.Builder, + com.google.cloud.retail.v2.FulfillmentInfoOrBuilder>( + fulfillmentInfo_, + ((bitField0_ & 0x00000020) != 0), + getParentForChildren(), + isClean()); + fulfillmentInfo_ = null; } - return result; + return fulfillmentInfoBuilder_; } - @java.lang.Override - public com.google.cloud.retail.v2.Product buildPartial() { - com.google.cloud.retail.v2.Product result = new com.google.cloud.retail.v2.Product(this); - int from_bitField0_ = bitField0_; - result.name_ = name_; - result.id_ = id_; - result.type_ = type_; - result.primaryProductId_ = primaryProductId_; - if (((bitField0_ & 0x00000001) != 0)) { - categories_ = categories_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.categories_ = categories_; - result.title_ = title_; - result.description_ = description_; - result.attributes_ = internalGetAttributes(); - result.attributes_.makeImmutable(); - if (((bitField0_ & 0x00000004) != 0)) { - tags_ = tags_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000004); - } - result.tags_ = tags_; - if (priceInfoBuilder_ == null) { - result.priceInfo_ = priceInfo_; - } else { - result.priceInfo_ = priceInfoBuilder_.build(); - } - if (availableTimeBuilder_ == null) { - result.availableTime_ = availableTime_; - } else { - result.availableTime_ = availableTimeBuilder_.build(); - } - result.availability_ = availability_; - if (availableQuantityBuilder_ == null) { - result.availableQuantity_ = availableQuantity_; + private java.lang.Object uri_ = ""; + /** + * + * + *
+     * Canonical URL directly linking to the product detail page.
+     * It is strongly recommended to provide a valid uri for the product,
+     * otherwise the service performance could be significantly degraded.
+     * 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
+     * [link](https://support.google.com/merchants/answer/6324416). Schema.org
+     * property [Offer.url](https://schema.org/url).
+     * 
+ * + * string uri = 22; + * + * @return The uri. + */ + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; } else { - result.availableQuantity_ = availableQuantityBuilder_.build(); + return (java.lang.String) ref; } - result.uri_ = uri_; - if (imagesBuilder_ == null) { - if (((bitField0_ & 0x00000008) != 0)) { - images_ = java.util.Collections.unmodifiableList(images_); - bitField0_ = (bitField0_ & ~0x00000008); - } - result.images_ = images_; + } + /** + * + * + *
+     * Canonical URL directly linking to the product detail page.
+     * It is strongly recommended to provide a valid uri for the product,
+     * otherwise the service performance could be significantly degraded.
+     * 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
+     * [link](https://support.google.com/merchants/answer/6324416). Schema.org
+     * property [Offer.url](https://schema.org/url).
+     * 
+ * + * string uri = 22; + * + * @return The bytes for uri. + */ + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; } else { - result.images_ = imagesBuilder_.build(); + return (com.google.protobuf.ByteString) ref; } - onBuilt(); - return result; } + /** + * + * + *
+     * Canonical URL directly linking to the product detail page.
+     * It is strongly recommended to provide a valid uri for the product,
+     * otherwise the service performance could be significantly degraded.
+     * 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
+     * [link](https://support.google.com/merchants/answer/6324416). Schema.org
+     * property [Offer.url](https://schema.org/url).
+     * 
+ * + * string uri = 22; + * + * @param value The uri to set. + * @return This builder for chaining. + */ + public Builder setUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } - @java.lang.Override - public Builder clone() { - return super.clone(); + uri_ = value; + onChanged(); + return this; } + /** + * + * + *
+     * Canonical URL directly linking to the product detail page.
+     * It is strongly recommended to provide a valid uri for the product,
+     * otherwise the service performance could be significantly degraded.
+     * 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
+     * [link](https://support.google.com/merchants/answer/6324416). Schema.org
+     * property [Offer.url](https://schema.org/url).
+     * 
+ * + * string uri = 22; + * + * @return This builder for chaining. + */ + public Builder clearUri() { - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); + uri_ = getDefaultInstance().getUri(); + onChanged(); + return this; } + /** + * + * + *
+     * Canonical URL directly linking to the product detail page.
+     * It is strongly recommended to provide a valid uri for the product,
+     * otherwise the service performance could be significantly degraded.
+     * 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
+     * [link](https://support.google.com/merchants/answer/6324416). Schema.org
+     * property [Offer.url](https://schema.org/url).
+     * 
+ * + * string uri = 22; + * + * @param value The bytes for uri to set. + * @return This builder for chaining. + */ + public Builder setUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); + uri_ = value; + onChanged(); + return this; } - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } + private java.util.List images_ = + java.util.Collections.emptyList(); - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); + private void ensureImagesIsMutable() { + if (!((bitField0_ & 0x00000040) != 0)) { + images_ = new java.util.ArrayList(images_); + bitField0_ |= 0x00000040; + } } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2.Image, + com.google.cloud.retail.v2.Image.Builder, + com.google.cloud.retail.v2.ImageOrBuilder> + imagesBuilder_; - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.retail.v2.Product) { - return mergeFrom((com.google.cloud.retail.v2.Product) other); + /** + * + * + *
+     * Product images for the product.Highly recommended to put the main image
+     * to the first.
+     * A maximum of 300 images are allowed.
+     * Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
+     * 
+ * + * repeated .google.cloud.retail.v2.Image images = 23; + */ + public java.util.List getImagesList() { + if (imagesBuilder_ == null) { + return java.util.Collections.unmodifiableList(images_); } else { - super.mergeFrom(other); - return this; + return imagesBuilder_.getMessageList(); } } - - public Builder mergeFrom(com.google.cloud.retail.v2.Product other) { - if (other == com.google.cloud.retail.v2.Product.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (!other.getId().isEmpty()) { - id_ = other.id_; - onChanged(); - } - if (other.type_ != 0) { - setTypeValue(other.getTypeValue()); - } - if (!other.getPrimaryProductId().isEmpty()) { - primaryProductId_ = other.primaryProductId_; - onChanged(); - } - if (!other.categories_.isEmpty()) { - if (categories_.isEmpty()) { - categories_ = other.categories_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureCategoriesIsMutable(); - categories_.addAll(other.categories_); - } - onChanged(); - } - if (!other.getTitle().isEmpty()) { - title_ = other.title_; - onChanged(); - } - if (!other.getDescription().isEmpty()) { - description_ = other.description_; - onChanged(); - } - internalGetMutableAttributes().mergeFrom(other.internalGetAttributes()); - if (!other.tags_.isEmpty()) { - if (tags_.isEmpty()) { - tags_ = other.tags_; - bitField0_ = (bitField0_ & ~0x00000004); - } else { - ensureTagsIsMutable(); - tags_.addAll(other.tags_); - } - onChanged(); - } - if (other.hasPriceInfo()) { - mergePriceInfo(other.getPriceInfo()); - } - if (other.hasAvailableTime()) { - mergeAvailableTime(other.getAvailableTime()); - } - if (other.availability_ != 0) { - setAvailabilityValue(other.getAvailabilityValue()); - } - if (other.hasAvailableQuantity()) { - mergeAvailableQuantity(other.getAvailableQuantity()); - } - if (!other.getUri().isEmpty()) { - uri_ = other.uri_; - onChanged(); - } + /** + * + * + *
+     * Product images for the product.Highly recommended to put the main image
+     * to the first.
+     * A maximum of 300 images are allowed.
+     * Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
+     * 
+ * + * repeated .google.cloud.retail.v2.Image images = 23; + */ + public int getImagesCount() { if (imagesBuilder_ == null) { - if (!other.images_.isEmpty()) { - if (images_.isEmpty()) { - images_ = other.images_; - bitField0_ = (bitField0_ & ~0x00000008); - } else { - ensureImagesIsMutable(); - images_.addAll(other.images_); - } - onChanged(); - } + return images_.size(); } else { - if (!other.images_.isEmpty()) { - if (imagesBuilder_.isEmpty()) { - imagesBuilder_.dispose(); - imagesBuilder_ = null; - images_ = other.images_; - bitField0_ = (bitField0_ & ~0x00000008); - imagesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getImagesFieldBuilder() - : null; - } else { - imagesBuilder_.addAllMessages(other.images_); - } - } + return imagesBuilder_.getCount(); } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; } - - @java.lang.Override - public final boolean isInitialized() { - return true; + /** + * + * + *
+     * Product images for the product.Highly recommended to put the main image
+     * to the first.
+     * A maximum of 300 images are allowed.
+     * Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
+     * 
+ * + * repeated .google.cloud.retail.v2.Image images = 23; + */ + public com.google.cloud.retail.v2.Image getImages(int index) { + if (imagesBuilder_ == null) { + return images_.get(index); + } else { + return imagesBuilder_.getMessage(index); + } } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.retail.v2.Product parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.retail.v2.Product) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); + /** + * + * + *
+     * Product images for the product.Highly recommended to put the main image
+     * to the first.
+     * A maximum of 300 images are allowed.
+     * Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
+     * 
+ * + * repeated .google.cloud.retail.v2.Image images = 23; + */ + public Builder setImages(int index, com.google.cloud.retail.v2.Image value) { + if (imagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); } + ensureImagesIsMutable(); + images_.set(index, value); + onChanged(); + } else { + imagesBuilder_.setMessage(index, value); } return this; } - - private int bitField0_; - - private java.lang.Object name_ = ""; /** * * *
-     * Immutable. Full resource name of the product, such as
-     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/product_id`.
-     * The branch ID must be "default_branch".
+     * Product images for the product.Highly recommended to put the main image
+     * to the first.
+     * A maximum of 300 images are allowed.
+     * Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
      * 
* - * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @return The name. + * repeated .google.cloud.retail.v2.Image images = 23; */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; + public Builder setImages(int index, com.google.cloud.retail.v2.Image.Builder builderForValue) { + if (imagesBuilder_ == null) { + ensureImagesIsMutable(); + images_.set(index, builderForValue.build()); + onChanged(); } else { - return (java.lang.String) ref; + imagesBuilder_.setMessage(index, builderForValue.build()); } + return this; } /** * * *
-     * Immutable. Full resource name of the product, such as
-     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/product_id`.
-     * The branch ID must be "default_branch".
+     * Product images for the product.Highly recommended to put the main image
+     * to the first.
+     * A maximum of 300 images are allowed.
+     * Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
      * 
* - * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @return The bytes for name. + * repeated .google.cloud.retail.v2.Image images = 23; */ - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; + public Builder addImages(com.google.cloud.retail.v2.Image value) { + if (imagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureImagesIsMutable(); + images_.add(value); + onChanged(); } else { - return (com.google.protobuf.ByteString) ref; + imagesBuilder_.addMessage(value); } + return this; } /** * * *
-     * Immutable. Full resource name of the product, such as
-     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/product_id`.
-     * The branch ID must be "default_branch".
+     * Product images for the product.Highly recommended to put the main image
+     * to the first.
+     * A maximum of 300 images are allowed.
+     * Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
      * 
* - * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @param value The name to set. - * @return This builder for chaining. + * repeated .google.cloud.retail.v2.Image images = 23; */ - public Builder setName(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); + public Builder addImages(int index, com.google.cloud.retail.v2.Image value) { + if (imagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureImagesIsMutable(); + images_.add(index, value); + onChanged(); + } else { + imagesBuilder_.addMessage(index, value); } - - name_ = value; - onChanged(); return this; } /** * * *
-     * Immutable. Full resource name of the product, such as
-     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/product_id`.
-     * The branch ID must be "default_branch".
+     * Product images for the product.Highly recommended to put the main image
+     * to the first.
+     * A maximum of 300 images are allowed.
+     * Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
      * 
* - * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @return This builder for chaining. + * repeated .google.cloud.retail.v2.Image images = 23; */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); + public Builder addImages(com.google.cloud.retail.v2.Image.Builder builderForValue) { + if (imagesBuilder_ == null) { + ensureImagesIsMutable(); + images_.add(builderForValue.build()); + onChanged(); + } else { + imagesBuilder_.addMessage(builderForValue.build()); + } return this; } /** * * *
-     * Immutable. Full resource name of the product, such as
-     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/product_id`.
-     * The branch ID must be "default_branch".
+     * Product images for the product.Highly recommended to put the main image
+     * to the first.
+     * A maximum of 300 images are allowed.
+     * Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
      * 
* - * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @param value The bytes for name to set. - * @return This builder for chaining. + * repeated .google.cloud.retail.v2.Image images = 23; */ - public Builder setNameBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); + public Builder addImages(int index, com.google.cloud.retail.v2.Image.Builder builderForValue) { + if (imagesBuilder_ == null) { + ensureImagesIsMutable(); + images_.add(index, builderForValue.build()); + onChanged(); + } else { + imagesBuilder_.addMessage(index, builderForValue.build()); } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); return this; } - - private java.lang.Object id_ = ""; /** * * *
-     * Immutable. [Product][google.cloud.retail.v2.Product] identifier, which is
-     * the final component of [name][google.cloud.retail.v2.Product.name]. For
-     * example, this field is "id_1", if
-     * [name][google.cloud.retail.v2.Product.name] is
-     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/id_1`.
-     * This field must be a UTF-8 encoded string with a length limit of 128
-     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Product images for the product.Highly recommended to put the main image
+     * to the first.
+     * A maximum of 300 images are allowed.
      * Google Merchant Center property
-     * [id](https://support.google.com/merchants/answer/6324405). Schema.org
-     * Property [Product.sku](https://schema.org/sku).
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
      * 
* - * string id = 2 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @return The id. + * repeated .google.cloud.retail.v2.Image images = 23; */ - public java.lang.String getId() { - java.lang.Object ref = id_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - id_ = s; - return s; + public Builder addAllImages( + java.lang.Iterable values) { + if (imagesBuilder_ == null) { + ensureImagesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, images_); + onChanged(); } else { - return (java.lang.String) ref; + imagesBuilder_.addAllMessages(values); } + return this; } /** * * *
-     * Immutable. [Product][google.cloud.retail.v2.Product] identifier, which is
-     * the final component of [name][google.cloud.retail.v2.Product.name]. For
-     * example, this field is "id_1", if
-     * [name][google.cloud.retail.v2.Product.name] is
-     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/id_1`.
-     * This field must be a UTF-8 encoded string with a length limit of 128
-     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Product images for the product.Highly recommended to put the main image
+     * to the first.
+     * A maximum of 300 images are allowed.
      * Google Merchant Center property
-     * [id](https://support.google.com/merchants/answer/6324405). Schema.org
-     * Property [Product.sku](https://schema.org/sku).
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
      * 
* - * string id = 2 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @return The bytes for id. + * repeated .google.cloud.retail.v2.Image images = 23; */ - public com.google.protobuf.ByteString getIdBytes() { - java.lang.Object ref = id_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - id_ = b; - return b; + public Builder clearImages() { + if (imagesBuilder_ == null) { + images_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); } else { - return (com.google.protobuf.ByteString) ref; + imagesBuilder_.clear(); } + return this; } /** * * *
-     * Immutable. [Product][google.cloud.retail.v2.Product] identifier, which is
-     * the final component of [name][google.cloud.retail.v2.Product.name]. For
-     * example, this field is "id_1", if
-     * [name][google.cloud.retail.v2.Product.name] is
-     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/id_1`.
-     * This field must be a UTF-8 encoded string with a length limit of 128
-     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Product images for the product.Highly recommended to put the main image
+     * to the first.
+     * A maximum of 300 images are allowed.
      * Google Merchant Center property
-     * [id](https://support.google.com/merchants/answer/6324405). Schema.org
-     * Property [Product.sku](https://schema.org/sku).
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
      * 
* - * string id = 2 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @param value The id to set. - * @return This builder for chaining. + * repeated .google.cloud.retail.v2.Image images = 23; */ - public Builder setId(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); + public Builder removeImages(int index) { + if (imagesBuilder_ == null) { + ensureImagesIsMutable(); + images_.remove(index); + onChanged(); + } else { + imagesBuilder_.remove(index); } - - id_ = value; - onChanged(); return this; } /** * * *
-     * Immutable. [Product][google.cloud.retail.v2.Product] identifier, which is
-     * the final component of [name][google.cloud.retail.v2.Product.name]. For
-     * example, this field is "id_1", if
-     * [name][google.cloud.retail.v2.Product.name] is
-     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/id_1`.
-     * This field must be a UTF-8 encoded string with a length limit of 128
-     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Product images for the product.Highly recommended to put the main image
+     * to the first.
+     * A maximum of 300 images are allowed.
      * Google Merchant Center property
-     * [id](https://support.google.com/merchants/answer/6324405). Schema.org
-     * Property [Product.sku](https://schema.org/sku).
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
      * 
- * - * string id = 2 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @return This builder for chaining. - */ - public Builder clearId() { - - id_ = getDefaultInstance().getId(); - onChanged(); - return this; + * + * repeated .google.cloud.retail.v2.Image images = 23; + */ + public com.google.cloud.retail.v2.Image.Builder getImagesBuilder(int index) { + return getImagesFieldBuilder().getBuilder(index); } /** * * *
-     * Immutable. [Product][google.cloud.retail.v2.Product] identifier, which is
-     * the final component of [name][google.cloud.retail.v2.Product.name]. For
-     * example, this field is "id_1", if
-     * [name][google.cloud.retail.v2.Product.name] is
-     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/id_1`.
-     * This field must be a UTF-8 encoded string with a length limit of 128
-     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Product images for the product.Highly recommended to put the main image
+     * to the first.
+     * A maximum of 300 images are allowed.
      * Google Merchant Center property
-     * [id](https://support.google.com/merchants/answer/6324405). Schema.org
-     * Property [Product.sku](https://schema.org/sku).
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
      * 
* - * string id = 2 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @param value The bytes for id to set. - * @return This builder for chaining. + * repeated .google.cloud.retail.v2.Image images = 23; */ - public Builder setIdBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); + public com.google.cloud.retail.v2.ImageOrBuilder getImagesOrBuilder(int index) { + if (imagesBuilder_ == null) { + return images_.get(index); + } else { + return imagesBuilder_.getMessageOrBuilder(index); } - checkByteStringIsUtf8(value); - - id_ = value; - onChanged(); - return this; } - - private int type_ = 0; /** * * *
-     * Immutable. The type of the product. This field is output-only.
+     * Product images for the product.Highly recommended to put the main image
+     * to the first.
+     * A maximum of 300 images are allowed.
+     * Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
      * 
* - * - * .google.cloud.retail.v2.Product.Type type = 3 [(.google.api.field_behavior) = IMMUTABLE]; - * - * - * @return The enum numeric value on the wire for type. + * repeated .google.cloud.retail.v2.Image images = 23; */ - @java.lang.Override - public int getTypeValue() { - return type_; + public java.util.List + getImagesOrBuilderList() { + if (imagesBuilder_ != null) { + return imagesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(images_); + } } /** * * *
-     * Immutable. The type of the product. This field is output-only.
+     * Product images for the product.Highly recommended to put the main image
+     * to the first.
+     * A maximum of 300 images are allowed.
+     * Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
      * 
* - * - * .google.cloud.retail.v2.Product.Type type = 3 [(.google.api.field_behavior) = IMMUTABLE]; - * - * - * @param value The enum numeric value on the wire for type to set. - * @return This builder for chaining. + * repeated .google.cloud.retail.v2.Image images = 23; */ - public Builder setTypeValue(int value) { - - type_ = value; - onChanged(); - return this; + public com.google.cloud.retail.v2.Image.Builder addImagesBuilder() { + return getImagesFieldBuilder() + .addBuilder(com.google.cloud.retail.v2.Image.getDefaultInstance()); } /** * * *
-     * Immutable. The type of the product. This field is output-only.
+     * Product images for the product.Highly recommended to put the main image
+     * to the first.
+     * A maximum of 300 images are allowed.
+     * Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
      * 
* - * - * .google.cloud.retail.v2.Product.Type type = 3 [(.google.api.field_behavior) = IMMUTABLE]; - * - * - * @return The type. + * repeated .google.cloud.retail.v2.Image images = 23; */ - @java.lang.Override - public com.google.cloud.retail.v2.Product.Type getType() { - @SuppressWarnings("deprecation") - com.google.cloud.retail.v2.Product.Type result = - com.google.cloud.retail.v2.Product.Type.valueOf(type_); - return result == null ? com.google.cloud.retail.v2.Product.Type.UNRECOGNIZED : result; + public com.google.cloud.retail.v2.Image.Builder addImagesBuilder(int index) { + return getImagesFieldBuilder() + .addBuilder(index, com.google.cloud.retail.v2.Image.getDefaultInstance()); } /** * * *
-     * Immutable. The type of the product. This field is output-only.
+     * Product images for the product.Highly recommended to put the main image
+     * to the first.
+     * A maximum of 300 images are allowed.
+     * Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
      * 
* - * - * .google.cloud.retail.v2.Product.Type type = 3 [(.google.api.field_behavior) = IMMUTABLE]; - * - * - * @param value The type to set. - * @return This builder for chaining. + * repeated .google.cloud.retail.v2.Image images = 23; */ - public Builder setType(com.google.cloud.retail.v2.Product.Type value) { - if (value == null) { - throw new NullPointerException(); - } + public java.util.List getImagesBuilderList() { + return getImagesFieldBuilder().getBuilderList(); + } - type_ = value.getNumber(); - onChanged(); - return this; + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2.Image, + com.google.cloud.retail.v2.Image.Builder, + com.google.cloud.retail.v2.ImageOrBuilder> + getImagesFieldBuilder() { + if (imagesBuilder_ == null) { + imagesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2.Image, + com.google.cloud.retail.v2.Image.Builder, + com.google.cloud.retail.v2.ImageOrBuilder>( + images_, ((bitField0_ & 0x00000040) != 0), getParentForChildren(), isClean()); + images_ = null; + } + return imagesBuilder_; } + + private com.google.cloud.retail.v2.Audience audience_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2.Audience, + com.google.cloud.retail.v2.Audience.Builder, + com.google.cloud.retail.v2.AudienceOrBuilder> + audienceBuilder_; /** * * *
-     * Immutable. The type of the product. This field is output-only.
+     * The target group associated with a given audience (e.g. male, veterans,
+     * car owners, musicians, etc.) of the product.
      * 
* - * - * .google.cloud.retail.v2.Product.Type type = 3 [(.google.api.field_behavior) = IMMUTABLE]; - * + * .google.cloud.retail.v2.Audience audience = 24; * - * @return This builder for chaining. + * @return Whether the audience field is set. */ - public Builder clearType() { - - type_ = 0; - onChanged(); - return this; + public boolean hasAudience() { + return audienceBuilder_ != null || audience_ != null; } - - private java.lang.Object primaryProductId_ = ""; /** * * *
-     * Variant group identifier. Must be an
-     * [id][google.cloud.retail.v2.Product.id], with the same parent branch with
-     * this product. Otherwise, an error is thrown.
-     * For [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
-     * [Product][google.cloud.retail.v2.Product]s, this field can only be empty or
-     * set to the same value as [id][google.cloud.retail.v2.Product.id].
-     * For VARIANT [Product][google.cloud.retail.v2.Product]s, this field cannot
-     * be empty. A maximum of 2,000 products are allowed to share the same
-     * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
-     * [Product][google.cloud.retail.v2.Product]. Otherwise, an INVALID_ARGUMENT
-     * error is returned.
-     * Google Merchant Center Property
-     * [item_group_id](https://support.google.com/merchants/answer/6324507).
-     * 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).
+     * The target group associated with a given audience (e.g. male, veterans,
+     * car owners, musicians, etc.) of the product.
      * 
* - * string primary_product_id = 4; + * .google.cloud.retail.v2.Audience audience = 24; * - * @return The primaryProductId. + * @return The audience. */ - public java.lang.String getPrimaryProductId() { - java.lang.Object ref = primaryProductId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - primaryProductId_ = s; - return s; + public com.google.cloud.retail.v2.Audience getAudience() { + if (audienceBuilder_ == null) { + return audience_ == null + ? com.google.cloud.retail.v2.Audience.getDefaultInstance() + : audience_; } else { - return (java.lang.String) ref; + return audienceBuilder_.getMessage(); } } /** * * *
-     * Variant group identifier. Must be an
-     * [id][google.cloud.retail.v2.Product.id], with the same parent branch with
-     * this product. Otherwise, an error is thrown.
-     * For [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
-     * [Product][google.cloud.retail.v2.Product]s, this field can only be empty or
-     * set to the same value as [id][google.cloud.retail.v2.Product.id].
-     * For VARIANT [Product][google.cloud.retail.v2.Product]s, this field cannot
-     * be empty. A maximum of 2,000 products are allowed to share the same
-     * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
-     * [Product][google.cloud.retail.v2.Product]. Otherwise, an INVALID_ARGUMENT
-     * error is returned.
-     * Google Merchant Center Property
-     * [item_group_id](https://support.google.com/merchants/answer/6324507).
-     * 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).
+     * The target group associated with a given audience (e.g. male, veterans,
+     * car owners, musicians, etc.) of the product.
      * 
* - * string primary_product_id = 4; - * - * @return The bytes for primaryProductId. + * .google.cloud.retail.v2.Audience audience = 24; */ - public com.google.protobuf.ByteString getPrimaryProductIdBytes() { - java.lang.Object ref = primaryProductId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - primaryProductId_ = b; - return b; + public Builder setAudience(com.google.cloud.retail.v2.Audience value) { + if (audienceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + audience_ = value; + onChanged(); } else { - return (com.google.protobuf.ByteString) ref; + audienceBuilder_.setMessage(value); } + + return this; } /** * * *
-     * Variant group identifier. Must be an
-     * [id][google.cloud.retail.v2.Product.id], with the same parent branch with
-     * this product. Otherwise, an error is thrown.
-     * For [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
-     * [Product][google.cloud.retail.v2.Product]s, this field can only be empty or
-     * set to the same value as [id][google.cloud.retail.v2.Product.id].
-     * For VARIANT [Product][google.cloud.retail.v2.Product]s, this field cannot
-     * be empty. A maximum of 2,000 products are allowed to share the same
-     * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
-     * [Product][google.cloud.retail.v2.Product]. Otherwise, an INVALID_ARGUMENT
-     * error is returned.
-     * Google Merchant Center Property
-     * [item_group_id](https://support.google.com/merchants/answer/6324507).
-     * 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).
+     * The target group associated with a given audience (e.g. male, veterans,
+     * car owners, musicians, etc.) of the product.
      * 
* - * string primary_product_id = 4; - * - * @param value The primaryProductId to set. - * @return This builder for chaining. + * .google.cloud.retail.v2.Audience audience = 24; */ - public Builder setPrimaryProductId(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); + public Builder setAudience(com.google.cloud.retail.v2.Audience.Builder builderForValue) { + if (audienceBuilder_ == null) { + audience_ = builderForValue.build(); + onChanged(); + } else { + audienceBuilder_.setMessage(builderForValue.build()); } - primaryProductId_ = value; - onChanged(); return this; } /** * * *
-     * Variant group identifier. Must be an
-     * [id][google.cloud.retail.v2.Product.id], with the same parent branch with
-     * this product. Otherwise, an error is thrown.
-     * For [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
-     * [Product][google.cloud.retail.v2.Product]s, this field can only be empty or
-     * set to the same value as [id][google.cloud.retail.v2.Product.id].
-     * For VARIANT [Product][google.cloud.retail.v2.Product]s, this field cannot
-     * be empty. A maximum of 2,000 products are allowed to share the same
-     * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
-     * [Product][google.cloud.retail.v2.Product]. Otherwise, an INVALID_ARGUMENT
-     * error is returned.
-     * Google Merchant Center Property
-     * [item_group_id](https://support.google.com/merchants/answer/6324507).
-     * 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).
+     * The target group associated with a given audience (e.g. male, veterans,
+     * car owners, musicians, etc.) of the product.
      * 
* - * string primary_product_id = 4; - * - * @return This builder for chaining. + * .google.cloud.retail.v2.Audience audience = 24; */ - public Builder clearPrimaryProductId() { + public Builder mergeAudience(com.google.cloud.retail.v2.Audience value) { + if (audienceBuilder_ == null) { + if (audience_ != null) { + audience_ = + com.google.cloud.retail.v2.Audience.newBuilder(audience_) + .mergeFrom(value) + .buildPartial(); + } else { + audience_ = value; + } + onChanged(); + } else { + audienceBuilder_.mergeFrom(value); + } - primaryProductId_ = getDefaultInstance().getPrimaryProductId(); - onChanged(); return this; } /** * * *
-     * Variant group identifier. Must be an
-     * [id][google.cloud.retail.v2.Product.id], with the same parent branch with
-     * this product. Otherwise, an error is thrown.
-     * For [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
-     * [Product][google.cloud.retail.v2.Product]s, this field can only be empty or
-     * set to the same value as [id][google.cloud.retail.v2.Product.id].
-     * For VARIANT [Product][google.cloud.retail.v2.Product]s, this field cannot
-     * be empty. A maximum of 2,000 products are allowed to share the same
-     * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
-     * [Product][google.cloud.retail.v2.Product]. Otherwise, an INVALID_ARGUMENT
-     * error is returned.
-     * Google Merchant Center Property
-     * [item_group_id](https://support.google.com/merchants/answer/6324507).
-     * 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).
+     * The target group associated with a given audience (e.g. male, veterans,
+     * car owners, musicians, etc.) of the product.
      * 
* - * string primary_product_id = 4; - * - * @param value The bytes for primaryProductId to set. - * @return This builder for chaining. + * .google.cloud.retail.v2.Audience audience = 24; */ - public Builder setPrimaryProductIdBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); + public Builder clearAudience() { + if (audienceBuilder_ == null) { + audience_ = null; + onChanged(); + } else { + audience_ = null; + audienceBuilder_ = null; } - checkByteStringIsUtf8(value); - primaryProductId_ = value; - onChanged(); return this; } - - private com.google.protobuf.LazyStringList categories_ = - com.google.protobuf.LazyStringArrayList.EMPTY; - - private void ensureCategoriesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - categories_ = new com.google.protobuf.LazyStringArrayList(categories_); - bitField0_ |= 0x00000001; - } - } /** * * *
-     * Product categories. This field is repeated for supporting one product
-     * belonging to several parallel categories. Strongly recommended using the
-     * full path for better search / recommendation quality.
-     * To represent full path of category, use '>' sign to separate different
-     * hierarchies. If '>' is part of the category name, please replace it with
-     * other character(s).
-     * For example, if a shoes product belongs to both
-     * ["Shoes & Accessories" -> "Shoes"] and
-     * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
-     * represented as:
-     *      "categories": [
-     *        "Shoes & Accessories > Shoes",
-     *        "Sports & Fitness > Athletic Clothing > Shoes"
-     *      ]
-     * Must be set for [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
-     * [Product][google.cloud.retail.v2.Product] otherwise an INVALID_ARGUMENT
-     * error is returned.
-     * At most 250 values are allowed per
-     * [Product][google.cloud.retail.v2.Product]. Empty values are not allowed.
-     * 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
-     * [google_product_category][mc_google_product_category]. Schema.org property
-     * [Product.category] (https://schema.org/category).
-     * [mc_google_product_category]:
-     * https://support.google.com/merchants/answer/6324436
+     * The target group associated with a given audience (e.g. male, veterans,
+     * car owners, musicians, etc.) of the product.
      * 
* - * repeated string categories = 7; - * - * @return A list containing the categories. + * .google.cloud.retail.v2.Audience audience = 24; */ - public com.google.protobuf.ProtocolStringList getCategoriesList() { - return categories_.getUnmodifiableView(); + public com.google.cloud.retail.v2.Audience.Builder getAudienceBuilder() { + + onChanged(); + return getAudienceFieldBuilder().getBuilder(); } /** * * *
-     * Product categories. This field is repeated for supporting one product
-     * belonging to several parallel categories. Strongly recommended using the
-     * full path for better search / recommendation quality.
-     * To represent full path of category, use '>' sign to separate different
-     * hierarchies. If '>' is part of the category name, please replace it with
-     * other character(s).
-     * For example, if a shoes product belongs to both
-     * ["Shoes & Accessories" -> "Shoes"] and
-     * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
-     * represented as:
-     *      "categories": [
-     *        "Shoes & Accessories > Shoes",
-     *        "Sports & Fitness > Athletic Clothing > Shoes"
-     *      ]
-     * Must be set for [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
-     * [Product][google.cloud.retail.v2.Product] otherwise an INVALID_ARGUMENT
-     * error is returned.
-     * At most 250 values are allowed per
-     * [Product][google.cloud.retail.v2.Product]. Empty values are not allowed.
-     * 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
-     * [google_product_category][mc_google_product_category]. Schema.org property
-     * [Product.category] (https://schema.org/category).
-     * [mc_google_product_category]:
-     * https://support.google.com/merchants/answer/6324436
+     * The target group associated with a given audience (e.g. male, veterans,
+     * car owners, musicians, etc.) of the product.
      * 
* - * repeated string categories = 7; - * - * @return The count of categories. + * .google.cloud.retail.v2.Audience audience = 24; */ - public int getCategoriesCount() { - return categories_.size(); + public com.google.cloud.retail.v2.AudienceOrBuilder getAudienceOrBuilder() { + if (audienceBuilder_ != null) { + return audienceBuilder_.getMessageOrBuilder(); + } else { + return audience_ == null + ? com.google.cloud.retail.v2.Audience.getDefaultInstance() + : audience_; + } } /** * * *
-     * Product categories. This field is repeated for supporting one product
-     * belonging to several parallel categories. Strongly recommended using the
-     * full path for better search / recommendation quality.
-     * To represent full path of category, use '>' sign to separate different
-     * hierarchies. If '>' is part of the category name, please replace it with
-     * other character(s).
-     * For example, if a shoes product belongs to both
-     * ["Shoes & Accessories" -> "Shoes"] and
-     * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
-     * represented as:
-     *      "categories": [
-     *        "Shoes & Accessories > Shoes",
-     *        "Sports & Fitness > Athletic Clothing > Shoes"
-     *      ]
-     * Must be set for [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
-     * [Product][google.cloud.retail.v2.Product] otherwise an INVALID_ARGUMENT
-     * error is returned.
-     * At most 250 values are allowed per
-     * [Product][google.cloud.retail.v2.Product]. Empty values are not allowed.
-     * 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
-     * [google_product_category][mc_google_product_category]. Schema.org property
-     * [Product.category] (https://schema.org/category).
-     * [mc_google_product_category]:
-     * https://support.google.com/merchants/answer/6324436
+     * The target group associated with a given audience (e.g. male, veterans,
+     * car owners, musicians, etc.) of the product.
      * 
* - * repeated string categories = 7; - * - * @param index The index of the element to return. - * @return The categories at the given index. + * .google.cloud.retail.v2.Audience audience = 24; */ - public java.lang.String getCategories(int index) { - return categories_.get(index); + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2.Audience, + com.google.cloud.retail.v2.Audience.Builder, + com.google.cloud.retail.v2.AudienceOrBuilder> + getAudienceFieldBuilder() { + if (audienceBuilder_ == null) { + audienceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2.Audience, + com.google.cloud.retail.v2.Audience.Builder, + com.google.cloud.retail.v2.AudienceOrBuilder>( + getAudience(), getParentForChildren(), isClean()); + audience_ = null; + } + return audienceBuilder_; } + + private com.google.cloud.retail.v2.ColorInfo colorInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2.ColorInfo, + com.google.cloud.retail.v2.ColorInfo.Builder, + com.google.cloud.retail.v2.ColorInfoOrBuilder> + colorInfoBuilder_; /** * * *
-     * Product categories. This field is repeated for supporting one product
-     * belonging to several parallel categories. Strongly recommended using the
-     * full path for better search / recommendation quality.
-     * To represent full path of category, use '>' sign to separate different
-     * hierarchies. If '>' is part of the category name, please replace it with
-     * other character(s).
-     * For example, if a shoes product belongs to both
-     * ["Shoes & Accessories" -> "Shoes"] and
-     * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
-     * represented as:
-     *      "categories": [
-     *        "Shoes & Accessories > Shoes",
-     *        "Sports & Fitness > Athletic Clothing > Shoes"
-     *      ]
-     * Must be set for [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
-     * [Product][google.cloud.retail.v2.Product] otherwise an INVALID_ARGUMENT
-     * error is returned.
-     * At most 250 values are allowed per
-     * [Product][google.cloud.retail.v2.Product]. Empty values are not allowed.
-     * Each value must be a UTF-8 encoded string with a length limit of 5,000
-     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * The color of the product.
      * Google Merchant Center property
-     * [google_product_category][mc_google_product_category]. Schema.org property
-     * [Product.category] (https://schema.org/category).
-     * [mc_google_product_category]:
-     * https://support.google.com/merchants/answer/6324436
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
      * 
* - * repeated string categories = 7; + * .google.cloud.retail.v2.ColorInfo color_info = 25; * - * @param index The index of the value to return. - * @return The bytes of the categories at the given index. + * @return Whether the colorInfo field is set. */ - public com.google.protobuf.ByteString getCategoriesBytes(int index) { - return categories_.getByteString(index); + public boolean hasColorInfo() { + return colorInfoBuilder_ != null || colorInfo_ != null; } /** * * *
-     * Product categories. This field is repeated for supporting one product
-     * belonging to several parallel categories. Strongly recommended using the
-     * full path for better search / recommendation quality.
-     * To represent full path of category, use '>' sign to separate different
-     * hierarchies. If '>' is part of the category name, please replace it with
-     * other character(s).
-     * For example, if a shoes product belongs to both
-     * ["Shoes & Accessories" -> "Shoes"] and
-     * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
-     * represented as:
-     *      "categories": [
-     *        "Shoes & Accessories > Shoes",
-     *        "Sports & Fitness > Athletic Clothing > Shoes"
-     *      ]
-     * Must be set for [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
-     * [Product][google.cloud.retail.v2.Product] otherwise an INVALID_ARGUMENT
-     * error is returned.
-     * At most 250 values are allowed per
-     * [Product][google.cloud.retail.v2.Product]. Empty values are not allowed.
-     * Each value must be a UTF-8 encoded string with a length limit of 5,000
-     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * The color of the product.
      * Google Merchant Center property
-     * [google_product_category][mc_google_product_category]. Schema.org property
-     * [Product.category] (https://schema.org/category).
-     * [mc_google_product_category]:
-     * https://support.google.com/merchants/answer/6324436
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
      * 
* - * repeated string categories = 7; + * .google.cloud.retail.v2.ColorInfo color_info = 25; * - * @param index The index to set the value at. - * @param value The categories to set. - * @return This builder for chaining. + * @return The colorInfo. */ - public Builder setCategories(int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); + public com.google.cloud.retail.v2.ColorInfo getColorInfo() { + if (colorInfoBuilder_ == null) { + return colorInfo_ == null + ? com.google.cloud.retail.v2.ColorInfo.getDefaultInstance() + : colorInfo_; + } else { + return colorInfoBuilder_.getMessage(); } - ensureCategoriesIsMutable(); - categories_.set(index, value); - onChanged(); - return this; } /** * * *
-     * Product categories. This field is repeated for supporting one product
-     * belonging to several parallel categories. Strongly recommended using the
-     * full path for better search / recommendation quality.
-     * To represent full path of category, use '>' sign to separate different
-     * hierarchies. If '>' is part of the category name, please replace it with
-     * other character(s).
-     * For example, if a shoes product belongs to both
-     * ["Shoes & Accessories" -> "Shoes"] and
-     * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
-     * represented as:
-     *      "categories": [
-     *        "Shoes & Accessories > Shoes",
-     *        "Sports & Fitness > Athletic Clothing > Shoes"
-     *      ]
-     * Must be set for [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
-     * [Product][google.cloud.retail.v2.Product] otherwise an INVALID_ARGUMENT
-     * error is returned.
-     * At most 250 values are allowed per
-     * [Product][google.cloud.retail.v2.Product]. Empty values are not allowed.
-     * Each value must be a UTF-8 encoded string with a length limit of 5,000
-     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * The color of the product.
      * Google Merchant Center property
-     * [google_product_category][mc_google_product_category]. Schema.org property
-     * [Product.category] (https://schema.org/category).
-     * [mc_google_product_category]:
-     * https://support.google.com/merchants/answer/6324436
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
      * 
* - * repeated string categories = 7; - * - * @param value The categories to add. - * @return This builder for chaining. + * .google.cloud.retail.v2.ColorInfo color_info = 25; */ - public Builder addCategories(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); + public Builder setColorInfo(com.google.cloud.retail.v2.ColorInfo value) { + if (colorInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + colorInfo_ = value; + onChanged(); + } else { + colorInfoBuilder_.setMessage(value); } - ensureCategoriesIsMutable(); - categories_.add(value); - onChanged(); + return this; } /** * * *
-     * Product categories. This field is repeated for supporting one product
-     * belonging to several parallel categories. Strongly recommended using the
-     * full path for better search / recommendation quality.
-     * To represent full path of category, use '>' sign to separate different
-     * hierarchies. If '>' is part of the category name, please replace it with
-     * other character(s).
-     * For example, if a shoes product belongs to both
-     * ["Shoes & Accessories" -> "Shoes"] and
-     * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
-     * represented as:
-     *      "categories": [
-     *        "Shoes & Accessories > Shoes",
-     *        "Sports & Fitness > Athletic Clothing > Shoes"
-     *      ]
-     * Must be set for [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
-     * [Product][google.cloud.retail.v2.Product] otherwise an INVALID_ARGUMENT
-     * error is returned.
-     * At most 250 values are allowed per
-     * [Product][google.cloud.retail.v2.Product]. Empty values are not allowed.
-     * Each value must be a UTF-8 encoded string with a length limit of 5,000
-     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * The color of the product.
      * Google Merchant Center property
-     * [google_product_category][mc_google_product_category]. Schema.org property
-     * [Product.category] (https://schema.org/category).
-     * [mc_google_product_category]:
-     * https://support.google.com/merchants/answer/6324436
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
      * 
* - * repeated string categories = 7; - * - * @param values The categories to add. - * @return This builder for chaining. + * .google.cloud.retail.v2.ColorInfo color_info = 25; */ - public Builder addAllCategories(java.lang.Iterable values) { - ensureCategoriesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, categories_); - onChanged(); + public Builder setColorInfo(com.google.cloud.retail.v2.ColorInfo.Builder builderForValue) { + if (colorInfoBuilder_ == null) { + colorInfo_ = builderForValue.build(); + onChanged(); + } else { + colorInfoBuilder_.setMessage(builderForValue.build()); + } + return this; } /** * * *
-     * Product categories. This field is repeated for supporting one product
-     * belonging to several parallel categories. Strongly recommended using the
-     * full path for better search / recommendation quality.
-     * To represent full path of category, use '>' sign to separate different
-     * hierarchies. If '>' is part of the category name, please replace it with
-     * other character(s).
-     * For example, if a shoes product belongs to both
-     * ["Shoes & Accessories" -> "Shoes"] and
-     * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
-     * represented as:
-     *      "categories": [
-     *        "Shoes & Accessories > Shoes",
-     *        "Sports & Fitness > Athletic Clothing > Shoes"
-     *      ]
-     * Must be set for [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
-     * [Product][google.cloud.retail.v2.Product] otherwise an INVALID_ARGUMENT
-     * error is returned.
-     * At most 250 values are allowed per
-     * [Product][google.cloud.retail.v2.Product]. Empty values are not allowed.
-     * Each value must be a UTF-8 encoded string with a length limit of 5,000
-     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * The color of the product.
      * Google Merchant Center property
-     * [google_product_category][mc_google_product_category]. Schema.org property
-     * [Product.category] (https://schema.org/category).
-     * [mc_google_product_category]:
-     * https://support.google.com/merchants/answer/6324436
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
      * 
* - * repeated string categories = 7; - * - * @return This builder for chaining. + * .google.cloud.retail.v2.ColorInfo color_info = 25; */ - public Builder clearCategories() { - categories_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); + public Builder mergeColorInfo(com.google.cloud.retail.v2.ColorInfo value) { + if (colorInfoBuilder_ == null) { + if (colorInfo_ != null) { + colorInfo_ = + com.google.cloud.retail.v2.ColorInfo.newBuilder(colorInfo_) + .mergeFrom(value) + .buildPartial(); + } else { + colorInfo_ = value; + } + onChanged(); + } else { + colorInfoBuilder_.mergeFrom(value); + } + return this; } /** * * *
-     * Product categories. This field is repeated for supporting one product
-     * belonging to several parallel categories. Strongly recommended using the
-     * full path for better search / recommendation quality.
-     * To represent full path of category, use '>' sign to separate different
-     * hierarchies. If '>' is part of the category name, please replace it with
-     * other character(s).
-     * For example, if a shoes product belongs to both
-     * ["Shoes & Accessories" -> "Shoes"] and
-     * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
-     * represented as:
-     *      "categories": [
-     *        "Shoes & Accessories > Shoes",
-     *        "Sports & Fitness > Athletic Clothing > Shoes"
-     *      ]
-     * Must be set for [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
-     * [Product][google.cloud.retail.v2.Product] otherwise an INVALID_ARGUMENT
-     * error is returned.
-     * At most 250 values are allowed per
-     * [Product][google.cloud.retail.v2.Product]. Empty values are not allowed.
-     * Each value must be a UTF-8 encoded string with a length limit of 5,000
-     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * The color of the product.
      * Google Merchant Center property
-     * [google_product_category][mc_google_product_category]. Schema.org property
-     * [Product.category] (https://schema.org/category).
-     * [mc_google_product_category]:
-     * https://support.google.com/merchants/answer/6324436
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
      * 
* - * repeated string categories = 7; - * - * @param value The bytes of the categories to add. - * @return This builder for chaining. + * .google.cloud.retail.v2.ColorInfo color_info = 25; */ - public Builder addCategoriesBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); + public Builder clearColorInfo() { + if (colorInfoBuilder_ == null) { + colorInfo_ = null; + onChanged(); + } else { + colorInfo_ = null; + colorInfoBuilder_ = null; } - checkByteStringIsUtf8(value); - ensureCategoriesIsMutable(); - categories_.add(value); - onChanged(); + return this; } - - private java.lang.Object title_ = ""; /** * * *
-     * Required. Product title.
-     * This field must be a UTF-8 encoded string with a length limit of 128
-     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * The color of the product.
      * Google Merchant Center property
-     * [title](https://support.google.com/merchants/answer/6324415). Schema.org
-     * property [Product.name](https://schema.org/name).
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
      * 
* - * string title = 8 [(.google.api.field_behavior) = REQUIRED]; + * .google.cloud.retail.v2.ColorInfo color_info = 25; + */ + public com.google.cloud.retail.v2.ColorInfo.Builder getColorInfoBuilder() { + + onChanged(); + return getColorInfoFieldBuilder().getBuilder(); + } + /** * - * @return The title. + * + *
+     * The color of the product.
+     * Google Merchant Center property
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * .google.cloud.retail.v2.ColorInfo color_info = 25; */ - public java.lang.String getTitle() { - java.lang.Object ref = title_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - title_ = s; - return s; + public com.google.cloud.retail.v2.ColorInfoOrBuilder getColorInfoOrBuilder() { + if (colorInfoBuilder_ != null) { + return colorInfoBuilder_.getMessageOrBuilder(); } else { - return (java.lang.String) ref; + return colorInfo_ == null + ? com.google.cloud.retail.v2.ColorInfo.getDefaultInstance() + : colorInfo_; } } /** * * *
-     * Required. Product title.
-     * This field must be a UTF-8 encoded string with a length limit of 128
-     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * The color of the product.
      * Google Merchant Center property
-     * [title](https://support.google.com/merchants/answer/6324415). Schema.org
-     * property [Product.name](https://schema.org/name).
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
      * 
* - * string title = 8 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for title. + * .google.cloud.retail.v2.ColorInfo color_info = 25; */ - public com.google.protobuf.ByteString getTitleBytes() { - java.lang.Object ref = title_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - title_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2.ColorInfo, + com.google.cloud.retail.v2.ColorInfo.Builder, + com.google.cloud.retail.v2.ColorInfoOrBuilder> + getColorInfoFieldBuilder() { + if (colorInfoBuilder_ == null) { + colorInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2.ColorInfo, + com.google.cloud.retail.v2.ColorInfo.Builder, + com.google.cloud.retail.v2.ColorInfoOrBuilder>( + getColorInfo(), getParentForChildren(), isClean()); + colorInfo_ = null; + } + return colorInfoBuilder_; + } + + private com.google.protobuf.LazyStringList sizes_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureSizesIsMutable() { + if (!((bitField0_ & 0x00000080) != 0)) { + sizes_ = new com.google.protobuf.LazyStringArrayList(sizes_); + bitField0_ |= 0x00000080; } } /** * * *
-     * Required. Product title.
-     * This field must be a UTF-8 encoded string with a length limit of 128
-     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * The size of the product. To represent different size systems or size types,
+     * consider using this format: [[[size_system:]size_type:]size_value].
+     * For example, in "US:MENS:M", "US" represents size system; "MENS" represents
+     * size type; "M" represents size value. In "GIRLS:27", size system is empty;
+     * "GIRLS" represents size type; "27" represents size value. In "32 inches",
+     * both size system and size type are empty, while size value is "32 inches".
+     * A maximum of 20 values are 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
-     * [title](https://support.google.com/merchants/answer/6324415). Schema.org
-     * property [Product.name](https://schema.org/name).
+     * [size](https://support.google.com/merchants/answer/6324492),
+     * [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).
      * 
* - * string title = 8 [(.google.api.field_behavior) = REQUIRED]; + * repeated string sizes = 26; * - * @param value The title to set. - * @return This builder for chaining. + * @return A list containing the sizes. */ - public Builder setTitle(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - title_ = value; - onChanged(); - return this; + public com.google.protobuf.ProtocolStringList getSizesList() { + return sizes_.getUnmodifiableView(); } /** * * *
-     * Required. Product title.
-     * This field must be a UTF-8 encoded string with a length limit of 128
-     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * The size of the product. To represent different size systems or size types,
+     * consider using this format: [[[size_system:]size_type:]size_value].
+     * For example, in "US:MENS:M", "US" represents size system; "MENS" represents
+     * size type; "M" represents size value. In "GIRLS:27", size system is empty;
+     * "GIRLS" represents size type; "27" represents size value. In "32 inches",
+     * both size system and size type are empty, while size value is "32 inches".
+     * A maximum of 20 values are 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
-     * [title](https://support.google.com/merchants/answer/6324415). Schema.org
-     * property [Product.name](https://schema.org/name).
+     * [size](https://support.google.com/merchants/answer/6324492),
+     * [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).
      * 
* - * string title = 8 [(.google.api.field_behavior) = REQUIRED]; + * repeated string sizes = 26; * - * @return This builder for chaining. + * @return The count of sizes. */ - public Builder clearTitle() { - - title_ = getDefaultInstance().getTitle(); - onChanged(); - return this; + public int getSizesCount() { + return sizes_.size(); } /** * * *
-     * Required. Product title.
-     * This field must be a UTF-8 encoded string with a length limit of 128
-     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * The size of the product. To represent different size systems or size types,
+     * consider using this format: [[[size_system:]size_type:]size_value].
+     * For example, in "US:MENS:M", "US" represents size system; "MENS" represents
+     * size type; "M" represents size value. In "GIRLS:27", size system is empty;
+     * "GIRLS" represents size type; "27" represents size value. In "32 inches",
+     * both size system and size type are empty, while size value is "32 inches".
+     * A maximum of 20 values are 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
-     * [title](https://support.google.com/merchants/answer/6324415). Schema.org
-     * property [Product.name](https://schema.org/name).
+     * [size](https://support.google.com/merchants/answer/6324492),
+     * [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).
      * 
* - * string title = 8 [(.google.api.field_behavior) = REQUIRED]; + * repeated string sizes = 26; * - * @param value The bytes for title to set. - * @return This builder for chaining. + * @param index The index of the element to return. + * @return The sizes at the given index. */ - public Builder setTitleBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - title_ = value; - onChanged(); - return this; + public java.lang.String getSizes(int index) { + return sizes_.get(index); } - - private java.lang.Object description_ = ""; /** * * *
-     * Product description.
-     * This field must be a UTF-8 encoded string with a length limit of 5,000
-     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * The size of the product. To represent different size systems or size types,
+     * consider using this format: [[[size_system:]size_type:]size_value].
+     * For example, in "US:MENS:M", "US" represents size system; "MENS" represents
+     * size type; "M" represents size value. In "GIRLS:27", size system is empty;
+     * "GIRLS" represents size type; "27" represents size value. In "32 inches",
+     * both size system and size type are empty, while size value is "32 inches".
+     * A maximum of 20 values are 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
-     * [description](https://support.google.com/merchants/answer/6324468).
-     * schema.org property [Product.description](https://schema.org/description).
+     * [size](https://support.google.com/merchants/answer/6324492),
+     * [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).
      * 
* - * string description = 10; + * repeated string sizes = 26; * - * @return The description. + * @param index The index of the value to return. + * @return The bytes of the sizes at the given index. */ - public java.lang.String getDescription() { - java.lang.Object ref = description_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - description_ = s; - return s; - } else { - return (java.lang.String) ref; - } + public com.google.protobuf.ByteString getSizesBytes(int index) { + return sizes_.getByteString(index); } /** * * *
-     * Product description.
-     * This field must be a UTF-8 encoded string with a length limit of 5,000
-     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * The size of the product. To represent different size systems or size types,
+     * consider using this format: [[[size_system:]size_type:]size_value].
+     * For example, in "US:MENS:M", "US" represents size system; "MENS" represents
+     * size type; "M" represents size value. In "GIRLS:27", size system is empty;
+     * "GIRLS" represents size type; "27" represents size value. In "32 inches",
+     * both size system and size type are empty, while size value is "32 inches".
+     * A maximum of 20 values are 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
-     * [description](https://support.google.com/merchants/answer/6324468).
-     * schema.org property [Product.description](https://schema.org/description).
+     * [size](https://support.google.com/merchants/answer/6324492),
+     * [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).
      * 
* - * string description = 10; + * repeated string sizes = 26; * - * @return The bytes for description. + * @param index The index to set the value at. + * @param value The sizes to set. + * @return This builder for chaining. */ - public com.google.protobuf.ByteString getDescriptionBytes() { - java.lang.Object ref = description_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - description_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; + public Builder setSizes(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); } + ensureSizesIsMutable(); + sizes_.set(index, value); + onChanged(); + return this; } /** * * *
-     * Product description.
-     * This field must be a UTF-8 encoded string with a length limit of 5,000
-     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * The size of the product. To represent different size systems or size types,
+     * consider using this format: [[[size_system:]size_type:]size_value].
+     * For example, in "US:MENS:M", "US" represents size system; "MENS" represents
+     * size type; "M" represents size value. In "GIRLS:27", size system is empty;
+     * "GIRLS" represents size type; "27" represents size value. In "32 inches",
+     * both size system and size type are empty, while size value is "32 inches".
+     * A maximum of 20 values are 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
-     * [description](https://support.google.com/merchants/answer/6324468).
-     * schema.org property [Product.description](https://schema.org/description).
+     * [size](https://support.google.com/merchants/answer/6324492),
+     * [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).
      * 
* - * string description = 10; + * repeated string sizes = 26; * - * @param value The description to set. + * @param value The sizes to add. * @return This builder for chaining. */ - public Builder setDescription(java.lang.String value) { + public Builder addSizes(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - - description_ = value; + ensureSizesIsMutable(); + sizes_.add(value); onChanged(); return this; } @@ -3673,21 +10641,31 @@ public Builder setDescription(java.lang.String value) { * * *
-     * Product description.
-     * This field must be a UTF-8 encoded string with a length limit of 5,000
-     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * The size of the product. To represent different size systems or size types,
+     * consider using this format: [[[size_system:]size_type:]size_value].
+     * For example, in "US:MENS:M", "US" represents size system; "MENS" represents
+     * size type; "M" represents size value. In "GIRLS:27", size system is empty;
+     * "GIRLS" represents size type; "27" represents size value. In "32 inches",
+     * both size system and size type are empty, while size value is "32 inches".
+     * A maximum of 20 values are 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
-     * [description](https://support.google.com/merchants/answer/6324468).
-     * schema.org property [Product.description](https://schema.org/description).
+     * [size](https://support.google.com/merchants/answer/6324492),
+     * [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).
      * 
* - * string description = 10; + * repeated string sizes = 26; * + * @param values The sizes to add. * @return This builder for chaining. */ - public Builder clearDescription() { - - description_ = getDefaultInstance().getDescription(); + public Builder addAllSizes(java.lang.Iterable values) { + ensureSizesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, sizes_); onChanged(); return this; } @@ -3695,437 +10673,418 @@ public Builder clearDescription() { * * *
-     * Product description.
-     * This field must be a UTF-8 encoded string with a length limit of 5,000
-     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * The size of the product. To represent different size systems or size types,
+     * consider using this format: [[[size_system:]size_type:]size_value].
+     * For example, in "US:MENS:M", "US" represents size system; "MENS" represents
+     * size type; "M" represents size value. In "GIRLS:27", size system is empty;
+     * "GIRLS" represents size type; "27" represents size value. In "32 inches",
+     * both size system and size type are empty, while size value is "32 inches".
+     * A maximum of 20 values are 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
-     * [description](https://support.google.com/merchants/answer/6324468).
-     * schema.org property [Product.description](https://schema.org/description).
+     * [size](https://support.google.com/merchants/answer/6324492),
+     * [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).
      * 
* - * string description = 10; + * repeated string sizes = 26; * - * @param value The bytes for description to set. * @return This builder for chaining. */ - public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + public Builder clearSizes() { + sizes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + /** + * + * + *
+     * The size of the product. To represent different size systems or size types,
+     * consider using this format: [[[size_system:]size_type:]size_value].
+     * For example, in "US:MENS:M", "US" represents size system; "MENS" represents
+     * size type; "M" represents size value. In "GIRLS:27", size system is empty;
+     * "GIRLS" represents size type; "27" represents size value. In "32 inches",
+     * both size system and size type are empty, while size value is "32 inches".
+     * A maximum of 20 values are 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
+     * [size](https://support.google.com/merchants/answer/6324492),
+     * [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; + * + * @param value The bytes of the sizes to add. + * @return This builder for chaining. + */ + public Builder addSizesBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - - description_ = value; + ensureSizesIsMutable(); + sizes_.add(value); onChanged(); return this; } - private com.google.protobuf.MapField< - java.lang.String, com.google.cloud.retail.v2.CustomAttribute> - attributes_; - - private com.google.protobuf.MapField< - java.lang.String, com.google.cloud.retail.v2.CustomAttribute> - internalGetAttributes() { - if (attributes_ == null) { - return com.google.protobuf.MapField.emptyMapField( - AttributesDefaultEntryHolder.defaultEntry); - } - return attributes_; - } + private com.google.protobuf.LazyStringList materials_ = + com.google.protobuf.LazyStringArrayList.EMPTY; - private com.google.protobuf.MapField< - java.lang.String, com.google.cloud.retail.v2.CustomAttribute> - internalGetMutableAttributes() { - onChanged(); - ; - if (attributes_ == null) { - attributes_ = - com.google.protobuf.MapField.newMapField(AttributesDefaultEntryHolder.defaultEntry); + private void ensureMaterialsIsMutable() { + if (!((bitField0_ & 0x00000100) != 0)) { + materials_ = new com.google.protobuf.LazyStringArrayList(materials_); + bitField0_ |= 0x00000100; } - if (!attributes_.isMutable()) { - attributes_ = attributes_.copy(); - } - return attributes_; - } - - public int getAttributesCount() { - return internalGetAttributes().getMap().size(); } /** * * *
-     * Highly encouraged. Extra product attributes to be included. For example,
-     * for products, this could include the store name, vendor, style, color, etc.
-     * These are very strong signals for recommendation model, thus we highly
-     * recommend providing the attributes here.
-     * Features that can take on one of a limited number of possible values. Two
-     * types of features can be set are:
-     * Textual features. some examples would be the brand/maker of a product, or
-     * country of a customer. Numerical features. Some examples would be the
-     * height/weight of a product, or age of a customer.
-     * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]},
-     * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]}
-     * }`.
-     * A maximum of 150 attributes are allowed. Otherwise, an INVALID_ARGUMENT
-     * error is returned.
-     * The key must be a UTF-8 encoded string with a length limit of 5,000
-     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * The material of the product. For example, "leather", "wooden".
+     * A maximum of 5 values are allowed. 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
+     * [material](https://support.google.com/merchants/answer/6324410). Schema.org
+     * property [Product.material](https://schema.org/material).
      * 
* - * map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 12; + * repeated string materials = 27; + * + * @return A list containing the materials. */ - @java.lang.Override - public boolean containsAttributes(java.lang.String key) { - if (key == null) { - throw new java.lang.NullPointerException(); - } - return internalGetAttributes().getMap().containsKey(key); + public com.google.protobuf.ProtocolStringList getMaterialsList() { + return materials_.getUnmodifiableView(); } - /** Use {@link #getAttributesMap()} instead. */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map - getAttributes() { - return getAttributesMap(); + /** + * + * + *
+     * The material of the product. For example, "leather", "wooden".
+     * A maximum of 5 values are allowed. 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
+     * [material](https://support.google.com/merchants/answer/6324410). Schema.org
+     * property [Product.material](https://schema.org/material).
+     * 
+ * + * repeated string materials = 27; + * + * @return The count of materials. + */ + public int getMaterialsCount() { + return materials_.size(); } /** * * *
-     * Highly encouraged. Extra product attributes to be included. For example,
-     * for products, this could include the store name, vendor, style, color, etc.
-     * These are very strong signals for recommendation model, thus we highly
-     * recommend providing the attributes here.
-     * Features that can take on one of a limited number of possible values. Two
-     * types of features can be set are:
-     * Textual features. some examples would be the brand/maker of a product, or
-     * country of a customer. Numerical features. Some examples would be the
-     * height/weight of a product, or age of a customer.
-     * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]},
-     * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]}
-     * }`.
-     * A maximum of 150 attributes are allowed. Otherwise, an INVALID_ARGUMENT
-     * error is returned.
-     * The key must be a UTF-8 encoded string with a length limit of 5,000
-     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * The material of the product. For example, "leather", "wooden".
+     * A maximum of 5 values are allowed. 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
+     * [material](https://support.google.com/merchants/answer/6324410). Schema.org
+     * property [Product.material](https://schema.org/material).
      * 
* - * map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 12; + * repeated string materials = 27; + * + * @param index The index of the element to return. + * @return The materials at the given index. */ - @java.lang.Override - public java.util.Map - getAttributesMap() { - return internalGetAttributes().getMap(); + public java.lang.String getMaterials(int index) { + return materials_.get(index); } /** * * *
-     * Highly encouraged. Extra product attributes to be included. For example,
-     * for products, this could include the store name, vendor, style, color, etc.
-     * These are very strong signals for recommendation model, thus we highly
-     * recommend providing the attributes here.
-     * Features that can take on one of a limited number of possible values. Two
-     * types of features can be set are:
-     * Textual features. some examples would be the brand/maker of a product, or
-     * country of a customer. Numerical features. Some examples would be the
-     * height/weight of a product, or age of a customer.
-     * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]},
-     * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]}
-     * }`.
-     * A maximum of 150 attributes are allowed. Otherwise, an INVALID_ARGUMENT
-     * error is returned.
-     * The key must be a UTF-8 encoded string with a length limit of 5,000
-     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * The material of the product. For example, "leather", "wooden".
+     * A maximum of 5 values are allowed. 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
+     * [material](https://support.google.com/merchants/answer/6324410). Schema.org
+     * property [Product.material](https://schema.org/material).
      * 
* - * map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 12; + * repeated string materials = 27; + * + * @param index The index of the value to return. + * @return The bytes of the materials at the given index. */ - @java.lang.Override - public com.google.cloud.retail.v2.CustomAttribute getAttributesOrDefault( - java.lang.String key, com.google.cloud.retail.v2.CustomAttribute defaultValue) { - if (key == null) { - throw new java.lang.NullPointerException(); - } - java.util.Map map = - internalGetAttributes().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; + public com.google.protobuf.ByteString getMaterialsBytes(int index) { + return materials_.getByteString(index); } /** * * *
-     * Highly encouraged. Extra product attributes to be included. For example,
-     * for products, this could include the store name, vendor, style, color, etc.
-     * These are very strong signals for recommendation model, thus we highly
-     * recommend providing the attributes here.
-     * Features that can take on one of a limited number of possible values. Two
-     * types of features can be set are:
-     * Textual features. some examples would be the brand/maker of a product, or
-     * country of a customer. Numerical features. Some examples would be the
-     * height/weight of a product, or age of a customer.
-     * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]},
-     * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]}
-     * }`.
-     * A maximum of 150 attributes are allowed. Otherwise, an INVALID_ARGUMENT
-     * error is returned.
-     * The key must be a UTF-8 encoded string with a length limit of 5,000
-     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * The material of the product. For example, "leather", "wooden".
+     * A maximum of 5 values are allowed. 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
+     * [material](https://support.google.com/merchants/answer/6324410). Schema.org
+     * property [Product.material](https://schema.org/material).
      * 
* - * map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 12; + * repeated string materials = 27; + * + * @param index The index to set the value at. + * @param value The materials to set. + * @return This builder for chaining. */ - @java.lang.Override - public com.google.cloud.retail.v2.CustomAttribute getAttributesOrThrow(java.lang.String key) { - if (key == null) { - throw new java.lang.NullPointerException(); - } - java.util.Map map = - internalGetAttributes().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); + public Builder setMaterials(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); } - return map.get(key); - } - - public Builder clearAttributes() { - internalGetMutableAttributes().getMutableMap().clear(); + ensureMaterialsIsMutable(); + materials_.set(index, value); + onChanged(); return this; } /** * * *
-     * Highly encouraged. Extra product attributes to be included. For example,
-     * for products, this could include the store name, vendor, style, color, etc.
-     * These are very strong signals for recommendation model, thus we highly
-     * recommend providing the attributes here.
-     * Features that can take on one of a limited number of possible values. Two
-     * types of features can be set are:
-     * Textual features. some examples would be the brand/maker of a product, or
-     * country of a customer. Numerical features. Some examples would be the
-     * height/weight of a product, or age of a customer.
-     * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]},
-     * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]}
-     * }`.
-     * A maximum of 150 attributes are allowed. Otherwise, an INVALID_ARGUMENT
-     * error is returned.
-     * The key must be a UTF-8 encoded string with a length limit of 5,000
-     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * The material of the product. For example, "leather", "wooden".
+     * A maximum of 5 values are allowed. 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
+     * [material](https://support.google.com/merchants/answer/6324410). Schema.org
+     * property [Product.material](https://schema.org/material).
      * 
* - * map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 12; + * repeated string materials = 27; + * + * @param value The materials to add. + * @return This builder for chaining. */ - public Builder removeAttributes(java.lang.String key) { - if (key == null) { - throw new java.lang.NullPointerException(); + public Builder addMaterials(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); } - internalGetMutableAttributes().getMutableMap().remove(key); + ensureMaterialsIsMutable(); + materials_.add(value); + onChanged(); return this; } - /** Use alternate mutation accessors instead. */ - @java.lang.Deprecated - public java.util.Map - getMutableAttributes() { - return internalGetMutableAttributes().getMutableMap(); - } /** * * *
-     * Highly encouraged. Extra product attributes to be included. For example,
-     * for products, this could include the store name, vendor, style, color, etc.
-     * These are very strong signals for recommendation model, thus we highly
-     * recommend providing the attributes here.
-     * Features that can take on one of a limited number of possible values. Two
-     * types of features can be set are:
-     * Textual features. some examples would be the brand/maker of a product, or
-     * country of a customer. Numerical features. Some examples would be the
-     * height/weight of a product, or age of a customer.
-     * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]},
-     * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]}
-     * }`.
-     * A maximum of 150 attributes are allowed. Otherwise, an INVALID_ARGUMENT
-     * error is returned.
-     * The key must be a UTF-8 encoded string with a length limit of 5,000
-     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * The material of the product. For example, "leather", "wooden".
+     * A maximum of 5 values are allowed. 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
+     * [material](https://support.google.com/merchants/answer/6324410). Schema.org
+     * property [Product.material](https://schema.org/material).
      * 
* - * map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 12; + * repeated string materials = 27; + * + * @param values The materials to add. + * @return This builder for chaining. */ - public Builder putAttributes( - java.lang.String key, com.google.cloud.retail.v2.CustomAttribute value) { - if (key == null) { - throw new java.lang.NullPointerException(); - } - if (value == null) { - throw new java.lang.NullPointerException(); - } - internalGetMutableAttributes().getMutableMap().put(key, value); + public Builder addAllMaterials(java.lang.Iterable values) { + ensureMaterialsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, materials_); + onChanged(); return this; } /** * * *
-     * Highly encouraged. Extra product attributes to be included. For example,
-     * for products, this could include the store name, vendor, style, color, etc.
-     * These are very strong signals for recommendation model, thus we highly
-     * recommend providing the attributes here.
-     * Features that can take on one of a limited number of possible values. Two
-     * types of features can be set are:
-     * Textual features. some examples would be the brand/maker of a product, or
-     * country of a customer. Numerical features. Some examples would be the
-     * height/weight of a product, or age of a customer.
-     * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]},
-     * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]}
-     * }`.
-     * A maximum of 150 attributes are allowed. Otherwise, an INVALID_ARGUMENT
-     * error is returned.
-     * The key must be a UTF-8 encoded string with a length limit of 5,000
-     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * The material of the product. For example, "leather", "wooden".
+     * A maximum of 5 values are allowed. 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
+     * [material](https://support.google.com/merchants/answer/6324410). Schema.org
+     * property [Product.material](https://schema.org/material).
      * 
* - * map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 12; + * repeated string materials = 27; + * + * @return This builder for chaining. */ - public Builder putAllAttributes( - java.util.Map values) { - internalGetMutableAttributes().getMutableMap().putAll(values); + public Builder clearMaterials() { + materials_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + return this; + } + /** + * + * + *
+     * The material of the product. For example, "leather", "wooden".
+     * A maximum of 5 values are allowed. 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
+     * [material](https://support.google.com/merchants/answer/6324410). Schema.org
+     * property [Product.material](https://schema.org/material).
+     * 
+ * + * repeated string materials = 27; + * + * @param value The bytes of the materials to add. + * @return This builder for chaining. + */ + public Builder addMaterialsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureMaterialsIsMutable(); + materials_.add(value); + onChanged(); return this; } - private com.google.protobuf.LazyStringList tags_ = + private com.google.protobuf.LazyStringList patterns_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureTagsIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { - tags_ = new com.google.protobuf.LazyStringArrayList(tags_); - bitField0_ |= 0x00000004; + private void ensurePatternsIsMutable() { + if (!((bitField0_ & 0x00000200) != 0)) { + patterns_ = new com.google.protobuf.LazyStringArrayList(patterns_); + bitField0_ |= 0x00000200; } } /** * * *
-     * Custom tags associated with the product.
-     * At most 250 values are allowed per
-     * [Product][google.cloud.retail.v2.Product]. This value must be a UTF-8
-     * encoded string with a length limit of 1,000 characters. Otherwise, an
+     * The pattern or graphic print of the product. For example, "striped", "polka
+     * dot", "paisley".
+     * A maximum of 5 values are 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.
-     * This tag can be used for filtering recommendation results by passing the
-     * tag as part of the
-     * [PredictRequest.filter][google.cloud.retail.v2.PredictRequest.filter].
      * Google Merchant Center property
-     * [custom_label_0–4](https://support.google.com/merchants/answer/6324473).
+     * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org
+     * property [Product.pattern](https://schema.org/pattern).
      * 
* - * repeated string tags = 13; + * repeated string patterns = 28; * - * @return A list containing the tags. + * @return A list containing the patterns. */ - public com.google.protobuf.ProtocolStringList getTagsList() { - return tags_.getUnmodifiableView(); + public com.google.protobuf.ProtocolStringList getPatternsList() { + return patterns_.getUnmodifiableView(); } /** * * *
-     * Custom tags associated with the product.
-     * At most 250 values are allowed per
-     * [Product][google.cloud.retail.v2.Product]. This value must be a UTF-8
-     * encoded string with a length limit of 1,000 characters. Otherwise, an
+     * The pattern or graphic print of the product. For example, "striped", "polka
+     * dot", "paisley".
+     * A maximum of 5 values are 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.
-     * This tag can be used for filtering recommendation results by passing the
-     * tag as part of the
-     * [PredictRequest.filter][google.cloud.retail.v2.PredictRequest.filter].
      * Google Merchant Center property
-     * [custom_label_0–4](https://support.google.com/merchants/answer/6324473).
+     * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org
+     * property [Product.pattern](https://schema.org/pattern).
      * 
* - * repeated string tags = 13; + * repeated string patterns = 28; * - * @return The count of tags. + * @return The count of patterns. */ - public int getTagsCount() { - return tags_.size(); + public int getPatternsCount() { + return patterns_.size(); } /** * * *
-     * Custom tags associated with the product.
-     * At most 250 values are allowed per
-     * [Product][google.cloud.retail.v2.Product]. This value must be a UTF-8
-     * encoded string with a length limit of 1,000 characters. Otherwise, an
+     * The pattern or graphic print of the product. For example, "striped", "polka
+     * dot", "paisley".
+     * A maximum of 5 values are 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.
-     * This tag can be used for filtering recommendation results by passing the
-     * tag as part of the
-     * [PredictRequest.filter][google.cloud.retail.v2.PredictRequest.filter].
      * Google Merchant Center property
-     * [custom_label_0–4](https://support.google.com/merchants/answer/6324473).
+     * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org
+     * property [Product.pattern](https://schema.org/pattern).
      * 
* - * repeated string tags = 13; + * repeated string patterns = 28; * * @param index The index of the element to return. - * @return The tags at the given index. + * @return The patterns at the given index. */ - public java.lang.String getTags(int index) { - return tags_.get(index); + public java.lang.String getPatterns(int index) { + return patterns_.get(index); } /** * * *
-     * Custom tags associated with the product.
-     * At most 250 values are allowed per
-     * [Product][google.cloud.retail.v2.Product]. This value must be a UTF-8
-     * encoded string with a length limit of 1,000 characters. Otherwise, an
+     * The pattern or graphic print of the product. For example, "striped", "polka
+     * dot", "paisley".
+     * A maximum of 5 values are 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.
-     * This tag can be used for filtering recommendation results by passing the
-     * tag as part of the
-     * [PredictRequest.filter][google.cloud.retail.v2.PredictRequest.filter].
      * Google Merchant Center property
-     * [custom_label_0–4](https://support.google.com/merchants/answer/6324473).
+     * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org
+     * property [Product.pattern](https://schema.org/pattern).
      * 
* - * repeated string tags = 13; + * repeated string patterns = 28; * * @param index The index of the value to return. - * @return The bytes of the tags at the given index. + * @return The bytes of the patterns at the given index. */ - public com.google.protobuf.ByteString getTagsBytes(int index) { - return tags_.getByteString(index); + public com.google.protobuf.ByteString getPatternsBytes(int index) { + return patterns_.getByteString(index); } /** * * *
-     * Custom tags associated with the product.
-     * At most 250 values are allowed per
-     * [Product][google.cloud.retail.v2.Product]. This value must be a UTF-8
-     * encoded string with a length limit of 1,000 characters. Otherwise, an
+     * The pattern or graphic print of the product. For example, "striped", "polka
+     * dot", "paisley".
+     * A maximum of 5 values are 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.
-     * This tag can be used for filtering recommendation results by passing the
-     * tag as part of the
-     * [PredictRequest.filter][google.cloud.retail.v2.PredictRequest.filter].
      * Google Merchant Center property
-     * [custom_label_0–4](https://support.google.com/merchants/answer/6324473).
+     * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org
+     * property [Product.pattern](https://schema.org/pattern).
      * 
* - * repeated string tags = 13; + * repeated string patterns = 28; * * @param index The index to set the value at. - * @param value The tags to set. + * @param value The patterns to set. * @return This builder for chaining. */ - public Builder setTags(int index, java.lang.String value) { + public Builder setPatterns(int index, java.lang.String value) { if (value == null) { throw new NullPointerException(); } - ensureTagsIsMutable(); - tags_.set(index, value); + ensurePatternsIsMutable(); + patterns_.set(index, value); onChanged(); return this; } @@ -4133,29 +11092,28 @@ public Builder setTags(int index, java.lang.String value) { * * *
-     * Custom tags associated with the product.
-     * At most 250 values are allowed per
-     * [Product][google.cloud.retail.v2.Product]. This value must be a UTF-8
-     * encoded string with a length limit of 1,000 characters. Otherwise, an
+     * The pattern or graphic print of the product. For example, "striped", "polka
+     * dot", "paisley".
+     * A maximum of 5 values are 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.
-     * This tag can be used for filtering recommendation results by passing the
-     * tag as part of the
-     * [PredictRequest.filter][google.cloud.retail.v2.PredictRequest.filter].
      * Google Merchant Center property
-     * [custom_label_0–4](https://support.google.com/merchants/answer/6324473).
+     * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org
+     * property [Product.pattern](https://schema.org/pattern).
      * 
* - * repeated string tags = 13; + * repeated string patterns = 28; * - * @param value The tags to add. + * @param value The patterns to add. * @return This builder for chaining. */ - public Builder addTags(java.lang.String value) { + public Builder addPatterns(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - ensureTagsIsMutable(); - tags_.add(value); + ensurePatternsIsMutable(); + patterns_.add(value); onChanged(); return this; } @@ -4163,26 +11121,25 @@ public Builder addTags(java.lang.String value) { * * *
-     * Custom tags associated with the product.
-     * At most 250 values are allowed per
-     * [Product][google.cloud.retail.v2.Product]. This value must be a UTF-8
-     * encoded string with a length limit of 1,000 characters. Otherwise, an
+     * The pattern or graphic print of the product. For example, "striped", "polka
+     * dot", "paisley".
+     * A maximum of 5 values are 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.
-     * This tag can be used for filtering recommendation results by passing the
-     * tag as part of the
-     * [PredictRequest.filter][google.cloud.retail.v2.PredictRequest.filter].
      * Google Merchant Center property
-     * [custom_label_0–4](https://support.google.com/merchants/answer/6324473).
+     * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org
+     * property [Product.pattern](https://schema.org/pattern).
      * 
* - * repeated string tags = 13; + * repeated string patterns = 28; * - * @param values The tags to add. + * @param values The patterns to add. * @return This builder for chaining. */ - public Builder addAllTags(java.lang.Iterable values) { - ensureTagsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, tags_); + public Builder addAllPatterns(java.lang.Iterable values) { + ensurePatternsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, patterns_); onChanged(); return this; } @@ -4190,25 +11147,24 @@ public Builder addAllTags(java.lang.Iterable values) { * * *
-     * Custom tags associated with the product.
-     * At most 250 values are allowed per
-     * [Product][google.cloud.retail.v2.Product]. This value must be a UTF-8
-     * encoded string with a length limit of 1,000 characters. Otherwise, an
+     * The pattern or graphic print of the product. For example, "striped", "polka
+     * dot", "paisley".
+     * A maximum of 5 values are 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.
-     * This tag can be used for filtering recommendation results by passing the
-     * tag as part of the
-     * [PredictRequest.filter][google.cloud.retail.v2.PredictRequest.filter].
      * Google Merchant Center property
-     * [custom_label_0–4](https://support.google.com/merchants/answer/6324473).
+     * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org
+     * property [Product.pattern](https://schema.org/pattern).
      * 
* - * repeated string tags = 13; + * repeated string patterns = 28; * * @return This builder for chaining. */ - public Builder clearTags() { - tags_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000004); + public Builder clearPatterns() { + patterns_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000200); onChanged(); return this; } @@ -4216,605 +11172,721 @@ public Builder clearTags() { * * *
-     * Custom tags associated with the product.
-     * At most 250 values are allowed per
-     * [Product][google.cloud.retail.v2.Product]. This value must be a UTF-8
-     * encoded string with a length limit of 1,000 characters. Otherwise, an
+     * The pattern or graphic print of the product. For example, "striped", "polka
+     * dot", "paisley".
+     * A maximum of 5 values are 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.
-     * This tag can be used for filtering recommendation results by passing the
-     * tag as part of the
-     * [PredictRequest.filter][google.cloud.retail.v2.PredictRequest.filter].
      * Google Merchant Center property
-     * [custom_label_0–4](https://support.google.com/merchants/answer/6324473).
+     * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org
+     * property [Product.pattern](https://schema.org/pattern).
      * 
* - * repeated string tags = 13; + * repeated string patterns = 28; * - * @param value The bytes of the tags to add. + * @param value The bytes of the patterns to add. * @return This builder for chaining. */ - public Builder addTagsBytes(com.google.protobuf.ByteString value) { + public Builder addPatternsBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - ensureTagsIsMutable(); - tags_.add(value); + ensurePatternsIsMutable(); + patterns_.add(value); onChanged(); return this; } - private com.google.cloud.retail.v2.PriceInfo priceInfo_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.retail.v2.PriceInfo, - com.google.cloud.retail.v2.PriceInfo.Builder, - com.google.cloud.retail.v2.PriceInfoOrBuilder> - priceInfoBuilder_; + private com.google.protobuf.LazyStringList conditions_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureConditionsIsMutable() { + if (!((bitField0_ & 0x00000400) != 0)) { + conditions_ = new com.google.protobuf.LazyStringArrayList(conditions_); + bitField0_ |= 0x00000400; + } + } /** * * *
-     * Product price and cost information.
+     * The condition of the product. Strongly encouraged to use the standard
+     * values: "new", "refurbished", "used".
+     * A maximum of 5 values are 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
-     * [price](https://support.google.com/merchants/answer/6324371).
+     * [condition](https://support.google.com/merchants/answer/6324469).
+     * Schema.org property
+     * [Offer.itemCondition](https://schema.org/itemCondition).
      * 
* - * .google.cloud.retail.v2.PriceInfo price_info = 14; + * repeated string conditions = 29; * - * @return Whether the priceInfo field is set. + * @return A list containing the conditions. */ - public boolean hasPriceInfo() { - return priceInfoBuilder_ != null || priceInfo_ != null; + public com.google.protobuf.ProtocolStringList getConditionsList() { + return conditions_.getUnmodifiableView(); } /** * * *
-     * Product price and cost information.
+     * The condition of the product. Strongly encouraged to use the standard
+     * values: "new", "refurbished", "used".
+     * A maximum of 5 values are 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
-     * [price](https://support.google.com/merchants/answer/6324371).
+     * [condition](https://support.google.com/merchants/answer/6324469).
+     * Schema.org property
+     * [Offer.itemCondition](https://schema.org/itemCondition).
      * 
* - * .google.cloud.retail.v2.PriceInfo price_info = 14; + * repeated string conditions = 29; * - * @return The priceInfo. + * @return The count of conditions. */ - public com.google.cloud.retail.v2.PriceInfo getPriceInfo() { - if (priceInfoBuilder_ == null) { - return priceInfo_ == null - ? com.google.cloud.retail.v2.PriceInfo.getDefaultInstance() - : priceInfo_; - } else { - return priceInfoBuilder_.getMessage(); + public int getConditionsCount() { + return conditions_.size(); + } + /** + * + * + *
+     * The condition of the product. Strongly encouraged to use the standard
+     * values: "new", "refurbished", "used".
+     * A maximum of 5 values are 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
+     * [condition](https://support.google.com/merchants/answer/6324469).
+     * Schema.org property
+     * [Offer.itemCondition](https://schema.org/itemCondition).
+     * 
+ * + * repeated string conditions = 29; + * + * @param index The index of the element to return. + * @return The conditions at the given index. + */ + public java.lang.String getConditions(int index) { + return conditions_.get(index); + } + /** + * + * + *
+     * The condition of the product. Strongly encouraged to use the standard
+     * values: "new", "refurbished", "used".
+     * A maximum of 5 values are 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
+     * [condition](https://support.google.com/merchants/answer/6324469).
+     * Schema.org property
+     * [Offer.itemCondition](https://schema.org/itemCondition).
+     * 
+ * + * repeated string conditions = 29; + * + * @param index The index of the value to return. + * @return The bytes of the conditions at the given index. + */ + public com.google.protobuf.ByteString getConditionsBytes(int index) { + return conditions_.getByteString(index); + } + /** + * + * + *
+     * The condition of the product. Strongly encouraged to use the standard
+     * values: "new", "refurbished", "used".
+     * A maximum of 5 values are 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
+     * [condition](https://support.google.com/merchants/answer/6324469).
+     * Schema.org property
+     * [Offer.itemCondition](https://schema.org/itemCondition).
+     * 
+ * + * repeated string conditions = 29; + * + * @param index The index to set the value at. + * @param value The conditions to set. + * @return This builder for chaining. + */ + public Builder setConditions(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); } + ensureConditionsIsMutable(); + conditions_.set(index, value); + onChanged(); + return this; } /** * * *
-     * Product price and cost information.
+     * The condition of the product. Strongly encouraged to use the standard
+     * values: "new", "refurbished", "used".
+     * A maximum of 5 values are 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
-     * [price](https://support.google.com/merchants/answer/6324371).
+     * [condition](https://support.google.com/merchants/answer/6324469).
+     * Schema.org property
+     * [Offer.itemCondition](https://schema.org/itemCondition).
      * 
* - * .google.cloud.retail.v2.PriceInfo price_info = 14; + * repeated string conditions = 29; + * + * @param value The conditions to add. + * @return This builder for chaining. */ - public Builder setPriceInfo(com.google.cloud.retail.v2.PriceInfo value) { - if (priceInfoBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - priceInfo_ = value; - onChanged(); - } else { - priceInfoBuilder_.setMessage(value); + public Builder addConditions(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); } - + ensureConditionsIsMutable(); + conditions_.add(value); + onChanged(); return this; } /** * * *
-     * Product price and cost information.
+     * The condition of the product. Strongly encouraged to use the standard
+     * values: "new", "refurbished", "used".
+     * A maximum of 5 values are 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
-     * [price](https://support.google.com/merchants/answer/6324371).
+     * [condition](https://support.google.com/merchants/answer/6324469).
+     * Schema.org property
+     * [Offer.itemCondition](https://schema.org/itemCondition).
      * 
* - * .google.cloud.retail.v2.PriceInfo price_info = 14; + * repeated string conditions = 29; + * + * @param values The conditions to add. + * @return This builder for chaining. */ - public Builder setPriceInfo(com.google.cloud.retail.v2.PriceInfo.Builder builderForValue) { - if (priceInfoBuilder_ == null) { - priceInfo_ = builderForValue.build(); - onChanged(); - } else { - priceInfoBuilder_.setMessage(builderForValue.build()); - } - + public Builder addAllConditions(java.lang.Iterable values) { + ensureConditionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, conditions_); + onChanged(); return this; } /** * * *
-     * Product price and cost information.
+     * The condition of the product. Strongly encouraged to use the standard
+     * values: "new", "refurbished", "used".
+     * A maximum of 5 values are 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
-     * [price](https://support.google.com/merchants/answer/6324371).
+     * [condition](https://support.google.com/merchants/answer/6324469).
+     * Schema.org property
+     * [Offer.itemCondition](https://schema.org/itemCondition).
      * 
* - * .google.cloud.retail.v2.PriceInfo price_info = 14; + * repeated string conditions = 29; + * + * @return This builder for chaining. */ - public Builder mergePriceInfo(com.google.cloud.retail.v2.PriceInfo value) { - if (priceInfoBuilder_ == null) { - if (priceInfo_ != null) { - priceInfo_ = - com.google.cloud.retail.v2.PriceInfo.newBuilder(priceInfo_) - .mergeFrom(value) - .buildPartial(); - } else { - priceInfo_ = value; - } - onChanged(); - } else { - priceInfoBuilder_.mergeFrom(value); - } - + public Builder clearConditions() { + conditions_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); return this; } /** * * *
-     * Product price and cost information.
+     * The condition of the product. Strongly encouraged to use the standard
+     * values: "new", "refurbished", "used".
+     * A maximum of 5 values are 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
-     * [price](https://support.google.com/merchants/answer/6324371).
+     * [condition](https://support.google.com/merchants/answer/6324469).
+     * Schema.org property
+     * [Offer.itemCondition](https://schema.org/itemCondition).
      * 
* - * .google.cloud.retail.v2.PriceInfo price_info = 14; + * repeated string conditions = 29; + * + * @param value The bytes of the conditions to add. + * @return This builder for chaining. */ - public Builder clearPriceInfo() { - if (priceInfoBuilder_ == null) { - priceInfo_ = null; - onChanged(); - } else { - priceInfo_ = null; - priceInfoBuilder_ = null; + public Builder addConditionsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); } - + checkByteStringIsUtf8(value); + ensureConditionsIsMutable(); + conditions_.add(value); + onChanged(); return this; } + + private java.util.List promotions_ = + java.util.Collections.emptyList(); + + private void ensurePromotionsIsMutable() { + if (!((bitField0_ & 0x00000800) != 0)) { + promotions_ = new java.util.ArrayList(promotions_); + bitField0_ |= 0x00000800; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2.Promotion, + com.google.cloud.retail.v2.Promotion.Builder, + com.google.cloud.retail.v2.PromotionOrBuilder> + promotionsBuilder_; + /** * * *
-     * Product price and cost information.
-     * Google Merchant Center property
-     * [price](https://support.google.com/merchants/answer/6324371).
+     * The promotions applied to the product. A maximum of 10 values are allowed
+     * per [Product][google.cloud.retail.v2.Product].
      * 
* - * .google.cloud.retail.v2.PriceInfo price_info = 14; + * repeated .google.cloud.retail.v2.Promotion promotions = 34; */ - public com.google.cloud.retail.v2.PriceInfo.Builder getPriceInfoBuilder() { - - onChanged(); - return getPriceInfoFieldBuilder().getBuilder(); + public java.util.List getPromotionsList() { + if (promotionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(promotions_); + } else { + return promotionsBuilder_.getMessageList(); + } } /** * * *
-     * Product price and cost information.
-     * Google Merchant Center property
-     * [price](https://support.google.com/merchants/answer/6324371).
+     * The promotions applied to the product. A maximum of 10 values are allowed
+     * per [Product][google.cloud.retail.v2.Product].
      * 
* - * .google.cloud.retail.v2.PriceInfo price_info = 14; + * repeated .google.cloud.retail.v2.Promotion promotions = 34; */ - public com.google.cloud.retail.v2.PriceInfoOrBuilder getPriceInfoOrBuilder() { - if (priceInfoBuilder_ != null) { - return priceInfoBuilder_.getMessageOrBuilder(); + public int getPromotionsCount() { + if (promotionsBuilder_ == null) { + return promotions_.size(); } else { - return priceInfo_ == null - ? com.google.cloud.retail.v2.PriceInfo.getDefaultInstance() - : priceInfo_; + return promotionsBuilder_.getCount(); } } /** * * *
-     * Product price and cost information.
-     * Google Merchant Center property
-     * [price](https://support.google.com/merchants/answer/6324371).
+     * The promotions applied to the product. A maximum of 10 values are allowed
+     * per [Product][google.cloud.retail.v2.Product].
      * 
* - * .google.cloud.retail.v2.PriceInfo price_info = 14; + * repeated .google.cloud.retail.v2.Promotion promotions = 34; */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.retail.v2.PriceInfo, - com.google.cloud.retail.v2.PriceInfo.Builder, - com.google.cloud.retail.v2.PriceInfoOrBuilder> - getPriceInfoFieldBuilder() { - if (priceInfoBuilder_ == null) { - priceInfoBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.retail.v2.PriceInfo, - com.google.cloud.retail.v2.PriceInfo.Builder, - com.google.cloud.retail.v2.PriceInfoOrBuilder>( - getPriceInfo(), getParentForChildren(), isClean()); - priceInfo_ = null; + public com.google.cloud.retail.v2.Promotion getPromotions(int index) { + if (promotionsBuilder_ == null) { + return promotions_.get(index); + } else { + return promotionsBuilder_.getMessage(index); } - return priceInfoBuilder_; } - - private com.google.protobuf.Timestamp availableTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - availableTimeBuilder_; /** * * *
-     * The timestamp when this [Product][google.cloud.retail.v2.Product] becomes
-     * available recommendation and search.
+     * The promotions applied to the product. A maximum of 10 values are allowed
+     * per [Product][google.cloud.retail.v2.Product].
      * 
* - * .google.protobuf.Timestamp available_time = 18; - * - * @return Whether the availableTime field is set. + * repeated .google.cloud.retail.v2.Promotion promotions = 34; */ - public boolean hasAvailableTime() { - return availableTimeBuilder_ != null || availableTime_ != null; + public Builder setPromotions(int index, com.google.cloud.retail.v2.Promotion value) { + if (promotionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePromotionsIsMutable(); + promotions_.set(index, value); + onChanged(); + } else { + promotionsBuilder_.setMessage(index, value); + } + return this; } /** * * *
-     * The timestamp when this [Product][google.cloud.retail.v2.Product] becomes
-     * available recommendation and search.
+     * The promotions applied to the product. A maximum of 10 values are allowed
+     * per [Product][google.cloud.retail.v2.Product].
      * 
* - * .google.protobuf.Timestamp available_time = 18; - * - * @return The availableTime. + * repeated .google.cloud.retail.v2.Promotion promotions = 34; */ - public com.google.protobuf.Timestamp getAvailableTime() { - if (availableTimeBuilder_ == null) { - return availableTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : availableTime_; + public Builder setPromotions( + int index, com.google.cloud.retail.v2.Promotion.Builder builderForValue) { + if (promotionsBuilder_ == null) { + ensurePromotionsIsMutable(); + promotions_.set(index, builderForValue.build()); + onChanged(); } else { - return availableTimeBuilder_.getMessage(); + promotionsBuilder_.setMessage(index, builderForValue.build()); } + return this; } /** * * *
-     * The timestamp when this [Product][google.cloud.retail.v2.Product] becomes
-     * available recommendation and search.
+     * The promotions applied to the product. A maximum of 10 values are allowed
+     * per [Product][google.cloud.retail.v2.Product].
      * 
* - * .google.protobuf.Timestamp available_time = 18; + * repeated .google.cloud.retail.v2.Promotion promotions = 34; */ - public Builder setAvailableTime(com.google.protobuf.Timestamp value) { - if (availableTimeBuilder_ == null) { + public Builder addPromotions(com.google.cloud.retail.v2.Promotion value) { + if (promotionsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - availableTime_ = value; + ensurePromotionsIsMutable(); + promotions_.add(value); onChanged(); } else { - availableTimeBuilder_.setMessage(value); + promotionsBuilder_.addMessage(value); } - return this; } /** * * *
-     * The timestamp when this [Product][google.cloud.retail.v2.Product] becomes
-     * available recommendation and search.
+     * The promotions applied to the product. A maximum of 10 values are allowed
+     * per [Product][google.cloud.retail.v2.Product].
      * 
* - * .google.protobuf.Timestamp available_time = 18; + * repeated .google.cloud.retail.v2.Promotion promotions = 34; */ - public Builder setAvailableTime(com.google.protobuf.Timestamp.Builder builderForValue) { - if (availableTimeBuilder_ == null) { - availableTime_ = builderForValue.build(); + public Builder addPromotions(int index, com.google.cloud.retail.v2.Promotion value) { + if (promotionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePromotionsIsMutable(); + promotions_.add(index, value); onChanged(); } else { - availableTimeBuilder_.setMessage(builderForValue.build()); + promotionsBuilder_.addMessage(index, value); } - return this; } /** * * *
-     * The timestamp when this [Product][google.cloud.retail.v2.Product] becomes
-     * available recommendation and search.
+     * The promotions applied to the product. A maximum of 10 values are allowed
+     * per [Product][google.cloud.retail.v2.Product].
      * 
* - * .google.protobuf.Timestamp available_time = 18; + * repeated .google.cloud.retail.v2.Promotion promotions = 34; */ - public Builder mergeAvailableTime(com.google.protobuf.Timestamp value) { - if (availableTimeBuilder_ == null) { - if (availableTime_ != null) { - availableTime_ = - com.google.protobuf.Timestamp.newBuilder(availableTime_) - .mergeFrom(value) - .buildPartial(); - } else { - availableTime_ = value; - } + public Builder addPromotions(com.google.cloud.retail.v2.Promotion.Builder builderForValue) { + if (promotionsBuilder_ == null) { + ensurePromotionsIsMutable(); + promotions_.add(builderForValue.build()); onChanged(); } else { - availableTimeBuilder_.mergeFrom(value); + promotionsBuilder_.addMessage(builderForValue.build()); } - return this; } /** * * *
-     * The timestamp when this [Product][google.cloud.retail.v2.Product] becomes
-     * available recommendation and search.
+     * The promotions applied to the product. A maximum of 10 values are allowed
+     * per [Product][google.cloud.retail.v2.Product].
      * 
* - * .google.protobuf.Timestamp available_time = 18; + * repeated .google.cloud.retail.v2.Promotion promotions = 34; */ - public Builder clearAvailableTime() { - if (availableTimeBuilder_ == null) { - availableTime_ = null; + public Builder addPromotions( + int index, com.google.cloud.retail.v2.Promotion.Builder builderForValue) { + if (promotionsBuilder_ == null) { + ensurePromotionsIsMutable(); + promotions_.add(index, builderForValue.build()); onChanged(); } else { - availableTime_ = null; - availableTimeBuilder_ = null; + promotionsBuilder_.addMessage(index, builderForValue.build()); } - return this; } /** * * *
-     * The timestamp when this [Product][google.cloud.retail.v2.Product] becomes
-     * available recommendation and search.
+     * The promotions applied to the product. A maximum of 10 values are allowed
+     * per [Product][google.cloud.retail.v2.Product].
      * 
* - * .google.protobuf.Timestamp available_time = 18; + * repeated .google.cloud.retail.v2.Promotion promotions = 34; */ - public com.google.protobuf.Timestamp.Builder getAvailableTimeBuilder() { - - onChanged(); - return getAvailableTimeFieldBuilder().getBuilder(); + public Builder addAllPromotions( + java.lang.Iterable values) { + if (promotionsBuilder_ == null) { + ensurePromotionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, promotions_); + onChanged(); + } else { + promotionsBuilder_.addAllMessages(values); + } + return this; } /** * * *
-     * The timestamp when this [Product][google.cloud.retail.v2.Product] becomes
-     * available recommendation and search.
+     * The promotions applied to the product. A maximum of 10 values are allowed
+     * per [Product][google.cloud.retail.v2.Product].
      * 
* - * .google.protobuf.Timestamp available_time = 18; + * repeated .google.cloud.retail.v2.Promotion promotions = 34; */ - public com.google.protobuf.TimestampOrBuilder getAvailableTimeOrBuilder() { - if (availableTimeBuilder_ != null) { - return availableTimeBuilder_.getMessageOrBuilder(); + public Builder clearPromotions() { + if (promotionsBuilder_ == null) { + promotions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000800); + onChanged(); } else { - return availableTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : availableTime_; + promotionsBuilder_.clear(); } + return this; } /** * * *
-     * The timestamp when this [Product][google.cloud.retail.v2.Product] becomes
-     * available recommendation and search.
+     * The promotions applied to the product. A maximum of 10 values are allowed
+     * per [Product][google.cloud.retail.v2.Product].
      * 
* - * .google.protobuf.Timestamp available_time = 18; + * repeated .google.cloud.retail.v2.Promotion promotions = 34; */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - getAvailableTimeFieldBuilder() { - if (availableTimeBuilder_ == null) { - availableTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder>( - getAvailableTime(), getParentForChildren(), isClean()); - availableTime_ = null; + public Builder removePromotions(int index) { + if (promotionsBuilder_ == null) { + ensurePromotionsIsMutable(); + promotions_.remove(index); + onChanged(); + } else { + promotionsBuilder_.remove(index); } - return availableTimeBuilder_; + return this; } - - private int availability_ = 0; /** * * *
-     * The online availability of the [Product][google.cloud.retail.v2.Product].
-     * Default to
-     * [Availability.IN_STOCK][google.cloud.retail.v2.Product.Availability.IN_STOCK].
-     * Google Merchant Center Property
-     * [availability](https://support.google.com/merchants/answer/6324448).
-     * Schema.org Property [Offer.availability](https://schema.org/availability).
+     * The promotions applied to the product. A maximum of 10 values are allowed
+     * per [Product][google.cloud.retail.v2.Product].
      * 
* - * .google.cloud.retail.v2.Product.Availability availability = 19; - * - * @return The enum numeric value on the wire for availability. + * repeated .google.cloud.retail.v2.Promotion promotions = 34; */ - @java.lang.Override - public int getAvailabilityValue() { - return availability_; + public com.google.cloud.retail.v2.Promotion.Builder getPromotionsBuilder(int index) { + return getPromotionsFieldBuilder().getBuilder(index); } /** * * *
-     * The online availability of the [Product][google.cloud.retail.v2.Product].
-     * Default to
-     * [Availability.IN_STOCK][google.cloud.retail.v2.Product.Availability.IN_STOCK].
-     * Google Merchant Center Property
-     * [availability](https://support.google.com/merchants/answer/6324448).
-     * Schema.org Property [Offer.availability](https://schema.org/availability).
+     * The promotions applied to the product. A maximum of 10 values are allowed
+     * per [Product][google.cloud.retail.v2.Product].
      * 
* - * .google.cloud.retail.v2.Product.Availability availability = 19; - * - * @param value The enum numeric value on the wire for availability to set. - * @return This builder for chaining. + * repeated .google.cloud.retail.v2.Promotion promotions = 34; */ - public Builder setAvailabilityValue(int value) { - - availability_ = value; - onChanged(); - return this; + public com.google.cloud.retail.v2.PromotionOrBuilder getPromotionsOrBuilder(int index) { + if (promotionsBuilder_ == null) { + return promotions_.get(index); + } else { + return promotionsBuilder_.getMessageOrBuilder(index); + } } /** * * *
-     * The online availability of the [Product][google.cloud.retail.v2.Product].
-     * Default to
-     * [Availability.IN_STOCK][google.cloud.retail.v2.Product.Availability.IN_STOCK].
-     * Google Merchant Center Property
-     * [availability](https://support.google.com/merchants/answer/6324448).
-     * Schema.org Property [Offer.availability](https://schema.org/availability).
+     * The promotions applied to the product. A maximum of 10 values are allowed
+     * per [Product][google.cloud.retail.v2.Product].
      * 
* - * .google.cloud.retail.v2.Product.Availability availability = 19; + * repeated .google.cloud.retail.v2.Promotion promotions = 34; + */ + public java.util.List + getPromotionsOrBuilderList() { + if (promotionsBuilder_ != null) { + return promotionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(promotions_); + } + } + /** + * * - * @return The availability. + *
+     * The promotions applied to the product. A maximum of 10 values are allowed
+     * per [Product][google.cloud.retail.v2.Product].
+     * 
+ * + * repeated .google.cloud.retail.v2.Promotion promotions = 34; */ - @java.lang.Override - public com.google.cloud.retail.v2.Product.Availability getAvailability() { - @SuppressWarnings("deprecation") - com.google.cloud.retail.v2.Product.Availability result = - com.google.cloud.retail.v2.Product.Availability.valueOf(availability_); - return result == null ? com.google.cloud.retail.v2.Product.Availability.UNRECOGNIZED : result; + public com.google.cloud.retail.v2.Promotion.Builder addPromotionsBuilder() { + return getPromotionsFieldBuilder() + .addBuilder(com.google.cloud.retail.v2.Promotion.getDefaultInstance()); } /** * * *
-     * The online availability of the [Product][google.cloud.retail.v2.Product].
-     * Default to
-     * [Availability.IN_STOCK][google.cloud.retail.v2.Product.Availability.IN_STOCK].
-     * Google Merchant Center Property
-     * [availability](https://support.google.com/merchants/answer/6324448).
-     * Schema.org Property [Offer.availability](https://schema.org/availability).
+     * The promotions applied to the product. A maximum of 10 values are allowed
+     * per [Product][google.cloud.retail.v2.Product].
      * 
* - * .google.cloud.retail.v2.Product.Availability availability = 19; - * - * @param value The availability to set. - * @return This builder for chaining. + * repeated .google.cloud.retail.v2.Promotion promotions = 34; */ - public Builder setAvailability(com.google.cloud.retail.v2.Product.Availability value) { - if (value == null) { - throw new NullPointerException(); - } - - availability_ = value.getNumber(); - onChanged(); - return this; + public com.google.cloud.retail.v2.Promotion.Builder addPromotionsBuilder(int index) { + return getPromotionsFieldBuilder() + .addBuilder(index, com.google.cloud.retail.v2.Promotion.getDefaultInstance()); } /** * * *
-     * The online availability of the [Product][google.cloud.retail.v2.Product].
-     * Default to
-     * [Availability.IN_STOCK][google.cloud.retail.v2.Product.Availability.IN_STOCK].
-     * Google Merchant Center Property
-     * [availability](https://support.google.com/merchants/answer/6324448).
-     * Schema.org Property [Offer.availability](https://schema.org/availability).
+     * The promotions applied to the product. A maximum of 10 values are allowed
+     * per [Product][google.cloud.retail.v2.Product].
      * 
* - * .google.cloud.retail.v2.Product.Availability availability = 19; - * - * @return This builder for chaining. + * repeated .google.cloud.retail.v2.Promotion promotions = 34; */ - public Builder clearAvailability() { + public java.util.List getPromotionsBuilderList() { + return getPromotionsFieldBuilder().getBuilderList(); + } - availability_ = 0; - onChanged(); - return this; + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2.Promotion, + com.google.cloud.retail.v2.Promotion.Builder, + com.google.cloud.retail.v2.PromotionOrBuilder> + getPromotionsFieldBuilder() { + if (promotionsBuilder_ == null) { + promotionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2.Promotion, + com.google.cloud.retail.v2.Promotion.Builder, + com.google.cloud.retail.v2.PromotionOrBuilder>( + promotions_, ((bitField0_ & 0x00000800) != 0), getParentForChildren(), isClean()); + promotions_ = null; + } + return promotionsBuilder_; } - private com.google.protobuf.Int32Value availableQuantity_; + private com.google.protobuf.Timestamp publishTime_; private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Int32Value, - com.google.protobuf.Int32Value.Builder, - com.google.protobuf.Int32ValueOrBuilder> - availableQuantityBuilder_; + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + publishTimeBuilder_; /** * * *
-     * The available quantity of the item.
+     * The timestamp when the product is published by the retailer for the first
+     * time, which indicates the freshness of the products. Note that this field
+     * is different from
+     * [available_time][google.cloud.retail.v2.Product.available_time], given it
+     * purely describes product freshness regardless of when it is available on
+     * search and recommendation.
      * 
* - * .google.protobuf.Int32Value available_quantity = 20; + * .google.protobuf.Timestamp publish_time = 33; * - * @return Whether the availableQuantity field is set. + * @return Whether the publishTime field is set. */ - public boolean hasAvailableQuantity() { - return availableQuantityBuilder_ != null || availableQuantity_ != null; + public boolean hasPublishTime() { + return publishTimeBuilder_ != null || publishTime_ != null; } /** * * *
-     * The available quantity of the item.
+     * The timestamp when the product is published by the retailer for the first
+     * time, which indicates the freshness of the products. Note that this field
+     * is different from
+     * [available_time][google.cloud.retail.v2.Product.available_time], given it
+     * purely describes product freshness regardless of when it is available on
+     * search and recommendation.
      * 
* - * .google.protobuf.Int32Value available_quantity = 20; + * .google.protobuf.Timestamp publish_time = 33; * - * @return The availableQuantity. + * @return The publishTime. */ - public com.google.protobuf.Int32Value getAvailableQuantity() { - if (availableQuantityBuilder_ == null) { - return availableQuantity_ == null - ? com.google.protobuf.Int32Value.getDefaultInstance() - : availableQuantity_; + public com.google.protobuf.Timestamp getPublishTime() { + if (publishTimeBuilder_ == null) { + return publishTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : publishTime_; } else { - return availableQuantityBuilder_.getMessage(); + return publishTimeBuilder_.getMessage(); } } /** * * *
-     * The available quantity of the item.
+     * The timestamp when the product is published by the retailer for the first
+     * time, which indicates the freshness of the products. Note that this field
+     * is different from
+     * [available_time][google.cloud.retail.v2.Product.available_time], given it
+     * purely describes product freshness regardless of when it is available on
+     * search and recommendation.
      * 
* - * .google.protobuf.Int32Value available_quantity = 20; + * .google.protobuf.Timestamp publish_time = 33; */ - public Builder setAvailableQuantity(com.google.protobuf.Int32Value value) { - if (availableQuantityBuilder_ == null) { + public Builder setPublishTime(com.google.protobuf.Timestamp value) { + if (publishTimeBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - availableQuantity_ = value; + publishTime_ = value; onChanged(); } else { - availableQuantityBuilder_.setMessage(value); + publishTimeBuilder_.setMessage(value); } return this; @@ -4823,17 +11895,22 @@ public Builder setAvailableQuantity(com.google.protobuf.Int32Value value) { * * *
-     * The available quantity of the item.
+     * The timestamp when the product is published by the retailer for the first
+     * time, which indicates the freshness of the products. Note that this field
+     * is different from
+     * [available_time][google.cloud.retail.v2.Product.available_time], given it
+     * purely describes product freshness regardless of when it is available on
+     * search and recommendation.
      * 
* - * .google.protobuf.Int32Value available_quantity = 20; + * .google.protobuf.Timestamp publish_time = 33; */ - public Builder setAvailableQuantity(com.google.protobuf.Int32Value.Builder builderForValue) { - if (availableQuantityBuilder_ == null) { - availableQuantity_ = builderForValue.build(); + public Builder setPublishTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (publishTimeBuilder_ == null) { + publishTime_ = builderForValue.build(); onChanged(); } else { - availableQuantityBuilder_.setMessage(builderForValue.build()); + publishTimeBuilder_.setMessage(builderForValue.build()); } return this; @@ -4842,24 +11919,29 @@ public Builder setAvailableQuantity(com.google.protobuf.Int32Value.Builder build * * *
-     * The available quantity of the item.
+     * The timestamp when the product is published by the retailer for the first
+     * time, which indicates the freshness of the products. Note that this field
+     * is different from
+     * [available_time][google.cloud.retail.v2.Product.available_time], given it
+     * purely describes product freshness regardless of when it is available on
+     * search and recommendation.
      * 
* - * .google.protobuf.Int32Value available_quantity = 20; + * .google.protobuf.Timestamp publish_time = 33; */ - public Builder mergeAvailableQuantity(com.google.protobuf.Int32Value value) { - if (availableQuantityBuilder_ == null) { - if (availableQuantity_ != null) { - availableQuantity_ = - com.google.protobuf.Int32Value.newBuilder(availableQuantity_) + public Builder mergePublishTime(com.google.protobuf.Timestamp value) { + if (publishTimeBuilder_ == null) { + if (publishTime_ != null) { + publishTime_ = + com.google.protobuf.Timestamp.newBuilder(publishTime_) .mergeFrom(value) .buildPartial(); } else { - availableQuantity_ = value; + publishTime_ = value; } onChanged(); } else { - availableQuantityBuilder_.mergeFrom(value); + publishTimeBuilder_.mergeFrom(value); } return this; @@ -4868,18 +11950,23 @@ public Builder mergeAvailableQuantity(com.google.protobuf.Int32Value value) { * * *
-     * The available quantity of the item.
+     * The timestamp when the product is published by the retailer for the first
+     * time, which indicates the freshness of the products. Note that this field
+     * is different from
+     * [available_time][google.cloud.retail.v2.Product.available_time], given it
+     * purely describes product freshness regardless of when it is available on
+     * search and recommendation.
      * 
* - * .google.protobuf.Int32Value available_quantity = 20; + * .google.protobuf.Timestamp publish_time = 33; */ - public Builder clearAvailableQuantity() { - if (availableQuantityBuilder_ == null) { - availableQuantity_ = null; + public Builder clearPublishTime() { + if (publishTimeBuilder_ == null) { + publishTime_ = null; onChanged(); } else { - availableQuantity_ = null; - availableQuantityBuilder_ = null; + publishTime_ = null; + publishTimeBuilder_ = null; } return this; @@ -4888,290 +11975,743 @@ public Builder clearAvailableQuantity() { * * *
-     * The available quantity of the item.
+     * The timestamp when the product is published by the retailer for the first
+     * time, which indicates the freshness of the products. Note that this field
+     * is different from
+     * [available_time][google.cloud.retail.v2.Product.available_time], given it
+     * purely describes product freshness regardless of when it is available on
+     * search and recommendation.
      * 
* - * .google.protobuf.Int32Value available_quantity = 20; + * .google.protobuf.Timestamp publish_time = 33; */ - public com.google.protobuf.Int32Value.Builder getAvailableQuantityBuilder() { + public com.google.protobuf.Timestamp.Builder getPublishTimeBuilder() { onChanged(); - return getAvailableQuantityFieldBuilder().getBuilder(); + return getPublishTimeFieldBuilder().getBuilder(); } /** * * *
-     * The available quantity of the item.
+     * The timestamp when the product is published by the retailer for the first
+     * time, which indicates the freshness of the products. Note that this field
+     * is different from
+     * [available_time][google.cloud.retail.v2.Product.available_time], given it
+     * purely describes product freshness regardless of when it is available on
+     * search and recommendation.
      * 
* - * .google.protobuf.Int32Value available_quantity = 20; + * .google.protobuf.Timestamp publish_time = 33; */ - public com.google.protobuf.Int32ValueOrBuilder getAvailableQuantityOrBuilder() { - if (availableQuantityBuilder_ != null) { - return availableQuantityBuilder_.getMessageOrBuilder(); + public com.google.protobuf.TimestampOrBuilder getPublishTimeOrBuilder() { + if (publishTimeBuilder_ != null) { + return publishTimeBuilder_.getMessageOrBuilder(); } else { - return availableQuantity_ == null - ? com.google.protobuf.Int32Value.getDefaultInstance() - : availableQuantity_; + return publishTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : publishTime_; } } /** * * *
-     * The available quantity of the item.
+     * The timestamp when the product is published by the retailer for the first
+     * time, which indicates the freshness of the products. Note that this field
+     * is different from
+     * [available_time][google.cloud.retail.v2.Product.available_time], given it
+     * purely describes product freshness regardless of when it is available on
+     * search and recommendation.
      * 
* - * .google.protobuf.Int32Value available_quantity = 20; + * .google.protobuf.Timestamp publish_time = 33; */ private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Int32Value, - com.google.protobuf.Int32Value.Builder, - com.google.protobuf.Int32ValueOrBuilder> - getAvailableQuantityFieldBuilder() { - if (availableQuantityBuilder_ == null) { - availableQuantityBuilder_ = + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getPublishTimeFieldBuilder() { + if (publishTimeBuilder_ == null) { + publishTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Int32Value, - com.google.protobuf.Int32Value.Builder, - com.google.protobuf.Int32ValueOrBuilder>( - getAvailableQuantity(), getParentForChildren(), isClean()); - availableQuantity_ = null; + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getPublishTime(), getParentForChildren(), isClean()); + publishTime_ = null; } - return availableQuantityBuilder_; + return publishTimeBuilder_; } - private java.lang.Object uri_ = ""; + private com.google.protobuf.FieldMask retrievableFields_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + retrievableFieldsBuilder_; + /** + * + * + *
+     * Indicates which fields in the [Product][google.cloud.retail.v2.Product]s
+     * are returned in [SearchResponse][google.cloud.retail.v2.SearchResponse].
+     * Supported fields for all [type][google.cloud.retail.v2.Product.type]s:
+     * * [audience][google.cloud.retail.v2.Product.audience]
+     * * [availability][google.cloud.retail.v2.Product.availability]
+     * * [brands][google.cloud.retail.v2.Product.brands]
+     * * [color_info][google.cloud.retail.v2.Product.color_info]
+     * * [conditions][google.cloud.retail.v2.Product.conditions]
+     * * [gtin][google.cloud.retail.v2.Product.gtin]
+     * * [materials][google.cloud.retail.v2.Product.materials]
+     * * [name][google.cloud.retail.v2.Product.name]
+     * * [patterns][google.cloud.retail.v2.Product.patterns]
+     * * [price_info][google.cloud.retail.v2.Product.price_info]
+     * * [rating][google.cloud.retail.v2.Product.rating]
+     * * [sizes][google.cloud.retail.v2.Product.sizes]
+     * * [title][google.cloud.retail.v2.Product.title]
+     * * [uri][google.cloud.retail.v2.Product.uri]
+     * Supported fields only for
+     * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and
+     * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]:
+     * * [categories][google.cloud.retail.v2.Product.categories]
+     * * [description][google.cloud.retail.v2.Product.description]
+     * * [images][google.cloud.retail.v2.Product.images]
+     * Supported fields only for
+     * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]:
+     * * Only the first image in [images][google.cloud.retail.v2.Product.images]
+     * To mark [attributes][google.cloud.retail.v2.Product.attributes] as
+     * retrievable, include paths of the form "attributes.key" where "key" is the
+     * key of a custom attribute, as specified in
+     * [attributes][google.cloud.retail.v2.Product.attributes].
+     * For [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and
+     * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION], the
+     * following fields are always returned in
+     * [SearchResponse][google.cloud.retail.v2.SearchResponse] by default:
+     * * [name][google.cloud.retail.v2.Product.name]
+     * For [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT], the
+     * following fields are always returned in by default:
+     * * [name][google.cloud.retail.v2.Product.name]
+     * * [color_info][google.cloud.retail.v2.Product.color_info]
+     * Maximum number of paths is 20. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * .google.protobuf.FieldMask retrievable_fields = 30; + * + * @return Whether the retrievableFields field is set. + */ + public boolean hasRetrievableFields() { + return retrievableFieldsBuilder_ != null || retrievableFields_ != null; + } + /** + * + * + *
+     * Indicates which fields in the [Product][google.cloud.retail.v2.Product]s
+     * are returned in [SearchResponse][google.cloud.retail.v2.SearchResponse].
+     * Supported fields for all [type][google.cloud.retail.v2.Product.type]s:
+     * * [audience][google.cloud.retail.v2.Product.audience]
+     * * [availability][google.cloud.retail.v2.Product.availability]
+     * * [brands][google.cloud.retail.v2.Product.brands]
+     * * [color_info][google.cloud.retail.v2.Product.color_info]
+     * * [conditions][google.cloud.retail.v2.Product.conditions]
+     * * [gtin][google.cloud.retail.v2.Product.gtin]
+     * * [materials][google.cloud.retail.v2.Product.materials]
+     * * [name][google.cloud.retail.v2.Product.name]
+     * * [patterns][google.cloud.retail.v2.Product.patterns]
+     * * [price_info][google.cloud.retail.v2.Product.price_info]
+     * * [rating][google.cloud.retail.v2.Product.rating]
+     * * [sizes][google.cloud.retail.v2.Product.sizes]
+     * * [title][google.cloud.retail.v2.Product.title]
+     * * [uri][google.cloud.retail.v2.Product.uri]
+     * Supported fields only for
+     * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and
+     * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]:
+     * * [categories][google.cloud.retail.v2.Product.categories]
+     * * [description][google.cloud.retail.v2.Product.description]
+     * * [images][google.cloud.retail.v2.Product.images]
+     * Supported fields only for
+     * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]:
+     * * Only the first image in [images][google.cloud.retail.v2.Product.images]
+     * To mark [attributes][google.cloud.retail.v2.Product.attributes] as
+     * retrievable, include paths of the form "attributes.key" where "key" is the
+     * key of a custom attribute, as specified in
+     * [attributes][google.cloud.retail.v2.Product.attributes].
+     * For [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and
+     * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION], the
+     * following fields are always returned in
+     * [SearchResponse][google.cloud.retail.v2.SearchResponse] by default:
+     * * [name][google.cloud.retail.v2.Product.name]
+     * For [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT], the
+     * following fields are always returned in by default:
+     * * [name][google.cloud.retail.v2.Product.name]
+     * * [color_info][google.cloud.retail.v2.Product.color_info]
+     * Maximum number of paths is 20. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * .google.protobuf.FieldMask retrievable_fields = 30; + * + * @return The retrievableFields. + */ + public com.google.protobuf.FieldMask getRetrievableFields() { + if (retrievableFieldsBuilder_ == null) { + return retrievableFields_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : retrievableFields_; + } else { + return retrievableFieldsBuilder_.getMessage(); + } + } /** * * *
-     * Canonical URL directly linking to the product detail page.
-     * 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
-     * [link](https://support.google.com/merchants/answer/6324416). Schema.org
-     * property [Offer.url](https://schema.org/url).
-     * 
- * - * string uri = 22; - * - * @return The uri. - */ - public java.lang.String getUri() { - java.lang.Object ref = uri_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - uri_ = s; - return s; + * Indicates which fields in the [Product][google.cloud.retail.v2.Product]s + * are returned in [SearchResponse][google.cloud.retail.v2.SearchResponse]. + * Supported fields for all [type][google.cloud.retail.v2.Product.type]s: + * * [audience][google.cloud.retail.v2.Product.audience] + * * [availability][google.cloud.retail.v2.Product.availability] + * * [brands][google.cloud.retail.v2.Product.brands] + * * [color_info][google.cloud.retail.v2.Product.color_info] + * * [conditions][google.cloud.retail.v2.Product.conditions] + * * [gtin][google.cloud.retail.v2.Product.gtin] + * * [materials][google.cloud.retail.v2.Product.materials] + * * [name][google.cloud.retail.v2.Product.name] + * * [patterns][google.cloud.retail.v2.Product.patterns] + * * [price_info][google.cloud.retail.v2.Product.price_info] + * * [rating][google.cloud.retail.v2.Product.rating] + * * [sizes][google.cloud.retail.v2.Product.sizes] + * * [title][google.cloud.retail.v2.Product.title] + * * [uri][google.cloud.retail.v2.Product.uri] + * Supported fields only for + * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and + * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]: + * * [categories][google.cloud.retail.v2.Product.categories] + * * [description][google.cloud.retail.v2.Product.description] + * * [images][google.cloud.retail.v2.Product.images] + * Supported fields only for + * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]: + * * Only the first image in [images][google.cloud.retail.v2.Product.images] + * To mark [attributes][google.cloud.retail.v2.Product.attributes] as + * retrievable, include paths of the form "attributes.key" where "key" is the + * key of a custom attribute, as specified in + * [attributes][google.cloud.retail.v2.Product.attributes]. + * For [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and + * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION], the + * following fields are always returned in + * [SearchResponse][google.cloud.retail.v2.SearchResponse] by default: + * * [name][google.cloud.retail.v2.Product.name] + * For [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT], the + * following fields are always returned in by default: + * * [name][google.cloud.retail.v2.Product.name] + * * [color_info][google.cloud.retail.v2.Product.color_info] + * Maximum number of paths is 20. Otherwise, an INVALID_ARGUMENT error is + * returned. + *
+ * + * .google.protobuf.FieldMask retrievable_fields = 30; + */ + public Builder setRetrievableFields(com.google.protobuf.FieldMask value) { + if (retrievableFieldsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + retrievableFields_ = value; + onChanged(); } else { - return (java.lang.String) ref; + retrievableFieldsBuilder_.setMessage(value); } + + return this; } /** * * *
-     * Canonical URL directly linking to the product detail page.
-     * 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
-     * [link](https://support.google.com/merchants/answer/6324416). Schema.org
-     * property [Offer.url](https://schema.org/url).
-     * 
- * - * string uri = 22; - * - * @return The bytes for uri. - */ - public com.google.protobuf.ByteString getUriBytes() { - java.lang.Object ref = uri_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - uri_ = b; - return b; + * Indicates which fields in the [Product][google.cloud.retail.v2.Product]s + * are returned in [SearchResponse][google.cloud.retail.v2.SearchResponse]. + * Supported fields for all [type][google.cloud.retail.v2.Product.type]s: + * * [audience][google.cloud.retail.v2.Product.audience] + * * [availability][google.cloud.retail.v2.Product.availability] + * * [brands][google.cloud.retail.v2.Product.brands] + * * [color_info][google.cloud.retail.v2.Product.color_info] + * * [conditions][google.cloud.retail.v2.Product.conditions] + * * [gtin][google.cloud.retail.v2.Product.gtin] + * * [materials][google.cloud.retail.v2.Product.materials] + * * [name][google.cloud.retail.v2.Product.name] + * * [patterns][google.cloud.retail.v2.Product.patterns] + * * [price_info][google.cloud.retail.v2.Product.price_info] + * * [rating][google.cloud.retail.v2.Product.rating] + * * [sizes][google.cloud.retail.v2.Product.sizes] + * * [title][google.cloud.retail.v2.Product.title] + * * [uri][google.cloud.retail.v2.Product.uri] + * Supported fields only for + * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and + * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]: + * * [categories][google.cloud.retail.v2.Product.categories] + * * [description][google.cloud.retail.v2.Product.description] + * * [images][google.cloud.retail.v2.Product.images] + * Supported fields only for + * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]: + * * Only the first image in [images][google.cloud.retail.v2.Product.images] + * To mark [attributes][google.cloud.retail.v2.Product.attributes] as + * retrievable, include paths of the form "attributes.key" where "key" is the + * key of a custom attribute, as specified in + * [attributes][google.cloud.retail.v2.Product.attributes]. + * For [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and + * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION], the + * following fields are always returned in + * [SearchResponse][google.cloud.retail.v2.SearchResponse] by default: + * * [name][google.cloud.retail.v2.Product.name] + * For [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT], the + * following fields are always returned in by default: + * * [name][google.cloud.retail.v2.Product.name] + * * [color_info][google.cloud.retail.v2.Product.color_info] + * Maximum number of paths is 20. Otherwise, an INVALID_ARGUMENT error is + * returned. + *
+ * + * .google.protobuf.FieldMask retrievable_fields = 30; + */ + public Builder setRetrievableFields(com.google.protobuf.FieldMask.Builder builderForValue) { + if (retrievableFieldsBuilder_ == null) { + retrievableFields_ = builderForValue.build(); + onChanged(); } else { - return (com.google.protobuf.ByteString) ref; + retrievableFieldsBuilder_.setMessage(builderForValue.build()); } + + return this; } /** * * *
-     * Canonical URL directly linking to the product detail page.
-     * 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
-     * [link](https://support.google.com/merchants/answer/6324416). Schema.org
-     * property [Offer.url](https://schema.org/url).
-     * 
- * - * string uri = 22; - * - * @param value The uri to set. - * @return This builder for chaining. - */ - public Builder setUri(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); + * Indicates which fields in the [Product][google.cloud.retail.v2.Product]s + * are returned in [SearchResponse][google.cloud.retail.v2.SearchResponse]. + * Supported fields for all [type][google.cloud.retail.v2.Product.type]s: + * * [audience][google.cloud.retail.v2.Product.audience] + * * [availability][google.cloud.retail.v2.Product.availability] + * * [brands][google.cloud.retail.v2.Product.brands] + * * [color_info][google.cloud.retail.v2.Product.color_info] + * * [conditions][google.cloud.retail.v2.Product.conditions] + * * [gtin][google.cloud.retail.v2.Product.gtin] + * * [materials][google.cloud.retail.v2.Product.materials] + * * [name][google.cloud.retail.v2.Product.name] + * * [patterns][google.cloud.retail.v2.Product.patterns] + * * [price_info][google.cloud.retail.v2.Product.price_info] + * * [rating][google.cloud.retail.v2.Product.rating] + * * [sizes][google.cloud.retail.v2.Product.sizes] + * * [title][google.cloud.retail.v2.Product.title] + * * [uri][google.cloud.retail.v2.Product.uri] + * Supported fields only for + * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and + * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]: + * * [categories][google.cloud.retail.v2.Product.categories] + * * [description][google.cloud.retail.v2.Product.description] + * * [images][google.cloud.retail.v2.Product.images] + * Supported fields only for + * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]: + * * Only the first image in [images][google.cloud.retail.v2.Product.images] + * To mark [attributes][google.cloud.retail.v2.Product.attributes] as + * retrievable, include paths of the form "attributes.key" where "key" is the + * key of a custom attribute, as specified in + * [attributes][google.cloud.retail.v2.Product.attributes]. + * For [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and + * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION], the + * following fields are always returned in + * [SearchResponse][google.cloud.retail.v2.SearchResponse] by default: + * * [name][google.cloud.retail.v2.Product.name] + * For [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT], the + * following fields are always returned in by default: + * * [name][google.cloud.retail.v2.Product.name] + * * [color_info][google.cloud.retail.v2.Product.color_info] + * Maximum number of paths is 20. Otherwise, an INVALID_ARGUMENT error is + * returned. + *
+ * + * .google.protobuf.FieldMask retrievable_fields = 30; + */ + public Builder mergeRetrievableFields(com.google.protobuf.FieldMask value) { + if (retrievableFieldsBuilder_ == null) { + if (retrievableFields_ != null) { + retrievableFields_ = + com.google.protobuf.FieldMask.newBuilder(retrievableFields_) + .mergeFrom(value) + .buildPartial(); + } else { + retrievableFields_ = value; + } + onChanged(); + } else { + retrievableFieldsBuilder_.mergeFrom(value); } - uri_ = value; - onChanged(); return this; } /** * * *
-     * Canonical URL directly linking to the product detail page.
-     * 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
-     * [link](https://support.google.com/merchants/answer/6324416). Schema.org
-     * property [Offer.url](https://schema.org/url).
-     * 
- * - * string uri = 22; - * - * @return This builder for chaining. - */ - public Builder clearUri() { + * Indicates which fields in the [Product][google.cloud.retail.v2.Product]s + * are returned in [SearchResponse][google.cloud.retail.v2.SearchResponse]. + * Supported fields for all [type][google.cloud.retail.v2.Product.type]s: + * * [audience][google.cloud.retail.v2.Product.audience] + * * [availability][google.cloud.retail.v2.Product.availability] + * * [brands][google.cloud.retail.v2.Product.brands] + * * [color_info][google.cloud.retail.v2.Product.color_info] + * * [conditions][google.cloud.retail.v2.Product.conditions] + * * [gtin][google.cloud.retail.v2.Product.gtin] + * * [materials][google.cloud.retail.v2.Product.materials] + * * [name][google.cloud.retail.v2.Product.name] + * * [patterns][google.cloud.retail.v2.Product.patterns] + * * [price_info][google.cloud.retail.v2.Product.price_info] + * * [rating][google.cloud.retail.v2.Product.rating] + * * [sizes][google.cloud.retail.v2.Product.sizes] + * * [title][google.cloud.retail.v2.Product.title] + * * [uri][google.cloud.retail.v2.Product.uri] + * Supported fields only for + * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and + * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]: + * * [categories][google.cloud.retail.v2.Product.categories] + * * [description][google.cloud.retail.v2.Product.description] + * * [images][google.cloud.retail.v2.Product.images] + * Supported fields only for + * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]: + * * Only the first image in [images][google.cloud.retail.v2.Product.images] + * To mark [attributes][google.cloud.retail.v2.Product.attributes] as + * retrievable, include paths of the form "attributes.key" where "key" is the + * key of a custom attribute, as specified in + * [attributes][google.cloud.retail.v2.Product.attributes]. + * For [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and + * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION], the + * following fields are always returned in + * [SearchResponse][google.cloud.retail.v2.SearchResponse] by default: + * * [name][google.cloud.retail.v2.Product.name] + * For [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT], the + * following fields are always returned in by default: + * * [name][google.cloud.retail.v2.Product.name] + * * [color_info][google.cloud.retail.v2.Product.color_info] + * Maximum number of paths is 20. Otherwise, an INVALID_ARGUMENT error is + * returned. + *
+ * + * .google.protobuf.FieldMask retrievable_fields = 30; + */ + public Builder clearRetrievableFields() { + if (retrievableFieldsBuilder_ == null) { + retrievableFields_ = null; + onChanged(); + } else { + retrievableFields_ = null; + retrievableFieldsBuilder_ = null; + } - uri_ = getDefaultInstance().getUri(); - onChanged(); return this; } /** * * *
-     * Canonical URL directly linking to the product detail page.
-     * 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
-     * [link](https://support.google.com/merchants/answer/6324416). Schema.org
-     * property [Offer.url](https://schema.org/url).
-     * 
+ * Indicates which fields in the [Product][google.cloud.retail.v2.Product]s + * are returned in [SearchResponse][google.cloud.retail.v2.SearchResponse]. + * Supported fields for all [type][google.cloud.retail.v2.Product.type]s: + * * [audience][google.cloud.retail.v2.Product.audience] + * * [availability][google.cloud.retail.v2.Product.availability] + * * [brands][google.cloud.retail.v2.Product.brands] + * * [color_info][google.cloud.retail.v2.Product.color_info] + * * [conditions][google.cloud.retail.v2.Product.conditions] + * * [gtin][google.cloud.retail.v2.Product.gtin] + * * [materials][google.cloud.retail.v2.Product.materials] + * * [name][google.cloud.retail.v2.Product.name] + * * [patterns][google.cloud.retail.v2.Product.patterns] + * * [price_info][google.cloud.retail.v2.Product.price_info] + * * [rating][google.cloud.retail.v2.Product.rating] + * * [sizes][google.cloud.retail.v2.Product.sizes] + * * [title][google.cloud.retail.v2.Product.title] + * * [uri][google.cloud.retail.v2.Product.uri] + * Supported fields only for + * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and + * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]: + * * [categories][google.cloud.retail.v2.Product.categories] + * * [description][google.cloud.retail.v2.Product.description] + * * [images][google.cloud.retail.v2.Product.images] + * Supported fields only for + * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]: + * * Only the first image in [images][google.cloud.retail.v2.Product.images] + * To mark [attributes][google.cloud.retail.v2.Product.attributes] as + * retrievable, include paths of the form "attributes.key" where "key" is the + * key of a custom attribute, as specified in + * [attributes][google.cloud.retail.v2.Product.attributes]. + * For [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and + * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION], the + * following fields are always returned in + * [SearchResponse][google.cloud.retail.v2.SearchResponse] by default: + * * [name][google.cloud.retail.v2.Product.name] + * For [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT], the + * following fields are always returned in by default: + * * [name][google.cloud.retail.v2.Product.name] + * * [color_info][google.cloud.retail.v2.Product.color_info] + * Maximum number of paths is 20. Otherwise, an INVALID_ARGUMENT error is + * returned. + *
+ * + * .google.protobuf.FieldMask retrievable_fields = 30; + */ + public com.google.protobuf.FieldMask.Builder getRetrievableFieldsBuilder() { + + onChanged(); + return getRetrievableFieldsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Indicates which fields in the [Product][google.cloud.retail.v2.Product]s
+     * are returned in [SearchResponse][google.cloud.retail.v2.SearchResponse].
+     * Supported fields for all [type][google.cloud.retail.v2.Product.type]s:
+     * * [audience][google.cloud.retail.v2.Product.audience]
+     * * [availability][google.cloud.retail.v2.Product.availability]
+     * * [brands][google.cloud.retail.v2.Product.brands]
+     * * [color_info][google.cloud.retail.v2.Product.color_info]
+     * * [conditions][google.cloud.retail.v2.Product.conditions]
+     * * [gtin][google.cloud.retail.v2.Product.gtin]
+     * * [materials][google.cloud.retail.v2.Product.materials]
+     * * [name][google.cloud.retail.v2.Product.name]
+     * * [patterns][google.cloud.retail.v2.Product.patterns]
+     * * [price_info][google.cloud.retail.v2.Product.price_info]
+     * * [rating][google.cloud.retail.v2.Product.rating]
+     * * [sizes][google.cloud.retail.v2.Product.sizes]
+     * * [title][google.cloud.retail.v2.Product.title]
+     * * [uri][google.cloud.retail.v2.Product.uri]
+     * Supported fields only for
+     * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and
+     * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]:
+     * * [categories][google.cloud.retail.v2.Product.categories]
+     * * [description][google.cloud.retail.v2.Product.description]
+     * * [images][google.cloud.retail.v2.Product.images]
+     * Supported fields only for
+     * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]:
+     * * Only the first image in [images][google.cloud.retail.v2.Product.images]
+     * To mark [attributes][google.cloud.retail.v2.Product.attributes] as
+     * retrievable, include paths of the form "attributes.key" where "key" is the
+     * key of a custom attribute, as specified in
+     * [attributes][google.cloud.retail.v2.Product.attributes].
+     * For [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and
+     * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION], the
+     * following fields are always returned in
+     * [SearchResponse][google.cloud.retail.v2.SearchResponse] by default:
+     * * [name][google.cloud.retail.v2.Product.name]
+     * For [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT], the
+     * following fields are always returned in by default:
+     * * [name][google.cloud.retail.v2.Product.name]
+     * * [color_info][google.cloud.retail.v2.Product.color_info]
+     * Maximum number of paths is 20. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * .google.protobuf.FieldMask retrievable_fields = 30; + */ + public com.google.protobuf.FieldMaskOrBuilder getRetrievableFieldsOrBuilder() { + if (retrievableFieldsBuilder_ != null) { + return retrievableFieldsBuilder_.getMessageOrBuilder(); + } else { + return retrievableFields_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : retrievableFields_; + } + } + /** * - * string uri = 22; * - * @param value The bytes for uri to set. - * @return This builder for chaining. + *
+     * Indicates which fields in the [Product][google.cloud.retail.v2.Product]s
+     * are returned in [SearchResponse][google.cloud.retail.v2.SearchResponse].
+     * Supported fields for all [type][google.cloud.retail.v2.Product.type]s:
+     * * [audience][google.cloud.retail.v2.Product.audience]
+     * * [availability][google.cloud.retail.v2.Product.availability]
+     * * [brands][google.cloud.retail.v2.Product.brands]
+     * * [color_info][google.cloud.retail.v2.Product.color_info]
+     * * [conditions][google.cloud.retail.v2.Product.conditions]
+     * * [gtin][google.cloud.retail.v2.Product.gtin]
+     * * [materials][google.cloud.retail.v2.Product.materials]
+     * * [name][google.cloud.retail.v2.Product.name]
+     * * [patterns][google.cloud.retail.v2.Product.patterns]
+     * * [price_info][google.cloud.retail.v2.Product.price_info]
+     * * [rating][google.cloud.retail.v2.Product.rating]
+     * * [sizes][google.cloud.retail.v2.Product.sizes]
+     * * [title][google.cloud.retail.v2.Product.title]
+     * * [uri][google.cloud.retail.v2.Product.uri]
+     * Supported fields only for
+     * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and
+     * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]:
+     * * [categories][google.cloud.retail.v2.Product.categories]
+     * * [description][google.cloud.retail.v2.Product.description]
+     * * [images][google.cloud.retail.v2.Product.images]
+     * Supported fields only for
+     * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]:
+     * * Only the first image in [images][google.cloud.retail.v2.Product.images]
+     * To mark [attributes][google.cloud.retail.v2.Product.attributes] as
+     * retrievable, include paths of the form "attributes.key" where "key" is the
+     * key of a custom attribute, as specified in
+     * [attributes][google.cloud.retail.v2.Product.attributes].
+     * For [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and
+     * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION], the
+     * following fields are always returned in
+     * [SearchResponse][google.cloud.retail.v2.SearchResponse] by default:
+     * * [name][google.cloud.retail.v2.Product.name]
+     * For [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT], the
+     * following fields are always returned in by default:
+     * * [name][google.cloud.retail.v2.Product.name]
+     * * [color_info][google.cloud.retail.v2.Product.color_info]
+     * Maximum number of paths is 20. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * .google.protobuf.FieldMask retrievable_fields = 30; */ - public Builder setUriBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getRetrievableFieldsFieldBuilder() { + if (retrievableFieldsBuilder_ == null) { + retrievableFieldsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getRetrievableFields(), getParentForChildren(), isClean()); + retrievableFields_ = null; } - checkByteStringIsUtf8(value); - - uri_ = value; - onChanged(); - return this; + return retrievableFieldsBuilder_; } - private java.util.List images_ = + private java.util.List variants_ = java.util.Collections.emptyList(); - private void ensureImagesIsMutable() { - if (!((bitField0_ & 0x00000008) != 0)) { - images_ = new java.util.ArrayList(images_); - bitField0_ |= 0x00000008; + private void ensureVariantsIsMutable() { + if (!((bitField0_ & 0x00001000) != 0)) { + variants_ = new java.util.ArrayList(variants_); + bitField0_ |= 0x00001000; } } private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.retail.v2.Image, - com.google.cloud.retail.v2.Image.Builder, - com.google.cloud.retail.v2.ImageOrBuilder> - imagesBuilder_; + com.google.cloud.retail.v2.Product, + com.google.cloud.retail.v2.Product.Builder, + com.google.cloud.retail.v2.ProductOrBuilder> + variantsBuilder_; /** * * *
-     * Product images for the product.
-     * A maximum of 300 images are allowed.
-     * Google Merchant Center property
-     * [image_link](https://support.google.com/merchants/answer/6324350).
-     * Schema.org property [Product.image](https://schema.org/image).
+     * Output only. Product variants grouped together on primary product which
+     * share similar product attributes. It's automatically grouped by
+     * [primary_product_id][google.cloud.retail.v2.Product.primary_product_id] for
+     * all the product variants. Only populated for
+     * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct].
+     * Do not set this field in API requests.
      * 
* - * repeated .google.cloud.retail.v2.Image images = 23; + * + * repeated .google.cloud.retail.v2.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ - public java.util.List getImagesList() { - if (imagesBuilder_ == null) { - return java.util.Collections.unmodifiableList(images_); + public java.util.List getVariantsList() { + if (variantsBuilder_ == null) { + return java.util.Collections.unmodifiableList(variants_); } else { - return imagesBuilder_.getMessageList(); + return variantsBuilder_.getMessageList(); } } /** * * *
-     * Product images for the product.
-     * A maximum of 300 images are allowed.
-     * Google Merchant Center property
-     * [image_link](https://support.google.com/merchants/answer/6324350).
-     * Schema.org property [Product.image](https://schema.org/image).
+     * Output only. Product variants grouped together on primary product which
+     * share similar product attributes. It's automatically grouped by
+     * [primary_product_id][google.cloud.retail.v2.Product.primary_product_id] for
+     * all the product variants. Only populated for
+     * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct].
+     * Do not set this field in API requests.
      * 
* - * repeated .google.cloud.retail.v2.Image images = 23; + * + * repeated .google.cloud.retail.v2.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ - public int getImagesCount() { - if (imagesBuilder_ == null) { - return images_.size(); + public int getVariantsCount() { + if (variantsBuilder_ == null) { + return variants_.size(); } else { - return imagesBuilder_.getCount(); + return variantsBuilder_.getCount(); } } /** * * *
-     * Product images for the product.
-     * A maximum of 300 images are allowed.
-     * Google Merchant Center property
-     * [image_link](https://support.google.com/merchants/answer/6324350).
-     * Schema.org property [Product.image](https://schema.org/image).
+     * Output only. Product variants grouped together on primary product which
+     * share similar product attributes. It's automatically grouped by
+     * [primary_product_id][google.cloud.retail.v2.Product.primary_product_id] for
+     * all the product variants. Only populated for
+     * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct].
+     * Do not set this field in API requests.
      * 
* - * repeated .google.cloud.retail.v2.Image images = 23; + * + * repeated .google.cloud.retail.v2.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ - public com.google.cloud.retail.v2.Image getImages(int index) { - if (imagesBuilder_ == null) { - return images_.get(index); + public com.google.cloud.retail.v2.Product getVariants(int index) { + if (variantsBuilder_ == null) { + return variants_.get(index); } else { - return imagesBuilder_.getMessage(index); + return variantsBuilder_.getMessage(index); } } /** * * *
-     * Product images for the product.
-     * A maximum of 300 images are allowed.
-     * Google Merchant Center property
-     * [image_link](https://support.google.com/merchants/answer/6324350).
-     * Schema.org property [Product.image](https://schema.org/image).
+     * Output only. Product variants grouped together on primary product which
+     * share similar product attributes. It's automatically grouped by
+     * [primary_product_id][google.cloud.retail.v2.Product.primary_product_id] for
+     * all the product variants. Only populated for
+     * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct].
+     * Do not set this field in API requests.
      * 
* - * repeated .google.cloud.retail.v2.Image images = 23; + * + * repeated .google.cloud.retail.v2.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ - public Builder setImages(int index, com.google.cloud.retail.v2.Image value) { - if (imagesBuilder_ == null) { + public Builder setVariants(int index, com.google.cloud.retail.v2.Product value) { + if (variantsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureImagesIsMutable(); - images_.set(index, value); + ensureVariantsIsMutable(); + variants_.set(index, value); onChanged(); } else { - imagesBuilder_.setMessage(index, value); + variantsBuilder_.setMessage(index, value); } return this; } @@ -5179,22 +12719,29 @@ public Builder setImages(int index, com.google.cloud.retail.v2.Image value) { * * *
-     * Product images for the product.
-     * A maximum of 300 images are allowed.
-     * Google Merchant Center property
-     * [image_link](https://support.google.com/merchants/answer/6324350).
-     * Schema.org property [Product.image](https://schema.org/image).
+     * Output only. Product variants grouped together on primary product which
+     * share similar product attributes. It's automatically grouped by
+     * [primary_product_id][google.cloud.retail.v2.Product.primary_product_id] for
+     * all the product variants. Only populated for
+     * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct].
+     * Do not set this field in API requests.
      * 
* - * repeated .google.cloud.retail.v2.Image images = 23; + * + * repeated .google.cloud.retail.v2.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ - public Builder setImages(int index, com.google.cloud.retail.v2.Image.Builder builderForValue) { - if (imagesBuilder_ == null) { - ensureImagesIsMutable(); - images_.set(index, builderForValue.build()); + public Builder setVariants( + int index, com.google.cloud.retail.v2.Product.Builder builderForValue) { + if (variantsBuilder_ == null) { + ensureVariantsIsMutable(); + variants_.set(index, builderForValue.build()); onChanged(); } else { - imagesBuilder_.setMessage(index, builderForValue.build()); + variantsBuilder_.setMessage(index, builderForValue.build()); } return this; } @@ -5202,25 +12749,31 @@ public Builder setImages(int index, com.google.cloud.retail.v2.Image.Builder bui * * *
-     * Product images for the product.
-     * A maximum of 300 images are allowed.
-     * Google Merchant Center property
-     * [image_link](https://support.google.com/merchants/answer/6324350).
-     * Schema.org property [Product.image](https://schema.org/image).
+     * Output only. Product variants grouped together on primary product which
+     * share similar product attributes. It's automatically grouped by
+     * [primary_product_id][google.cloud.retail.v2.Product.primary_product_id] for
+     * all the product variants. Only populated for
+     * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct].
+     * Do not set this field in API requests.
      * 
* - * repeated .google.cloud.retail.v2.Image images = 23; + * + * repeated .google.cloud.retail.v2.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ - public Builder addImages(com.google.cloud.retail.v2.Image value) { - if (imagesBuilder_ == null) { + public Builder addVariants(com.google.cloud.retail.v2.Product value) { + if (variantsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureImagesIsMutable(); - images_.add(value); + ensureVariantsIsMutable(); + variants_.add(value); onChanged(); } else { - imagesBuilder_.addMessage(value); + variantsBuilder_.addMessage(value); } return this; } @@ -5228,25 +12781,31 @@ public Builder addImages(com.google.cloud.retail.v2.Image value) { * * *
-     * Product images for the product.
-     * A maximum of 300 images are allowed.
-     * Google Merchant Center property
-     * [image_link](https://support.google.com/merchants/answer/6324350).
-     * Schema.org property [Product.image](https://schema.org/image).
+     * Output only. Product variants grouped together on primary product which
+     * share similar product attributes. It's automatically grouped by
+     * [primary_product_id][google.cloud.retail.v2.Product.primary_product_id] for
+     * all the product variants. Only populated for
+     * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct].
+     * Do not set this field in API requests.
      * 
* - * repeated .google.cloud.retail.v2.Image images = 23; + * + * repeated .google.cloud.retail.v2.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ - public Builder addImages(int index, com.google.cloud.retail.v2.Image value) { - if (imagesBuilder_ == null) { + public Builder addVariants(int index, com.google.cloud.retail.v2.Product value) { + if (variantsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureImagesIsMutable(); - images_.add(index, value); + ensureVariantsIsMutable(); + variants_.add(index, value); onChanged(); } else { - imagesBuilder_.addMessage(index, value); + variantsBuilder_.addMessage(index, value); } return this; } @@ -5254,22 +12813,28 @@ public Builder addImages(int index, com.google.cloud.retail.v2.Image value) { * * *
-     * Product images for the product.
-     * A maximum of 300 images are allowed.
-     * Google Merchant Center property
-     * [image_link](https://support.google.com/merchants/answer/6324350).
-     * Schema.org property [Product.image](https://schema.org/image).
+     * Output only. Product variants grouped together on primary product which
+     * share similar product attributes. It's automatically grouped by
+     * [primary_product_id][google.cloud.retail.v2.Product.primary_product_id] for
+     * all the product variants. Only populated for
+     * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct].
+     * Do not set this field in API requests.
      * 
* - * repeated .google.cloud.retail.v2.Image images = 23; + * + * repeated .google.cloud.retail.v2.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ - public Builder addImages(com.google.cloud.retail.v2.Image.Builder builderForValue) { - if (imagesBuilder_ == null) { - ensureImagesIsMutable(); - images_.add(builderForValue.build()); + public Builder addVariants(com.google.cloud.retail.v2.Product.Builder builderForValue) { + if (variantsBuilder_ == null) { + ensureVariantsIsMutable(); + variants_.add(builderForValue.build()); onChanged(); } else { - imagesBuilder_.addMessage(builderForValue.build()); + variantsBuilder_.addMessage(builderForValue.build()); } return this; } @@ -5277,22 +12842,29 @@ public Builder addImages(com.google.cloud.retail.v2.Image.Builder builderForValu * * *
-     * Product images for the product.
-     * A maximum of 300 images are allowed.
-     * Google Merchant Center property
-     * [image_link](https://support.google.com/merchants/answer/6324350).
-     * Schema.org property [Product.image](https://schema.org/image).
+     * Output only. Product variants grouped together on primary product which
+     * share similar product attributes. It's automatically grouped by
+     * [primary_product_id][google.cloud.retail.v2.Product.primary_product_id] for
+     * all the product variants. Only populated for
+     * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct].
+     * Do not set this field in API requests.
      * 
* - * repeated .google.cloud.retail.v2.Image images = 23; + * + * repeated .google.cloud.retail.v2.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ - public Builder addImages(int index, com.google.cloud.retail.v2.Image.Builder builderForValue) { - if (imagesBuilder_ == null) { - ensureImagesIsMutable(); - images_.add(index, builderForValue.build()); + public Builder addVariants( + int index, com.google.cloud.retail.v2.Product.Builder builderForValue) { + if (variantsBuilder_ == null) { + ensureVariantsIsMutable(); + variants_.add(index, builderForValue.build()); onChanged(); } else { - imagesBuilder_.addMessage(index, builderForValue.build()); + variantsBuilder_.addMessage(index, builderForValue.build()); } return this; } @@ -5300,23 +12872,29 @@ public Builder addImages(int index, com.google.cloud.retail.v2.Image.Builder bui * * *
-     * Product images for the product.
-     * A maximum of 300 images are allowed.
-     * Google Merchant Center property
-     * [image_link](https://support.google.com/merchants/answer/6324350).
-     * Schema.org property [Product.image](https://schema.org/image).
+     * Output only. Product variants grouped together on primary product which
+     * share similar product attributes. It's automatically grouped by
+     * [primary_product_id][google.cloud.retail.v2.Product.primary_product_id] for
+     * all the product variants. Only populated for
+     * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct].
+     * Do not set this field in API requests.
      * 
* - * repeated .google.cloud.retail.v2.Image images = 23; + * + * repeated .google.cloud.retail.v2.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ - public Builder addAllImages( - java.lang.Iterable values) { - if (imagesBuilder_ == null) { - ensureImagesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, images_); + public Builder addAllVariants( + java.lang.Iterable values) { + if (variantsBuilder_ == null) { + ensureVariantsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, variants_); onChanged(); } else { - imagesBuilder_.addAllMessages(values); + variantsBuilder_.addAllMessages(values); } return this; } @@ -5324,22 +12902,28 @@ public Builder addAllImages( * * *
-     * Product images for the product.
-     * A maximum of 300 images are allowed.
-     * Google Merchant Center property
-     * [image_link](https://support.google.com/merchants/answer/6324350).
-     * Schema.org property [Product.image](https://schema.org/image).
+     * Output only. Product variants grouped together on primary product which
+     * share similar product attributes. It's automatically grouped by
+     * [primary_product_id][google.cloud.retail.v2.Product.primary_product_id] for
+     * all the product variants. Only populated for
+     * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct].
+     * Do not set this field in API requests.
      * 
* - * repeated .google.cloud.retail.v2.Image images = 23; + * + * repeated .google.cloud.retail.v2.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ - public Builder clearImages() { - if (imagesBuilder_ == null) { - images_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); + public Builder clearVariants() { + if (variantsBuilder_ == null) { + variants_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00001000); onChanged(); } else { - imagesBuilder_.clear(); + variantsBuilder_.clear(); } return this; } @@ -5347,22 +12931,28 @@ public Builder clearImages() { * * *
-     * Product images for the product.
-     * A maximum of 300 images are allowed.
-     * Google Merchant Center property
-     * [image_link](https://support.google.com/merchants/answer/6324350).
-     * Schema.org property [Product.image](https://schema.org/image).
+     * Output only. Product variants grouped together on primary product which
+     * share similar product attributes. It's automatically grouped by
+     * [primary_product_id][google.cloud.retail.v2.Product.primary_product_id] for
+     * all the product variants. Only populated for
+     * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct].
+     * Do not set this field in API requests.
      * 
* - * repeated .google.cloud.retail.v2.Image images = 23; + * + * repeated .google.cloud.retail.v2.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ - public Builder removeImages(int index) { - if (imagesBuilder_ == null) { - ensureImagesIsMutable(); - images_.remove(index); + public Builder removeVariants(int index) { + if (variantsBuilder_ == null) { + ensureVariantsIsMutable(); + variants_.remove(index); onChanged(); } else { - imagesBuilder_.remove(index); + variantsBuilder_.remove(index); } return this; } @@ -5370,125 +12960,161 @@ public Builder removeImages(int index) { * * *
-     * Product images for the product.
-     * A maximum of 300 images are allowed.
-     * Google Merchant Center property
-     * [image_link](https://support.google.com/merchants/answer/6324350).
-     * Schema.org property [Product.image](https://schema.org/image).
+     * Output only. Product variants grouped together on primary product which
+     * share similar product attributes. It's automatically grouped by
+     * [primary_product_id][google.cloud.retail.v2.Product.primary_product_id] for
+     * all the product variants. Only populated for
+     * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct].
+     * Do not set this field in API requests.
      * 
* - * repeated .google.cloud.retail.v2.Image images = 23; + * + * repeated .google.cloud.retail.v2.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ - public com.google.cloud.retail.v2.Image.Builder getImagesBuilder(int index) { - return getImagesFieldBuilder().getBuilder(index); + public com.google.cloud.retail.v2.Product.Builder getVariantsBuilder(int index) { + return getVariantsFieldBuilder().getBuilder(index); } /** * * *
-     * Product images for the product.
-     * A maximum of 300 images are allowed.
-     * Google Merchant Center property
-     * [image_link](https://support.google.com/merchants/answer/6324350).
-     * Schema.org property [Product.image](https://schema.org/image).
+     * Output only. Product variants grouped together on primary product which
+     * share similar product attributes. It's automatically grouped by
+     * [primary_product_id][google.cloud.retail.v2.Product.primary_product_id] for
+     * all the product variants. Only populated for
+     * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct].
+     * Do not set this field in API requests.
      * 
* - * repeated .google.cloud.retail.v2.Image images = 23; + * + * repeated .google.cloud.retail.v2.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ - public com.google.cloud.retail.v2.ImageOrBuilder getImagesOrBuilder(int index) { - if (imagesBuilder_ == null) { - return images_.get(index); + public com.google.cloud.retail.v2.ProductOrBuilder getVariantsOrBuilder(int index) { + if (variantsBuilder_ == null) { + return variants_.get(index); } else { - return imagesBuilder_.getMessageOrBuilder(index); + return variantsBuilder_.getMessageOrBuilder(index); } } /** * * *
-     * Product images for the product.
-     * A maximum of 300 images are allowed.
-     * Google Merchant Center property
-     * [image_link](https://support.google.com/merchants/answer/6324350).
-     * Schema.org property [Product.image](https://schema.org/image).
+     * Output only. Product variants grouped together on primary product which
+     * share similar product attributes. It's automatically grouped by
+     * [primary_product_id][google.cloud.retail.v2.Product.primary_product_id] for
+     * all the product variants. Only populated for
+     * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct].
+     * Do not set this field in API requests.
      * 
* - * repeated .google.cloud.retail.v2.Image images = 23; + * + * repeated .google.cloud.retail.v2.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ - public java.util.List - getImagesOrBuilderList() { - if (imagesBuilder_ != null) { - return imagesBuilder_.getMessageOrBuilderList(); + public java.util.List + getVariantsOrBuilderList() { + if (variantsBuilder_ != null) { + return variantsBuilder_.getMessageOrBuilderList(); } else { - return java.util.Collections.unmodifiableList(images_); + return java.util.Collections.unmodifiableList(variants_); } } /** * * *
-     * Product images for the product.
-     * A maximum of 300 images are allowed.
-     * Google Merchant Center property
-     * [image_link](https://support.google.com/merchants/answer/6324350).
-     * Schema.org property [Product.image](https://schema.org/image).
+     * Output only. Product variants grouped together on primary product which
+     * share similar product attributes. It's automatically grouped by
+     * [primary_product_id][google.cloud.retail.v2.Product.primary_product_id] for
+     * all the product variants. Only populated for
+     * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct].
+     * Do not set this field in API requests.
      * 
* - * repeated .google.cloud.retail.v2.Image images = 23; + * + * repeated .google.cloud.retail.v2.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ - public com.google.cloud.retail.v2.Image.Builder addImagesBuilder() { - return getImagesFieldBuilder() - .addBuilder(com.google.cloud.retail.v2.Image.getDefaultInstance()); + public com.google.cloud.retail.v2.Product.Builder addVariantsBuilder() { + return getVariantsFieldBuilder() + .addBuilder(com.google.cloud.retail.v2.Product.getDefaultInstance()); } /** * * *
-     * Product images for the product.
-     * A maximum of 300 images are allowed.
-     * Google Merchant Center property
-     * [image_link](https://support.google.com/merchants/answer/6324350).
-     * Schema.org property [Product.image](https://schema.org/image).
+     * Output only. Product variants grouped together on primary product which
+     * share similar product attributes. It's automatically grouped by
+     * [primary_product_id][google.cloud.retail.v2.Product.primary_product_id] for
+     * all the product variants. Only populated for
+     * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct].
+     * Do not set this field in API requests.
      * 
* - * repeated .google.cloud.retail.v2.Image images = 23; + * + * repeated .google.cloud.retail.v2.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ - public com.google.cloud.retail.v2.Image.Builder addImagesBuilder(int index) { - return getImagesFieldBuilder() - .addBuilder(index, com.google.cloud.retail.v2.Image.getDefaultInstance()); + public com.google.cloud.retail.v2.Product.Builder addVariantsBuilder(int index) { + return getVariantsFieldBuilder() + .addBuilder(index, com.google.cloud.retail.v2.Product.getDefaultInstance()); } /** * * *
-     * Product images for the product.
-     * A maximum of 300 images are allowed.
-     * Google Merchant Center property
-     * [image_link](https://support.google.com/merchants/answer/6324350).
-     * Schema.org property [Product.image](https://schema.org/image).
+     * Output only. Product variants grouped together on primary product which
+     * share similar product attributes. It's automatically grouped by
+     * [primary_product_id][google.cloud.retail.v2.Product.primary_product_id] for
+     * all the product variants. Only populated for
+     * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct].
+     * Do not set this field in API requests.
      * 
* - * repeated .google.cloud.retail.v2.Image images = 23; + * + * repeated .google.cloud.retail.v2.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ - public java.util.List getImagesBuilderList() { - return getImagesFieldBuilder().getBuilderList(); + public java.util.List getVariantsBuilderList() { + return getVariantsFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.retail.v2.Image, - com.google.cloud.retail.v2.Image.Builder, - com.google.cloud.retail.v2.ImageOrBuilder> - getImagesFieldBuilder() { - if (imagesBuilder_ == null) { - imagesBuilder_ = + com.google.cloud.retail.v2.Product, + com.google.cloud.retail.v2.Product.Builder, + com.google.cloud.retail.v2.ProductOrBuilder> + getVariantsFieldBuilder() { + if (variantsBuilder_ == null) { + variantsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.retail.v2.Image, - com.google.cloud.retail.v2.Image.Builder, - com.google.cloud.retail.v2.ImageOrBuilder>( - images_, ((bitField0_ & 0x00000008) != 0), getParentForChildren(), isClean()); - images_ = null; + com.google.cloud.retail.v2.Product, + com.google.cloud.retail.v2.Product.Builder, + com.google.cloud.retail.v2.ProductOrBuilder>( + variants_, ((bitField0_ & 0x00001000) != 0), getParentForChildren(), isClean()); + variants_ = null; } - return imagesBuilder_; + return variantsBuilder_; } @java.lang.Override diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ProductInlineSource.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ProductInlineSource.java index 45b05923..fc3bf46c 100644 --- a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ProductInlineSource.java +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ProductInlineSource.java @@ -127,7 +127,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { *
    * Required. A list of products to update/create. Each product must have a
    * valid [Product.id][google.cloud.retail.v2.Product.id]. Recommended max of
-   * 10k items.
+   * 100 items.
    * 
* * @@ -144,7 +144,7 @@ public java.util.List getProductsList() { *
    * Required. A list of products to update/create. Each product must have a
    * valid [Product.id][google.cloud.retail.v2.Product.id]. Recommended max of
-   * 10k items.
+   * 100 items.
    * 
* * @@ -162,7 +162,7 @@ public java.util.List getProductsList() { *
    * Required. A list of products to update/create. Each product must have a
    * valid [Product.id][google.cloud.retail.v2.Product.id]. Recommended max of
-   * 10k items.
+   * 100 items.
    * 
* * @@ -179,7 +179,7 @@ public int getProductsCount() { *
    * Required. A list of products to update/create. Each product must have a
    * valid [Product.id][google.cloud.retail.v2.Product.id]. Recommended max of
-   * 10k items.
+   * 100 items.
    * 
* * @@ -196,7 +196,7 @@ public com.google.cloud.retail.v2.Product getProducts(int index) { *
    * Required. A list of products to update/create. Each product must have a
    * valid [Product.id][google.cloud.retail.v2.Product.id]. Recommended max of
-   * 10k items.
+   * 100 items.
    * 
* * @@ -588,7 +588,7 @@ private void ensureProductsIsMutable() { *
      * Required. A list of products to update/create. Each product must have a
      * valid [Product.id][google.cloud.retail.v2.Product.id]. Recommended max of
-     * 10k items.
+     * 100 items.
      * 
* * @@ -608,7 +608,7 @@ public java.util.List getProductsList() { *
      * Required. A list of products to update/create. Each product must have a
      * valid [Product.id][google.cloud.retail.v2.Product.id]. Recommended max of
-     * 10k items.
+     * 100 items.
      * 
* * @@ -628,7 +628,7 @@ public int getProductsCount() { *
      * Required. A list of products to update/create. Each product must have a
      * valid [Product.id][google.cloud.retail.v2.Product.id]. Recommended max of
-     * 10k items.
+     * 100 items.
      * 
* * @@ -648,7 +648,7 @@ public com.google.cloud.retail.v2.Product getProducts(int index) { *
      * Required. A list of products to update/create. Each product must have a
      * valid [Product.id][google.cloud.retail.v2.Product.id]. Recommended max of
-     * 10k items.
+     * 100 items.
      * 
* * @@ -674,7 +674,7 @@ public Builder setProducts(int index, com.google.cloud.retail.v2.Product value) *
      * Required. A list of products to update/create. Each product must have a
      * valid [Product.id][google.cloud.retail.v2.Product.id]. Recommended max of
-     * 10k items.
+     * 100 items.
      * 
* * @@ -698,7 +698,7 @@ public Builder setProducts( *
      * Required. A list of products to update/create. Each product must have a
      * valid [Product.id][google.cloud.retail.v2.Product.id]. Recommended max of
-     * 10k items.
+     * 100 items.
      * 
* * @@ -724,7 +724,7 @@ public Builder addProducts(com.google.cloud.retail.v2.Product value) { *
      * Required. A list of products to update/create. Each product must have a
      * valid [Product.id][google.cloud.retail.v2.Product.id]. Recommended max of
-     * 10k items.
+     * 100 items.
      * 
* * @@ -750,7 +750,7 @@ public Builder addProducts(int index, com.google.cloud.retail.v2.Product value) *
      * Required. A list of products to update/create. Each product must have a
      * valid [Product.id][google.cloud.retail.v2.Product.id]. Recommended max of
-     * 10k items.
+     * 100 items.
      * 
* * @@ -773,7 +773,7 @@ public Builder addProducts(com.google.cloud.retail.v2.Product.Builder builderFor *
      * Required. A list of products to update/create. Each product must have a
      * valid [Product.id][google.cloud.retail.v2.Product.id]. Recommended max of
-     * 10k items.
+     * 100 items.
      * 
* * @@ -797,7 +797,7 @@ public Builder addProducts( *
      * Required. A list of products to update/create. Each product must have a
      * valid [Product.id][google.cloud.retail.v2.Product.id]. Recommended max of
-     * 10k items.
+     * 100 items.
      * 
* * @@ -821,7 +821,7 @@ public Builder addAllProducts( *
      * Required. A list of products to update/create. Each product must have a
      * valid [Product.id][google.cloud.retail.v2.Product.id]. Recommended max of
-     * 10k items.
+     * 100 items.
      * 
* * @@ -844,7 +844,7 @@ public Builder clearProducts() { *
      * Required. A list of products to update/create. Each product must have a
      * valid [Product.id][google.cloud.retail.v2.Product.id]. Recommended max of
-     * 10k items.
+     * 100 items.
      * 
* * @@ -867,7 +867,7 @@ public Builder removeProducts(int index) { *
      * Required. A list of products to update/create. Each product must have a
      * valid [Product.id][google.cloud.retail.v2.Product.id]. Recommended max of
-     * 10k items.
+     * 100 items.
      * 
* * @@ -883,7 +883,7 @@ public com.google.cloud.retail.v2.Product.Builder getProductsBuilder(int index) *
      * Required. A list of products to update/create. Each product must have a
      * valid [Product.id][google.cloud.retail.v2.Product.id]. Recommended max of
-     * 10k items.
+     * 100 items.
      * 
* * @@ -903,7 +903,7 @@ public com.google.cloud.retail.v2.ProductOrBuilder getProductsOrBuilder(int inde *
      * Required. A list of products to update/create. Each product must have a
      * valid [Product.id][google.cloud.retail.v2.Product.id]. Recommended max of
-     * 10k items.
+     * 100 items.
      * 
* * @@ -924,7 +924,7 @@ public com.google.cloud.retail.v2.ProductOrBuilder getProductsOrBuilder(int inde *
      * Required. A list of products to update/create. Each product must have a
      * valid [Product.id][google.cloud.retail.v2.Product.id]. Recommended max of
-     * 10k items.
+     * 100 items.
      * 
* * @@ -941,7 +941,7 @@ public com.google.cloud.retail.v2.Product.Builder addProductsBuilder() { *
      * Required. A list of products to update/create. Each product must have a
      * valid [Product.id][google.cloud.retail.v2.Product.id]. Recommended max of
-     * 10k items.
+     * 100 items.
      * 
* * @@ -958,7 +958,7 @@ public com.google.cloud.retail.v2.Product.Builder addProductsBuilder(int index) *
      * Required. A list of products to update/create. Each product must have a
      * valid [Product.id][google.cloud.retail.v2.Product.id]. Recommended max of
-     * 10k items.
+     * 100 items.
      * 
* * diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ProductInlineSourceOrBuilder.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ProductInlineSourceOrBuilder.java index b9c62cb2..dcf6cf77 100644 --- a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ProductInlineSourceOrBuilder.java +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ProductInlineSourceOrBuilder.java @@ -29,7 +29,7 @@ public interface ProductInlineSourceOrBuilder *
    * Required. A list of products to update/create. Each product must have a
    * valid [Product.id][google.cloud.retail.v2.Product.id]. Recommended max of
-   * 10k items.
+   * 100 items.
    * 
* * @@ -43,7 +43,7 @@ public interface ProductInlineSourceOrBuilder *
    * Required. A list of products to update/create. Each product must have a
    * valid [Product.id][google.cloud.retail.v2.Product.id]. Recommended max of
-   * 10k items.
+   * 100 items.
    * 
* * @@ -57,7 +57,7 @@ public interface ProductInlineSourceOrBuilder *
    * Required. A list of products to update/create. Each product must have a
    * valid [Product.id][google.cloud.retail.v2.Product.id]. Recommended max of
-   * 10k items.
+   * 100 items.
    * 
* * @@ -71,7 +71,7 @@ public interface ProductInlineSourceOrBuilder *
    * Required. A list of products to update/create. Each product must have a
    * valid [Product.id][google.cloud.retail.v2.Product.id]. Recommended max of
-   * 10k items.
+   * 100 items.
    * 
* * @@ -85,7 +85,7 @@ public interface ProductInlineSourceOrBuilder *
    * Required. A list of products to update/create. Each product must have a
    * valid [Product.id][google.cloud.retail.v2.Product.id]. Recommended max of
-   * 10k items.
+   * 100 items.
    * 
* * diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ProductLevelConfig.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ProductLevelConfig.java index 66e50e0f..73f4586b 100644 --- a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ProductLevelConfig.java +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ProductLevelConfig.java @@ -145,9 +145,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * If this field is `variant` and * [merchant_center_product_id_field][google.cloud.retail.v2.ProductLevelConfig.merchant_center_product_id_field] * is `itemGroupId`, an INVALID_ARGUMENT error is returned. - * See [Using catalog - * levels](/retail/recommendations-ai/docs/catalog#catalog-levels) for more - * details. + * See [Using product + * levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels) + * for more details. *
* * string ingestion_product_type = 1; @@ -189,9 +189,9 @@ public java.lang.String getIngestionProductType() { * If this field is `variant` and * [merchant_center_product_id_field][google.cloud.retail.v2.ProductLevelConfig.merchant_center_product_id_field] * is `itemGroupId`, an INVALID_ARGUMENT error is returned. - * See [Using catalog - * levels](/retail/recommendations-ai/docs/catalog#catalog-levels) for more - * details. + * See [Using product + * levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels) + * for more details. * * * string ingestion_product_type = 1; @@ -230,9 +230,9 @@ public com.google.protobuf.ByteString getIngestionProductTypeBytes() { * If this field is `itemGroupId` and * [ingestion_product_type][google.cloud.retail.v2.ProductLevelConfig.ingestion_product_type] * is `variant`, an INVALID_ARGUMENT error is returned. - * See [Using catalog - * levels](/retail/recommendations-ai/docs/catalog#catalog-levels) for more - * details. + * See [Using product + * levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels) + * for more details. * * * string merchant_center_product_id_field = 2; @@ -268,9 +268,9 @@ public java.lang.String getMerchantCenterProductIdField() { * If this field is `itemGroupId` and * [ingestion_product_type][google.cloud.retail.v2.ProductLevelConfig.ingestion_product_type] * is `variant`, an INVALID_ARGUMENT error is returned. - * See [Using catalog - * levels](/retail/recommendations-ai/docs/catalog#catalog-levels) for more - * details. + * See [Using product + * levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels) + * for more details. * * * string merchant_center_product_id_field = 2; @@ -650,9 +650,9 @@ public Builder mergeFrom( * If this field is `variant` and * [merchant_center_product_id_field][google.cloud.retail.v2.ProductLevelConfig.merchant_center_product_id_field] * is `itemGroupId`, an INVALID_ARGUMENT error is returned. - * See [Using catalog - * levels](/retail/recommendations-ai/docs/catalog#catalog-levels) for more - * details. + * See [Using product + * levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels) + * for more details. * * * string ingestion_product_type = 1; @@ -693,9 +693,9 @@ public java.lang.String getIngestionProductType() { * If this field is `variant` and * [merchant_center_product_id_field][google.cloud.retail.v2.ProductLevelConfig.merchant_center_product_id_field] * is `itemGroupId`, an INVALID_ARGUMENT error is returned. - * See [Using catalog - * levels](/retail/recommendations-ai/docs/catalog#catalog-levels) for more - * details. + * See [Using product + * levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels) + * for more details. * * * string ingestion_product_type = 1; @@ -736,9 +736,9 @@ public com.google.protobuf.ByteString getIngestionProductTypeBytes() { * If this field is `variant` and * [merchant_center_product_id_field][google.cloud.retail.v2.ProductLevelConfig.merchant_center_product_id_field] * is `itemGroupId`, an INVALID_ARGUMENT error is returned. - * See [Using catalog - * levels](/retail/recommendations-ai/docs/catalog#catalog-levels) for more - * details. + * See [Using product + * levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels) + * for more details. * * * string ingestion_product_type = 1; @@ -778,9 +778,9 @@ public Builder setIngestionProductType(java.lang.String value) { * If this field is `variant` and * [merchant_center_product_id_field][google.cloud.retail.v2.ProductLevelConfig.merchant_center_product_id_field] * is `itemGroupId`, an INVALID_ARGUMENT error is returned. - * See [Using catalog - * levels](/retail/recommendations-ai/docs/catalog#catalog-levels) for more - * details. + * See [Using product + * levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels) + * for more details. * * * string ingestion_product_type = 1; @@ -816,9 +816,9 @@ public Builder clearIngestionProductType() { * If this field is `variant` and * [merchant_center_product_id_field][google.cloud.retail.v2.ProductLevelConfig.merchant_center_product_id_field] * is `itemGroupId`, an INVALID_ARGUMENT error is returned. - * See [Using catalog - * levels](/retail/recommendations-ai/docs/catalog#catalog-levels) for more - * details. + * See [Using product + * levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels) + * for more details. * * * string ingestion_product_type = 1; @@ -855,9 +855,9 @@ public Builder setIngestionProductTypeBytes(com.google.protobuf.ByteString value * If this field is `itemGroupId` and * [ingestion_product_type][google.cloud.retail.v2.ProductLevelConfig.ingestion_product_type] * is `variant`, an INVALID_ARGUMENT error is returned. - * See [Using catalog - * levels](/retail/recommendations-ai/docs/catalog#catalog-levels) for more - * details. + * See [Using product + * levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels) + * for more details. * * * string merchant_center_product_id_field = 2; @@ -892,9 +892,9 @@ public java.lang.String getMerchantCenterProductIdField() { * If this field is `itemGroupId` and * [ingestion_product_type][google.cloud.retail.v2.ProductLevelConfig.ingestion_product_type] * is `variant`, an INVALID_ARGUMENT error is returned. - * See [Using catalog - * levels](/retail/recommendations-ai/docs/catalog#catalog-levels) for more - * details. + * See [Using product + * levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels) + * for more details. * * * string merchant_center_product_id_field = 2; @@ -929,9 +929,9 @@ public com.google.protobuf.ByteString getMerchantCenterProductIdFieldBytes() { * If this field is `itemGroupId` and * [ingestion_product_type][google.cloud.retail.v2.ProductLevelConfig.ingestion_product_type] * is `variant`, an INVALID_ARGUMENT error is returned. - * See [Using catalog - * levels](/retail/recommendations-ai/docs/catalog#catalog-levels) for more - * details. + * See [Using product + * levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels) + * for more details. * * * string merchant_center_product_id_field = 2; @@ -965,9 +965,9 @@ public Builder setMerchantCenterProductIdField(java.lang.String value) { * If this field is `itemGroupId` and * [ingestion_product_type][google.cloud.retail.v2.ProductLevelConfig.ingestion_product_type] * is `variant`, an INVALID_ARGUMENT error is returned. - * See [Using catalog - * levels](/retail/recommendations-ai/docs/catalog#catalog-levels) for more - * details. + * See [Using product + * levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels) + * for more details. * * * string merchant_center_product_id_field = 2; @@ -997,9 +997,9 @@ public Builder clearMerchantCenterProductIdField() { * If this field is `itemGroupId` and * [ingestion_product_type][google.cloud.retail.v2.ProductLevelConfig.ingestion_product_type] * is `variant`, an INVALID_ARGUMENT error is returned. - * See [Using catalog - * levels](/retail/recommendations-ai/docs/catalog#catalog-levels) for more - * details. + * See [Using product + * levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels) + * for more details. * * * string merchant_center_product_id_field = 2; diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ProductLevelConfigOrBuilder.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ProductLevelConfigOrBuilder.java index 333d97f0..069cb235 100644 --- a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ProductLevelConfigOrBuilder.java +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ProductLevelConfigOrBuilder.java @@ -46,9 +46,9 @@ public interface ProductLevelConfigOrBuilder * If this field is `variant` and * [merchant_center_product_id_field][google.cloud.retail.v2.ProductLevelConfig.merchant_center_product_id_field] * is `itemGroupId`, an INVALID_ARGUMENT error is returned. - * See [Using catalog - * levels](/retail/recommendations-ai/docs/catalog#catalog-levels) for more - * details. + * See [Using product + * levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels) + * for more details. * * * string ingestion_product_type = 1; @@ -79,9 +79,9 @@ public interface ProductLevelConfigOrBuilder * If this field is `variant` and * [merchant_center_product_id_field][google.cloud.retail.v2.ProductLevelConfig.merchant_center_product_id_field] * is `itemGroupId`, an INVALID_ARGUMENT error is returned. - * See [Using catalog - * levels](/retail/recommendations-ai/docs/catalog#catalog-levels) for more - * details. + * See [Using product + * levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels) + * for more details. * * * string ingestion_product_type = 1; @@ -107,9 +107,9 @@ public interface ProductLevelConfigOrBuilder * If this field is `itemGroupId` and * [ingestion_product_type][google.cloud.retail.v2.ProductLevelConfig.ingestion_product_type] * is `variant`, an INVALID_ARGUMENT error is returned. - * See [Using catalog - * levels](/retail/recommendations-ai/docs/catalog#catalog-levels) for more - * details. + * See [Using product + * levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels) + * for more details. * * * string merchant_center_product_id_field = 2; @@ -134,9 +134,9 @@ public interface ProductLevelConfigOrBuilder * If this field is `itemGroupId` and * [ingestion_product_type][google.cloud.retail.v2.ProductLevelConfig.ingestion_product_type] * is `variant`, an INVALID_ARGUMENT error is returned. - * See [Using catalog - * levels](/retail/recommendations-ai/docs/catalog#catalog-levels) for more - * details. + * See [Using product + * levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels) + * for more details. * * * string merchant_center_product_id_field = 2; diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ProductOrBuilder.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ProductOrBuilder.java index 1995ba45..e1659da5 100644 --- a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ProductOrBuilder.java +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ProductOrBuilder.java @@ -23,6 +23,148 @@ public interface ProductOrBuilder // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2.Product) com.google.protobuf.MessageOrBuilder { + /** + * + * + *
+   * The timestamp when this product becomes unavailable for
+   * [SearchService.Search][google.cloud.retail.v2.SearchService.Search].
+   * If it is set, the [Product][google.cloud.retail.v2.Product] is not
+   * available for
+   * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] after
+   * [expire_time][google.cloud.retail.v2.Product.expire_time]. However, the
+   * product can still be retrieved by
+   * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]
+   * and
+   * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].
+   * Google Merchant Center property
+   * [expiration_date](https://support.google.com/merchants/answer/6324499).
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 16; + * + * @return Whether the expireTime field is set. + */ + boolean hasExpireTime(); + /** + * + * + *
+   * The timestamp when this product becomes unavailable for
+   * [SearchService.Search][google.cloud.retail.v2.SearchService.Search].
+   * If it is set, the [Product][google.cloud.retail.v2.Product] is not
+   * available for
+   * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] after
+   * [expire_time][google.cloud.retail.v2.Product.expire_time]. However, the
+   * product can still be retrieved by
+   * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]
+   * and
+   * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].
+   * Google Merchant Center property
+   * [expiration_date](https://support.google.com/merchants/answer/6324499).
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 16; + * + * @return The expireTime. + */ + com.google.protobuf.Timestamp getExpireTime(); + /** + * + * + *
+   * The timestamp when this product becomes unavailable for
+   * [SearchService.Search][google.cloud.retail.v2.SearchService.Search].
+   * If it is set, the [Product][google.cloud.retail.v2.Product] is not
+   * available for
+   * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] after
+   * [expire_time][google.cloud.retail.v2.Product.expire_time]. However, the
+   * product can still be retrieved by
+   * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]
+   * and
+   * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].
+   * Google Merchant Center property
+   * [expiration_date](https://support.google.com/merchants/answer/6324499).
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 16; + */ + com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder(); + + /** + * + * + *
+   * Input only. The TTL (time to live) of the product.
+   * If it is set, [expire_time][google.cloud.retail.v2.Product.expire_time]
+   * is set as current timestamp plus
+   * [ttl][google.cloud.retail.v2.Product.ttl]. The derived
+   * [expire_time][google.cloud.retail.v2.Product.expire_time] is returned in
+   * the output and [ttl][google.cloud.retail.v2.Product.ttl] is left blank
+   * when retrieving the [Product][google.cloud.retail.v2.Product].
+   * If it is set, the product is not available for
+   * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] after
+   * current timestamp plus [ttl][google.cloud.retail.v2.Product.ttl].
+   * However, the product can still be retrieved by
+   * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]
+   * and
+   * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].
+   * 
+ * + * .google.protobuf.Duration ttl = 17 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return Whether the ttl field is set. + */ + boolean hasTtl(); + /** + * + * + *
+   * Input only. The TTL (time to live) of the product.
+   * If it is set, [expire_time][google.cloud.retail.v2.Product.expire_time]
+   * is set as current timestamp plus
+   * [ttl][google.cloud.retail.v2.Product.ttl]. The derived
+   * [expire_time][google.cloud.retail.v2.Product.expire_time] is returned in
+   * the output and [ttl][google.cloud.retail.v2.Product.ttl] is left blank
+   * when retrieving the [Product][google.cloud.retail.v2.Product].
+   * If it is set, the product is not available for
+   * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] after
+   * current timestamp plus [ttl][google.cloud.retail.v2.Product.ttl].
+   * However, the product can still be retrieved by
+   * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]
+   * and
+   * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].
+   * 
+ * + * .google.protobuf.Duration ttl = 17 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return The ttl. + */ + com.google.protobuf.Duration getTtl(); + /** + * + * + *
+   * Input only. The TTL (time to live) of the product.
+   * If it is set, [expire_time][google.cloud.retail.v2.Product.expire_time]
+   * is set as current timestamp plus
+   * [ttl][google.cloud.retail.v2.Product.ttl]. The derived
+   * [expire_time][google.cloud.retail.v2.Product.expire_time] is returned in
+   * the output and [ttl][google.cloud.retail.v2.Product.ttl] is left blank
+   * when retrieving the [Product][google.cloud.retail.v2.Product].
+   * If it is set, the product is not available for
+   * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] after
+   * current timestamp plus [ttl][google.cloud.retail.v2.Product.ttl].
+   * However, the product can still be retrieved by
+   * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]
+   * and
+   * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].
+   * 
+ * + * .google.protobuf.Duration ttl = 17 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + com.google.protobuf.DurationOrBuilder getTtlOrBuilder(); + /** * * @@ -99,7 +241,9 @@ public interface ProductOrBuilder * * *
-   * Immutable. The type of the product. This field is output-only.
+   * Immutable. The type of the product. Default to
+   * [Catalog.product_level_config.ingestion_product_type][google.cloud.retail.v2.ProductLevelConfig.ingestion_product_type]
+   * if unset.
    * 
* * .google.cloud.retail.v2.Product.Type type = 3 [(.google.api.field_behavior) = IMMUTABLE]; @@ -112,7 +256,9 @@ public interface ProductOrBuilder * * *
-   * Immutable. The type of the product. This field is output-only.
+   * Immutable. The type of the product. Default to
+   * [Catalog.product_level_config.ingestion_product_type][google.cloud.retail.v2.ProductLevelConfig.ingestion_product_type]
+   * if unset.
    * 
* * .google.cloud.retail.v2.Product.Type type = 3 [(.google.api.field_behavior) = IMMUTABLE]; @@ -179,6 +325,120 @@ public interface ProductOrBuilder */ com.google.protobuf.ByteString getPrimaryProductIdBytes(); + /** + * + * + *
+   * 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.
+   * 
+ * + * repeated string collection_member_ids = 5; + * + * @return A list containing the collectionMemberIds. + */ + java.util.List getCollectionMemberIdsList(); + /** + * + * + *
+   * 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.
+   * 
+ * + * repeated string collection_member_ids = 5; + * + * @return The count of collectionMemberIds. + */ + int getCollectionMemberIdsCount(); + /** + * + * + *
+   * 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.
+   * 
+ * + * repeated string collection_member_ids = 5; + * + * @param index The index of the element to return. + * @return The collectionMemberIds at the given index. + */ + java.lang.String getCollectionMemberIds(int index); + /** + * + * + *
+   * 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.
+   * 
+ * + * repeated string collection_member_ids = 5; + * + * @param index The index of the value to return. + * @return The bytes of the collectionMemberIds at the given index. + */ + com.google.protobuf.ByteString getCollectionMemberIdsBytes(int index); + + /** + * + * + *
+   * The Global Trade Item Number (GTIN) of the 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
+   * [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.gtin14](https://schema.org/gtin14).
+   * If the value is not a valid GTIN, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string gtin = 6; + * + * @return The gtin. + */ + java.lang.String getGtin(); + /** + * + * + *
+   * The Global Trade Item Number (GTIN) of the 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
+   * [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.gtin14](https://schema.org/gtin14).
+   * If the value is not a valid GTIN, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string gtin = 6; + * + * @return The bytes for gtin. + */ + com.google.protobuf.ByteString getGtinBytes(); + /** * * @@ -335,7 +595,7 @@ public interface ProductOrBuilder * *
    * Required. Product title.
-   * This field must be a UTF-8 encoded string with a length limit of 128
+   * 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
    * [title](https://support.google.com/merchants/answer/6324415). Schema.org
@@ -352,7 +612,7 @@ public interface ProductOrBuilder
    *
    * 
    * Required. Product title.
-   * This field must be a UTF-8 encoded string with a length limit of 128
+   * 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
    * [title](https://support.google.com/merchants/answer/6324415). Schema.org
@@ -365,6 +625,81 @@ public interface ProductOrBuilder
    */
   com.google.protobuf.ByteString getTitleBytes();
 
+  /**
+   *
+   *
+   * 
+   * The brands of the product.
+   * A maximum of 30 brands are allowed. Each brand 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
+   * [brand](https://support.google.com/merchants/answer/6324351). Schema.org
+   * property [Product.brand](https://schema.org/brand).
+   * 
+ * + * repeated string brands = 9; + * + * @return A list containing the brands. + */ + java.util.List getBrandsList(); + /** + * + * + *
+   * The brands of the product.
+   * A maximum of 30 brands are allowed. Each brand 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
+   * [brand](https://support.google.com/merchants/answer/6324351). Schema.org
+   * property [Product.brand](https://schema.org/brand).
+   * 
+ * + * repeated string brands = 9; + * + * @return The count of brands. + */ + int getBrandsCount(); + /** + * + * + *
+   * The brands of the product.
+   * A maximum of 30 brands are allowed. Each brand 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
+   * [brand](https://support.google.com/merchants/answer/6324351). Schema.org
+   * property [Product.brand](https://schema.org/brand).
+   * 
+ * + * repeated string brands = 9; + * + * @param index The index of the element to return. + * @return The brands at the given index. + */ + java.lang.String getBrands(int index); + /** + * + * + *
+   * The brands of the product.
+   * A maximum of 30 brands are allowed. Each brand 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
+   * [brand](https://support.google.com/merchants/answer/6324351). Schema.org
+   * property [Product.brand](https://schema.org/brand).
+   * 
+ * + * repeated string brands = 9; + * + * @param index The index of the value to return. + * @return The bytes of the brands at the given index. + */ + com.google.protobuf.ByteString getBrandsBytes(int index); + /** * * @@ -400,6 +735,45 @@ public interface ProductOrBuilder */ com.google.protobuf.ByteString getDescriptionBytes(); + /** + * + * + *
+   * 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].
+   * For product prediction, this field is ignored and the model automatically
+   * detects the text language. The [Product][google.cloud.retail.v2.Product]
+   * can include text in different languages, but duplicating
+   * [Product][google.cloud.retail.v2.Product]s to provide text in multiple
+   * languages can result in degraded model performance.
+   * For product search this field is in use. It defaults to "en-US" if unset.
+   * 
+ * + * string language_code = 11; + * + * @return The languageCode. + */ + java.lang.String getLanguageCode(); + /** + * + * + *
+   * 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].
+   * For product prediction, this field is ignored and the model automatically
+   * detects the text language. The [Product][google.cloud.retail.v2.Product]
+   * can include text in different languages, but duplicating
+   * [Product][google.cloud.retail.v2.Product]s to provide text in multiple
+   * languages can result in degraded model performance.
+   * For product search this field is in use. It defaults to "en-US" if unset.
+   * 
+ * + * string language_code = 11; + * + * @return The bytes for languageCode. + */ + com.google.protobuf.ByteString getLanguageCodeBytes(); + /** * * @@ -416,10 +790,17 @@ public interface ProductOrBuilder * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]}, * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]} * }`. - * A maximum of 150 attributes are allowed. Otherwise, an INVALID_ARGUMENT - * error is returned. - * The key must be a UTF-8 encoded string with a length limit of 5,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT + * error is returned: + * * Max entries count: 200 by default; 100 for + * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]. + * * The key must be a UTF-8 encoded string with a length limit of 128 + * characters. + * * Max indexable entries count: 200 by default; 40 for + * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]. + * * Max searchable entries count: 30. + * * 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. *
* * map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 12; @@ -441,10 +822,17 @@ public interface ProductOrBuilder * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]}, * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]} * }`. - * A maximum of 150 attributes are allowed. Otherwise, an INVALID_ARGUMENT - * error is returned. - * The key must be a UTF-8 encoded string with a length limit of 5,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT + * error is returned: + * * Max entries count: 200 by default; 100 for + * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]. + * * The key must be a UTF-8 encoded string with a length limit of 128 + * characters. + * * Max indexable entries count: 200 by default; 40 for + * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]. + * * Max searchable entries count: 30. + * * 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. *
* * map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 12; @@ -469,10 +857,17 @@ public interface ProductOrBuilder * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]}, * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]} * }`. - * A maximum of 150 attributes are allowed. Otherwise, an INVALID_ARGUMENT - * error is returned. - * The key must be a UTF-8 encoded string with a length limit of 5,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT + * error is returned: + * * Max entries count: 200 by default; 100 for + * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]. + * * The key must be a UTF-8 encoded string with a length limit of 128 + * characters. + * * Max indexable entries count: 200 by default; 40 for + * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]. + * * Max searchable entries count: 30. + * * 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. * * * map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 12; @@ -494,10 +889,17 @@ public interface ProductOrBuilder * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]}, * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]} * }`. - * A maximum of 150 attributes are allowed. Otherwise, an INVALID_ARGUMENT - * error is returned. - * The key must be a UTF-8 encoded string with a length limit of 5,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT + * error is returned: + * * Max entries count: 200 by default; 100 for + * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]. + * * The key must be a UTF-8 encoded string with a length limit of 128 + * characters. + * * Max indexable entries count: 200 by default; 40 for + * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]. + * * Max searchable entries count: 30. + * * 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. * * * map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 12; @@ -520,10 +922,17 @@ com.google.cloud.retail.v2.CustomAttribute getAttributesOrDefault( * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]}, * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]} * }`. - * A maximum of 150 attributes are allowed. Otherwise, an INVALID_ARGUMENT - * error is returned. - * The key must be a UTF-8 encoded string with a length limit of 5,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT + * error is returned: + * * Max entries count: 200 by default; 100 for + * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]. + * * The key must be a UTF-8 encoded string with a length limit of 128 + * characters. + * * Max indexable entries count: 200 by default; 40 for + * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]. + * * Max searchable entries count: 30. + * * 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. * * * map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 12; @@ -658,12 +1067,48 @@ com.google.cloud.retail.v2.CustomAttribute getAttributesOrDefault( */ com.google.cloud.retail.v2.PriceInfoOrBuilder getPriceInfoOrBuilder(); + /** + * + * + *
+   * The rating of this product.
+   * 
+ * + * .google.cloud.retail.v2.Rating rating = 15; + * + * @return Whether the rating field is set. + */ + boolean hasRating(); + /** + * + * + *
+   * The rating of this product.
+   * 
+ * + * .google.cloud.retail.v2.Rating rating = 15; + * + * @return The rating. + */ + com.google.cloud.retail.v2.Rating getRating(); + /** + * + * + *
+   * The rating of this product.
+   * 
+ * + * .google.cloud.retail.v2.Rating rating = 15; + */ + com.google.cloud.retail.v2.RatingOrBuilder getRatingOrBuilder(); + /** * * *
    * The timestamp when this [Product][google.cloud.retail.v2.Product] becomes
-   * available recommendation and search.
+   * available for
+   * [SearchService.Search][google.cloud.retail.v2.SearchService.Search].
    * 
* * .google.protobuf.Timestamp available_time = 18; @@ -676,7 +1121,8 @@ com.google.cloud.retail.v2.CustomAttribute getAttributesOrDefault( * *
    * The timestamp when this [Product][google.cloud.retail.v2.Product] becomes
-   * available recommendation and search.
+   * available for
+   * [SearchService.Search][google.cloud.retail.v2.SearchService.Search].
    * 
* * .google.protobuf.Timestamp available_time = 18; @@ -689,7 +1135,8 @@ com.google.cloud.retail.v2.CustomAttribute getAttributesOrDefault( * *
    * The timestamp when this [Product][google.cloud.retail.v2.Product] becomes
-   * available recommendation and search.
+   * available for
+   * [SearchService.Search][google.cloud.retail.v2.SearchService.Search].
    * 
* * .google.protobuf.Timestamp available_time = 18; @@ -766,11 +1213,85 @@ com.google.cloud.retail.v2.CustomAttribute getAttributesOrDefault( */ com.google.protobuf.Int32ValueOrBuilder getAvailableQuantityOrBuilder(); + /** + * + * + *
+   * Fulfillment information, such as the store IDs for in-store pickup or
+   * region IDs for different shipping methods.
+   * All the elements must have distinct
+   * [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type].
+   * Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2.FulfillmentInfo fulfillment_info = 21; + */ + java.util.List getFulfillmentInfoList(); + /** + * + * + *
+   * Fulfillment information, such as the store IDs for in-store pickup or
+   * region IDs for different shipping methods.
+   * All the elements must have distinct
+   * [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type].
+   * Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2.FulfillmentInfo fulfillment_info = 21; + */ + com.google.cloud.retail.v2.FulfillmentInfo getFulfillmentInfo(int index); + /** + * + * + *
+   * Fulfillment information, such as the store IDs for in-store pickup or
+   * region IDs for different shipping methods.
+   * All the elements must have distinct
+   * [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type].
+   * Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2.FulfillmentInfo fulfillment_info = 21; + */ + int getFulfillmentInfoCount(); + /** + * + * + *
+   * Fulfillment information, such as the store IDs for in-store pickup or
+   * region IDs for different shipping methods.
+   * All the elements must have distinct
+   * [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type].
+   * Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2.FulfillmentInfo fulfillment_info = 21; + */ + java.util.List + getFulfillmentInfoOrBuilderList(); + /** + * + * + *
+   * Fulfillment information, such as the store IDs for in-store pickup or
+   * region IDs for different shipping methods.
+   * All the elements must have distinct
+   * [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type].
+   * Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2.FulfillmentInfo fulfillment_info = 21; + */ + com.google.cloud.retail.v2.FulfillmentInfoOrBuilder getFulfillmentInfoOrBuilder(int index); + /** * * *
    * Canonical URL directly linking to the product detail page.
+   * It is strongly recommended to provide a valid uri for the product,
+   * otherwise the service performance could be significantly degraded.
    * 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
@@ -788,6 +1309,8 @@ com.google.cloud.retail.v2.CustomAttribute getAttributesOrDefault(
    *
    * 
    * Canonical URL directly linking to the product detail page.
+   * It is strongly recommended to provide a valid uri for the product,
+   * otherwise the service performance could be significantly degraded.
    * 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
@@ -805,7 +1328,8 @@ com.google.cloud.retail.v2.CustomAttribute getAttributesOrDefault(
    *
    *
    * 
-   * Product images for the product.
+   * Product images for the product.Highly recommended to put the main image
+   * to the first.
    * A maximum of 300 images are allowed.
    * Google Merchant Center property
    * [image_link](https://support.google.com/merchants/answer/6324350).
@@ -819,7 +1343,8 @@ com.google.cloud.retail.v2.CustomAttribute getAttributesOrDefault(
    *
    *
    * 
-   * Product images for the product.
+   * Product images for the product.Highly recommended to put the main image
+   * to the first.
    * A maximum of 300 images are allowed.
    * Google Merchant Center property
    * [image_link](https://support.google.com/merchants/answer/6324350).
@@ -833,7 +1358,8 @@ com.google.cloud.retail.v2.CustomAttribute getAttributesOrDefault(
    *
    *
    * 
-   * Product images for the product.
+   * Product images for the product.Highly recommended to put the main image
+   * to the first.
    * A maximum of 300 images are allowed.
    * Google Merchant Center property
    * [image_link](https://support.google.com/merchants/answer/6324350).
@@ -847,7 +1373,8 @@ com.google.cloud.retail.v2.CustomAttribute getAttributesOrDefault(
    *
    *
    * 
-   * Product images for the product.
+   * Product images for the product.Highly recommended to put the main image
+   * to the first.
    * A maximum of 300 images are allowed.
    * Google Merchant Center property
    * [image_link](https://support.google.com/merchants/answer/6324350).
@@ -861,7 +1388,8 @@ com.google.cloud.retail.v2.CustomAttribute getAttributesOrDefault(
    *
    *
    * 
-   * Product images for the product.
+   * Product images for the product.Highly recommended to put the main image
+   * to the first.
    * A maximum of 300 images are allowed.
    * Google Merchant Center property
    * [image_link](https://support.google.com/merchants/answer/6324350).
@@ -871,4 +1399,803 @@ com.google.cloud.retail.v2.CustomAttribute getAttributesOrDefault(
    * repeated .google.cloud.retail.v2.Image images = 23;
    */
   com.google.cloud.retail.v2.ImageOrBuilder getImagesOrBuilder(int index);
+
+  /**
+   *
+   *
+   * 
+   * The target group associated with a given audience (e.g. male, veterans,
+   * car owners, musicians, etc.) of the product.
+   * 
+ * + * .google.cloud.retail.v2.Audience audience = 24; + * + * @return Whether the audience field is set. + */ + boolean hasAudience(); + /** + * + * + *
+   * The target group associated with a given audience (e.g. male, veterans,
+   * car owners, musicians, etc.) of the product.
+   * 
+ * + * .google.cloud.retail.v2.Audience audience = 24; + * + * @return The audience. + */ + com.google.cloud.retail.v2.Audience getAudience(); + /** + * + * + *
+   * The target group associated with a given audience (e.g. male, veterans,
+   * car owners, musicians, etc.) of the product.
+   * 
+ * + * .google.cloud.retail.v2.Audience audience = 24; + */ + com.google.cloud.retail.v2.AudienceOrBuilder getAudienceOrBuilder(); + + /** + * + * + *
+   * The color of the product.
+   * Google Merchant Center property
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * .google.cloud.retail.v2.ColorInfo color_info = 25; + * + * @return Whether the colorInfo field is set. + */ + boolean hasColorInfo(); + /** + * + * + *
+   * The color of the product.
+   * Google Merchant Center property
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * .google.cloud.retail.v2.ColorInfo color_info = 25; + * + * @return The colorInfo. + */ + com.google.cloud.retail.v2.ColorInfo getColorInfo(); + /** + * + * + *
+   * The color of the product.
+   * Google Merchant Center property
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * .google.cloud.retail.v2.ColorInfo color_info = 25; + */ + com.google.cloud.retail.v2.ColorInfoOrBuilder getColorInfoOrBuilder(); + + /** + * + * + *
+   * The size of the product. To represent different size systems or size types,
+   * consider using this format: [[[size_system:]size_type:]size_value].
+   * For example, in "US:MENS:M", "US" represents size system; "MENS" represents
+   * size type; "M" represents size value. In "GIRLS:27", size system is empty;
+   * "GIRLS" represents size type; "27" represents size value. In "32 inches",
+   * both size system and size type are empty, while size value is "32 inches".
+   * A maximum of 20 values are 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
+   * [size](https://support.google.com/merchants/answer/6324492),
+   * [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; + * + * @return A list containing the sizes. + */ + java.util.List getSizesList(); + /** + * + * + *
+   * The size of the product. To represent different size systems or size types,
+   * consider using this format: [[[size_system:]size_type:]size_value].
+   * For example, in "US:MENS:M", "US" represents size system; "MENS" represents
+   * size type; "M" represents size value. In "GIRLS:27", size system is empty;
+   * "GIRLS" represents size type; "27" represents size value. In "32 inches",
+   * both size system and size type are empty, while size value is "32 inches".
+   * A maximum of 20 values are 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
+   * [size](https://support.google.com/merchants/answer/6324492),
+   * [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; + * + * @return The count of sizes. + */ + int getSizesCount(); + /** + * + * + *
+   * The size of the product. To represent different size systems or size types,
+   * consider using this format: [[[size_system:]size_type:]size_value].
+   * For example, in "US:MENS:M", "US" represents size system; "MENS" represents
+   * size type; "M" represents size value. In "GIRLS:27", size system is empty;
+   * "GIRLS" represents size type; "27" represents size value. In "32 inches",
+   * both size system and size type are empty, while size value is "32 inches".
+   * A maximum of 20 values are 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
+   * [size](https://support.google.com/merchants/answer/6324492),
+   * [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; + * + * @param index The index of the element to return. + * @return The sizes at the given index. + */ + java.lang.String getSizes(int index); + /** + * + * + *
+   * The size of the product. To represent different size systems or size types,
+   * consider using this format: [[[size_system:]size_type:]size_value].
+   * For example, in "US:MENS:M", "US" represents size system; "MENS" represents
+   * size type; "M" represents size value. In "GIRLS:27", size system is empty;
+   * "GIRLS" represents size type; "27" represents size value. In "32 inches",
+   * both size system and size type are empty, while size value is "32 inches".
+   * A maximum of 20 values are 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
+   * [size](https://support.google.com/merchants/answer/6324492),
+   * [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; + * + * @param index The index of the value to return. + * @return The bytes of the sizes at the given index. + */ + com.google.protobuf.ByteString getSizesBytes(int index); + + /** + * + * + *
+   * The material of the product. For example, "leather", "wooden".
+   * A maximum of 5 values are allowed. 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
+   * [material](https://support.google.com/merchants/answer/6324410). Schema.org
+   * property [Product.material](https://schema.org/material).
+   * 
+ * + * repeated string materials = 27; + * + * @return A list containing the materials. + */ + java.util.List getMaterialsList(); + /** + * + * + *
+   * The material of the product. For example, "leather", "wooden".
+   * A maximum of 5 values are allowed. 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
+   * [material](https://support.google.com/merchants/answer/6324410). Schema.org
+   * property [Product.material](https://schema.org/material).
+   * 
+ * + * repeated string materials = 27; + * + * @return The count of materials. + */ + int getMaterialsCount(); + /** + * + * + *
+   * The material of the product. For example, "leather", "wooden".
+   * A maximum of 5 values are allowed. 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
+   * [material](https://support.google.com/merchants/answer/6324410). Schema.org
+   * property [Product.material](https://schema.org/material).
+   * 
+ * + * repeated string materials = 27; + * + * @param index The index of the element to return. + * @return The materials at the given index. + */ + java.lang.String getMaterials(int index); + /** + * + * + *
+   * The material of the product. For example, "leather", "wooden".
+   * A maximum of 5 values are allowed. 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
+   * [material](https://support.google.com/merchants/answer/6324410). Schema.org
+   * property [Product.material](https://schema.org/material).
+   * 
+ * + * repeated string materials = 27; + * + * @param index The index of the value to return. + * @return The bytes of the materials at the given index. + */ + com.google.protobuf.ByteString getMaterialsBytes(int index); + + /** + * + * + *
+   * The pattern or graphic print of the product. For example, "striped", "polka
+   * dot", "paisley".
+   * A maximum of 5 values are 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
+   * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org
+   * property [Product.pattern](https://schema.org/pattern).
+   * 
+ * + * repeated string patterns = 28; + * + * @return A list containing the patterns. + */ + java.util.List getPatternsList(); + /** + * + * + *
+   * The pattern or graphic print of the product. For example, "striped", "polka
+   * dot", "paisley".
+   * A maximum of 5 values are 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
+   * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org
+   * property [Product.pattern](https://schema.org/pattern).
+   * 
+ * + * repeated string patterns = 28; + * + * @return The count of patterns. + */ + int getPatternsCount(); + /** + * + * + *
+   * The pattern or graphic print of the product. For example, "striped", "polka
+   * dot", "paisley".
+   * A maximum of 5 values are 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
+   * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org
+   * property [Product.pattern](https://schema.org/pattern).
+   * 
+ * + * repeated string patterns = 28; + * + * @param index The index of the element to return. + * @return The patterns at the given index. + */ + java.lang.String getPatterns(int index); + /** + * + * + *
+   * The pattern or graphic print of the product. For example, "striped", "polka
+   * dot", "paisley".
+   * A maximum of 5 values are 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
+   * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org
+   * property [Product.pattern](https://schema.org/pattern).
+   * 
+ * + * repeated string patterns = 28; + * + * @param index The index of the value to return. + * @return The bytes of the patterns at the given index. + */ + com.google.protobuf.ByteString getPatternsBytes(int index); + + /** + * + * + *
+   * The condition of the product. Strongly encouraged to use the standard
+   * values: "new", "refurbished", "used".
+   * A maximum of 5 values are 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
+   * [condition](https://support.google.com/merchants/answer/6324469).
+   * Schema.org property
+   * [Offer.itemCondition](https://schema.org/itemCondition).
+   * 
+ * + * repeated string conditions = 29; + * + * @return A list containing the conditions. + */ + java.util.List getConditionsList(); + /** + * + * + *
+   * The condition of the product. Strongly encouraged to use the standard
+   * values: "new", "refurbished", "used".
+   * A maximum of 5 values are 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
+   * [condition](https://support.google.com/merchants/answer/6324469).
+   * Schema.org property
+   * [Offer.itemCondition](https://schema.org/itemCondition).
+   * 
+ * + * repeated string conditions = 29; + * + * @return The count of conditions. + */ + int getConditionsCount(); + /** + * + * + *
+   * The condition of the product. Strongly encouraged to use the standard
+   * values: "new", "refurbished", "used".
+   * A maximum of 5 values are 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
+   * [condition](https://support.google.com/merchants/answer/6324469).
+   * Schema.org property
+   * [Offer.itemCondition](https://schema.org/itemCondition).
+   * 
+ * + * repeated string conditions = 29; + * + * @param index The index of the element to return. + * @return The conditions at the given index. + */ + java.lang.String getConditions(int index); + /** + * + * + *
+   * The condition of the product. Strongly encouraged to use the standard
+   * values: "new", "refurbished", "used".
+   * A maximum of 5 values are 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
+   * [condition](https://support.google.com/merchants/answer/6324469).
+   * Schema.org property
+   * [Offer.itemCondition](https://schema.org/itemCondition).
+   * 
+ * + * repeated string conditions = 29; + * + * @param index The index of the value to return. + * @return The bytes of the conditions at the given index. + */ + com.google.protobuf.ByteString getConditionsBytes(int index); + + /** + * + * + *
+   * The promotions applied to the product. A maximum of 10 values are allowed
+   * per [Product][google.cloud.retail.v2.Product].
+   * 
+ * + * repeated .google.cloud.retail.v2.Promotion promotions = 34; + */ + java.util.List getPromotionsList(); + /** + * + * + *
+   * The promotions applied to the product. A maximum of 10 values are allowed
+   * per [Product][google.cloud.retail.v2.Product].
+   * 
+ * + * repeated .google.cloud.retail.v2.Promotion promotions = 34; + */ + com.google.cloud.retail.v2.Promotion getPromotions(int index); + /** + * + * + *
+   * The promotions applied to the product. A maximum of 10 values are allowed
+   * per [Product][google.cloud.retail.v2.Product].
+   * 
+ * + * repeated .google.cloud.retail.v2.Promotion promotions = 34; + */ + int getPromotionsCount(); + /** + * + * + *
+   * The promotions applied to the product. A maximum of 10 values are allowed
+   * per [Product][google.cloud.retail.v2.Product].
+   * 
+ * + * repeated .google.cloud.retail.v2.Promotion promotions = 34; + */ + java.util.List + getPromotionsOrBuilderList(); + /** + * + * + *
+   * The promotions applied to the product. A maximum of 10 values are allowed
+   * per [Product][google.cloud.retail.v2.Product].
+   * 
+ * + * repeated .google.cloud.retail.v2.Promotion promotions = 34; + */ + com.google.cloud.retail.v2.PromotionOrBuilder getPromotionsOrBuilder(int index); + + /** + * + * + *
+   * The timestamp when the product is published by the retailer for the first
+   * time, which indicates the freshness of the products. Note that this field
+   * is different from
+   * [available_time][google.cloud.retail.v2.Product.available_time], given it
+   * purely describes product freshness regardless of when it is available on
+   * search and recommendation.
+   * 
+ * + * .google.protobuf.Timestamp publish_time = 33; + * + * @return Whether the publishTime field is set. + */ + boolean hasPublishTime(); + /** + * + * + *
+   * The timestamp when the product is published by the retailer for the first
+   * time, which indicates the freshness of the products. Note that this field
+   * is different from
+   * [available_time][google.cloud.retail.v2.Product.available_time], given it
+   * purely describes product freshness regardless of when it is available on
+   * search and recommendation.
+   * 
+ * + * .google.protobuf.Timestamp publish_time = 33; + * + * @return The publishTime. + */ + com.google.protobuf.Timestamp getPublishTime(); + /** + * + * + *
+   * The timestamp when the product is published by the retailer for the first
+   * time, which indicates the freshness of the products. Note that this field
+   * is different from
+   * [available_time][google.cloud.retail.v2.Product.available_time], given it
+   * purely describes product freshness regardless of when it is available on
+   * search and recommendation.
+   * 
+ * + * .google.protobuf.Timestamp publish_time = 33; + */ + com.google.protobuf.TimestampOrBuilder getPublishTimeOrBuilder(); + + /** + * + * + *
+   * Indicates which fields in the [Product][google.cloud.retail.v2.Product]s
+   * are returned in [SearchResponse][google.cloud.retail.v2.SearchResponse].
+   * Supported fields for all [type][google.cloud.retail.v2.Product.type]s:
+   * * [audience][google.cloud.retail.v2.Product.audience]
+   * * [availability][google.cloud.retail.v2.Product.availability]
+   * * [brands][google.cloud.retail.v2.Product.brands]
+   * * [color_info][google.cloud.retail.v2.Product.color_info]
+   * * [conditions][google.cloud.retail.v2.Product.conditions]
+   * * [gtin][google.cloud.retail.v2.Product.gtin]
+   * * [materials][google.cloud.retail.v2.Product.materials]
+   * * [name][google.cloud.retail.v2.Product.name]
+   * * [patterns][google.cloud.retail.v2.Product.patterns]
+   * * [price_info][google.cloud.retail.v2.Product.price_info]
+   * * [rating][google.cloud.retail.v2.Product.rating]
+   * * [sizes][google.cloud.retail.v2.Product.sizes]
+   * * [title][google.cloud.retail.v2.Product.title]
+   * * [uri][google.cloud.retail.v2.Product.uri]
+   * Supported fields only for
+   * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and
+   * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]:
+   * * [categories][google.cloud.retail.v2.Product.categories]
+   * * [description][google.cloud.retail.v2.Product.description]
+   * * [images][google.cloud.retail.v2.Product.images]
+   * Supported fields only for
+   * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]:
+   * * Only the first image in [images][google.cloud.retail.v2.Product.images]
+   * To mark [attributes][google.cloud.retail.v2.Product.attributes] as
+   * retrievable, include paths of the form "attributes.key" where "key" is the
+   * key of a custom attribute, as specified in
+   * [attributes][google.cloud.retail.v2.Product.attributes].
+   * For [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and
+   * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION], the
+   * following fields are always returned in
+   * [SearchResponse][google.cloud.retail.v2.SearchResponse] by default:
+   * * [name][google.cloud.retail.v2.Product.name]
+   * For [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT], the
+   * following fields are always returned in by default:
+   * * [name][google.cloud.retail.v2.Product.name]
+   * * [color_info][google.cloud.retail.v2.Product.color_info]
+   * Maximum number of paths is 20. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * .google.protobuf.FieldMask retrievable_fields = 30; + * + * @return Whether the retrievableFields field is set. + */ + boolean hasRetrievableFields(); + /** + * + * + *
+   * Indicates which fields in the [Product][google.cloud.retail.v2.Product]s
+   * are returned in [SearchResponse][google.cloud.retail.v2.SearchResponse].
+   * Supported fields for all [type][google.cloud.retail.v2.Product.type]s:
+   * * [audience][google.cloud.retail.v2.Product.audience]
+   * * [availability][google.cloud.retail.v2.Product.availability]
+   * * [brands][google.cloud.retail.v2.Product.brands]
+   * * [color_info][google.cloud.retail.v2.Product.color_info]
+   * * [conditions][google.cloud.retail.v2.Product.conditions]
+   * * [gtin][google.cloud.retail.v2.Product.gtin]
+   * * [materials][google.cloud.retail.v2.Product.materials]
+   * * [name][google.cloud.retail.v2.Product.name]
+   * * [patterns][google.cloud.retail.v2.Product.patterns]
+   * * [price_info][google.cloud.retail.v2.Product.price_info]
+   * * [rating][google.cloud.retail.v2.Product.rating]
+   * * [sizes][google.cloud.retail.v2.Product.sizes]
+   * * [title][google.cloud.retail.v2.Product.title]
+   * * [uri][google.cloud.retail.v2.Product.uri]
+   * Supported fields only for
+   * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and
+   * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]:
+   * * [categories][google.cloud.retail.v2.Product.categories]
+   * * [description][google.cloud.retail.v2.Product.description]
+   * * [images][google.cloud.retail.v2.Product.images]
+   * Supported fields only for
+   * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]:
+   * * Only the first image in [images][google.cloud.retail.v2.Product.images]
+   * To mark [attributes][google.cloud.retail.v2.Product.attributes] as
+   * retrievable, include paths of the form "attributes.key" where "key" is the
+   * key of a custom attribute, as specified in
+   * [attributes][google.cloud.retail.v2.Product.attributes].
+   * For [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and
+   * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION], the
+   * following fields are always returned in
+   * [SearchResponse][google.cloud.retail.v2.SearchResponse] by default:
+   * * [name][google.cloud.retail.v2.Product.name]
+   * For [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT], the
+   * following fields are always returned in by default:
+   * * [name][google.cloud.retail.v2.Product.name]
+   * * [color_info][google.cloud.retail.v2.Product.color_info]
+   * Maximum number of paths is 20. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * .google.protobuf.FieldMask retrievable_fields = 30; + * + * @return The retrievableFields. + */ + com.google.protobuf.FieldMask getRetrievableFields(); + /** + * + * + *
+   * Indicates which fields in the [Product][google.cloud.retail.v2.Product]s
+   * are returned in [SearchResponse][google.cloud.retail.v2.SearchResponse].
+   * Supported fields for all [type][google.cloud.retail.v2.Product.type]s:
+   * * [audience][google.cloud.retail.v2.Product.audience]
+   * * [availability][google.cloud.retail.v2.Product.availability]
+   * * [brands][google.cloud.retail.v2.Product.brands]
+   * * [color_info][google.cloud.retail.v2.Product.color_info]
+   * * [conditions][google.cloud.retail.v2.Product.conditions]
+   * * [gtin][google.cloud.retail.v2.Product.gtin]
+   * * [materials][google.cloud.retail.v2.Product.materials]
+   * * [name][google.cloud.retail.v2.Product.name]
+   * * [patterns][google.cloud.retail.v2.Product.patterns]
+   * * [price_info][google.cloud.retail.v2.Product.price_info]
+   * * [rating][google.cloud.retail.v2.Product.rating]
+   * * [sizes][google.cloud.retail.v2.Product.sizes]
+   * * [title][google.cloud.retail.v2.Product.title]
+   * * [uri][google.cloud.retail.v2.Product.uri]
+   * Supported fields only for
+   * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and
+   * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]:
+   * * [categories][google.cloud.retail.v2.Product.categories]
+   * * [description][google.cloud.retail.v2.Product.description]
+   * * [images][google.cloud.retail.v2.Product.images]
+   * Supported fields only for
+   * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]:
+   * * Only the first image in [images][google.cloud.retail.v2.Product.images]
+   * To mark [attributes][google.cloud.retail.v2.Product.attributes] as
+   * retrievable, include paths of the form "attributes.key" where "key" is the
+   * key of a custom attribute, as specified in
+   * [attributes][google.cloud.retail.v2.Product.attributes].
+   * For [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and
+   * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION], the
+   * following fields are always returned in
+   * [SearchResponse][google.cloud.retail.v2.SearchResponse] by default:
+   * * [name][google.cloud.retail.v2.Product.name]
+   * For [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT], the
+   * following fields are always returned in by default:
+   * * [name][google.cloud.retail.v2.Product.name]
+   * * [color_info][google.cloud.retail.v2.Product.color_info]
+   * Maximum number of paths is 20. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * .google.protobuf.FieldMask retrievable_fields = 30; + */ + com.google.protobuf.FieldMaskOrBuilder getRetrievableFieldsOrBuilder(); + + /** + * + * + *
+   * Output only. Product variants grouped together on primary product which
+   * share similar product attributes. It's automatically grouped by
+   * [primary_product_id][google.cloud.retail.v2.Product.primary_product_id] for
+   * all the product variants. Only populated for
+   * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2.Product]s.
+   * Note: This field is OUTPUT_ONLY for
+   * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct].
+   * Do not set this field in API requests.
+   * 
+ * + * + * repeated .google.cloud.retail.v2.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getVariantsList(); + /** + * + * + *
+   * Output only. Product variants grouped together on primary product which
+   * share similar product attributes. It's automatically grouped by
+   * [primary_product_id][google.cloud.retail.v2.Product.primary_product_id] for
+   * all the product variants. Only populated for
+   * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2.Product]s.
+   * Note: This field is OUTPUT_ONLY for
+   * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct].
+   * Do not set this field in API requests.
+   * 
+ * + * + * repeated .google.cloud.retail.v2.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.retail.v2.Product getVariants(int index); + /** + * + * + *
+   * Output only. Product variants grouped together on primary product which
+   * share similar product attributes. It's automatically grouped by
+   * [primary_product_id][google.cloud.retail.v2.Product.primary_product_id] for
+   * all the product variants. Only populated for
+   * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2.Product]s.
+   * Note: This field is OUTPUT_ONLY for
+   * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct].
+   * Do not set this field in API requests.
+   * 
+ * + * + * repeated .google.cloud.retail.v2.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getVariantsCount(); + /** + * + * + *
+   * Output only. Product variants grouped together on primary product which
+   * share similar product attributes. It's automatically grouped by
+   * [primary_product_id][google.cloud.retail.v2.Product.primary_product_id] for
+   * all the product variants. Only populated for
+   * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2.Product]s.
+   * Note: This field is OUTPUT_ONLY for
+   * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct].
+   * Do not set this field in API requests.
+   * 
+ * + * + * repeated .google.cloud.retail.v2.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getVariantsOrBuilderList(); + /** + * + * + *
+   * Output only. Product variants grouped together on primary product which
+   * share similar product attributes. It's automatically grouped by
+   * [primary_product_id][google.cloud.retail.v2.Product.primary_product_id] for
+   * all the product variants. Only populated for
+   * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2.Product]s.
+   * Note: This field is OUTPUT_ONLY for
+   * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct].
+   * Do not set this field in API requests.
+   * 
+ * + * + * repeated .google.cloud.retail.v2.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.retail.v2.ProductOrBuilder getVariantsOrBuilder(int index); + + public com.google.cloud.retail.v2.Product.ExpirationCase getExpirationCase(); } diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ProductProto.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ProductProto.java index 55d05752..695dbff8 100644 --- a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ProductProto.java +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ProductProto.java @@ -48,42 +48,60 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "google.cloud.retail.v2\032\034google/api/annot" + "ations.proto\032\037google/api/field_behavior." + "proto\032\031google/api/resource.proto\032#google" - + "/cloud/retail/v2/common.proto\032 google/pr" - + "otobuf/field_mask.proto\032\037google/protobuf" - + "/timestamp.proto\032\036google/protobuf/wrappe" - + "rs.proto\"\314\007\n\007Product\022\021\n\004name\030\001 \001(\tB\003\340A\005\022" - + "\017\n\002id\030\002 \001(\tB\003\340A\005\0227\n\004type\030\003 \001(\0162$.google." - + "cloud.retail.v2.Product.TypeB\003\340A\005\022\032\n\022pri" - + "mary_product_id\030\004 \001(\t\022\022\n\ncategories\030\007 \003(" - + "\t\022\022\n\005title\030\010 \001(\tB\003\340A\002\022\023\n\013description\030\n \001" - + "(\t\022C\n\nattributes\030\014 \003(\0132/.google.cloud.re" - + "tail.v2.Product.AttributesEntry\022\014\n\004tags\030" - + "\r \003(\t\0225\n\nprice_info\030\016 \001(\0132!.google.cloud" - + ".retail.v2.PriceInfo\0222\n\016available_time\030\022" - + " \001(\0132\032.google.protobuf.Timestamp\022B\n\014avai" - + "lability\030\023 \001(\0162,.google.cloud.retail.v2." - + "Product.Availability\0227\n\022available_quanti" - + "ty\030\024 \001(\0132\033.google.protobuf.Int32Value\022\013\n" - + "\003uri\030\026 \001(\t\022-\n\006images\030\027 \003(\0132\035.google.clou" - + "d.retail.v2.Image\032Z\n\017AttributesEntry\022\013\n\003" - + "key\030\001 \001(\t\0226\n\005value\030\002 \001(\0132\'.google.cloud." - + "retail.v2.CustomAttribute:\0028\001\"F\n\004Type\022\024\n" - + "\020TYPE_UNSPECIFIED\020\000\022\013\n\007PRIMARY\020\001\022\013\n\007VARI" - + "ANT\020\002\022\016\n\nCOLLECTION\020\003\"i\n\014Availability\022\034\n" - + "\030AVAILABILITY_UNSPECIFIED\020\000\022\014\n\010IN_STOCK\020" - + "\001\022\020\n\014OUT_OF_STOCK\020\002\022\014\n\010PREORDER\020\003\022\r\n\tBAC" - + "KORDER\020\004:\204\001\352A\200\001\n\035retail.googleapis.com/P" - + "roduct\022_projects/{project}/locations/{lo" - + "cation}/catalogs/{catalog}/branches/{bra" - + "nch}/products/{product}B\260\002\n\032com.google.c" - + "loud.retail.v2B\014ProductProtoP\001Z + * Promotion information. + *
+ * + * Protobuf type {@code google.cloud.retail.v2.Promotion} + */ +public final class Promotion extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.Promotion) + PromotionOrBuilder { + private static final long serialVersionUID = 0L; + // Use Promotion.newBuilder() to construct. + private Promotion(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Promotion() { + promotionId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Promotion(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Promotion( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + promotionId_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.CommonProto + .internal_static_google_cloud_retail_v2_Promotion_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.CommonProto + .internal_static_google_cloud_retail_v2_Promotion_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.Promotion.class, + com.google.cloud.retail.v2.Promotion.Builder.class); + } + + public static final int PROMOTION_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object promotionId_; + /** + * + * + *
+   * 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.
+   * Google Merchant Center property
+   * [promotion](https://support.google.com/merchants/answer/7050148).
+   * 
+ * + * string promotion_id = 1; + * + * @return The promotionId. + */ + @java.lang.Override + public java.lang.String getPromotionId() { + java.lang.Object ref = promotionId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + promotionId_ = s; + return s; + } + } + /** + * + * + *
+   * 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.
+   * Google Merchant Center property
+   * [promotion](https://support.google.com/merchants/answer/7050148).
+   * 
+ * + * string promotion_id = 1; + * + * @return The bytes for promotionId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPromotionIdBytes() { + java.lang.Object ref = promotionId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + promotionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getPromotionIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, promotionId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getPromotionIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, promotionId_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.retail.v2.Promotion)) { + return super.equals(obj); + } + com.google.cloud.retail.v2.Promotion other = (com.google.cloud.retail.v2.Promotion) obj; + + if (!getPromotionId().equals(other.getPromotionId())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PROMOTION_ID_FIELD_NUMBER; + hash = (53 * hash) + getPromotionId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2.Promotion parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.Promotion parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.Promotion parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.Promotion parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.Promotion parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.Promotion parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.Promotion parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.Promotion parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.Promotion parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.Promotion parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.Promotion parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.Promotion parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2.Promotion prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Promotion information.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2.Promotion} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.Promotion) + com.google.cloud.retail.v2.PromotionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.CommonProto + .internal_static_google_cloud_retail_v2_Promotion_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.CommonProto + .internal_static_google_cloud_retail_v2_Promotion_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.Promotion.class, + com.google.cloud.retail.v2.Promotion.Builder.class); + } + + // Construct using com.google.cloud.retail.v2.Promotion.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + promotionId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2.CommonProto + .internal_static_google_cloud_retail_v2_Promotion_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2.Promotion getDefaultInstanceForType() { + return com.google.cloud.retail.v2.Promotion.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2.Promotion build() { + com.google.cloud.retail.v2.Promotion result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2.Promotion buildPartial() { + com.google.cloud.retail.v2.Promotion result = new com.google.cloud.retail.v2.Promotion(this); + result.promotionId_ = promotionId_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.retail.v2.Promotion) { + return mergeFrom((com.google.cloud.retail.v2.Promotion) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2.Promotion other) { + if (other == com.google.cloud.retail.v2.Promotion.getDefaultInstance()) return this; + if (!other.getPromotionId().isEmpty()) { + promotionId_ = other.promotionId_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.retail.v2.Promotion parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2.Promotion) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object promotionId_ = ""; + /** + * + * + *
+     * 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.
+     * Google Merchant Center property
+     * [promotion](https://support.google.com/merchants/answer/7050148).
+     * 
+ * + * string promotion_id = 1; + * + * @return The promotionId. + */ + public java.lang.String getPromotionId() { + java.lang.Object ref = promotionId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + promotionId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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.
+     * Google Merchant Center property
+     * [promotion](https://support.google.com/merchants/answer/7050148).
+     * 
+ * + * string promotion_id = 1; + * + * @return The bytes for promotionId. + */ + public com.google.protobuf.ByteString getPromotionIdBytes() { + java.lang.Object ref = promotionId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + promotionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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.
+     * Google Merchant Center property
+     * [promotion](https://support.google.com/merchants/answer/7050148).
+     * 
+ * + * string promotion_id = 1; + * + * @param value The promotionId to set. + * @return This builder for chaining. + */ + public Builder setPromotionId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + promotionId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * Google Merchant Center property
+     * [promotion](https://support.google.com/merchants/answer/7050148).
+     * 
+ * + * string promotion_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearPromotionId() { + + promotionId_ = getDefaultInstance().getPromotionId(); + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * Google Merchant Center property
+     * [promotion](https://support.google.com/merchants/answer/7050148).
+     * 
+ * + * string promotion_id = 1; + * + * @param value The bytes for promotionId to set. + * @return This builder for chaining. + */ + public Builder setPromotionIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + promotionId_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.Promotion) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.Promotion) + private static final com.google.cloud.retail.v2.Promotion DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2.Promotion(); + } + + public static com.google.cloud.retail.v2.Promotion getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Promotion parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Promotion(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.retail.v2.Promotion getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/PromotionOrBuilder.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/PromotionOrBuilder.java new file mode 100644 index 00000000..5ae35872 --- /dev/null +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/PromotionOrBuilder.java @@ -0,0 +1,62 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2/common.proto + +package com.google.cloud.retail.v2; + +public interface PromotionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2.Promotion) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * 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.
+   * Google Merchant Center property
+   * [promotion](https://support.google.com/merchants/answer/7050148).
+   * 
+ * + * string promotion_id = 1; + * + * @return The promotionId. + */ + java.lang.String getPromotionId(); + /** + * + * + *
+   * 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.
+   * Google Merchant Center property
+   * [promotion](https://support.google.com/merchants/answer/7050148).
+   * 
+ * + * string promotion_id = 1; + * + * @return The bytes for promotionId. + */ + com.google.protobuf.ByteString getPromotionIdBytes(); +} diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/PurgeUserEventsRequest.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/PurgeUserEventsRequest.java index 3dc4d338..8405d223 100644 --- a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/PurgeUserEventsRequest.java +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/PurgeUserEventsRequest.java @@ -132,7 +132,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { *
    * Required. The resource name of the catalog under which the events are
    * created. The format is
-   * "projects/${projectId}/locations/global/catalogs/${catalogId}"
+   * `projects/${projectId}/locations/global/catalogs/${catalogId}`
    * 
* * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -157,7 +157,7 @@ public java.lang.String getParent() { *
    * Required. The resource name of the catalog under which the events are
    * created. The format is
-   * "projects/${projectId}/locations/global/catalogs/${catalogId}"
+   * `projects/${projectId}/locations/global/catalogs/${catalogId}`
    * 
* * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -638,7 +638,7 @@ public Builder mergeFrom( *
      * Required. The resource name of the catalog under which the events are
      * created. The format is
-     * "projects/${projectId}/locations/global/catalogs/${catalogId}"
+     * `projects/${projectId}/locations/global/catalogs/${catalogId}`
      * 
* * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -662,7 +662,7 @@ public java.lang.String getParent() { *
      * Required. The resource name of the catalog under which the events are
      * created. The format is
-     * "projects/${projectId}/locations/global/catalogs/${catalogId}"
+     * `projects/${projectId}/locations/global/catalogs/${catalogId}`
      * 
* * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -686,7 +686,7 @@ public com.google.protobuf.ByteString getParentBytes() { *
      * Required. The resource name of the catalog under which the events are
      * created. The format is
-     * "projects/${projectId}/locations/global/catalogs/${catalogId}"
+     * `projects/${projectId}/locations/global/catalogs/${catalogId}`
      * 
* * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -709,7 +709,7 @@ public Builder setParent(java.lang.String value) { *
      * Required. The resource name of the catalog under which the events are
      * created. The format is
-     * "projects/${projectId}/locations/global/catalogs/${catalogId}"
+     * `projects/${projectId}/locations/global/catalogs/${catalogId}`
      * 
* * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -728,7 +728,7 @@ public Builder clearParent() { *
      * Required. The resource name of the catalog under which the events are
      * created. The format is
-     * "projects/${projectId}/locations/global/catalogs/${catalogId}"
+     * `projects/${projectId}/locations/global/catalogs/${catalogId}`
      * 
* * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/PurgeUserEventsRequestOrBuilder.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/PurgeUserEventsRequestOrBuilder.java index c1df01e5..fe1071fa 100644 --- a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/PurgeUserEventsRequestOrBuilder.java +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/PurgeUserEventsRequestOrBuilder.java @@ -29,7 +29,7 @@ public interface PurgeUserEventsRequestOrBuilder *
    * Required. The resource name of the catalog under which the events are
    * created. The format is
-   * "projects/${projectId}/locations/global/catalogs/${catalogId}"
+   * `projects/${projectId}/locations/global/catalogs/${catalogId}`
    * 
* * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -43,7 +43,7 @@ public interface PurgeUserEventsRequestOrBuilder *
    * Required. The resource name of the catalog under which the events are
    * created. The format is
-   * "projects/${projectId}/locations/global/catalogs/${catalogId}"
+   * `projects/${projectId}/locations/global/catalogs/${catalogId}`
    * 
* * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/Rating.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/Rating.java new file mode 100644 index 00000000..0463d5ad --- /dev/null +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/Rating.java @@ -0,0 +1,952 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2/common.proto + +package com.google.cloud.retail.v2; + +/** + * + * + *
+ * The rating of a [Product][google.cloud.retail.v2.Product].
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2.Rating} + */ +public final class Rating extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.Rating) + RatingOrBuilder { + private static final long serialVersionUID = 0L; + // Use Rating.newBuilder() to construct. + private Rating(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Rating() { + ratingHistogram_ = emptyIntList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Rating(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Rating( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + ratingCount_ = input.readInt32(); + break; + } + case 21: + { + averageRating_ = input.readFloat(); + break; + } + case 24: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + ratingHistogram_ = newIntList(); + mutable_bitField0_ |= 0x00000001; + } + ratingHistogram_.addInt(input.readInt32()); + break; + } + case 26: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00000001) != 0) && input.getBytesUntilLimit() > 0) { + ratingHistogram_ = newIntList(); + mutable_bitField0_ |= 0x00000001; + } + while (input.getBytesUntilLimit() > 0) { + ratingHistogram_.addInt(input.readInt32()); + } + input.popLimit(limit); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + ratingHistogram_.makeImmutable(); // C + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.CommonProto + .internal_static_google_cloud_retail_v2_Rating_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.CommonProto + .internal_static_google_cloud_retail_v2_Rating_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.Rating.class, + com.google.cloud.retail.v2.Rating.Builder.class); + } + + public static final int RATING_COUNT_FIELD_NUMBER = 1; + private int ratingCount_; + /** + * + * + *
+   * The total number of ratings. This value is independent of the value of
+   * [rating_histogram][google.cloud.retail.v2.Rating.rating_histogram].
+   * This value must be nonnegative. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * int32 rating_count = 1; + * + * @return The ratingCount. + */ + @java.lang.Override + public int getRatingCount() { + return ratingCount_; + } + + public static final int AVERAGE_RATING_FIELD_NUMBER = 2; + private float averageRating_; + /** + * + * + *
+   * The average rating of the [Product][google.cloud.retail.v2.Product].
+   * The rating is scaled at 1-5. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * float average_rating = 2; + * + * @return The averageRating. + */ + @java.lang.Override + public float getAverageRating() { + return averageRating_; + } + + public static final int RATING_HISTOGRAM_FIELD_NUMBER = 3; + private com.google.protobuf.Internal.IntList ratingHistogram_; + /** + * + * + *
+   * List of rating counts per rating value (index = rating - 1). The list is
+   * empty if there is no rating. If the list is non-empty, its size is
+   * always 5. Otherwise, an INVALID_ARGUMENT error is returned.
+   * For example, [41, 14, 13, 47, 303]. It means that the
+   * [Product][google.cloud.retail.v2.Product] got 41 ratings with 1 star, 14
+   * ratings with 2 star, and so on.
+   * 
+ * + * repeated int32 rating_histogram = 3; + * + * @return A list containing the ratingHistogram. + */ + @java.lang.Override + public java.util.List getRatingHistogramList() { + return ratingHistogram_; + } + /** + * + * + *
+   * List of rating counts per rating value (index = rating - 1). The list is
+   * empty if there is no rating. If the list is non-empty, its size is
+   * always 5. Otherwise, an INVALID_ARGUMENT error is returned.
+   * For example, [41, 14, 13, 47, 303]. It means that the
+   * [Product][google.cloud.retail.v2.Product] got 41 ratings with 1 star, 14
+   * ratings with 2 star, and so on.
+   * 
+ * + * repeated int32 rating_histogram = 3; + * + * @return The count of ratingHistogram. + */ + public int getRatingHistogramCount() { + return ratingHistogram_.size(); + } + /** + * + * + *
+   * List of rating counts per rating value (index = rating - 1). The list is
+   * empty if there is no rating. If the list is non-empty, its size is
+   * always 5. Otherwise, an INVALID_ARGUMENT error is returned.
+   * For example, [41, 14, 13, 47, 303]. It means that the
+   * [Product][google.cloud.retail.v2.Product] got 41 ratings with 1 star, 14
+   * ratings with 2 star, and so on.
+   * 
+ * + * repeated int32 rating_histogram = 3; + * + * @param index The index of the element to return. + * @return The ratingHistogram at the given index. + */ + public int getRatingHistogram(int index) { + return ratingHistogram_.getInt(index); + } + + private int ratingHistogramMemoizedSerializedSize = -1; + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getSerializedSize(); + if (ratingCount_ != 0) { + output.writeInt32(1, ratingCount_); + } + if (averageRating_ != 0F) { + output.writeFloat(2, averageRating_); + } + if (getRatingHistogramList().size() > 0) { + output.writeUInt32NoTag(26); + output.writeUInt32NoTag(ratingHistogramMemoizedSerializedSize); + } + for (int i = 0; i < ratingHistogram_.size(); i++) { + output.writeInt32NoTag(ratingHistogram_.getInt(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (ratingCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, ratingCount_); + } + if (averageRating_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, averageRating_); + } + { + int dataSize = 0; + for (int i = 0; i < ratingHistogram_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(ratingHistogram_.getInt(i)); + } + size += dataSize; + if (!getRatingHistogramList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); + } + ratingHistogramMemoizedSerializedSize = dataSize; + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.retail.v2.Rating)) { + return super.equals(obj); + } + com.google.cloud.retail.v2.Rating other = (com.google.cloud.retail.v2.Rating) obj; + + if (getRatingCount() != other.getRatingCount()) return false; + if (java.lang.Float.floatToIntBits(getAverageRating()) + != java.lang.Float.floatToIntBits(other.getAverageRating())) return false; + if (!getRatingHistogramList().equals(other.getRatingHistogramList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + RATING_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getRatingCount(); + hash = (37 * hash) + AVERAGE_RATING_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getAverageRating()); + if (getRatingHistogramCount() > 0) { + hash = (37 * hash) + RATING_HISTOGRAM_FIELD_NUMBER; + hash = (53 * hash) + getRatingHistogramList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2.Rating parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.Rating parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.Rating parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.Rating parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.Rating parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.Rating parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.Rating parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.Rating parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.Rating parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.Rating parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.Rating parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.Rating parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2.Rating prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The rating of a [Product][google.cloud.retail.v2.Product].
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2.Rating} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.Rating) + com.google.cloud.retail.v2.RatingOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.CommonProto + .internal_static_google_cloud_retail_v2_Rating_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.CommonProto + .internal_static_google_cloud_retail_v2_Rating_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.Rating.class, + com.google.cloud.retail.v2.Rating.Builder.class); + } + + // Construct using com.google.cloud.retail.v2.Rating.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + ratingCount_ = 0; + + averageRating_ = 0F; + + ratingHistogram_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2.CommonProto + .internal_static_google_cloud_retail_v2_Rating_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2.Rating getDefaultInstanceForType() { + return com.google.cloud.retail.v2.Rating.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2.Rating build() { + com.google.cloud.retail.v2.Rating result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2.Rating buildPartial() { + com.google.cloud.retail.v2.Rating result = new com.google.cloud.retail.v2.Rating(this); + int from_bitField0_ = bitField0_; + result.ratingCount_ = ratingCount_; + result.averageRating_ = averageRating_; + if (((bitField0_ & 0x00000001) != 0)) { + ratingHistogram_.makeImmutable(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.ratingHistogram_ = ratingHistogram_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.retail.v2.Rating) { + return mergeFrom((com.google.cloud.retail.v2.Rating) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2.Rating other) { + if (other == com.google.cloud.retail.v2.Rating.getDefaultInstance()) return this; + if (other.getRatingCount() != 0) { + setRatingCount(other.getRatingCount()); + } + if (other.getAverageRating() != 0F) { + setAverageRating(other.getAverageRating()); + } + if (!other.ratingHistogram_.isEmpty()) { + if (ratingHistogram_.isEmpty()) { + ratingHistogram_ = other.ratingHistogram_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureRatingHistogramIsMutable(); + ratingHistogram_.addAll(other.ratingHistogram_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.retail.v2.Rating parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2.Rating) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private int ratingCount_; + /** + * + * + *
+     * The total number of ratings. This value is independent of the value of
+     * [rating_histogram][google.cloud.retail.v2.Rating.rating_histogram].
+     * This value must be nonnegative. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * int32 rating_count = 1; + * + * @return The ratingCount. + */ + @java.lang.Override + public int getRatingCount() { + return ratingCount_; + } + /** + * + * + *
+     * The total number of ratings. This value is independent of the value of
+     * [rating_histogram][google.cloud.retail.v2.Rating.rating_histogram].
+     * This value must be nonnegative. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * int32 rating_count = 1; + * + * @param value The ratingCount to set. + * @return This builder for chaining. + */ + public Builder setRatingCount(int value) { + + ratingCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The total number of ratings. This value is independent of the value of
+     * [rating_histogram][google.cloud.retail.v2.Rating.rating_histogram].
+     * This value must be nonnegative. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * int32 rating_count = 1; + * + * @return This builder for chaining. + */ + public Builder clearRatingCount() { + + ratingCount_ = 0; + onChanged(); + return this; + } + + private float averageRating_; + /** + * + * + *
+     * The average rating of the [Product][google.cloud.retail.v2.Product].
+     * The rating is scaled at 1-5. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * float average_rating = 2; + * + * @return The averageRating. + */ + @java.lang.Override + public float getAverageRating() { + return averageRating_; + } + /** + * + * + *
+     * The average rating of the [Product][google.cloud.retail.v2.Product].
+     * The rating is scaled at 1-5. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * float average_rating = 2; + * + * @param value The averageRating to set. + * @return This builder for chaining. + */ + public Builder setAverageRating(float value) { + + averageRating_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The average rating of the [Product][google.cloud.retail.v2.Product].
+     * The rating is scaled at 1-5. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * float average_rating = 2; + * + * @return This builder for chaining. + */ + public Builder clearAverageRating() { + + averageRating_ = 0F; + onChanged(); + return this; + } + + private com.google.protobuf.Internal.IntList ratingHistogram_ = emptyIntList(); + + private void ensureRatingHistogramIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + ratingHistogram_ = mutableCopy(ratingHistogram_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * List of rating counts per rating value (index = rating - 1). The list is
+     * empty if there is no rating. If the list is non-empty, its size is
+     * always 5. Otherwise, an INVALID_ARGUMENT error is returned.
+     * For example, [41, 14, 13, 47, 303]. It means that the
+     * [Product][google.cloud.retail.v2.Product] got 41 ratings with 1 star, 14
+     * ratings with 2 star, and so on.
+     * 
+ * + * repeated int32 rating_histogram = 3; + * + * @return A list containing the ratingHistogram. + */ + public java.util.List getRatingHistogramList() { + return ((bitField0_ & 0x00000001) != 0) + ? java.util.Collections.unmodifiableList(ratingHistogram_) + : ratingHistogram_; + } + /** + * + * + *
+     * List of rating counts per rating value (index = rating - 1). The list is
+     * empty if there is no rating. If the list is non-empty, its size is
+     * always 5. Otherwise, an INVALID_ARGUMENT error is returned.
+     * For example, [41, 14, 13, 47, 303]. It means that the
+     * [Product][google.cloud.retail.v2.Product] got 41 ratings with 1 star, 14
+     * ratings with 2 star, and so on.
+     * 
+ * + * repeated int32 rating_histogram = 3; + * + * @return The count of ratingHistogram. + */ + public int getRatingHistogramCount() { + return ratingHistogram_.size(); + } + /** + * + * + *
+     * List of rating counts per rating value (index = rating - 1). The list is
+     * empty if there is no rating. If the list is non-empty, its size is
+     * always 5. Otherwise, an INVALID_ARGUMENT error is returned.
+     * For example, [41, 14, 13, 47, 303]. It means that the
+     * [Product][google.cloud.retail.v2.Product] got 41 ratings with 1 star, 14
+     * ratings with 2 star, and so on.
+     * 
+ * + * repeated int32 rating_histogram = 3; + * + * @param index The index of the element to return. + * @return The ratingHistogram at the given index. + */ + public int getRatingHistogram(int index) { + return ratingHistogram_.getInt(index); + } + /** + * + * + *
+     * List of rating counts per rating value (index = rating - 1). The list is
+     * empty if there is no rating. If the list is non-empty, its size is
+     * always 5. Otherwise, an INVALID_ARGUMENT error is returned.
+     * For example, [41, 14, 13, 47, 303]. It means that the
+     * [Product][google.cloud.retail.v2.Product] got 41 ratings with 1 star, 14
+     * ratings with 2 star, and so on.
+     * 
+ * + * repeated int32 rating_histogram = 3; + * + * @param index The index to set the value at. + * @param value The ratingHistogram to set. + * @return This builder for chaining. + */ + public Builder setRatingHistogram(int index, int value) { + ensureRatingHistogramIsMutable(); + ratingHistogram_.setInt(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * List of rating counts per rating value (index = rating - 1). The list is
+     * empty if there is no rating. If the list is non-empty, its size is
+     * always 5. Otherwise, an INVALID_ARGUMENT error is returned.
+     * For example, [41, 14, 13, 47, 303]. It means that the
+     * [Product][google.cloud.retail.v2.Product] got 41 ratings with 1 star, 14
+     * ratings with 2 star, and so on.
+     * 
+ * + * repeated int32 rating_histogram = 3; + * + * @param value The ratingHistogram to add. + * @return This builder for chaining. + */ + public Builder addRatingHistogram(int value) { + ensureRatingHistogramIsMutable(); + ratingHistogram_.addInt(value); + onChanged(); + return this; + } + /** + * + * + *
+     * List of rating counts per rating value (index = rating - 1). The list is
+     * empty if there is no rating. If the list is non-empty, its size is
+     * always 5. Otherwise, an INVALID_ARGUMENT error is returned.
+     * For example, [41, 14, 13, 47, 303]. It means that the
+     * [Product][google.cloud.retail.v2.Product] got 41 ratings with 1 star, 14
+     * ratings with 2 star, and so on.
+     * 
+ * + * repeated int32 rating_histogram = 3; + * + * @param values The ratingHistogram to add. + * @return This builder for chaining. + */ + public Builder addAllRatingHistogram(java.lang.Iterable values) { + ensureRatingHistogramIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, ratingHistogram_); + onChanged(); + return this; + } + /** + * + * + *
+     * List of rating counts per rating value (index = rating - 1). The list is
+     * empty if there is no rating. If the list is non-empty, its size is
+     * always 5. Otherwise, an INVALID_ARGUMENT error is returned.
+     * For example, [41, 14, 13, 47, 303]. It means that the
+     * [Product][google.cloud.retail.v2.Product] got 41 ratings with 1 star, 14
+     * ratings with 2 star, and so on.
+     * 
+ * + * repeated int32 rating_histogram = 3; + * + * @return This builder for chaining. + */ + public Builder clearRatingHistogram() { + ratingHistogram_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.Rating) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.Rating) + private static final com.google.cloud.retail.v2.Rating DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2.Rating(); + } + + public static com.google.cloud.retail.v2.Rating getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Rating parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Rating(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.retail.v2.Rating getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/RatingOrBuilder.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/RatingOrBuilder.java new file mode 100644 index 00000000..8007cb2c --- /dev/null +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/RatingOrBuilder.java @@ -0,0 +1,109 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2/common.proto + +package com.google.cloud.retail.v2; + +public interface RatingOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2.Rating) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The total number of ratings. This value is independent of the value of
+   * [rating_histogram][google.cloud.retail.v2.Rating.rating_histogram].
+   * This value must be nonnegative. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * int32 rating_count = 1; + * + * @return The ratingCount. + */ + int getRatingCount(); + + /** + * + * + *
+   * The average rating of the [Product][google.cloud.retail.v2.Product].
+   * The rating is scaled at 1-5. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * float average_rating = 2; + * + * @return The averageRating. + */ + float getAverageRating(); + + /** + * + * + *
+   * List of rating counts per rating value (index = rating - 1). The list is
+   * empty if there is no rating. If the list is non-empty, its size is
+   * always 5. Otherwise, an INVALID_ARGUMENT error is returned.
+   * For example, [41, 14, 13, 47, 303]. It means that the
+   * [Product][google.cloud.retail.v2.Product] got 41 ratings with 1 star, 14
+   * ratings with 2 star, and so on.
+   * 
+ * + * repeated int32 rating_histogram = 3; + * + * @return A list containing the ratingHistogram. + */ + java.util.List getRatingHistogramList(); + /** + * + * + *
+   * List of rating counts per rating value (index = rating - 1). The list is
+   * empty if there is no rating. If the list is non-empty, its size is
+   * always 5. Otherwise, an INVALID_ARGUMENT error is returned.
+   * For example, [41, 14, 13, 47, 303]. It means that the
+   * [Product][google.cloud.retail.v2.Product] got 41 ratings with 1 star, 14
+   * ratings with 2 star, and so on.
+   * 
+ * + * repeated int32 rating_histogram = 3; + * + * @return The count of ratingHistogram. + */ + int getRatingHistogramCount(); + /** + * + * + *
+   * List of rating counts per rating value (index = rating - 1). The list is
+   * empty if there is no rating. If the list is non-empty, its size is
+   * always 5. Otherwise, an INVALID_ARGUMENT error is returned.
+   * For example, [41, 14, 13, 47, 303]. It means that the
+   * [Product][google.cloud.retail.v2.Product] got 41 ratings with 1 star, 14
+   * ratings with 2 star, and so on.
+   * 
+ * + * repeated int32 rating_histogram = 3; + * + * @param index The index of the element to return. + * @return The ratingHistogram at the given index. + */ + int getRatingHistogram(int index); +} diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/RemoveFulfillmentPlacesMetadata.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/RemoveFulfillmentPlacesMetadata.java new file mode 100644 index 00000000..afaf5e72 --- /dev/null +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/RemoveFulfillmentPlacesMetadata.java @@ -0,0 +1,462 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2/product_service.proto + +package com.google.cloud.retail.v2; + +/** + * + * + *
+ * Metadata related to the progress of the RemoveFulfillmentPlaces operation.
+ * Currently empty because there is no meaningful metadata populated from the
+ * [RemoveFulfillmentPlaces][] method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata} + */ +public final class RemoveFulfillmentPlacesMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata) + RemoveFulfillmentPlacesMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use RemoveFulfillmentPlacesMetadata.newBuilder() to construct. + private RemoveFulfillmentPlacesMetadata( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RemoveFulfillmentPlacesMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RemoveFulfillmentPlacesMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RemoveFulfillmentPlacesMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.ProductServiceProto + .internal_static_google_cloud_retail_v2_RemoveFulfillmentPlacesMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.ProductServiceProto + .internal_static_google_cloud_retail_v2_RemoveFulfillmentPlacesMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata.class, + com.google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata)) { + return super.equals(obj); + } + com.google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata other = + (com.google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata) obj; + + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Metadata related to the progress of the RemoveFulfillmentPlaces operation.
+   * Currently empty because there is no meaningful metadata populated from the
+   * [RemoveFulfillmentPlaces][] method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata) + com.google.cloud.retail.v2.RemoveFulfillmentPlacesMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.ProductServiceProto + .internal_static_google_cloud_retail_v2_RemoveFulfillmentPlacesMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.ProductServiceProto + .internal_static_google_cloud_retail_v2_RemoveFulfillmentPlacesMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata.class, + com.google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata.Builder.class); + } + + // Construct using com.google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2.ProductServiceProto + .internal_static_google_cloud_retail_v2_RemoveFulfillmentPlacesMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata getDefaultInstanceForType() { + return com.google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata build() { + com.google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata buildPartial() { + com.google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata result = + new com.google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata) { + return mergeFrom((com.google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata other) { + if (other == com.google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata) + private static final com.google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata(); + } + + public static com.google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RemoveFulfillmentPlacesMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RemoveFulfillmentPlacesMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/RemoveFulfillmentPlacesMetadataOrBuilder.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/RemoveFulfillmentPlacesMetadataOrBuilder.java new file mode 100644 index 00000000..b4e30aa4 --- /dev/null +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/RemoveFulfillmentPlacesMetadataOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2/product_service.proto + +package com.google.cloud.retail.v2; + +public interface RemoveFulfillmentPlacesMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/RemoveFulfillmentPlacesRequest.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/RemoveFulfillmentPlacesRequest.java new file mode 100644 index 00000000..2c98d91b --- /dev/null +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/RemoveFulfillmentPlacesRequest.java @@ -0,0 +1,1754 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2/product_service.proto + +package com.google.cloud.retail.v2; + +/** + * + * + *
+ * Request message for [RemoveFulfillmentPlaces][] method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2.RemoveFulfillmentPlacesRequest} + */ +public final class RemoveFulfillmentPlacesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.RemoveFulfillmentPlacesRequest) + RemoveFulfillmentPlacesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use RemoveFulfillmentPlacesRequest.newBuilder() to construct. + private RemoveFulfillmentPlacesRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RemoveFulfillmentPlacesRequest() { + product_ = ""; + type_ = ""; + placeIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RemoveFulfillmentPlacesRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RemoveFulfillmentPlacesRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + product_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + type_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + placeIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + placeIds_.add(s); + break; + } + case 34: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (removeTime_ != null) { + subBuilder = removeTime_.toBuilder(); + } + removeTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(removeTime_); + removeTime_ = subBuilder.buildPartial(); + } + + break; + } + case 40: + { + allowMissing_ = input.readBool(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + placeIds_ = placeIds_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.ProductServiceProto + .internal_static_google_cloud_retail_v2_RemoveFulfillmentPlacesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.ProductServiceProto + .internal_static_google_cloud_retail_v2_RemoveFulfillmentPlacesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.class, + com.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.Builder.class); + } + + public static final int PRODUCT_FIELD_NUMBER = 1; + private volatile java.lang.Object product_; + /** + * + * + *
+   * 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) = { ... } + * + * + * @return The product. + */ + @java.lang.Override + public java.lang.String getProduct() { + java.lang.Object ref = product_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + product_ = s; + return s; + } + } + /** + * + * + *
+   * 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) = { ... } + * + * + * @return The bytes for product. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProductBytes() { + java.lang.Object ref = product_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + product_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TYPE_FIELD_NUMBER = 2; + private volatile java.lang.Object type_; + /** + * + * + *
+   * Required. The fulfillment type, including commonly used types (such as
+   * pickup in store and same day delivery), and custom types.
+   * 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.
+   * This field directly corresponds to [Product.fulfillment_info.type][].
+   * 
+ * + * string type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The type. + */ + @java.lang.Override + public java.lang.String getType() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The fulfillment type, including commonly used types (such as
+   * pickup in store and same day delivery), and custom types.
+   * 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.
+   * This field directly corresponds to [Product.fulfillment_info.type][].
+   * 
+ * + * string type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for type. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PLACE_IDS_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList placeIds_; + /** + * + * + *
+   * Required. The IDs for this
+   * [type][google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.type], such as
+   * the store IDs for "pickup-in-store" or the region IDs for
+   * "same-day-delivery", to be removed for this
+   * [type][google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.type].
+   * At least 1 value is required, and a maximum of 2000 values are allowed.
+   * Each value must be a string with a length limit of 10 characters, matching
+   * the pattern [a-zA-Z0-9_-]+, such as "store1" or "REGION-2". Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the placeIds. + */ + public com.google.protobuf.ProtocolStringList getPlaceIdsList() { + return placeIds_; + } + /** + * + * + *
+   * Required. The IDs for this
+   * [type][google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.type], such as
+   * the store IDs for "pickup-in-store" or the region IDs for
+   * "same-day-delivery", to be removed for this
+   * [type][google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.type].
+   * At least 1 value is required, and a maximum of 2000 values are allowed.
+   * Each value must be a string with a length limit of 10 characters, matching
+   * the pattern [a-zA-Z0-9_-]+, such as "store1" or "REGION-2". Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of placeIds. + */ + public int getPlaceIdsCount() { + return placeIds_.size(); + } + /** + * + * + *
+   * Required. The IDs for this
+   * [type][google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.type], such as
+   * the store IDs for "pickup-in-store" or the region IDs for
+   * "same-day-delivery", to be removed for this
+   * [type][google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.type].
+   * At least 1 value is required, and a maximum of 2000 values are allowed.
+   * Each value must be a string with a length limit of 10 characters, matching
+   * the pattern [a-zA-Z0-9_-]+, such as "store1" or "REGION-2". Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The placeIds at the given index. + */ + public java.lang.String getPlaceIds(int index) { + return placeIds_.get(index); + } + /** + * + * + *
+   * Required. The IDs for this
+   * [type][google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.type], such as
+   * the store IDs for "pickup-in-store" or the region IDs for
+   * "same-day-delivery", to be removed for this
+   * [type][google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.type].
+   * At least 1 value is required, and a maximum of 2000 values are allowed.
+   * Each value must be a string with a length limit of 10 characters, matching
+   * the pattern [a-zA-Z0-9_-]+, such as "store1" or "REGION-2". Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the placeIds at the given index. + */ + public com.google.protobuf.ByteString getPlaceIdsBytes(int index) { + return placeIds_.getByteString(index); + } + + public static final int REMOVE_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp removeTime_; + /** + * + * + *
+   * The time when the fulfillment updates are issued, used to prevent
+   * out-of-order updates on fulfillment information. If not provided, the
+   * internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp remove_time = 4; + * + * @return Whether the removeTime field is set. + */ + @java.lang.Override + public boolean hasRemoveTime() { + return removeTime_ != null; + } + /** + * + * + *
+   * The time when the fulfillment updates are issued, used to prevent
+   * out-of-order updates on fulfillment information. If not provided, the
+   * internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp remove_time = 4; + * + * @return The removeTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getRemoveTime() { + return removeTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : removeTime_; + } + /** + * + * + *
+   * The time when the fulfillment updates are issued, used to prevent
+   * out-of-order updates on fulfillment information. If not provided, the
+   * internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp remove_time = 4; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getRemoveTimeOrBuilder() { + return getRemoveTime(); + } + + public static final int ALLOW_MISSING_FIELD_NUMBER = 5; + private boolean allowMissing_; + /** + * + * + *
+   * If set to true, and the [Product][google.cloud.retail.v2.Product] is not
+   * found, the fulfillment information 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, an
+   * INVALID_ARGUMENT error is returned if the
+   * [Product][google.cloud.retail.v2.Product] is not found.
+   * 
+ * + * bool allow_missing = 5; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getProductBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, product_); + } + if (!getTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, type_); + } + for (int i = 0; i < placeIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, placeIds_.getRaw(i)); + } + if (removeTime_ != null) { + output.writeMessage(4, getRemoveTime()); + } + if (allowMissing_ != false) { + output.writeBool(5, allowMissing_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getProductBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, product_); + } + if (!getTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, type_); + } + { + int dataSize = 0; + for (int i = 0; i < placeIds_.size(); i++) { + dataSize += computeStringSizeNoTag(placeIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getPlaceIdsList().size(); + } + if (removeTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getRemoveTime()); + } + if (allowMissing_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, allowMissing_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest other = + (com.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest) obj; + + if (!getProduct().equals(other.getProduct())) return false; + if (!getType().equals(other.getType())) return false; + if (!getPlaceIdsList().equals(other.getPlaceIdsList())) return false; + if (hasRemoveTime() != other.hasRemoveTime()) return false; + if (hasRemoveTime()) { + if (!getRemoveTime().equals(other.getRemoveTime())) return false; + } + if (getAllowMissing() != other.getAllowMissing()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PRODUCT_FIELD_NUMBER; + hash = (53 * hash) + getProduct().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + if (getPlaceIdsCount() > 0) { + hash = (37 * hash) + PLACE_IDS_FIELD_NUMBER; + hash = (53 * hash) + getPlaceIdsList().hashCode(); + } + if (hasRemoveTime()) { + hash = (37 * hash) + REMOVE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getRemoveTime().hashCode(); + } + hash = (37 * hash) + ALLOW_MISSING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowMissing()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for [RemoveFulfillmentPlaces][] method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2.RemoveFulfillmentPlacesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.RemoveFulfillmentPlacesRequest) + com.google.cloud.retail.v2.RemoveFulfillmentPlacesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.ProductServiceProto + .internal_static_google_cloud_retail_v2_RemoveFulfillmentPlacesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.ProductServiceProto + .internal_static_google_cloud_retail_v2_RemoveFulfillmentPlacesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.class, + com.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + product_ = ""; + + type_ = ""; + + placeIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + if (removeTimeBuilder_ == null) { + removeTime_ = null; + } else { + removeTime_ = null; + removeTimeBuilder_ = null; + } + allowMissing_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2.ProductServiceProto + .internal_static_google_cloud_retail_v2_RemoveFulfillmentPlacesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest build() { + com.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest buildPartial() { + com.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest result = + new com.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest(this); + int from_bitField0_ = bitField0_; + result.product_ = product_; + result.type_ = type_; + if (((bitField0_ & 0x00000001) != 0)) { + placeIds_ = placeIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.placeIds_ = placeIds_; + if (removeTimeBuilder_ == null) { + result.removeTime_ = removeTime_; + } else { + result.removeTime_ = removeTimeBuilder_.build(); + } + result.allowMissing_ = allowMissing_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest) { + return mergeFrom((com.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest other) { + if (other == com.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.getDefaultInstance()) + return this; + if (!other.getProduct().isEmpty()) { + product_ = other.product_; + onChanged(); + } + if (!other.getType().isEmpty()) { + type_ = other.type_; + onChanged(); + } + if (!other.placeIds_.isEmpty()) { + if (placeIds_.isEmpty()) { + placeIds_ = other.placeIds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePlaceIdsIsMutable(); + placeIds_.addAll(other.placeIds_); + } + onChanged(); + } + if (other.hasRemoveTime()) { + mergeRemoveTime(other.getRemoveTime()); + } + if (other.getAllowMissing() != false) { + setAllowMissing(other.getAllowMissing()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object product_ = ""; + /** + * + * + *
+     * 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) = { ... } + * + * + * @return The product. + */ + public java.lang.String getProduct() { + java.lang.Object ref = product_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + product_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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) = { ... } + * + * + * @return The bytes for product. + */ + public com.google.protobuf.ByteString getProductBytes() { + java.lang.Object ref = product_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + product_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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) = { ... } + * + * + * @param value The product to set. + * @return This builder for chaining. + */ + public Builder setProduct(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + product_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 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) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearProduct() { + + product_ = getDefaultInstance().getProduct(); + onChanged(); + return this; + } + /** + * + * + *
+     * 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) = { ... } + * + * + * @param value The bytes for product to set. + * @return This builder for chaining. + */ + public Builder setProductBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + product_ = value; + onChanged(); + return this; + } + + private java.lang.Object type_ = ""; + /** + * + * + *
+     * Required. The fulfillment type, including commonly used types (such as
+     * pickup in store and same day delivery), and custom types.
+     * 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.
+     * This field directly corresponds to [Product.fulfillment_info.type][].
+     * 
+ * + * string type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The type. + */ + public java.lang.String getType() { + java.lang.Object ref = type_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The fulfillment type, including commonly used types (such as
+     * pickup in store and same day delivery), and custom types.
+     * 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.
+     * This field directly corresponds to [Product.fulfillment_info.type][].
+     * 
+ * + * string type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for type. + */ + public com.google.protobuf.ByteString getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The fulfillment type, including commonly used types (such as
+     * pickup in store and same day delivery), and custom types.
+     * 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.
+     * This field directly corresponds to [Product.fulfillment_info.type][].
+     * 
+ * + * string type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + type_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The fulfillment type, including commonly used types (such as
+     * pickup in store and same day delivery), and custom types.
+     * 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.
+     * This field directly corresponds to [Product.fulfillment_info.type][].
+     * 
+ * + * string type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearType() { + + type_ = getDefaultInstance().getType(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The fulfillment type, including commonly used types (such as
+     * pickup in store and same day delivery), and custom types.
+     * 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.
+     * This field directly corresponds to [Product.fulfillment_info.type][].
+     * 
+ * + * string type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for type to set. + * @return This builder for chaining. + */ + public Builder setTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + type_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList placeIds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensurePlaceIdsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + placeIds_ = new com.google.protobuf.LazyStringArrayList(placeIds_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * Required. The IDs for this
+     * [type][google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.type], such as
+     * the store IDs for "pickup-in-store" or the region IDs for
+     * "same-day-delivery", to be removed for this
+     * [type][google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.type].
+     * At least 1 value is required, and a maximum of 2000 values are allowed.
+     * Each value must be a string with a length limit of 10 characters, matching
+     * the pattern [a-zA-Z0-9_-]+, such as "store1" or "REGION-2". Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the placeIds. + */ + public com.google.protobuf.ProtocolStringList getPlaceIdsList() { + return placeIds_.getUnmodifiableView(); + } + /** + * + * + *
+     * Required. The IDs for this
+     * [type][google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.type], such as
+     * the store IDs for "pickup-in-store" or the region IDs for
+     * "same-day-delivery", to be removed for this
+     * [type][google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.type].
+     * At least 1 value is required, and a maximum of 2000 values are allowed.
+     * Each value must be a string with a length limit of 10 characters, matching
+     * the pattern [a-zA-Z0-9_-]+, such as "store1" or "REGION-2". Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of placeIds. + */ + public int getPlaceIdsCount() { + return placeIds_.size(); + } + /** + * + * + *
+     * Required. The IDs for this
+     * [type][google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.type], such as
+     * the store IDs for "pickup-in-store" or the region IDs for
+     * "same-day-delivery", to be removed for this
+     * [type][google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.type].
+     * At least 1 value is required, and a maximum of 2000 values are allowed.
+     * Each value must be a string with a length limit of 10 characters, matching
+     * the pattern [a-zA-Z0-9_-]+, such as "store1" or "REGION-2". Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The placeIds at the given index. + */ + public java.lang.String getPlaceIds(int index) { + return placeIds_.get(index); + } + /** + * + * + *
+     * Required. The IDs for this
+     * [type][google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.type], such as
+     * the store IDs for "pickup-in-store" or the region IDs for
+     * "same-day-delivery", to be removed for this
+     * [type][google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.type].
+     * At least 1 value is required, and a maximum of 2000 values are allowed.
+     * Each value must be a string with a length limit of 10 characters, matching
+     * the pattern [a-zA-Z0-9_-]+, such as "store1" or "REGION-2". Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the placeIds at the given index. + */ + public com.google.protobuf.ByteString getPlaceIdsBytes(int index) { + return placeIds_.getByteString(index); + } + /** + * + * + *
+     * Required. The IDs for this
+     * [type][google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.type], such as
+     * the store IDs for "pickup-in-store" or the region IDs for
+     * "same-day-delivery", to be removed for this
+     * [type][google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.type].
+     * At least 1 value is required, and a maximum of 2000 values are allowed.
+     * Each value must be a string with a length limit of 10 characters, matching
+     * the pattern [a-zA-Z0-9_-]+, such as "store1" or "REGION-2". Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index to set the value at. + * @param value The placeIds to set. + * @return This builder for chaining. + */ + public Builder setPlaceIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePlaceIdsIsMutable(); + placeIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The IDs for this
+     * [type][google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.type], such as
+     * the store IDs for "pickup-in-store" or the region IDs for
+     * "same-day-delivery", to be removed for this
+     * [type][google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.type].
+     * At least 1 value is required, and a maximum of 2000 values are allowed.
+     * Each value must be a string with a length limit of 10 characters, matching
+     * the pattern [a-zA-Z0-9_-]+, such as "store1" or "REGION-2". Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The placeIds to add. + * @return This builder for chaining. + */ + public Builder addPlaceIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePlaceIdsIsMutable(); + placeIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The IDs for this
+     * [type][google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.type], such as
+     * the store IDs for "pickup-in-store" or the region IDs for
+     * "same-day-delivery", to be removed for this
+     * [type][google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.type].
+     * At least 1 value is required, and a maximum of 2000 values are allowed.
+     * Each value must be a string with a length limit of 10 characters, matching
+     * the pattern [a-zA-Z0-9_-]+, such as "store1" or "REGION-2". Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param values The placeIds to add. + * @return This builder for chaining. + */ + public Builder addAllPlaceIds(java.lang.Iterable values) { + ensurePlaceIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, placeIds_); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The IDs for this
+     * [type][google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.type], such as
+     * the store IDs for "pickup-in-store" or the region IDs for
+     * "same-day-delivery", to be removed for this
+     * [type][google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.type].
+     * At least 1 value is required, and a maximum of 2000 values are allowed.
+     * Each value must be a string with a length limit of 10 characters, matching
+     * the pattern [a-zA-Z0-9_-]+, such as "store1" or "REGION-2". Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearPlaceIds() { + placeIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The IDs for this
+     * [type][google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.type], such as
+     * the store IDs for "pickup-in-store" or the region IDs for
+     * "same-day-delivery", to be removed for this
+     * [type][google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.type].
+     * At least 1 value is required, and a maximum of 2000 values are allowed.
+     * Each value must be a string with a length limit of 10 characters, matching
+     * the pattern [a-zA-Z0-9_-]+, such as "store1" or "REGION-2". Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes of the placeIds to add. + * @return This builder for chaining. + */ + public Builder addPlaceIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensurePlaceIdsIsMutable(); + placeIds_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp removeTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + removeTimeBuilder_; + /** + * + * + *
+     * The time when the fulfillment updates are issued, used to prevent
+     * out-of-order updates on fulfillment information. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp remove_time = 4; + * + * @return Whether the removeTime field is set. + */ + public boolean hasRemoveTime() { + return removeTimeBuilder_ != null || removeTime_ != null; + } + /** + * + * + *
+     * The time when the fulfillment updates are issued, used to prevent
+     * out-of-order updates on fulfillment information. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp remove_time = 4; + * + * @return The removeTime. + */ + public com.google.protobuf.Timestamp getRemoveTime() { + if (removeTimeBuilder_ == null) { + return removeTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : removeTime_; + } else { + return removeTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time when the fulfillment updates are issued, used to prevent
+     * out-of-order updates on fulfillment information. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp remove_time = 4; + */ + public Builder setRemoveTime(com.google.protobuf.Timestamp value) { + if (removeTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + removeTime_ = value; + onChanged(); + } else { + removeTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The time when the fulfillment updates are issued, used to prevent
+     * out-of-order updates on fulfillment information. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp remove_time = 4; + */ + public Builder setRemoveTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (removeTimeBuilder_ == null) { + removeTime_ = builderForValue.build(); + onChanged(); + } else { + removeTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time when the fulfillment updates are issued, used to prevent
+     * out-of-order updates on fulfillment information. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp remove_time = 4; + */ + public Builder mergeRemoveTime(com.google.protobuf.Timestamp value) { + if (removeTimeBuilder_ == null) { + if (removeTime_ != null) { + removeTime_ = + com.google.protobuf.Timestamp.newBuilder(removeTime_).mergeFrom(value).buildPartial(); + } else { + removeTime_ = value; + } + onChanged(); + } else { + removeTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The time when the fulfillment updates are issued, used to prevent
+     * out-of-order updates on fulfillment information. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp remove_time = 4; + */ + public Builder clearRemoveTime() { + if (removeTimeBuilder_ == null) { + removeTime_ = null; + onChanged(); + } else { + removeTime_ = null; + removeTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time when the fulfillment updates are issued, used to prevent
+     * out-of-order updates on fulfillment information. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp remove_time = 4; + */ + public com.google.protobuf.Timestamp.Builder getRemoveTimeBuilder() { + + onChanged(); + return getRemoveTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time when the fulfillment updates are issued, used to prevent
+     * out-of-order updates on fulfillment information. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp remove_time = 4; + */ + public com.google.protobuf.TimestampOrBuilder getRemoveTimeOrBuilder() { + if (removeTimeBuilder_ != null) { + return removeTimeBuilder_.getMessageOrBuilder(); + } else { + return removeTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : removeTime_; + } + } + /** + * + * + *
+     * The time when the fulfillment updates are issued, used to prevent
+     * out-of-order updates on fulfillment information. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp remove_time = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getRemoveTimeFieldBuilder() { + if (removeTimeBuilder_ == null) { + removeTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getRemoveTime(), getParentForChildren(), isClean()); + removeTime_ = null; + } + return removeTimeBuilder_; + } + + private boolean allowMissing_; + /** + * + * + *
+     * If set to true, and the [Product][google.cloud.retail.v2.Product] is not
+     * found, the fulfillment information 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, an
+     * INVALID_ARGUMENT error is returned if the
+     * [Product][google.cloud.retail.v2.Product] is not found.
+     * 
+ * + * bool allow_missing = 5; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + /** + * + * + *
+     * If set to true, and the [Product][google.cloud.retail.v2.Product] is not
+     * found, the fulfillment information 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, an
+     * INVALID_ARGUMENT error is returned if the
+     * [Product][google.cloud.retail.v2.Product] is not found.
+     * 
+ * + * bool allow_missing = 5; + * + * @param value The allowMissing to set. + * @return This builder for chaining. + */ + public Builder setAllowMissing(boolean value) { + + allowMissing_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If set to true, and the [Product][google.cloud.retail.v2.Product] is not
+     * found, the fulfillment information 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, an
+     * INVALID_ARGUMENT error is returned if the
+     * [Product][google.cloud.retail.v2.Product] is not found.
+     * 
+ * + * bool allow_missing = 5; + * + * @return This builder for chaining. + */ + public Builder clearAllowMissing() { + + allowMissing_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.RemoveFulfillmentPlacesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.RemoveFulfillmentPlacesRequest) + private static final com.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest(); + } + + public static com.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RemoveFulfillmentPlacesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RemoveFulfillmentPlacesRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/RemoveFulfillmentPlacesRequestOrBuilder.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/RemoveFulfillmentPlacesRequestOrBuilder.java new file mode 100644 index 00000000..d51dbf1d --- /dev/null +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/RemoveFulfillmentPlacesRequestOrBuilder.java @@ -0,0 +1,259 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2/product_service.proto + +package com.google.cloud.retail.v2; + +public interface RemoveFulfillmentPlacesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2.RemoveFulfillmentPlacesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * 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) = { ... } + * + * + * @return The product. + */ + java.lang.String getProduct(); + /** + * + * + *
+   * 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) = { ... } + * + * + * @return The bytes for product. + */ + com.google.protobuf.ByteString getProductBytes(); + + /** + * + * + *
+   * Required. The fulfillment type, including commonly used types (such as
+   * pickup in store and same day delivery), and custom types.
+   * 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.
+   * This field directly corresponds to [Product.fulfillment_info.type][].
+   * 
+ * + * string type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The type. + */ + java.lang.String getType(); + /** + * + * + *
+   * Required. The fulfillment type, including commonly used types (such as
+   * pickup in store and same day delivery), and custom types.
+   * 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.
+   * This field directly corresponds to [Product.fulfillment_info.type][].
+   * 
+ * + * string type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for type. + */ + com.google.protobuf.ByteString getTypeBytes(); + + /** + * + * + *
+   * Required. The IDs for this
+   * [type][google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.type], such as
+   * the store IDs for "pickup-in-store" or the region IDs for
+   * "same-day-delivery", to be removed for this
+   * [type][google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.type].
+   * At least 1 value is required, and a maximum of 2000 values are allowed.
+   * Each value must be a string with a length limit of 10 characters, matching
+   * the pattern [a-zA-Z0-9_-]+, such as "store1" or "REGION-2". Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the placeIds. + */ + java.util.List getPlaceIdsList(); + /** + * + * + *
+   * Required. The IDs for this
+   * [type][google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.type], such as
+   * the store IDs for "pickup-in-store" or the region IDs for
+   * "same-day-delivery", to be removed for this
+   * [type][google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.type].
+   * At least 1 value is required, and a maximum of 2000 values are allowed.
+   * Each value must be a string with a length limit of 10 characters, matching
+   * the pattern [a-zA-Z0-9_-]+, such as "store1" or "REGION-2". Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of placeIds. + */ + int getPlaceIdsCount(); + /** + * + * + *
+   * Required. The IDs for this
+   * [type][google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.type], such as
+   * the store IDs for "pickup-in-store" or the region IDs for
+   * "same-day-delivery", to be removed for this
+   * [type][google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.type].
+   * At least 1 value is required, and a maximum of 2000 values are allowed.
+   * Each value must be a string with a length limit of 10 characters, matching
+   * the pattern [a-zA-Z0-9_-]+, such as "store1" or "REGION-2". Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The placeIds at the given index. + */ + java.lang.String getPlaceIds(int index); + /** + * + * + *
+   * Required. The IDs for this
+   * [type][google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.type], such as
+   * the store IDs for "pickup-in-store" or the region IDs for
+   * "same-day-delivery", to be removed for this
+   * [type][google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.type].
+   * At least 1 value is required, and a maximum of 2000 values are allowed.
+   * Each value must be a string with a length limit of 10 characters, matching
+   * the pattern [a-zA-Z0-9_-]+, such as "store1" or "REGION-2". Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the placeIds at the given index. + */ + com.google.protobuf.ByteString getPlaceIdsBytes(int index); + + /** + * + * + *
+   * The time when the fulfillment updates are issued, used to prevent
+   * out-of-order updates on fulfillment information. If not provided, the
+   * internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp remove_time = 4; + * + * @return Whether the removeTime field is set. + */ + boolean hasRemoveTime(); + /** + * + * + *
+   * The time when the fulfillment updates are issued, used to prevent
+   * out-of-order updates on fulfillment information. If not provided, the
+   * internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp remove_time = 4; + * + * @return The removeTime. + */ + com.google.protobuf.Timestamp getRemoveTime(); + /** + * + * + *
+   * The time when the fulfillment updates are issued, used to prevent
+   * out-of-order updates on fulfillment information. If not provided, the
+   * internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp remove_time = 4; + */ + com.google.protobuf.TimestampOrBuilder getRemoveTimeOrBuilder(); + + /** + * + * + *
+   * If set to true, and the [Product][google.cloud.retail.v2.Product] is not
+   * found, the fulfillment information 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, an
+   * INVALID_ARGUMENT error is returned if the
+   * [Product][google.cloud.retail.v2.Product] is not found.
+   * 
+ * + * bool allow_missing = 5; + * + * @return The allowMissing. + */ + boolean getAllowMissing(); +} diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/RemoveFulfillmentPlacesResponse.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/RemoveFulfillmentPlacesResponse.java new file mode 100644 index 00000000..23160d66 --- /dev/null +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/RemoveFulfillmentPlacesResponse.java @@ -0,0 +1,462 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2/product_service.proto + +package com.google.cloud.retail.v2; + +/** + * + * + *
+ * Response of the RemoveFulfillmentPlacesRequest. Currently empty because there
+ * is no meaningful response populated from the [RemoveFulfillmentPlaces][]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2.RemoveFulfillmentPlacesResponse} + */ +public final class RemoveFulfillmentPlacesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.RemoveFulfillmentPlacesResponse) + RemoveFulfillmentPlacesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use RemoveFulfillmentPlacesResponse.newBuilder() to construct. + private RemoveFulfillmentPlacesResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RemoveFulfillmentPlacesResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RemoveFulfillmentPlacesResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RemoveFulfillmentPlacesResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.ProductServiceProto + .internal_static_google_cloud_retail_v2_RemoveFulfillmentPlacesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.ProductServiceProto + .internal_static_google_cloud_retail_v2_RemoveFulfillmentPlacesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.RemoveFulfillmentPlacesResponse.class, + com.google.cloud.retail.v2.RemoveFulfillmentPlacesResponse.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.retail.v2.RemoveFulfillmentPlacesResponse)) { + return super.equals(obj); + } + com.google.cloud.retail.v2.RemoveFulfillmentPlacesResponse other = + (com.google.cloud.retail.v2.RemoveFulfillmentPlacesResponse) obj; + + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2.RemoveFulfillmentPlacesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.RemoveFulfillmentPlacesResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.RemoveFulfillmentPlacesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.RemoveFulfillmentPlacesResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.RemoveFulfillmentPlacesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.RemoveFulfillmentPlacesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.RemoveFulfillmentPlacesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.RemoveFulfillmentPlacesResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.RemoveFulfillmentPlacesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.RemoveFulfillmentPlacesResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.RemoveFulfillmentPlacesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.RemoveFulfillmentPlacesResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2.RemoveFulfillmentPlacesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response of the RemoveFulfillmentPlacesRequest. Currently empty because there
+   * is no meaningful response populated from the [RemoveFulfillmentPlaces][]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2.RemoveFulfillmentPlacesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.RemoveFulfillmentPlacesResponse) + com.google.cloud.retail.v2.RemoveFulfillmentPlacesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.ProductServiceProto + .internal_static_google_cloud_retail_v2_RemoveFulfillmentPlacesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.ProductServiceProto + .internal_static_google_cloud_retail_v2_RemoveFulfillmentPlacesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.RemoveFulfillmentPlacesResponse.class, + com.google.cloud.retail.v2.RemoveFulfillmentPlacesResponse.Builder.class); + } + + // Construct using com.google.cloud.retail.v2.RemoveFulfillmentPlacesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2.ProductServiceProto + .internal_static_google_cloud_retail_v2_RemoveFulfillmentPlacesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2.RemoveFulfillmentPlacesResponse getDefaultInstanceForType() { + return com.google.cloud.retail.v2.RemoveFulfillmentPlacesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2.RemoveFulfillmentPlacesResponse build() { + com.google.cloud.retail.v2.RemoveFulfillmentPlacesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2.RemoveFulfillmentPlacesResponse buildPartial() { + com.google.cloud.retail.v2.RemoveFulfillmentPlacesResponse result = + new com.google.cloud.retail.v2.RemoveFulfillmentPlacesResponse(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.retail.v2.RemoveFulfillmentPlacesResponse) { + return mergeFrom((com.google.cloud.retail.v2.RemoveFulfillmentPlacesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2.RemoveFulfillmentPlacesResponse other) { + if (other == com.google.cloud.retail.v2.RemoveFulfillmentPlacesResponse.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.retail.v2.RemoveFulfillmentPlacesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2.RemoveFulfillmentPlacesResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.RemoveFulfillmentPlacesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.RemoveFulfillmentPlacesResponse) + private static final com.google.cloud.retail.v2.RemoveFulfillmentPlacesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2.RemoveFulfillmentPlacesResponse(); + } + + public static com.google.cloud.retail.v2.RemoveFulfillmentPlacesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RemoveFulfillmentPlacesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RemoveFulfillmentPlacesResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.retail.v2.RemoveFulfillmentPlacesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/RemoveFulfillmentPlacesResponseOrBuilder.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/RemoveFulfillmentPlacesResponseOrBuilder.java new file mode 100644 index 00000000..7eee2d9b --- /dev/null +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/RemoveFulfillmentPlacesResponseOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2/product_service.proto + +package com.google.cloud.retail.v2; + +public interface RemoveFulfillmentPlacesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2.RemoveFulfillmentPlacesResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/SearchRequest.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/SearchRequest.java new file mode 100644 index 00000000..d7e4409c --- /dev/null +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/SearchRequest.java @@ -0,0 +1,15557 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2/search_service.proto + +package com.google.cloud.retail.v2; + +/** + * + * + *
+ * Request message for
+ * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2.SearchRequest} + */ +public final class SearchRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.SearchRequest) + SearchRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use SearchRequest.newBuilder() to construct. + private SearchRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SearchRequest() { + placement_ = ""; + branch_ = ""; + query_ = ""; + visitorId_ = ""; + pageToken_ = ""; + filter_ = ""; + canonicalFilter_ = ""; + orderBy_ = ""; + facetSpecs_ = java.util.Collections.emptyList(); + variantRollupKeys_ = com.google.protobuf.LazyStringArrayList.EMPTY; + pageCategories_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SearchRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SearchRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + placement_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + branch_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + query_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + visitorId_ = s; + break; + } + case 42: + { + com.google.cloud.retail.v2.UserInfo.Builder subBuilder = null; + if (userInfo_ != null) { + subBuilder = userInfo_.toBuilder(); + } + userInfo_ = + input.readMessage( + com.google.cloud.retail.v2.UserInfo.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(userInfo_); + userInfo_ = subBuilder.buildPartial(); + } + + break; + } + case 56: + { + pageSize_ = input.readInt32(); + break; + } + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 72: + { + offset_ = input.readInt32(); + break; + } + case 82: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 90: + { + java.lang.String s = input.readStringRequireUtf8(); + + orderBy_ = s; + break; + } + case 98: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + facetSpecs_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + facetSpecs_.add( + input.readMessage( + com.google.cloud.retail.v2.SearchRequest.FacetSpec.parser(), + extensionRegistry)); + break; + } + case 106: + { + com.google.cloud.retail.v2.SearchRequest.BoostSpec.Builder subBuilder = null; + if (boostSpec_ != null) { + subBuilder = boostSpec_.toBuilder(); + } + boostSpec_ = + input.readMessage( + com.google.cloud.retail.v2.SearchRequest.BoostSpec.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(boostSpec_); + boostSpec_ = subBuilder.buildPartial(); + } + + break; + } + case 114: + { + com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Builder subBuilder = null; + if (queryExpansionSpec_ != null) { + subBuilder = queryExpansionSpec_.toBuilder(); + } + queryExpansionSpec_ = + input.readMessage( + com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(queryExpansionSpec_); + queryExpansionSpec_ = subBuilder.buildPartial(); + } + + break; + } + case 138: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + variantRollupKeys_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + variantRollupKeys_.add(s); + break; + } + case 170: + { + com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Builder subBuilder = null; + if (dynamicFacetSpec_ != null) { + subBuilder = dynamicFacetSpec_.toBuilder(); + } + dynamicFacetSpec_ = + input.readMessage( + com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(dynamicFacetSpec_); + dynamicFacetSpec_ = subBuilder.buildPartial(); + } + + break; + } + case 186: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + pageCategories_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000004; + } + pageCategories_.add(s); + break; + } + case 226: + { + java.lang.String s = input.readStringRequireUtf8(); + + canonicalFilter_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + facetSpecs_ = java.util.Collections.unmodifiableList(facetSpecs_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + variantRollupKeys_ = variantRollupKeys_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000004) != 0)) { + pageCategories_ = pageCategories_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.SearchRequest.class, + com.google.cloud.retail.v2.SearchRequest.Builder.class); + } + + public interface FacetSpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2.SearchRequest.FacetSpec) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. The facet key specification.
+     * 
+ * + * + * .google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the facetKey field is set. + */ + boolean hasFacetKey(); + /** + * + * + *
+     * Required. The facet key specification.
+     * 
+ * + * + * .google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The facetKey. + */ + com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey getFacetKey(); + /** + * + * + *
+     * Required. The facet key specification.
+     * 
+ * + * + * .google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKeyOrBuilder getFacetKeyOrBuilder(); + + /** + * + * + *
+     * Maximum of facet values that should be returned for this facet. If
+     * unspecified, defaults to 20. The maximum allowed value is 300. Values
+     * above 300 will be coerced to 300.
+     * If this field is negative, an INVALID_ARGUMENT is returned.
+     * 
+ * + * int32 limit = 2; + * + * @return The limit. + */ + int getLimit(); + + /** + * + * + *
+     * List of keys to exclude when faceting.
+     * By default,
+     * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
+     * is not excluded from the filter unless it is listed in this field.
+     * For example, suppose there are 100 products with color facet "Red" and
+     * 200 products with color facet "Blue". A query containing the filter
+     * "colorFamilies:ANY("Red")" and have "colorFamilies" as
+     * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
+     * will by default return the "Red" with count 100.
+     * If this field contains "colorFamilies", then the query returns both the
+     * "Red" with count 100 and "Blue" with count 200, because the
+     * "colorFamilies" key is now excluded from the filter.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @return A list containing the excludedFilterKeys. + */ + java.util.List getExcludedFilterKeysList(); + /** + * + * + *
+     * List of keys to exclude when faceting.
+     * By default,
+     * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
+     * is not excluded from the filter unless it is listed in this field.
+     * For example, suppose there are 100 products with color facet "Red" and
+     * 200 products with color facet "Blue". A query containing the filter
+     * "colorFamilies:ANY("Red")" and have "colorFamilies" as
+     * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
+     * will by default return the "Red" with count 100.
+     * If this field contains "colorFamilies", then the query returns both the
+     * "Red" with count 100 and "Blue" with count 200, because the
+     * "colorFamilies" key is now excluded from the filter.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @return The count of excludedFilterKeys. + */ + int getExcludedFilterKeysCount(); + /** + * + * + *
+     * List of keys to exclude when faceting.
+     * By default,
+     * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
+     * is not excluded from the filter unless it is listed in this field.
+     * For example, suppose there are 100 products with color facet "Red" and
+     * 200 products with color facet "Blue". A query containing the filter
+     * "colorFamilies:ANY("Red")" and have "colorFamilies" as
+     * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
+     * will by default return the "Red" with count 100.
+     * If this field contains "colorFamilies", then the query returns both the
+     * "Red" with count 100 and "Blue" with count 200, because the
+     * "colorFamilies" key is now excluded from the filter.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @param index The index of the element to return. + * @return The excludedFilterKeys at the given index. + */ + java.lang.String getExcludedFilterKeys(int index); + /** + * + * + *
+     * List of keys to exclude when faceting.
+     * By default,
+     * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
+     * is not excluded from the filter unless it is listed in this field.
+     * For example, suppose there are 100 products with color facet "Red" and
+     * 200 products with color facet "Blue". A query containing the filter
+     * "colorFamilies:ANY("Red")" and have "colorFamilies" as
+     * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
+     * will by default return the "Red" with count 100.
+     * If this field contains "colorFamilies", then the query returns both the
+     * "Red" with count 100 and "Blue" with count 200, because the
+     * "colorFamilies" key is now excluded from the filter.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @param index The index of the value to return. + * @return The bytes of the excludedFilterKeys at the given index. + */ + com.google.protobuf.ByteString getExcludedFilterKeysBytes(int index); + + /** + * + * + *
+     * Enables dynamic position for this facet. If set to true, the position of
+     * this facet among all facets in the response is determined by Google
+     * Retail Search. It will be ordered together with dynamic facets if dynamic
+     * facets is enabled. If set to false, the position of this facet in the
+     * response will be the same as in the request, and it will be ranked before
+     * the facets with dynamic position enable and all dynamic facets.
+     * For example, you may always want to have rating facet returned in
+     * the response, but it's not necessarily to always display the rating facet
+     * at the top. In that case, you can set enable_dynamic_position to true so
+     * that the position of rating facet in response will be determined by
+     * Google Retail Search.
+     * Another example, assuming you have the following facets in the request:
+     * * "rating", enable_dynamic_position = true
+     * * "price", enable_dynamic_position = false
+     * * "brands", enable_dynamic_position = false
+     * And also you have a dynamic facets enable, which will generate a facet
+     * 'gender'. Then the final order of the facets in the response can be
+     * ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
+     * "rating") depends on how Google Retail Search orders "gender" and
+     * "rating" facets. However, notice that "price" and "brands" will always be
+     * ranked at 1st and 2nd position since their enable_dynamic_position are
+     * false.
+     * 
+ * + * bool enable_dynamic_position = 4; + * + * @return The enableDynamicPosition. + */ + boolean getEnableDynamicPosition(); + } + /** + * + * + *
+   * A facet specification to perform faceted search.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2.SearchRequest.FacetSpec} + */ + public static final class FacetSpec extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.SearchRequest.FacetSpec) + FacetSpecOrBuilder { + private static final long serialVersionUID = 0L; + // Use FacetSpec.newBuilder() to construct. + private FacetSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FacetSpec() { + excludedFilterKeys_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FacetSpec(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private FacetSpec( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.Builder subBuilder = + null; + if (facetKey_ != null) { + subBuilder = facetKey_.toBuilder(); + } + facetKey_ = + input.readMessage( + com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(facetKey_); + facetKey_ = subBuilder.buildPartial(); + } + + break; + } + case 16: + { + limit_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + excludedFilterKeys_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + excludedFilterKeys_.add(s); + break; + } + case 32: + { + enableDynamicPosition_ = input.readBool(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + excludedFilterKeys_ = excludedFilterKeys_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchRequest_FacetSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchRequest_FacetSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.SearchRequest.FacetSpec.class, + com.google.cloud.retail.v2.SearchRequest.FacetSpec.Builder.class); + } + + public interface FacetKeyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Required. Supported textual and numerical facet keys in
+       * [Product][google.cloud.retail.v2.Product] object, over which the facet
+       * values are computed. Facet key is case-sensitive.
+       * Allowed facet keys when
+       * [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query]
+       * is not specified:
+       * * textual_field =<br>
+       *     <font color='grey'>
+       *     *# The
+       *     [Product.brands][google.cloud.retail.v2.Product.brands].<br>*
+       *     </font>
+       *     "brands";
+       *     <br>
+       *     <font color='categories'>
+       *     *# The
+       *     [Product.categories][google.cloud.retail.v2.Product.categories].<br>*
+       *     </font>
+       *     "categories";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The
+       *     [Audience.genders][google.cloud.retail.v2.Audience.genders].<br>*
+       *     </font>
+       *     | "genders";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The
+       *     [Audience.age_groups][google.cloud.retail.v2.Audience.age_groups].<br>*
+       *     </font>
+       *     | "ageGroups";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The
+       *     [Product.availability][google.cloud.retail.v2.Product.availability].
+       *     Value is one of<br>*
+       *     *# "IN_STOCK", "OUT_OF_STOCK", PREORDER", "BACKORDER".<br>*
+       *     </font>
+       *     | "availability";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The
+       *     [ColorInfo.color_families][google.cloud.retail.v2.ColorInfo.color_families].<br>*
+       *     </font>
+       *     | "colorFamilies";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The
+       *     [ColorInfo.colors][google.cloud.retail.v2.ColorInfo.colors].<br>*
+       *     </font>
+       *     | "colors";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The [Product.sizes][google.cloud.retail.v2.Product.sizes].<br>*
+       *     </font>
+       *     | "sizes";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The
+       *     [Product.materials][google.cloud.retail.v2.Product.materials].<br>*
+       *     </font>
+       *     | "materials";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The
+       *     [Product.patterns][google.cloud.retail.v2.Product.patterns].<br>*
+       *     </font>
+       *     | "patterns";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The
+       *     [Product.conditions][google.cloud.retail.v2.Product.conditions].<br>*
+       *     </font>
+       *     | "conditions";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The textual custom attribute in
+       *     [Product][google.cloud.retail.v2.Product] object. Key can<br>*
+       *     *# be any key in the
+       *     [Product.attributes][google.cloud.retail.v2.Product.attributes]
+       *     map<br>*
+       *     *# if the attribute values are textual.<br>*
+       *     *# map.<br>*
+       *     </font>
+       *     | "attributes.key";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The [FulfillmentInfo.ids][] for type
+       *     *# [FulfillmentInfo.Type.PICKUP_IN_STORE][].<br>*
+       *     </font>
+       *     | "pickupInStore";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The [FulfillmentInfo.ids][] for type
+       *     *# [FulfillmentInfo.Type.SHIP_TO_STORE][].<br>*
+       *     </font>
+       *     | "shipToStore";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The [FulfillmentInfo.ids][] for type
+       *     *# [FulfillmentInfo.Type.SAME_DAY_DELIVERY][].<br>*
+       *     </font>
+       *     | "sameDayDelivery";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The [FulfillmentInfo.ids][] for type
+       *     *# [FulfillmentInfo.Type.NEXT_DAY_DELIVERY][].<br>*
+       *     </font>
+       *     | "nextDayDelivery";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The [FulfillmentInfo.ids][] for type
+       *     *# [FulfillmentInfo.Type.CUSTOM_TYPE_1][].<br>*
+       *     </font>
+       *     | "customFulfillment1";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The [FulfillmentInfo.ids][] for type
+       *     *# [FulfillmentInfo.Type.CUSTOM_TYPE_2][].<br>*
+       *     </font>
+       *     | "customFulfillment2";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The [FulfillmentInfo.ids][] for type
+       *     *# [FulfillmentInfo.Type.CUSTOM_TYPE_3][].<br>*
+       *     </font>
+       *     | "customFulfillment3";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The [FulfillmentInfo.ids][] for type
+       *     *# [FulfillmentInfo.Type.CUSTOM_TYPE_4][].<br>*
+       *     </font>
+       *     | "customFulfillment4";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The [FulfillmentInfo.ids][] for type
+       *     *# [FulfillmentInfo.Type.CUSTOM_TYPE_5][].<br>*
+       *     </font>
+       *     | "customFulfillment5";
+       * * numerical_field =<br>
+       *     <font color='grey'>
+       *     *# The
+       *     [PriceInfo.price][google.cloud.retail.v2.PriceInfo.price].<br>*
+       *     </font>
+       *     "price";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The discount. Computed by (original_price-price)/price <br>*
+       *     </font>
+       *     "discount";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The
+       *     [Rating.average_rating][google.cloud.retail.v2.Rating.average_rating].<br>*
+       *     </font>
+       *     "rating";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The
+       *     [Rating.rating_count][google.cloud.retail.v2.Rating.rating_count].<br>*
+       *     </font>
+       *     "ratingCount";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The numerical custom attribute in
+       *     [Product][google.cloud.retail.v2.Product] object. Key can<br>*
+       *     *# be any key in the
+       *     [Product.attributes][google.cloud.retail.v2.Product.attributes]
+       *     map<br>*
+       *     *# if the attribute values are numerical.<br>*
+       *     </font>
+       *     | "attributes.key";
+       * 
+ * + * string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The key. + */ + java.lang.String getKey(); + /** + * + * + *
+       * Required. Supported textual and numerical facet keys in
+       * [Product][google.cloud.retail.v2.Product] object, over which the facet
+       * values are computed. Facet key is case-sensitive.
+       * Allowed facet keys when
+       * [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query]
+       * is not specified:
+       * * textual_field =<br>
+       *     <font color='grey'>
+       *     *# The
+       *     [Product.brands][google.cloud.retail.v2.Product.brands].<br>*
+       *     </font>
+       *     "brands";
+       *     <br>
+       *     <font color='categories'>
+       *     *# The
+       *     [Product.categories][google.cloud.retail.v2.Product.categories].<br>*
+       *     </font>
+       *     "categories";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The
+       *     [Audience.genders][google.cloud.retail.v2.Audience.genders].<br>*
+       *     </font>
+       *     | "genders";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The
+       *     [Audience.age_groups][google.cloud.retail.v2.Audience.age_groups].<br>*
+       *     </font>
+       *     | "ageGroups";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The
+       *     [Product.availability][google.cloud.retail.v2.Product.availability].
+       *     Value is one of<br>*
+       *     *# "IN_STOCK", "OUT_OF_STOCK", PREORDER", "BACKORDER".<br>*
+       *     </font>
+       *     | "availability";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The
+       *     [ColorInfo.color_families][google.cloud.retail.v2.ColorInfo.color_families].<br>*
+       *     </font>
+       *     | "colorFamilies";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The
+       *     [ColorInfo.colors][google.cloud.retail.v2.ColorInfo.colors].<br>*
+       *     </font>
+       *     | "colors";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The [Product.sizes][google.cloud.retail.v2.Product.sizes].<br>*
+       *     </font>
+       *     | "sizes";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The
+       *     [Product.materials][google.cloud.retail.v2.Product.materials].<br>*
+       *     </font>
+       *     | "materials";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The
+       *     [Product.patterns][google.cloud.retail.v2.Product.patterns].<br>*
+       *     </font>
+       *     | "patterns";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The
+       *     [Product.conditions][google.cloud.retail.v2.Product.conditions].<br>*
+       *     </font>
+       *     | "conditions";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The textual custom attribute in
+       *     [Product][google.cloud.retail.v2.Product] object. Key can<br>*
+       *     *# be any key in the
+       *     [Product.attributes][google.cloud.retail.v2.Product.attributes]
+       *     map<br>*
+       *     *# if the attribute values are textual.<br>*
+       *     *# map.<br>*
+       *     </font>
+       *     | "attributes.key";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The [FulfillmentInfo.ids][] for type
+       *     *# [FulfillmentInfo.Type.PICKUP_IN_STORE][].<br>*
+       *     </font>
+       *     | "pickupInStore";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The [FulfillmentInfo.ids][] for type
+       *     *# [FulfillmentInfo.Type.SHIP_TO_STORE][].<br>*
+       *     </font>
+       *     | "shipToStore";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The [FulfillmentInfo.ids][] for type
+       *     *# [FulfillmentInfo.Type.SAME_DAY_DELIVERY][].<br>*
+       *     </font>
+       *     | "sameDayDelivery";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The [FulfillmentInfo.ids][] for type
+       *     *# [FulfillmentInfo.Type.NEXT_DAY_DELIVERY][].<br>*
+       *     </font>
+       *     | "nextDayDelivery";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The [FulfillmentInfo.ids][] for type
+       *     *# [FulfillmentInfo.Type.CUSTOM_TYPE_1][].<br>*
+       *     </font>
+       *     | "customFulfillment1";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The [FulfillmentInfo.ids][] for type
+       *     *# [FulfillmentInfo.Type.CUSTOM_TYPE_2][].<br>*
+       *     </font>
+       *     | "customFulfillment2";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The [FulfillmentInfo.ids][] for type
+       *     *# [FulfillmentInfo.Type.CUSTOM_TYPE_3][].<br>*
+       *     </font>
+       *     | "customFulfillment3";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The [FulfillmentInfo.ids][] for type
+       *     *# [FulfillmentInfo.Type.CUSTOM_TYPE_4][].<br>*
+       *     </font>
+       *     | "customFulfillment4";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The [FulfillmentInfo.ids][] for type
+       *     *# [FulfillmentInfo.Type.CUSTOM_TYPE_5][].<br>*
+       *     </font>
+       *     | "customFulfillment5";
+       * * numerical_field =<br>
+       *     <font color='grey'>
+       *     *# The
+       *     [PriceInfo.price][google.cloud.retail.v2.PriceInfo.price].<br>*
+       *     </font>
+       *     "price";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The discount. Computed by (original_price-price)/price <br>*
+       *     </font>
+       *     "discount";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The
+       *     [Rating.average_rating][google.cloud.retail.v2.Rating.average_rating].<br>*
+       *     </font>
+       *     "rating";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The
+       *     [Rating.rating_count][google.cloud.retail.v2.Rating.rating_count].<br>*
+       *     </font>
+       *     "ratingCount";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The numerical custom attribute in
+       *     [Product][google.cloud.retail.v2.Product] object. Key can<br>*
+       *     *# be any key in the
+       *     [Product.attributes][google.cloud.retail.v2.Product.attributes]
+       *     map<br>*
+       *     *# if the attribute values are numerical.<br>*
+       *     </font>
+       *     | "attributes.key";
+       * 
+ * + * string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for key. + */ + com.google.protobuf.ByteString getKeyBytes(); + + /** + * + * + *
+       * Set only if values should be bucketized into intervals. Must be set
+       * for facets with numerical values. Must not be set for facet with text
+       * values. Maximum number of intervals is 30.
+       * 
+ * + * repeated .google.cloud.retail.v2.Interval intervals = 2; + */ + java.util.List getIntervalsList(); + /** + * + * + *
+       * Set only if values should be bucketized into intervals. Must be set
+       * for facets with numerical values. Must not be set for facet with text
+       * values. Maximum number of intervals is 30.
+       * 
+ * + * repeated .google.cloud.retail.v2.Interval intervals = 2; + */ + com.google.cloud.retail.v2.Interval getIntervals(int index); + /** + * + * + *
+       * Set only if values should be bucketized into intervals. Must be set
+       * for facets with numerical values. Must not be set for facet with text
+       * values. Maximum number of intervals is 30.
+       * 
+ * + * repeated .google.cloud.retail.v2.Interval intervals = 2; + */ + int getIntervalsCount(); + /** + * + * + *
+       * Set only if values should be bucketized into intervals. Must be set
+       * for facets with numerical values. Must not be set for facet with text
+       * values. Maximum number of intervals is 30.
+       * 
+ * + * repeated .google.cloud.retail.v2.Interval intervals = 2; + */ + java.util.List + getIntervalsOrBuilderList(); + /** + * + * + *
+       * Set only if values should be bucketized into intervals. Must be set
+       * for facets with numerical values. Must not be set for facet with text
+       * values. Maximum number of intervals is 30.
+       * 
+ * + * repeated .google.cloud.retail.v2.Interval intervals = 2; + */ + com.google.cloud.retail.v2.IntervalOrBuilder getIntervalsOrBuilder(int index); + + /** + * + * + *
+       * Only get facet for the given restricted values. For example, when using
+       * "pickupInStore" as key and set restricted values to
+       * ["store123", "store456"], only facets for "store123" and "store456" are
+       * returned. Only supported on textual fields and fulfillments.
+       * Maximum is 20.
+       * Must be set for the fulfillment facet keys:
+       * * pickupInStore
+       * * shipToStore
+       * * sameDayDelivery
+       * * nextDayDelivery
+       * * customFulfillment1
+       * * customFulfillment2
+       * * customFulfillment3
+       * * customFulfillment4
+       * * customFulfillment5
+       * 
+ * + * repeated string restricted_values = 3; + * + * @return A list containing the restrictedValues. + */ + java.util.List getRestrictedValuesList(); + /** + * + * + *
+       * Only get facet for the given restricted values. For example, when using
+       * "pickupInStore" as key and set restricted values to
+       * ["store123", "store456"], only facets for "store123" and "store456" are
+       * returned. Only supported on textual fields and fulfillments.
+       * Maximum is 20.
+       * Must be set for the fulfillment facet keys:
+       * * pickupInStore
+       * * shipToStore
+       * * sameDayDelivery
+       * * nextDayDelivery
+       * * customFulfillment1
+       * * customFulfillment2
+       * * customFulfillment3
+       * * customFulfillment4
+       * * customFulfillment5
+       * 
+ * + * repeated string restricted_values = 3; + * + * @return The count of restrictedValues. + */ + int getRestrictedValuesCount(); + /** + * + * + *
+       * Only get facet for the given restricted values. For example, when using
+       * "pickupInStore" as key and set restricted values to
+       * ["store123", "store456"], only facets for "store123" and "store456" are
+       * returned. Only supported on textual fields and fulfillments.
+       * Maximum is 20.
+       * Must be set for the fulfillment facet keys:
+       * * pickupInStore
+       * * shipToStore
+       * * sameDayDelivery
+       * * nextDayDelivery
+       * * customFulfillment1
+       * * customFulfillment2
+       * * customFulfillment3
+       * * customFulfillment4
+       * * customFulfillment5
+       * 
+ * + * repeated string restricted_values = 3; + * + * @param index The index of the element to return. + * @return The restrictedValues at the given index. + */ + java.lang.String getRestrictedValues(int index); + /** + * + * + *
+       * Only get facet for the given restricted values. For example, when using
+       * "pickupInStore" as key and set restricted values to
+       * ["store123", "store456"], only facets for "store123" and "store456" are
+       * returned. Only supported on textual fields and fulfillments.
+       * Maximum is 20.
+       * Must be set for the fulfillment facet keys:
+       * * pickupInStore
+       * * shipToStore
+       * * sameDayDelivery
+       * * nextDayDelivery
+       * * customFulfillment1
+       * * customFulfillment2
+       * * customFulfillment3
+       * * customFulfillment4
+       * * customFulfillment5
+       * 
+ * + * repeated string restricted_values = 3; + * + * @param index The index of the value to return. + * @return The bytes of the restrictedValues at the given index. + */ + com.google.protobuf.ByteString getRestrictedValuesBytes(int index); + + /** + * + * + *
+       * Only get facet values that start with the given string prefix. For
+       * example, suppose "categories" has three values "Women > Shoe",
+       * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the
+       * "categories" facet will give only "Women > Shoe" and "Women > Dress".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string prefixes = 8; + * + * @return A list containing the prefixes. + */ + java.util.List getPrefixesList(); + /** + * + * + *
+       * Only get facet values that start with the given string prefix. For
+       * example, suppose "categories" has three values "Women > Shoe",
+       * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the
+       * "categories" facet will give only "Women > Shoe" and "Women > Dress".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string prefixes = 8; + * + * @return The count of prefixes. + */ + int getPrefixesCount(); + /** + * + * + *
+       * Only get facet values that start with the given string prefix. For
+       * example, suppose "categories" has three values "Women > Shoe",
+       * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the
+       * "categories" facet will give only "Women > Shoe" and "Women > Dress".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string prefixes = 8; + * + * @param index The index of the element to return. + * @return The prefixes at the given index. + */ + java.lang.String getPrefixes(int index); + /** + * + * + *
+       * Only get facet values that start with the given string prefix. For
+       * example, suppose "categories" has three values "Women > Shoe",
+       * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the
+       * "categories" facet will give only "Women > Shoe" and "Women > Dress".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string prefixes = 8; + * + * @param index The index of the value to return. + * @return The bytes of the prefixes at the given index. + */ + com.google.protobuf.ByteString getPrefixesBytes(int index); + + /** + * + * + *
+       * Only get facet values that contains the given strings. For example,
+       * suppose "categories" has three values "Women > Shoe",
+       * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the
+       * "categories" facet will give only "Women > Shoe" and "Men > Shoe".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string contains = 9; + * + * @return A list containing the contains. + */ + java.util.List getContainsList(); + /** + * + * + *
+       * Only get facet values that contains the given strings. For example,
+       * suppose "categories" has three values "Women > Shoe",
+       * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the
+       * "categories" facet will give only "Women > Shoe" and "Men > Shoe".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string contains = 9; + * + * @return The count of contains. + */ + int getContainsCount(); + /** + * + * + *
+       * Only get facet values that contains the given strings. For example,
+       * suppose "categories" has three values "Women > Shoe",
+       * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the
+       * "categories" facet will give only "Women > Shoe" and "Men > Shoe".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string contains = 9; + * + * @param index The index of the element to return. + * @return The contains at the given index. + */ + java.lang.String getContains(int index); + /** + * + * + *
+       * Only get facet values that contains the given strings. For example,
+       * suppose "categories" has three values "Women > Shoe",
+       * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the
+       * "categories" facet will give only "Women > Shoe" and "Men > Shoe".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string contains = 9; + * + * @param index The index of the value to return. + * @return The bytes of the contains at the given index. + */ + com.google.protobuf.ByteString getContainsBytes(int index); + + /** + * + * + *
+       * The order in which [Facet.values][] are returned.
+       * Allowed values are:
+       * * "count desc", which means order by [Facet.FacetValue.count][]
+       * descending.
+       * * "value desc", which means order by [Facet.FacetValue.value][]
+       * descending.
+       *   Only applies to textual facets.
+       * If not set, textual values are sorted in [natural
+       * order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
+       * intervals are sorted in the order given by
+       * [FacetSpec.FacetKey.intervals][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.intervals];
+       * [FulfillmentInfo.ids][] are sorted in the order given by
+       * [FacetSpec.FacetKey.restricted_values][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.restricted_values].
+       * 
+ * + * string order_by = 4; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+       * The order in which [Facet.values][] are returned.
+       * Allowed values are:
+       * * "count desc", which means order by [Facet.FacetValue.count][]
+       * descending.
+       * * "value desc", which means order by [Facet.FacetValue.value][]
+       * descending.
+       *   Only applies to textual facets.
+       * If not set, textual values are sorted in [natural
+       * order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
+       * intervals are sorted in the order given by
+       * [FacetSpec.FacetKey.intervals][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.intervals];
+       * [FulfillmentInfo.ids][] are sorted in the order given by
+       * [FacetSpec.FacetKey.restricted_values][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.restricted_values].
+       * 
+ * + * string order_by = 4; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); + + /** + * + * + *
+       * The query that is used to compute facet for the given facet key.
+       * When provided, it will override the default behavior of facet
+       * computation. The query syntax is the same as a filter expression. See
+       * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
+       * detail syntax and limitations. Notice that there is no limitation on
+       * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
+       * when query is specified.
+       * In the response, [FacetValue.value][] will be always "1" and
+       * [FacetValue.count][] will be the number of results that matches the
+       * query.
+       * For example, you can set a customized facet for "shipToStore",
+       * where
+       * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
+       * is "customizedShipToStore", and
+       * [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query]
+       * is "availability: ANY(\"IN_STOCK\") AND shipToStore: ANY(\"123\")".
+       * Then the facet will count the products that are both in stock and ship
+       * to store "123".
+       * 
+ * + * string query = 5; + * + * @return The query. + */ + java.lang.String getQuery(); + /** + * + * + *
+       * The query that is used to compute facet for the given facet key.
+       * When provided, it will override the default behavior of facet
+       * computation. The query syntax is the same as a filter expression. See
+       * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
+       * detail syntax and limitations. Notice that there is no limitation on
+       * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
+       * when query is specified.
+       * In the response, [FacetValue.value][] will be always "1" and
+       * [FacetValue.count][] will be the number of results that matches the
+       * query.
+       * For example, you can set a customized facet for "shipToStore",
+       * where
+       * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
+       * is "customizedShipToStore", and
+       * [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query]
+       * is "availability: ANY(\"IN_STOCK\") AND shipToStore: ANY(\"123\")".
+       * Then the facet will count the products that are both in stock and ship
+       * to store "123".
+       * 
+ * + * string query = 5; + * + * @return The bytes for query. + */ + com.google.protobuf.ByteString getQueryBytes(); + } + /** + * + * + *
+     * Specifies how a facet is computed.
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey} + */ + public static final class FacetKey extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey) + FacetKeyOrBuilder { + private static final long serialVersionUID = 0L; + // Use FacetKey.newBuilder() to construct. + private FacetKey(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FacetKey() { + key_ = ""; + intervals_ = java.util.Collections.emptyList(); + restrictedValues_ = com.google.protobuf.LazyStringArrayList.EMPTY; + prefixes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + contains_ = com.google.protobuf.LazyStringArrayList.EMPTY; + orderBy_ = ""; + query_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FacetKey(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private FacetKey( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + key_ = s; + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + intervals_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + intervals_.add( + input.readMessage( + com.google.cloud.retail.v2.Interval.parser(), extensionRegistry)); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + restrictedValues_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + restrictedValues_.add(s); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + orderBy_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + query_ = s; + break; + } + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + prefixes_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000004; + } + prefixes_.add(s); + break; + } + case 74: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000008) != 0)) { + contains_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000008; + } + contains_.add(s); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + intervals_ = java.util.Collections.unmodifiableList(intervals_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + restrictedValues_ = restrictedValues_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000004) != 0)) { + prefixes_ = prefixes_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000008) != 0)) { + contains_ = contains_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchRequest_FacetSpec_FacetKey_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchRequest_FacetSpec_FacetKey_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.class, + com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.Builder.class); + } + + public static final int KEY_FIELD_NUMBER = 1; + private volatile java.lang.Object key_; + /** + * + * + *
+       * Required. Supported textual and numerical facet keys in
+       * [Product][google.cloud.retail.v2.Product] object, over which the facet
+       * values are computed. Facet key is case-sensitive.
+       * Allowed facet keys when
+       * [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query]
+       * is not specified:
+       * * textual_field =<br>
+       *     <font color='grey'>
+       *     *# The
+       *     [Product.brands][google.cloud.retail.v2.Product.brands].<br>*
+       *     </font>
+       *     "brands";
+       *     <br>
+       *     <font color='categories'>
+       *     *# The
+       *     [Product.categories][google.cloud.retail.v2.Product.categories].<br>*
+       *     </font>
+       *     "categories";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The
+       *     [Audience.genders][google.cloud.retail.v2.Audience.genders].<br>*
+       *     </font>
+       *     | "genders";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The
+       *     [Audience.age_groups][google.cloud.retail.v2.Audience.age_groups].<br>*
+       *     </font>
+       *     | "ageGroups";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The
+       *     [Product.availability][google.cloud.retail.v2.Product.availability].
+       *     Value is one of<br>*
+       *     *# "IN_STOCK", "OUT_OF_STOCK", PREORDER", "BACKORDER".<br>*
+       *     </font>
+       *     | "availability";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The
+       *     [ColorInfo.color_families][google.cloud.retail.v2.ColorInfo.color_families].<br>*
+       *     </font>
+       *     | "colorFamilies";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The
+       *     [ColorInfo.colors][google.cloud.retail.v2.ColorInfo.colors].<br>*
+       *     </font>
+       *     | "colors";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The [Product.sizes][google.cloud.retail.v2.Product.sizes].<br>*
+       *     </font>
+       *     | "sizes";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The
+       *     [Product.materials][google.cloud.retail.v2.Product.materials].<br>*
+       *     </font>
+       *     | "materials";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The
+       *     [Product.patterns][google.cloud.retail.v2.Product.patterns].<br>*
+       *     </font>
+       *     | "patterns";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The
+       *     [Product.conditions][google.cloud.retail.v2.Product.conditions].<br>*
+       *     </font>
+       *     | "conditions";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The textual custom attribute in
+       *     [Product][google.cloud.retail.v2.Product] object. Key can<br>*
+       *     *# be any key in the
+       *     [Product.attributes][google.cloud.retail.v2.Product.attributes]
+       *     map<br>*
+       *     *# if the attribute values are textual.<br>*
+       *     *# map.<br>*
+       *     </font>
+       *     | "attributes.key";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The [FulfillmentInfo.ids][] for type
+       *     *# [FulfillmentInfo.Type.PICKUP_IN_STORE][].<br>*
+       *     </font>
+       *     | "pickupInStore";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The [FulfillmentInfo.ids][] for type
+       *     *# [FulfillmentInfo.Type.SHIP_TO_STORE][].<br>*
+       *     </font>
+       *     | "shipToStore";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The [FulfillmentInfo.ids][] for type
+       *     *# [FulfillmentInfo.Type.SAME_DAY_DELIVERY][].<br>*
+       *     </font>
+       *     | "sameDayDelivery";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The [FulfillmentInfo.ids][] for type
+       *     *# [FulfillmentInfo.Type.NEXT_DAY_DELIVERY][].<br>*
+       *     </font>
+       *     | "nextDayDelivery";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The [FulfillmentInfo.ids][] for type
+       *     *# [FulfillmentInfo.Type.CUSTOM_TYPE_1][].<br>*
+       *     </font>
+       *     | "customFulfillment1";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The [FulfillmentInfo.ids][] for type
+       *     *# [FulfillmentInfo.Type.CUSTOM_TYPE_2][].<br>*
+       *     </font>
+       *     | "customFulfillment2";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The [FulfillmentInfo.ids][] for type
+       *     *# [FulfillmentInfo.Type.CUSTOM_TYPE_3][].<br>*
+       *     </font>
+       *     | "customFulfillment3";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The [FulfillmentInfo.ids][] for type
+       *     *# [FulfillmentInfo.Type.CUSTOM_TYPE_4][].<br>*
+       *     </font>
+       *     | "customFulfillment4";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The [FulfillmentInfo.ids][] for type
+       *     *# [FulfillmentInfo.Type.CUSTOM_TYPE_5][].<br>*
+       *     </font>
+       *     | "customFulfillment5";
+       * * numerical_field =<br>
+       *     <font color='grey'>
+       *     *# The
+       *     [PriceInfo.price][google.cloud.retail.v2.PriceInfo.price].<br>*
+       *     </font>
+       *     "price";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The discount. Computed by (original_price-price)/price <br>*
+       *     </font>
+       *     "discount";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The
+       *     [Rating.average_rating][google.cloud.retail.v2.Rating.average_rating].<br>*
+       *     </font>
+       *     "rating";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The
+       *     [Rating.rating_count][google.cloud.retail.v2.Rating.rating_count].<br>*
+       *     </font>
+       *     "ratingCount";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The numerical custom attribute in
+       *     [Product][google.cloud.retail.v2.Product] object. Key can<br>*
+       *     *# be any key in the
+       *     [Product.attributes][google.cloud.retail.v2.Product.attributes]
+       *     map<br>*
+       *     *# if the attribute values are numerical.<br>*
+       *     </font>
+       *     | "attributes.key";
+       * 
+ * + * string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The key. + */ + @java.lang.Override + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } + } + /** + * + * + *
+       * Required. Supported textual and numerical facet keys in
+       * [Product][google.cloud.retail.v2.Product] object, over which the facet
+       * values are computed. Facet key is case-sensitive.
+       * Allowed facet keys when
+       * [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query]
+       * is not specified:
+       * * textual_field =<br>
+       *     <font color='grey'>
+       *     *# The
+       *     [Product.brands][google.cloud.retail.v2.Product.brands].<br>*
+       *     </font>
+       *     "brands";
+       *     <br>
+       *     <font color='categories'>
+       *     *# The
+       *     [Product.categories][google.cloud.retail.v2.Product.categories].<br>*
+       *     </font>
+       *     "categories";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The
+       *     [Audience.genders][google.cloud.retail.v2.Audience.genders].<br>*
+       *     </font>
+       *     | "genders";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The
+       *     [Audience.age_groups][google.cloud.retail.v2.Audience.age_groups].<br>*
+       *     </font>
+       *     | "ageGroups";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The
+       *     [Product.availability][google.cloud.retail.v2.Product.availability].
+       *     Value is one of<br>*
+       *     *# "IN_STOCK", "OUT_OF_STOCK", PREORDER", "BACKORDER".<br>*
+       *     </font>
+       *     | "availability";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The
+       *     [ColorInfo.color_families][google.cloud.retail.v2.ColorInfo.color_families].<br>*
+       *     </font>
+       *     | "colorFamilies";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The
+       *     [ColorInfo.colors][google.cloud.retail.v2.ColorInfo.colors].<br>*
+       *     </font>
+       *     | "colors";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The [Product.sizes][google.cloud.retail.v2.Product.sizes].<br>*
+       *     </font>
+       *     | "sizes";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The
+       *     [Product.materials][google.cloud.retail.v2.Product.materials].<br>*
+       *     </font>
+       *     | "materials";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The
+       *     [Product.patterns][google.cloud.retail.v2.Product.patterns].<br>*
+       *     </font>
+       *     | "patterns";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The
+       *     [Product.conditions][google.cloud.retail.v2.Product.conditions].<br>*
+       *     </font>
+       *     | "conditions";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The textual custom attribute in
+       *     [Product][google.cloud.retail.v2.Product] object. Key can<br>*
+       *     *# be any key in the
+       *     [Product.attributes][google.cloud.retail.v2.Product.attributes]
+       *     map<br>*
+       *     *# if the attribute values are textual.<br>*
+       *     *# map.<br>*
+       *     </font>
+       *     | "attributes.key";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The [FulfillmentInfo.ids][] for type
+       *     *# [FulfillmentInfo.Type.PICKUP_IN_STORE][].<br>*
+       *     </font>
+       *     | "pickupInStore";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The [FulfillmentInfo.ids][] for type
+       *     *# [FulfillmentInfo.Type.SHIP_TO_STORE][].<br>*
+       *     </font>
+       *     | "shipToStore";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The [FulfillmentInfo.ids][] for type
+       *     *# [FulfillmentInfo.Type.SAME_DAY_DELIVERY][].<br>*
+       *     </font>
+       *     | "sameDayDelivery";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The [FulfillmentInfo.ids][] for type
+       *     *# [FulfillmentInfo.Type.NEXT_DAY_DELIVERY][].<br>*
+       *     </font>
+       *     | "nextDayDelivery";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The [FulfillmentInfo.ids][] for type
+       *     *# [FulfillmentInfo.Type.CUSTOM_TYPE_1][].<br>*
+       *     </font>
+       *     | "customFulfillment1";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The [FulfillmentInfo.ids][] for type
+       *     *# [FulfillmentInfo.Type.CUSTOM_TYPE_2][].<br>*
+       *     </font>
+       *     | "customFulfillment2";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The [FulfillmentInfo.ids][] for type
+       *     *# [FulfillmentInfo.Type.CUSTOM_TYPE_3][].<br>*
+       *     </font>
+       *     | "customFulfillment3";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The [FulfillmentInfo.ids][] for type
+       *     *# [FulfillmentInfo.Type.CUSTOM_TYPE_4][].<br>*
+       *     </font>
+       *     | "customFulfillment4";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The [FulfillmentInfo.ids][] for type
+       *     *# [FulfillmentInfo.Type.CUSTOM_TYPE_5][].<br>*
+       *     </font>
+       *     | "customFulfillment5";
+       * * numerical_field =<br>
+       *     <font color='grey'>
+       *     *# The
+       *     [PriceInfo.price][google.cloud.retail.v2.PriceInfo.price].<br>*
+       *     </font>
+       *     "price";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The discount. Computed by (original_price-price)/price <br>*
+       *     </font>
+       *     "discount";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The
+       *     [Rating.average_rating][google.cloud.retail.v2.Rating.average_rating].<br>*
+       *     </font>
+       *     "rating";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The
+       *     [Rating.rating_count][google.cloud.retail.v2.Rating.rating_count].<br>*
+       *     </font>
+       *     "ratingCount";
+       *     <br>
+       *     <font color='grey'>
+       *     *# The numerical custom attribute in
+       *     [Product][google.cloud.retail.v2.Product] object. Key can<br>*
+       *     *# be any key in the
+       *     [Product.attributes][google.cloud.retail.v2.Product.attributes]
+       *     map<br>*
+       *     *# if the attribute values are numerical.<br>*
+       *     </font>
+       *     | "attributes.key";
+       * 
+ * + * string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INTERVALS_FIELD_NUMBER = 2; + private java.util.List intervals_; + /** + * + * + *
+       * Set only if values should be bucketized into intervals. Must be set
+       * for facets with numerical values. Must not be set for facet with text
+       * values. Maximum number of intervals is 30.
+       * 
+ * + * repeated .google.cloud.retail.v2.Interval intervals = 2; + */ + @java.lang.Override + public java.util.List getIntervalsList() { + return intervals_; + } + /** + * + * + *
+       * Set only if values should be bucketized into intervals. Must be set
+       * for facets with numerical values. Must not be set for facet with text
+       * values. Maximum number of intervals is 30.
+       * 
+ * + * repeated .google.cloud.retail.v2.Interval intervals = 2; + */ + @java.lang.Override + public java.util.List + getIntervalsOrBuilderList() { + return intervals_; + } + /** + * + * + *
+       * Set only if values should be bucketized into intervals. Must be set
+       * for facets with numerical values. Must not be set for facet with text
+       * values. Maximum number of intervals is 30.
+       * 
+ * + * repeated .google.cloud.retail.v2.Interval intervals = 2; + */ + @java.lang.Override + public int getIntervalsCount() { + return intervals_.size(); + } + /** + * + * + *
+       * Set only if values should be bucketized into intervals. Must be set
+       * for facets with numerical values. Must not be set for facet with text
+       * values. Maximum number of intervals is 30.
+       * 
+ * + * repeated .google.cloud.retail.v2.Interval intervals = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2.Interval getIntervals(int index) { + return intervals_.get(index); + } + /** + * + * + *
+       * Set only if values should be bucketized into intervals. Must be set
+       * for facets with numerical values. Must not be set for facet with text
+       * values. Maximum number of intervals is 30.
+       * 
+ * + * repeated .google.cloud.retail.v2.Interval intervals = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2.IntervalOrBuilder getIntervalsOrBuilder(int index) { + return intervals_.get(index); + } + + public static final int RESTRICTED_VALUES_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList restrictedValues_; + /** + * + * + *
+       * Only get facet for the given restricted values. For example, when using
+       * "pickupInStore" as key and set restricted values to
+       * ["store123", "store456"], only facets for "store123" and "store456" are
+       * returned. Only supported on textual fields and fulfillments.
+       * Maximum is 20.
+       * Must be set for the fulfillment facet keys:
+       * * pickupInStore
+       * * shipToStore
+       * * sameDayDelivery
+       * * nextDayDelivery
+       * * customFulfillment1
+       * * customFulfillment2
+       * * customFulfillment3
+       * * customFulfillment4
+       * * customFulfillment5
+       * 
+ * + * repeated string restricted_values = 3; + * + * @return A list containing the restrictedValues. + */ + public com.google.protobuf.ProtocolStringList getRestrictedValuesList() { + return restrictedValues_; + } + /** + * + * + *
+       * Only get facet for the given restricted values. For example, when using
+       * "pickupInStore" as key and set restricted values to
+       * ["store123", "store456"], only facets for "store123" and "store456" are
+       * returned. Only supported on textual fields and fulfillments.
+       * Maximum is 20.
+       * Must be set for the fulfillment facet keys:
+       * * pickupInStore
+       * * shipToStore
+       * * sameDayDelivery
+       * * nextDayDelivery
+       * * customFulfillment1
+       * * customFulfillment2
+       * * customFulfillment3
+       * * customFulfillment4
+       * * customFulfillment5
+       * 
+ * + * repeated string restricted_values = 3; + * + * @return The count of restrictedValues. + */ + public int getRestrictedValuesCount() { + return restrictedValues_.size(); + } + /** + * + * + *
+       * Only get facet for the given restricted values. For example, when using
+       * "pickupInStore" as key and set restricted values to
+       * ["store123", "store456"], only facets for "store123" and "store456" are
+       * returned. Only supported on textual fields and fulfillments.
+       * Maximum is 20.
+       * Must be set for the fulfillment facet keys:
+       * * pickupInStore
+       * * shipToStore
+       * * sameDayDelivery
+       * * nextDayDelivery
+       * * customFulfillment1
+       * * customFulfillment2
+       * * customFulfillment3
+       * * customFulfillment4
+       * * customFulfillment5
+       * 
+ * + * repeated string restricted_values = 3; + * + * @param index The index of the element to return. + * @return The restrictedValues at the given index. + */ + public java.lang.String getRestrictedValues(int index) { + return restrictedValues_.get(index); + } + /** + * + * + *
+       * Only get facet for the given restricted values. For example, when using
+       * "pickupInStore" as key and set restricted values to
+       * ["store123", "store456"], only facets for "store123" and "store456" are
+       * returned. Only supported on textual fields and fulfillments.
+       * Maximum is 20.
+       * Must be set for the fulfillment facet keys:
+       * * pickupInStore
+       * * shipToStore
+       * * sameDayDelivery
+       * * nextDayDelivery
+       * * customFulfillment1
+       * * customFulfillment2
+       * * customFulfillment3
+       * * customFulfillment4
+       * * customFulfillment5
+       * 
+ * + * repeated string restricted_values = 3; + * + * @param index The index of the value to return. + * @return The bytes of the restrictedValues at the given index. + */ + public com.google.protobuf.ByteString getRestrictedValuesBytes(int index) { + return restrictedValues_.getByteString(index); + } + + public static final int PREFIXES_FIELD_NUMBER = 8; + private com.google.protobuf.LazyStringList prefixes_; + /** + * + * + *
+       * Only get facet values that start with the given string prefix. For
+       * example, suppose "categories" has three values "Women > Shoe",
+       * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the
+       * "categories" facet will give only "Women > Shoe" and "Women > Dress".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string prefixes = 8; + * + * @return A list containing the prefixes. + */ + public com.google.protobuf.ProtocolStringList getPrefixesList() { + return prefixes_; + } + /** + * + * + *
+       * Only get facet values that start with the given string prefix. For
+       * example, suppose "categories" has three values "Women > Shoe",
+       * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the
+       * "categories" facet will give only "Women > Shoe" and "Women > Dress".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string prefixes = 8; + * + * @return The count of prefixes. + */ + public int getPrefixesCount() { + return prefixes_.size(); + } + /** + * + * + *
+       * Only get facet values that start with the given string prefix. For
+       * example, suppose "categories" has three values "Women > Shoe",
+       * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the
+       * "categories" facet will give only "Women > Shoe" and "Women > Dress".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string prefixes = 8; + * + * @param index The index of the element to return. + * @return The prefixes at the given index. + */ + public java.lang.String getPrefixes(int index) { + return prefixes_.get(index); + } + /** + * + * + *
+       * Only get facet values that start with the given string prefix. For
+       * example, suppose "categories" has three values "Women > Shoe",
+       * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the
+       * "categories" facet will give only "Women > Shoe" and "Women > Dress".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string prefixes = 8; + * + * @param index The index of the value to return. + * @return The bytes of the prefixes at the given index. + */ + public com.google.protobuf.ByteString getPrefixesBytes(int index) { + return prefixes_.getByteString(index); + } + + public static final int CONTAINS_FIELD_NUMBER = 9; + private com.google.protobuf.LazyStringList contains_; + /** + * + * + *
+       * Only get facet values that contains the given strings. For example,
+       * suppose "categories" has three values "Women > Shoe",
+       * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the
+       * "categories" facet will give only "Women > Shoe" and "Men > Shoe".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string contains = 9; + * + * @return A list containing the contains. + */ + public com.google.protobuf.ProtocolStringList getContainsList() { + return contains_; + } + /** + * + * + *
+       * Only get facet values that contains the given strings. For example,
+       * suppose "categories" has three values "Women > Shoe",
+       * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the
+       * "categories" facet will give only "Women > Shoe" and "Men > Shoe".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string contains = 9; + * + * @return The count of contains. + */ + public int getContainsCount() { + return contains_.size(); + } + /** + * + * + *
+       * Only get facet values that contains the given strings. For example,
+       * suppose "categories" has three values "Women > Shoe",
+       * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the
+       * "categories" facet will give only "Women > Shoe" and "Men > Shoe".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string contains = 9; + * + * @param index The index of the element to return. + * @return The contains at the given index. + */ + public java.lang.String getContains(int index) { + return contains_.get(index); + } + /** + * + * + *
+       * Only get facet values that contains the given strings. For example,
+       * suppose "categories" has three values "Women > Shoe",
+       * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the
+       * "categories" facet will give only "Women > Shoe" and "Men > Shoe".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string contains = 9; + * + * @param index The index of the value to return. + * @return The bytes of the contains at the given index. + */ + public com.google.protobuf.ByteString getContainsBytes(int index) { + return contains_.getByteString(index); + } + + public static final int ORDER_BY_FIELD_NUMBER = 4; + private volatile java.lang.Object orderBy_; + /** + * + * + *
+       * The order in which [Facet.values][] are returned.
+       * Allowed values are:
+       * * "count desc", which means order by [Facet.FacetValue.count][]
+       * descending.
+       * * "value desc", which means order by [Facet.FacetValue.value][]
+       * descending.
+       *   Only applies to textual facets.
+       * If not set, textual values are sorted in [natural
+       * order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
+       * intervals are sorted in the order given by
+       * [FacetSpec.FacetKey.intervals][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.intervals];
+       * [FulfillmentInfo.ids][] are sorted in the order given by
+       * [FacetSpec.FacetKey.restricted_values][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.restricted_values].
+       * 
+ * + * string order_by = 4; + * + * @return The orderBy. + */ + @java.lang.Override + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } + } + /** + * + * + *
+       * The order in which [Facet.values][] are returned.
+       * Allowed values are:
+       * * "count desc", which means order by [Facet.FacetValue.count][]
+       * descending.
+       * * "value desc", which means order by [Facet.FacetValue.value][]
+       * descending.
+       *   Only applies to textual facets.
+       * If not set, textual values are sorted in [natural
+       * order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
+       * intervals are sorted in the order given by
+       * [FacetSpec.FacetKey.intervals][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.intervals];
+       * [FulfillmentInfo.ids][] are sorted in the order given by
+       * [FacetSpec.FacetKey.restricted_values][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.restricted_values].
+       * 
+ * + * string order_by = 4; + * + * @return The bytes for orderBy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int QUERY_FIELD_NUMBER = 5; + private volatile java.lang.Object query_; + /** + * + * + *
+       * The query that is used to compute facet for the given facet key.
+       * When provided, it will override the default behavior of facet
+       * computation. The query syntax is the same as a filter expression. See
+       * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
+       * detail syntax and limitations. Notice that there is no limitation on
+       * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
+       * when query is specified.
+       * In the response, [FacetValue.value][] will be always "1" and
+       * [FacetValue.count][] will be the number of results that matches the
+       * query.
+       * For example, you can set a customized facet for "shipToStore",
+       * where
+       * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
+       * is "customizedShipToStore", and
+       * [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query]
+       * is "availability: ANY(\"IN_STOCK\") AND shipToStore: ANY(\"123\")".
+       * Then the facet will count the products that are both in stock and ship
+       * to store "123".
+       * 
+ * + * string query = 5; + * + * @return The query. + */ + @java.lang.Override + public java.lang.String getQuery() { + java.lang.Object ref = query_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + query_ = s; + return s; + } + } + /** + * + * + *
+       * The query that is used to compute facet for the given facet key.
+       * When provided, it will override the default behavior of facet
+       * computation. The query syntax is the same as a filter expression. See
+       * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
+       * detail syntax and limitations. Notice that there is no limitation on
+       * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
+       * when query is specified.
+       * In the response, [FacetValue.value][] will be always "1" and
+       * [FacetValue.count][] will be the number of results that matches the
+       * query.
+       * For example, you can set a customized facet for "shipToStore",
+       * where
+       * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
+       * is "customizedShipToStore", and
+       * [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query]
+       * is "availability: ANY(\"IN_STOCK\") AND shipToStore: ANY(\"123\")".
+       * Then the facet will count the products that are both in stock and ship
+       * to store "123".
+       * 
+ * + * string query = 5; + * + * @return The bytes for query. + */ + @java.lang.Override + public com.google.protobuf.ByteString getQueryBytes() { + java.lang.Object ref = query_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + query_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getKeyBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, key_); + } + for (int i = 0; i < intervals_.size(); i++) { + output.writeMessage(2, intervals_.get(i)); + } + for (int i = 0; i < restrictedValues_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 3, restrictedValues_.getRaw(i)); + } + if (!getOrderByBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, orderBy_); + } + if (!getQueryBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, query_); + } + for (int i = 0; i < prefixes_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, prefixes_.getRaw(i)); + } + for (int i = 0; i < contains_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 9, contains_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getKeyBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, key_); + } + for (int i = 0; i < intervals_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, intervals_.get(i)); + } + { + int dataSize = 0; + for (int i = 0; i < restrictedValues_.size(); i++) { + dataSize += computeStringSizeNoTag(restrictedValues_.getRaw(i)); + } + size += dataSize; + size += 1 * getRestrictedValuesList().size(); + } + if (!getOrderByBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, orderBy_); + } + if (!getQueryBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, query_); + } + { + int dataSize = 0; + for (int i = 0; i < prefixes_.size(); i++) { + dataSize += computeStringSizeNoTag(prefixes_.getRaw(i)); + } + size += dataSize; + size += 1 * getPrefixesList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < contains_.size(); i++) { + dataSize += computeStringSizeNoTag(contains_.getRaw(i)); + } + size += dataSize; + size += 1 * getContainsList().size(); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey)) { + return super.equals(obj); + } + com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey other = + (com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey) obj; + + if (!getKey().equals(other.getKey())) return false; + if (!getIntervalsList().equals(other.getIntervalsList())) return false; + if (!getRestrictedValuesList().equals(other.getRestrictedValuesList())) return false; + if (!getPrefixesList().equals(other.getPrefixesList())) return false; + if (!getContainsList().equals(other.getContainsList())) return false; + if (!getOrderBy().equals(other.getOrderBy())) return false; + if (!getQuery().equals(other.getQuery())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + if (getIntervalsCount() > 0) { + hash = (37 * hash) + INTERVALS_FIELD_NUMBER; + hash = (53 * hash) + getIntervalsList().hashCode(); + } + if (getRestrictedValuesCount() > 0) { + hash = (37 * hash) + RESTRICTED_VALUES_FIELD_NUMBER; + hash = (53 * hash) + getRestrictedValuesList().hashCode(); + } + if (getPrefixesCount() > 0) { + hash = (37 * hash) + PREFIXES_FIELD_NUMBER; + hash = (53 * hash) + getPrefixesList().hashCode(); + } + if (getContainsCount() > 0) { + hash = (37 * hash) + CONTAINS_FIELD_NUMBER; + hash = (53 * hash) + getContainsList().hashCode(); + } + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (37 * hash) + QUERY_FIELD_NUMBER; + hash = (53 * hash) + getQuery().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+       * Specifies how a facet is computed.
+       * 
+ * + * Protobuf type {@code google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey) + com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKeyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchRequest_FacetSpec_FacetKey_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchRequest_FacetSpec_FacetKey_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.class, + com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.Builder.class); + } + + // Construct using com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getIntervalsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + key_ = ""; + + if (intervalsBuilder_ == null) { + intervals_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + intervalsBuilder_.clear(); + } + restrictedValues_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + prefixes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + contains_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000008); + orderBy_ = ""; + + query_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchRequest_FacetSpec_FacetKey_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey + getDefaultInstanceForType() { + return com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey build() { + com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey buildPartial() { + com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey result = + new com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey(this); + int from_bitField0_ = bitField0_; + result.key_ = key_; + if (intervalsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + intervals_ = java.util.Collections.unmodifiableList(intervals_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.intervals_ = intervals_; + } else { + result.intervals_ = intervalsBuilder_.build(); + } + if (((bitField0_ & 0x00000002) != 0)) { + restrictedValues_ = restrictedValues_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.restrictedValues_ = restrictedValues_; + if (((bitField0_ & 0x00000004) != 0)) { + prefixes_ = prefixes_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.prefixes_ = prefixes_; + if (((bitField0_ & 0x00000008) != 0)) { + contains_ = contains_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.contains_ = contains_; + result.orderBy_ = orderBy_; + result.query_ = query_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey) { + return mergeFrom((com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey other) { + if (other + == com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.getDefaultInstance()) + return this; + if (!other.getKey().isEmpty()) { + key_ = other.key_; + onChanged(); + } + if (intervalsBuilder_ == null) { + if (!other.intervals_.isEmpty()) { + if (intervals_.isEmpty()) { + intervals_ = other.intervals_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureIntervalsIsMutable(); + intervals_.addAll(other.intervals_); + } + onChanged(); + } + } else { + if (!other.intervals_.isEmpty()) { + if (intervalsBuilder_.isEmpty()) { + intervalsBuilder_.dispose(); + intervalsBuilder_ = null; + intervals_ = other.intervals_; + bitField0_ = (bitField0_ & ~0x00000001); + intervalsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getIntervalsFieldBuilder() + : null; + } else { + intervalsBuilder_.addAllMessages(other.intervals_); + } + } + } + if (!other.restrictedValues_.isEmpty()) { + if (restrictedValues_.isEmpty()) { + restrictedValues_ = other.restrictedValues_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureRestrictedValuesIsMutable(); + restrictedValues_.addAll(other.restrictedValues_); + } + onChanged(); + } + if (!other.prefixes_.isEmpty()) { + if (prefixes_.isEmpty()) { + prefixes_ = other.prefixes_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensurePrefixesIsMutable(); + prefixes_.addAll(other.prefixes_); + } + onChanged(); + } + if (!other.contains_.isEmpty()) { + if (contains_.isEmpty()) { + contains_ = other.contains_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureContainsIsMutable(); + contains_.addAll(other.contains_); + } + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + onChanged(); + } + if (!other.getQuery().isEmpty()) { + query_ = other.query_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object key_ = ""; + /** + * + * + *
+         * Required. Supported textual and numerical facet keys in
+         * [Product][google.cloud.retail.v2.Product] object, over which the facet
+         * values are computed. Facet key is case-sensitive.
+         * Allowed facet keys when
+         * [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query]
+         * is not specified:
+         * * textual_field =<br>
+         *     <font color='grey'>
+         *     *# The
+         *     [Product.brands][google.cloud.retail.v2.Product.brands].<br>*
+         *     </font>
+         *     "brands";
+         *     <br>
+         *     <font color='categories'>
+         *     *# The
+         *     [Product.categories][google.cloud.retail.v2.Product.categories].<br>*
+         *     </font>
+         *     "categories";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The
+         *     [Audience.genders][google.cloud.retail.v2.Audience.genders].<br>*
+         *     </font>
+         *     | "genders";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The
+         *     [Audience.age_groups][google.cloud.retail.v2.Audience.age_groups].<br>*
+         *     </font>
+         *     | "ageGroups";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The
+         *     [Product.availability][google.cloud.retail.v2.Product.availability].
+         *     Value is one of<br>*
+         *     *# "IN_STOCK", "OUT_OF_STOCK", PREORDER", "BACKORDER".<br>*
+         *     </font>
+         *     | "availability";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The
+         *     [ColorInfo.color_families][google.cloud.retail.v2.ColorInfo.color_families].<br>*
+         *     </font>
+         *     | "colorFamilies";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The
+         *     [ColorInfo.colors][google.cloud.retail.v2.ColorInfo.colors].<br>*
+         *     </font>
+         *     | "colors";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The [Product.sizes][google.cloud.retail.v2.Product.sizes].<br>*
+         *     </font>
+         *     | "sizes";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The
+         *     [Product.materials][google.cloud.retail.v2.Product.materials].<br>*
+         *     </font>
+         *     | "materials";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The
+         *     [Product.patterns][google.cloud.retail.v2.Product.patterns].<br>*
+         *     </font>
+         *     | "patterns";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The
+         *     [Product.conditions][google.cloud.retail.v2.Product.conditions].<br>*
+         *     </font>
+         *     | "conditions";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The textual custom attribute in
+         *     [Product][google.cloud.retail.v2.Product] object. Key can<br>*
+         *     *# be any key in the
+         *     [Product.attributes][google.cloud.retail.v2.Product.attributes]
+         *     map<br>*
+         *     *# if the attribute values are textual.<br>*
+         *     *# map.<br>*
+         *     </font>
+         *     | "attributes.key";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The [FulfillmentInfo.ids][] for type
+         *     *# [FulfillmentInfo.Type.PICKUP_IN_STORE][].<br>*
+         *     </font>
+         *     | "pickupInStore";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The [FulfillmentInfo.ids][] for type
+         *     *# [FulfillmentInfo.Type.SHIP_TO_STORE][].<br>*
+         *     </font>
+         *     | "shipToStore";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The [FulfillmentInfo.ids][] for type
+         *     *# [FulfillmentInfo.Type.SAME_DAY_DELIVERY][].<br>*
+         *     </font>
+         *     | "sameDayDelivery";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The [FulfillmentInfo.ids][] for type
+         *     *# [FulfillmentInfo.Type.NEXT_DAY_DELIVERY][].<br>*
+         *     </font>
+         *     | "nextDayDelivery";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The [FulfillmentInfo.ids][] for type
+         *     *# [FulfillmentInfo.Type.CUSTOM_TYPE_1][].<br>*
+         *     </font>
+         *     | "customFulfillment1";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The [FulfillmentInfo.ids][] for type
+         *     *# [FulfillmentInfo.Type.CUSTOM_TYPE_2][].<br>*
+         *     </font>
+         *     | "customFulfillment2";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The [FulfillmentInfo.ids][] for type
+         *     *# [FulfillmentInfo.Type.CUSTOM_TYPE_3][].<br>*
+         *     </font>
+         *     | "customFulfillment3";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The [FulfillmentInfo.ids][] for type
+         *     *# [FulfillmentInfo.Type.CUSTOM_TYPE_4][].<br>*
+         *     </font>
+         *     | "customFulfillment4";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The [FulfillmentInfo.ids][] for type
+         *     *# [FulfillmentInfo.Type.CUSTOM_TYPE_5][].<br>*
+         *     </font>
+         *     | "customFulfillment5";
+         * * numerical_field =<br>
+         *     <font color='grey'>
+         *     *# The
+         *     [PriceInfo.price][google.cloud.retail.v2.PriceInfo.price].<br>*
+         *     </font>
+         *     "price";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The discount. Computed by (original_price-price)/price <br>*
+         *     </font>
+         *     "discount";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The
+         *     [Rating.average_rating][google.cloud.retail.v2.Rating.average_rating].<br>*
+         *     </font>
+         *     "rating";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The
+         *     [Rating.rating_count][google.cloud.retail.v2.Rating.rating_count].<br>*
+         *     </font>
+         *     "ratingCount";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The numerical custom attribute in
+         *     [Product][google.cloud.retail.v2.Product] object. Key can<br>*
+         *     *# be any key in the
+         *     [Product.attributes][google.cloud.retail.v2.Product.attributes]
+         *     map<br>*
+         *     *# if the attribute values are numerical.<br>*
+         *     </font>
+         *     | "attributes.key";
+         * 
+ * + * string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The key. + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * Required. Supported textual and numerical facet keys in
+         * [Product][google.cloud.retail.v2.Product] object, over which the facet
+         * values are computed. Facet key is case-sensitive.
+         * Allowed facet keys when
+         * [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query]
+         * is not specified:
+         * * textual_field =<br>
+         *     <font color='grey'>
+         *     *# The
+         *     [Product.brands][google.cloud.retail.v2.Product.brands].<br>*
+         *     </font>
+         *     "brands";
+         *     <br>
+         *     <font color='categories'>
+         *     *# The
+         *     [Product.categories][google.cloud.retail.v2.Product.categories].<br>*
+         *     </font>
+         *     "categories";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The
+         *     [Audience.genders][google.cloud.retail.v2.Audience.genders].<br>*
+         *     </font>
+         *     | "genders";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The
+         *     [Audience.age_groups][google.cloud.retail.v2.Audience.age_groups].<br>*
+         *     </font>
+         *     | "ageGroups";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The
+         *     [Product.availability][google.cloud.retail.v2.Product.availability].
+         *     Value is one of<br>*
+         *     *# "IN_STOCK", "OUT_OF_STOCK", PREORDER", "BACKORDER".<br>*
+         *     </font>
+         *     | "availability";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The
+         *     [ColorInfo.color_families][google.cloud.retail.v2.ColorInfo.color_families].<br>*
+         *     </font>
+         *     | "colorFamilies";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The
+         *     [ColorInfo.colors][google.cloud.retail.v2.ColorInfo.colors].<br>*
+         *     </font>
+         *     | "colors";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The [Product.sizes][google.cloud.retail.v2.Product.sizes].<br>*
+         *     </font>
+         *     | "sizes";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The
+         *     [Product.materials][google.cloud.retail.v2.Product.materials].<br>*
+         *     </font>
+         *     | "materials";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The
+         *     [Product.patterns][google.cloud.retail.v2.Product.patterns].<br>*
+         *     </font>
+         *     | "patterns";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The
+         *     [Product.conditions][google.cloud.retail.v2.Product.conditions].<br>*
+         *     </font>
+         *     | "conditions";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The textual custom attribute in
+         *     [Product][google.cloud.retail.v2.Product] object. Key can<br>*
+         *     *# be any key in the
+         *     [Product.attributes][google.cloud.retail.v2.Product.attributes]
+         *     map<br>*
+         *     *# if the attribute values are textual.<br>*
+         *     *# map.<br>*
+         *     </font>
+         *     | "attributes.key";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The [FulfillmentInfo.ids][] for type
+         *     *# [FulfillmentInfo.Type.PICKUP_IN_STORE][].<br>*
+         *     </font>
+         *     | "pickupInStore";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The [FulfillmentInfo.ids][] for type
+         *     *# [FulfillmentInfo.Type.SHIP_TO_STORE][].<br>*
+         *     </font>
+         *     | "shipToStore";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The [FulfillmentInfo.ids][] for type
+         *     *# [FulfillmentInfo.Type.SAME_DAY_DELIVERY][].<br>*
+         *     </font>
+         *     | "sameDayDelivery";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The [FulfillmentInfo.ids][] for type
+         *     *# [FulfillmentInfo.Type.NEXT_DAY_DELIVERY][].<br>*
+         *     </font>
+         *     | "nextDayDelivery";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The [FulfillmentInfo.ids][] for type
+         *     *# [FulfillmentInfo.Type.CUSTOM_TYPE_1][].<br>*
+         *     </font>
+         *     | "customFulfillment1";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The [FulfillmentInfo.ids][] for type
+         *     *# [FulfillmentInfo.Type.CUSTOM_TYPE_2][].<br>*
+         *     </font>
+         *     | "customFulfillment2";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The [FulfillmentInfo.ids][] for type
+         *     *# [FulfillmentInfo.Type.CUSTOM_TYPE_3][].<br>*
+         *     </font>
+         *     | "customFulfillment3";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The [FulfillmentInfo.ids][] for type
+         *     *# [FulfillmentInfo.Type.CUSTOM_TYPE_4][].<br>*
+         *     </font>
+         *     | "customFulfillment4";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The [FulfillmentInfo.ids][] for type
+         *     *# [FulfillmentInfo.Type.CUSTOM_TYPE_5][].<br>*
+         *     </font>
+         *     | "customFulfillment5";
+         * * numerical_field =<br>
+         *     <font color='grey'>
+         *     *# The
+         *     [PriceInfo.price][google.cloud.retail.v2.PriceInfo.price].<br>*
+         *     </font>
+         *     "price";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The discount. Computed by (original_price-price)/price <br>*
+         *     </font>
+         *     "discount";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The
+         *     [Rating.average_rating][google.cloud.retail.v2.Rating.average_rating].<br>*
+         *     </font>
+         *     "rating";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The
+         *     [Rating.rating_count][google.cloud.retail.v2.Rating.rating_count].<br>*
+         *     </font>
+         *     "ratingCount";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The numerical custom attribute in
+         *     [Product][google.cloud.retail.v2.Product] object. Key can<br>*
+         *     *# be any key in the
+         *     [Product.attributes][google.cloud.retail.v2.Product.attributes]
+         *     map<br>*
+         *     *# if the attribute values are numerical.<br>*
+         *     </font>
+         *     | "attributes.key";
+         * 
+ * + * string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for key. + */ + public com.google.protobuf.ByteString getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * Required. Supported textual and numerical facet keys in
+         * [Product][google.cloud.retail.v2.Product] object, over which the facet
+         * values are computed. Facet key is case-sensitive.
+         * Allowed facet keys when
+         * [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query]
+         * is not specified:
+         * * textual_field =<br>
+         *     <font color='grey'>
+         *     *# The
+         *     [Product.brands][google.cloud.retail.v2.Product.brands].<br>*
+         *     </font>
+         *     "brands";
+         *     <br>
+         *     <font color='categories'>
+         *     *# The
+         *     [Product.categories][google.cloud.retail.v2.Product.categories].<br>*
+         *     </font>
+         *     "categories";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The
+         *     [Audience.genders][google.cloud.retail.v2.Audience.genders].<br>*
+         *     </font>
+         *     | "genders";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The
+         *     [Audience.age_groups][google.cloud.retail.v2.Audience.age_groups].<br>*
+         *     </font>
+         *     | "ageGroups";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The
+         *     [Product.availability][google.cloud.retail.v2.Product.availability].
+         *     Value is one of<br>*
+         *     *# "IN_STOCK", "OUT_OF_STOCK", PREORDER", "BACKORDER".<br>*
+         *     </font>
+         *     | "availability";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The
+         *     [ColorInfo.color_families][google.cloud.retail.v2.ColorInfo.color_families].<br>*
+         *     </font>
+         *     | "colorFamilies";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The
+         *     [ColorInfo.colors][google.cloud.retail.v2.ColorInfo.colors].<br>*
+         *     </font>
+         *     | "colors";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The [Product.sizes][google.cloud.retail.v2.Product.sizes].<br>*
+         *     </font>
+         *     | "sizes";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The
+         *     [Product.materials][google.cloud.retail.v2.Product.materials].<br>*
+         *     </font>
+         *     | "materials";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The
+         *     [Product.patterns][google.cloud.retail.v2.Product.patterns].<br>*
+         *     </font>
+         *     | "patterns";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The
+         *     [Product.conditions][google.cloud.retail.v2.Product.conditions].<br>*
+         *     </font>
+         *     | "conditions";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The textual custom attribute in
+         *     [Product][google.cloud.retail.v2.Product] object. Key can<br>*
+         *     *# be any key in the
+         *     [Product.attributes][google.cloud.retail.v2.Product.attributes]
+         *     map<br>*
+         *     *# if the attribute values are textual.<br>*
+         *     *# map.<br>*
+         *     </font>
+         *     | "attributes.key";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The [FulfillmentInfo.ids][] for type
+         *     *# [FulfillmentInfo.Type.PICKUP_IN_STORE][].<br>*
+         *     </font>
+         *     | "pickupInStore";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The [FulfillmentInfo.ids][] for type
+         *     *# [FulfillmentInfo.Type.SHIP_TO_STORE][].<br>*
+         *     </font>
+         *     | "shipToStore";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The [FulfillmentInfo.ids][] for type
+         *     *# [FulfillmentInfo.Type.SAME_DAY_DELIVERY][].<br>*
+         *     </font>
+         *     | "sameDayDelivery";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The [FulfillmentInfo.ids][] for type
+         *     *# [FulfillmentInfo.Type.NEXT_DAY_DELIVERY][].<br>*
+         *     </font>
+         *     | "nextDayDelivery";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The [FulfillmentInfo.ids][] for type
+         *     *# [FulfillmentInfo.Type.CUSTOM_TYPE_1][].<br>*
+         *     </font>
+         *     | "customFulfillment1";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The [FulfillmentInfo.ids][] for type
+         *     *# [FulfillmentInfo.Type.CUSTOM_TYPE_2][].<br>*
+         *     </font>
+         *     | "customFulfillment2";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The [FulfillmentInfo.ids][] for type
+         *     *# [FulfillmentInfo.Type.CUSTOM_TYPE_3][].<br>*
+         *     </font>
+         *     | "customFulfillment3";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The [FulfillmentInfo.ids][] for type
+         *     *# [FulfillmentInfo.Type.CUSTOM_TYPE_4][].<br>*
+         *     </font>
+         *     | "customFulfillment4";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The [FulfillmentInfo.ids][] for type
+         *     *# [FulfillmentInfo.Type.CUSTOM_TYPE_5][].<br>*
+         *     </font>
+         *     | "customFulfillment5";
+         * * numerical_field =<br>
+         *     <font color='grey'>
+         *     *# The
+         *     [PriceInfo.price][google.cloud.retail.v2.PriceInfo.price].<br>*
+         *     </font>
+         *     "price";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The discount. Computed by (original_price-price)/price <br>*
+         *     </font>
+         *     "discount";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The
+         *     [Rating.average_rating][google.cloud.retail.v2.Rating.average_rating].<br>*
+         *     </font>
+         *     "rating";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The
+         *     [Rating.rating_count][google.cloud.retail.v2.Rating.rating_count].<br>*
+         *     </font>
+         *     "ratingCount";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The numerical custom attribute in
+         *     [Product][google.cloud.retail.v2.Product] object. Key can<br>*
+         *     *# be any key in the
+         *     [Product.attributes][google.cloud.retail.v2.Product.attributes]
+         *     map<br>*
+         *     *# if the attribute values are numerical.<br>*
+         *     </font>
+         *     | "attributes.key";
+         * 
+ * + * string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The key to set. + * @return This builder for chaining. + */ + public Builder setKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + key_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * Required. Supported textual and numerical facet keys in
+         * [Product][google.cloud.retail.v2.Product] object, over which the facet
+         * values are computed. Facet key is case-sensitive.
+         * Allowed facet keys when
+         * [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query]
+         * is not specified:
+         * * textual_field =<br>
+         *     <font color='grey'>
+         *     *# The
+         *     [Product.brands][google.cloud.retail.v2.Product.brands].<br>*
+         *     </font>
+         *     "brands";
+         *     <br>
+         *     <font color='categories'>
+         *     *# The
+         *     [Product.categories][google.cloud.retail.v2.Product.categories].<br>*
+         *     </font>
+         *     "categories";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The
+         *     [Audience.genders][google.cloud.retail.v2.Audience.genders].<br>*
+         *     </font>
+         *     | "genders";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The
+         *     [Audience.age_groups][google.cloud.retail.v2.Audience.age_groups].<br>*
+         *     </font>
+         *     | "ageGroups";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The
+         *     [Product.availability][google.cloud.retail.v2.Product.availability].
+         *     Value is one of<br>*
+         *     *# "IN_STOCK", "OUT_OF_STOCK", PREORDER", "BACKORDER".<br>*
+         *     </font>
+         *     | "availability";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The
+         *     [ColorInfo.color_families][google.cloud.retail.v2.ColorInfo.color_families].<br>*
+         *     </font>
+         *     | "colorFamilies";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The
+         *     [ColorInfo.colors][google.cloud.retail.v2.ColorInfo.colors].<br>*
+         *     </font>
+         *     | "colors";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The [Product.sizes][google.cloud.retail.v2.Product.sizes].<br>*
+         *     </font>
+         *     | "sizes";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The
+         *     [Product.materials][google.cloud.retail.v2.Product.materials].<br>*
+         *     </font>
+         *     | "materials";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The
+         *     [Product.patterns][google.cloud.retail.v2.Product.patterns].<br>*
+         *     </font>
+         *     | "patterns";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The
+         *     [Product.conditions][google.cloud.retail.v2.Product.conditions].<br>*
+         *     </font>
+         *     | "conditions";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The textual custom attribute in
+         *     [Product][google.cloud.retail.v2.Product] object. Key can<br>*
+         *     *# be any key in the
+         *     [Product.attributes][google.cloud.retail.v2.Product.attributes]
+         *     map<br>*
+         *     *# if the attribute values are textual.<br>*
+         *     *# map.<br>*
+         *     </font>
+         *     | "attributes.key";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The [FulfillmentInfo.ids][] for type
+         *     *# [FulfillmentInfo.Type.PICKUP_IN_STORE][].<br>*
+         *     </font>
+         *     | "pickupInStore";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The [FulfillmentInfo.ids][] for type
+         *     *# [FulfillmentInfo.Type.SHIP_TO_STORE][].<br>*
+         *     </font>
+         *     | "shipToStore";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The [FulfillmentInfo.ids][] for type
+         *     *# [FulfillmentInfo.Type.SAME_DAY_DELIVERY][].<br>*
+         *     </font>
+         *     | "sameDayDelivery";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The [FulfillmentInfo.ids][] for type
+         *     *# [FulfillmentInfo.Type.NEXT_DAY_DELIVERY][].<br>*
+         *     </font>
+         *     | "nextDayDelivery";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The [FulfillmentInfo.ids][] for type
+         *     *# [FulfillmentInfo.Type.CUSTOM_TYPE_1][].<br>*
+         *     </font>
+         *     | "customFulfillment1";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The [FulfillmentInfo.ids][] for type
+         *     *# [FulfillmentInfo.Type.CUSTOM_TYPE_2][].<br>*
+         *     </font>
+         *     | "customFulfillment2";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The [FulfillmentInfo.ids][] for type
+         *     *# [FulfillmentInfo.Type.CUSTOM_TYPE_3][].<br>*
+         *     </font>
+         *     | "customFulfillment3";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The [FulfillmentInfo.ids][] for type
+         *     *# [FulfillmentInfo.Type.CUSTOM_TYPE_4][].<br>*
+         *     </font>
+         *     | "customFulfillment4";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The [FulfillmentInfo.ids][] for type
+         *     *# [FulfillmentInfo.Type.CUSTOM_TYPE_5][].<br>*
+         *     </font>
+         *     | "customFulfillment5";
+         * * numerical_field =<br>
+         *     <font color='grey'>
+         *     *# The
+         *     [PriceInfo.price][google.cloud.retail.v2.PriceInfo.price].<br>*
+         *     </font>
+         *     "price";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The discount. Computed by (original_price-price)/price <br>*
+         *     </font>
+         *     "discount";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The
+         *     [Rating.average_rating][google.cloud.retail.v2.Rating.average_rating].<br>*
+         *     </font>
+         *     "rating";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The
+         *     [Rating.rating_count][google.cloud.retail.v2.Rating.rating_count].<br>*
+         *     </font>
+         *     "ratingCount";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The numerical custom attribute in
+         *     [Product][google.cloud.retail.v2.Product] object. Key can<br>*
+         *     *# be any key in the
+         *     [Product.attributes][google.cloud.retail.v2.Product.attributes]
+         *     map<br>*
+         *     *# if the attribute values are numerical.<br>*
+         *     </font>
+         *     | "attributes.key";
+         * 
+ * + * string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearKey() { + + key_ = getDefaultInstance().getKey(); + onChanged(); + return this; + } + /** + * + * + *
+         * Required. Supported textual and numerical facet keys in
+         * [Product][google.cloud.retail.v2.Product] object, over which the facet
+         * values are computed. Facet key is case-sensitive.
+         * Allowed facet keys when
+         * [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query]
+         * is not specified:
+         * * textual_field =<br>
+         *     <font color='grey'>
+         *     *# The
+         *     [Product.brands][google.cloud.retail.v2.Product.brands].<br>*
+         *     </font>
+         *     "brands";
+         *     <br>
+         *     <font color='categories'>
+         *     *# The
+         *     [Product.categories][google.cloud.retail.v2.Product.categories].<br>*
+         *     </font>
+         *     "categories";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The
+         *     [Audience.genders][google.cloud.retail.v2.Audience.genders].<br>*
+         *     </font>
+         *     | "genders";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The
+         *     [Audience.age_groups][google.cloud.retail.v2.Audience.age_groups].<br>*
+         *     </font>
+         *     | "ageGroups";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The
+         *     [Product.availability][google.cloud.retail.v2.Product.availability].
+         *     Value is one of<br>*
+         *     *# "IN_STOCK", "OUT_OF_STOCK", PREORDER", "BACKORDER".<br>*
+         *     </font>
+         *     | "availability";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The
+         *     [ColorInfo.color_families][google.cloud.retail.v2.ColorInfo.color_families].<br>*
+         *     </font>
+         *     | "colorFamilies";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The
+         *     [ColorInfo.colors][google.cloud.retail.v2.ColorInfo.colors].<br>*
+         *     </font>
+         *     | "colors";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The [Product.sizes][google.cloud.retail.v2.Product.sizes].<br>*
+         *     </font>
+         *     | "sizes";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The
+         *     [Product.materials][google.cloud.retail.v2.Product.materials].<br>*
+         *     </font>
+         *     | "materials";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The
+         *     [Product.patterns][google.cloud.retail.v2.Product.patterns].<br>*
+         *     </font>
+         *     | "patterns";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The
+         *     [Product.conditions][google.cloud.retail.v2.Product.conditions].<br>*
+         *     </font>
+         *     | "conditions";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The textual custom attribute in
+         *     [Product][google.cloud.retail.v2.Product] object. Key can<br>*
+         *     *# be any key in the
+         *     [Product.attributes][google.cloud.retail.v2.Product.attributes]
+         *     map<br>*
+         *     *# if the attribute values are textual.<br>*
+         *     *# map.<br>*
+         *     </font>
+         *     | "attributes.key";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The [FulfillmentInfo.ids][] for type
+         *     *# [FulfillmentInfo.Type.PICKUP_IN_STORE][].<br>*
+         *     </font>
+         *     | "pickupInStore";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The [FulfillmentInfo.ids][] for type
+         *     *# [FulfillmentInfo.Type.SHIP_TO_STORE][].<br>*
+         *     </font>
+         *     | "shipToStore";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The [FulfillmentInfo.ids][] for type
+         *     *# [FulfillmentInfo.Type.SAME_DAY_DELIVERY][].<br>*
+         *     </font>
+         *     | "sameDayDelivery";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The [FulfillmentInfo.ids][] for type
+         *     *# [FulfillmentInfo.Type.NEXT_DAY_DELIVERY][].<br>*
+         *     </font>
+         *     | "nextDayDelivery";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The [FulfillmentInfo.ids][] for type
+         *     *# [FulfillmentInfo.Type.CUSTOM_TYPE_1][].<br>*
+         *     </font>
+         *     | "customFulfillment1";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The [FulfillmentInfo.ids][] for type
+         *     *# [FulfillmentInfo.Type.CUSTOM_TYPE_2][].<br>*
+         *     </font>
+         *     | "customFulfillment2";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The [FulfillmentInfo.ids][] for type
+         *     *# [FulfillmentInfo.Type.CUSTOM_TYPE_3][].<br>*
+         *     </font>
+         *     | "customFulfillment3";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The [FulfillmentInfo.ids][] for type
+         *     *# [FulfillmentInfo.Type.CUSTOM_TYPE_4][].<br>*
+         *     </font>
+         *     | "customFulfillment4";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The [FulfillmentInfo.ids][] for type
+         *     *# [FulfillmentInfo.Type.CUSTOM_TYPE_5][].<br>*
+         *     </font>
+         *     | "customFulfillment5";
+         * * numerical_field =<br>
+         *     <font color='grey'>
+         *     *# The
+         *     [PriceInfo.price][google.cloud.retail.v2.PriceInfo.price].<br>*
+         *     </font>
+         *     "price";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The discount. Computed by (original_price-price)/price <br>*
+         *     </font>
+         *     "discount";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The
+         *     [Rating.average_rating][google.cloud.retail.v2.Rating.average_rating].<br>*
+         *     </font>
+         *     "rating";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The
+         *     [Rating.rating_count][google.cloud.retail.v2.Rating.rating_count].<br>*
+         *     </font>
+         *     "ratingCount";
+         *     <br>
+         *     <font color='grey'>
+         *     *# The numerical custom attribute in
+         *     [Product][google.cloud.retail.v2.Product] object. Key can<br>*
+         *     *# be any key in the
+         *     [Product.attributes][google.cloud.retail.v2.Product.attributes]
+         *     map<br>*
+         *     *# if the attribute values are numerical.<br>*
+         *     </font>
+         *     | "attributes.key";
+         * 
+ * + * string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for key to set. + * @return This builder for chaining. + */ + public Builder setKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + key_ = value; + onChanged(); + return this; + } + + private java.util.List intervals_ = + java.util.Collections.emptyList(); + + private void ensureIntervalsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + intervals_ = new java.util.ArrayList(intervals_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2.Interval, + com.google.cloud.retail.v2.Interval.Builder, + com.google.cloud.retail.v2.IntervalOrBuilder> + intervalsBuilder_; + + /** + * + * + *
+         * Set only if values should be bucketized into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.retail.v2.Interval intervals = 2; + */ + public java.util.List getIntervalsList() { + if (intervalsBuilder_ == null) { + return java.util.Collections.unmodifiableList(intervals_); + } else { + return intervalsBuilder_.getMessageList(); + } + } + /** + * + * + *
+         * Set only if values should be bucketized into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.retail.v2.Interval intervals = 2; + */ + public int getIntervalsCount() { + if (intervalsBuilder_ == null) { + return intervals_.size(); + } else { + return intervalsBuilder_.getCount(); + } + } + /** + * + * + *
+         * Set only if values should be bucketized into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.retail.v2.Interval intervals = 2; + */ + public com.google.cloud.retail.v2.Interval getIntervals(int index) { + if (intervalsBuilder_ == null) { + return intervals_.get(index); + } else { + return intervalsBuilder_.getMessage(index); + } + } + /** + * + * + *
+         * Set only if values should be bucketized into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.retail.v2.Interval intervals = 2; + */ + public Builder setIntervals(int index, com.google.cloud.retail.v2.Interval value) { + if (intervalsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIntervalsIsMutable(); + intervals_.set(index, value); + onChanged(); + } else { + intervalsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+         * Set only if values should be bucketized into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.retail.v2.Interval intervals = 2; + */ + public Builder setIntervals( + int index, com.google.cloud.retail.v2.Interval.Builder builderForValue) { + if (intervalsBuilder_ == null) { + ensureIntervalsIsMutable(); + intervals_.set(index, builderForValue.build()); + onChanged(); + } else { + intervalsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+         * Set only if values should be bucketized into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.retail.v2.Interval intervals = 2; + */ + public Builder addIntervals(com.google.cloud.retail.v2.Interval value) { + if (intervalsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIntervalsIsMutable(); + intervals_.add(value); + onChanged(); + } else { + intervalsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+         * Set only if values should be bucketized into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.retail.v2.Interval intervals = 2; + */ + public Builder addIntervals(int index, com.google.cloud.retail.v2.Interval value) { + if (intervalsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIntervalsIsMutable(); + intervals_.add(index, value); + onChanged(); + } else { + intervalsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+         * Set only if values should be bucketized into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.retail.v2.Interval intervals = 2; + */ + public Builder addIntervals(com.google.cloud.retail.v2.Interval.Builder builderForValue) { + if (intervalsBuilder_ == null) { + ensureIntervalsIsMutable(); + intervals_.add(builderForValue.build()); + onChanged(); + } else { + intervalsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+         * Set only if values should be bucketized into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.retail.v2.Interval intervals = 2; + */ + public Builder addIntervals( + int index, com.google.cloud.retail.v2.Interval.Builder builderForValue) { + if (intervalsBuilder_ == null) { + ensureIntervalsIsMutable(); + intervals_.add(index, builderForValue.build()); + onChanged(); + } else { + intervalsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+         * Set only if values should be bucketized into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.retail.v2.Interval intervals = 2; + */ + public Builder addAllIntervals( + java.lang.Iterable values) { + if (intervalsBuilder_ == null) { + ensureIntervalsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, intervals_); + onChanged(); + } else { + intervalsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+         * Set only if values should be bucketized into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.retail.v2.Interval intervals = 2; + */ + public Builder clearIntervals() { + if (intervalsBuilder_ == null) { + intervals_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + intervalsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+         * Set only if values should be bucketized into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.retail.v2.Interval intervals = 2; + */ + public Builder removeIntervals(int index) { + if (intervalsBuilder_ == null) { + ensureIntervalsIsMutable(); + intervals_.remove(index); + onChanged(); + } else { + intervalsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+         * Set only if values should be bucketized into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.retail.v2.Interval intervals = 2; + */ + public com.google.cloud.retail.v2.Interval.Builder getIntervalsBuilder(int index) { + return getIntervalsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+         * Set only if values should be bucketized into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.retail.v2.Interval intervals = 2; + */ + public com.google.cloud.retail.v2.IntervalOrBuilder getIntervalsOrBuilder(int index) { + if (intervalsBuilder_ == null) { + return intervals_.get(index); + } else { + return intervalsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+         * Set only if values should be bucketized into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.retail.v2.Interval intervals = 2; + */ + public java.util.List + getIntervalsOrBuilderList() { + if (intervalsBuilder_ != null) { + return intervalsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(intervals_); + } + } + /** + * + * + *
+         * Set only if values should be bucketized into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.retail.v2.Interval intervals = 2; + */ + public com.google.cloud.retail.v2.Interval.Builder addIntervalsBuilder() { + return getIntervalsFieldBuilder() + .addBuilder(com.google.cloud.retail.v2.Interval.getDefaultInstance()); + } + /** + * + * + *
+         * Set only if values should be bucketized into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.retail.v2.Interval intervals = 2; + */ + public com.google.cloud.retail.v2.Interval.Builder addIntervalsBuilder(int index) { + return getIntervalsFieldBuilder() + .addBuilder(index, com.google.cloud.retail.v2.Interval.getDefaultInstance()); + } + /** + * + * + *
+         * Set only if values should be bucketized into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.retail.v2.Interval intervals = 2; + */ + public java.util.List + getIntervalsBuilderList() { + return getIntervalsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2.Interval, + com.google.cloud.retail.v2.Interval.Builder, + com.google.cloud.retail.v2.IntervalOrBuilder> + getIntervalsFieldBuilder() { + if (intervalsBuilder_ == null) { + intervalsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2.Interval, + com.google.cloud.retail.v2.Interval.Builder, + com.google.cloud.retail.v2.IntervalOrBuilder>( + intervals_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + intervals_ = null; + } + return intervalsBuilder_; + } + + private com.google.protobuf.LazyStringList restrictedValues_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureRestrictedValuesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + restrictedValues_ = new com.google.protobuf.LazyStringArrayList(restrictedValues_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+         * Only get facet for the given restricted values. For example, when using
+         * "pickupInStore" as key and set restricted values to
+         * ["store123", "store456"], only facets for "store123" and "store456" are
+         * returned. Only supported on textual fields and fulfillments.
+         * Maximum is 20.
+         * Must be set for the fulfillment facet keys:
+         * * pickupInStore
+         * * shipToStore
+         * * sameDayDelivery
+         * * nextDayDelivery
+         * * customFulfillment1
+         * * customFulfillment2
+         * * customFulfillment3
+         * * customFulfillment4
+         * * customFulfillment5
+         * 
+ * + * repeated string restricted_values = 3; + * + * @return A list containing the restrictedValues. + */ + public com.google.protobuf.ProtocolStringList getRestrictedValuesList() { + return restrictedValues_.getUnmodifiableView(); + } + /** + * + * + *
+         * Only get facet for the given restricted values. For example, when using
+         * "pickupInStore" as key and set restricted values to
+         * ["store123", "store456"], only facets for "store123" and "store456" are
+         * returned. Only supported on textual fields and fulfillments.
+         * Maximum is 20.
+         * Must be set for the fulfillment facet keys:
+         * * pickupInStore
+         * * shipToStore
+         * * sameDayDelivery
+         * * nextDayDelivery
+         * * customFulfillment1
+         * * customFulfillment2
+         * * customFulfillment3
+         * * customFulfillment4
+         * * customFulfillment5
+         * 
+ * + * repeated string restricted_values = 3; + * + * @return The count of restrictedValues. + */ + public int getRestrictedValuesCount() { + return restrictedValues_.size(); + } + /** + * + * + *
+         * Only get facet for the given restricted values. For example, when using
+         * "pickupInStore" as key and set restricted values to
+         * ["store123", "store456"], only facets for "store123" and "store456" are
+         * returned. Only supported on textual fields and fulfillments.
+         * Maximum is 20.
+         * Must be set for the fulfillment facet keys:
+         * * pickupInStore
+         * * shipToStore
+         * * sameDayDelivery
+         * * nextDayDelivery
+         * * customFulfillment1
+         * * customFulfillment2
+         * * customFulfillment3
+         * * customFulfillment4
+         * * customFulfillment5
+         * 
+ * + * repeated string restricted_values = 3; + * + * @param index The index of the element to return. + * @return The restrictedValues at the given index. + */ + public java.lang.String getRestrictedValues(int index) { + return restrictedValues_.get(index); + } + /** + * + * + *
+         * Only get facet for the given restricted values. For example, when using
+         * "pickupInStore" as key and set restricted values to
+         * ["store123", "store456"], only facets for "store123" and "store456" are
+         * returned. Only supported on textual fields and fulfillments.
+         * Maximum is 20.
+         * Must be set for the fulfillment facet keys:
+         * * pickupInStore
+         * * shipToStore
+         * * sameDayDelivery
+         * * nextDayDelivery
+         * * customFulfillment1
+         * * customFulfillment2
+         * * customFulfillment3
+         * * customFulfillment4
+         * * customFulfillment5
+         * 
+ * + * repeated string restricted_values = 3; + * + * @param index The index of the value to return. + * @return The bytes of the restrictedValues at the given index. + */ + public com.google.protobuf.ByteString getRestrictedValuesBytes(int index) { + return restrictedValues_.getByteString(index); + } + /** + * + * + *
+         * Only get facet for the given restricted values. For example, when using
+         * "pickupInStore" as key and set restricted values to
+         * ["store123", "store456"], only facets for "store123" and "store456" are
+         * returned. Only supported on textual fields and fulfillments.
+         * Maximum is 20.
+         * Must be set for the fulfillment facet keys:
+         * * pickupInStore
+         * * shipToStore
+         * * sameDayDelivery
+         * * nextDayDelivery
+         * * customFulfillment1
+         * * customFulfillment2
+         * * customFulfillment3
+         * * customFulfillment4
+         * * customFulfillment5
+         * 
+ * + * repeated string restricted_values = 3; + * + * @param index The index to set the value at. + * @param value The restrictedValues to set. + * @return This builder for chaining. + */ + public Builder setRestrictedValues(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRestrictedValuesIsMutable(); + restrictedValues_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet for the given restricted values. For example, when using
+         * "pickupInStore" as key and set restricted values to
+         * ["store123", "store456"], only facets for "store123" and "store456" are
+         * returned. Only supported on textual fields and fulfillments.
+         * Maximum is 20.
+         * Must be set for the fulfillment facet keys:
+         * * pickupInStore
+         * * shipToStore
+         * * sameDayDelivery
+         * * nextDayDelivery
+         * * customFulfillment1
+         * * customFulfillment2
+         * * customFulfillment3
+         * * customFulfillment4
+         * * customFulfillment5
+         * 
+ * + * repeated string restricted_values = 3; + * + * @param value The restrictedValues to add. + * @return This builder for chaining. + */ + public Builder addRestrictedValues(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRestrictedValuesIsMutable(); + restrictedValues_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet for the given restricted values. For example, when using
+         * "pickupInStore" as key and set restricted values to
+         * ["store123", "store456"], only facets for "store123" and "store456" are
+         * returned. Only supported on textual fields and fulfillments.
+         * Maximum is 20.
+         * Must be set for the fulfillment facet keys:
+         * * pickupInStore
+         * * shipToStore
+         * * sameDayDelivery
+         * * nextDayDelivery
+         * * customFulfillment1
+         * * customFulfillment2
+         * * customFulfillment3
+         * * customFulfillment4
+         * * customFulfillment5
+         * 
+ * + * repeated string restricted_values = 3; + * + * @param values The restrictedValues to add. + * @return This builder for chaining. + */ + public Builder addAllRestrictedValues(java.lang.Iterable values) { + ensureRestrictedValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, restrictedValues_); + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet for the given restricted values. For example, when using
+         * "pickupInStore" as key and set restricted values to
+         * ["store123", "store456"], only facets for "store123" and "store456" are
+         * returned. Only supported on textual fields and fulfillments.
+         * Maximum is 20.
+         * Must be set for the fulfillment facet keys:
+         * * pickupInStore
+         * * shipToStore
+         * * sameDayDelivery
+         * * nextDayDelivery
+         * * customFulfillment1
+         * * customFulfillment2
+         * * customFulfillment3
+         * * customFulfillment4
+         * * customFulfillment5
+         * 
+ * + * repeated string restricted_values = 3; + * + * @return This builder for chaining. + */ + public Builder clearRestrictedValues() { + restrictedValues_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet for the given restricted values. For example, when using
+         * "pickupInStore" as key and set restricted values to
+         * ["store123", "store456"], only facets for "store123" and "store456" are
+         * returned. Only supported on textual fields and fulfillments.
+         * Maximum is 20.
+         * Must be set for the fulfillment facet keys:
+         * * pickupInStore
+         * * shipToStore
+         * * sameDayDelivery
+         * * nextDayDelivery
+         * * customFulfillment1
+         * * customFulfillment2
+         * * customFulfillment3
+         * * customFulfillment4
+         * * customFulfillment5
+         * 
+ * + * repeated string restricted_values = 3; + * + * @param value The bytes of the restrictedValues to add. + * @return This builder for chaining. + */ + public Builder addRestrictedValuesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureRestrictedValuesIsMutable(); + restrictedValues_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList prefixes_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensurePrefixesIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + prefixes_ = new com.google.protobuf.LazyStringArrayList(prefixes_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+         * Only get facet values that start with the given string prefix. For
+         * example, suppose "categories" has three values "Women > Shoe",
+         * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the
+         * "categories" facet will give only "Women > Shoe" and "Women > Dress".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string prefixes = 8; + * + * @return A list containing the prefixes. + */ + public com.google.protobuf.ProtocolStringList getPrefixesList() { + return prefixes_.getUnmodifiableView(); + } + /** + * + * + *
+         * Only get facet values that start with the given string prefix. For
+         * example, suppose "categories" has three values "Women > Shoe",
+         * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the
+         * "categories" facet will give only "Women > Shoe" and "Women > Dress".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string prefixes = 8; + * + * @return The count of prefixes. + */ + public int getPrefixesCount() { + return prefixes_.size(); + } + /** + * + * + *
+         * Only get facet values that start with the given string prefix. For
+         * example, suppose "categories" has three values "Women > Shoe",
+         * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the
+         * "categories" facet will give only "Women > Shoe" and "Women > Dress".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string prefixes = 8; + * + * @param index The index of the element to return. + * @return The prefixes at the given index. + */ + public java.lang.String getPrefixes(int index) { + return prefixes_.get(index); + } + /** + * + * + *
+         * Only get facet values that start with the given string prefix. For
+         * example, suppose "categories" has three values "Women > Shoe",
+         * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the
+         * "categories" facet will give only "Women > Shoe" and "Women > Dress".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string prefixes = 8; + * + * @param index The index of the value to return. + * @return The bytes of the prefixes at the given index. + */ + public com.google.protobuf.ByteString getPrefixesBytes(int index) { + return prefixes_.getByteString(index); + } + /** + * + * + *
+         * Only get facet values that start with the given string prefix. For
+         * example, suppose "categories" has three values "Women > Shoe",
+         * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the
+         * "categories" facet will give only "Women > Shoe" and "Women > Dress".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string prefixes = 8; + * + * @param index The index to set the value at. + * @param value The prefixes to set. + * @return This builder for chaining. + */ + public Builder setPrefixes(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePrefixesIsMutable(); + prefixes_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet values that start with the given string prefix. For
+         * example, suppose "categories" has three values "Women > Shoe",
+         * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the
+         * "categories" facet will give only "Women > Shoe" and "Women > Dress".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string prefixes = 8; + * + * @param value The prefixes to add. + * @return This builder for chaining. + */ + public Builder addPrefixes(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePrefixesIsMutable(); + prefixes_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet values that start with the given string prefix. For
+         * example, suppose "categories" has three values "Women > Shoe",
+         * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the
+         * "categories" facet will give only "Women > Shoe" and "Women > Dress".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string prefixes = 8; + * + * @param values The prefixes to add. + * @return This builder for chaining. + */ + public Builder addAllPrefixes(java.lang.Iterable values) { + ensurePrefixesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, prefixes_); + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet values that start with the given string prefix. For
+         * example, suppose "categories" has three values "Women > Shoe",
+         * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the
+         * "categories" facet will give only "Women > Shoe" and "Women > Dress".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string prefixes = 8; + * + * @return This builder for chaining. + */ + public Builder clearPrefixes() { + prefixes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet values that start with the given string prefix. For
+         * example, suppose "categories" has three values "Women > Shoe",
+         * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the
+         * "categories" facet will give only "Women > Shoe" and "Women > Dress".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string prefixes = 8; + * + * @param value The bytes of the prefixes to add. + * @return This builder for chaining. + */ + public Builder addPrefixesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensurePrefixesIsMutable(); + prefixes_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList contains_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureContainsIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + contains_ = new com.google.protobuf.LazyStringArrayList(contains_); + bitField0_ |= 0x00000008; + } + } + /** + * + * + *
+         * Only get facet values that contains the given strings. For example,
+         * suppose "categories" has three values "Women > Shoe",
+         * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the
+         * "categories" facet will give only "Women > Shoe" and "Men > Shoe".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string contains = 9; + * + * @return A list containing the contains. + */ + public com.google.protobuf.ProtocolStringList getContainsList() { + return contains_.getUnmodifiableView(); + } + /** + * + * + *
+         * Only get facet values that contains the given strings. For example,
+         * suppose "categories" has three values "Women > Shoe",
+         * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the
+         * "categories" facet will give only "Women > Shoe" and "Men > Shoe".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string contains = 9; + * + * @return The count of contains. + */ + public int getContainsCount() { + return contains_.size(); + } + /** + * + * + *
+         * Only get facet values that contains the given strings. For example,
+         * suppose "categories" has three values "Women > Shoe",
+         * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the
+         * "categories" facet will give only "Women > Shoe" and "Men > Shoe".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string contains = 9; + * + * @param index The index of the element to return. + * @return The contains at the given index. + */ + public java.lang.String getContains(int index) { + return contains_.get(index); + } + /** + * + * + *
+         * Only get facet values that contains the given strings. For example,
+         * suppose "categories" has three values "Women > Shoe",
+         * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the
+         * "categories" facet will give only "Women > Shoe" and "Men > Shoe".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string contains = 9; + * + * @param index The index of the value to return. + * @return The bytes of the contains at the given index. + */ + public com.google.protobuf.ByteString getContainsBytes(int index) { + return contains_.getByteString(index); + } + /** + * + * + *
+         * Only get facet values that contains the given strings. For example,
+         * suppose "categories" has three values "Women > Shoe",
+         * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the
+         * "categories" facet will give only "Women > Shoe" and "Men > Shoe".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string contains = 9; + * + * @param index The index to set the value at. + * @param value The contains to set. + * @return This builder for chaining. + */ + public Builder setContains(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureContainsIsMutable(); + contains_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet values that contains the given strings. For example,
+         * suppose "categories" has three values "Women > Shoe",
+         * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the
+         * "categories" facet will give only "Women > Shoe" and "Men > Shoe".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string contains = 9; + * + * @param value The contains to add. + * @return This builder for chaining. + */ + public Builder addContains(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureContainsIsMutable(); + contains_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet values that contains the given strings. For example,
+         * suppose "categories" has three values "Women > Shoe",
+         * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the
+         * "categories" facet will give only "Women > Shoe" and "Men > Shoe".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string contains = 9; + * + * @param values The contains to add. + * @return This builder for chaining. + */ + public Builder addAllContains(java.lang.Iterable values) { + ensureContainsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, contains_); + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet values that contains the given strings. For example,
+         * suppose "categories" has three values "Women > Shoe",
+         * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the
+         * "categories" facet will give only "Women > Shoe" and "Men > Shoe".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string contains = 9; + * + * @return This builder for chaining. + */ + public Builder clearContains() { + contains_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet values that contains the given strings. For example,
+         * suppose "categories" has three values "Women > Shoe",
+         * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the
+         * "categories" facet will give only "Women > Shoe" and "Men > Shoe".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string contains = 9; + * + * @param value The bytes of the contains to add. + * @return This builder for chaining. + */ + public Builder addContainsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureContainsIsMutable(); + contains_.add(value); + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+         * The order in which [Facet.values][] are returned.
+         * Allowed values are:
+         * * "count desc", which means order by [Facet.FacetValue.count][]
+         * descending.
+         * * "value desc", which means order by [Facet.FacetValue.value][]
+         * descending.
+         *   Only applies to textual facets.
+         * If not set, textual values are sorted in [natural
+         * order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
+         * intervals are sorted in the order given by
+         * [FacetSpec.FacetKey.intervals][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.intervals];
+         * [FulfillmentInfo.ids][] are sorted in the order given by
+         * [FacetSpec.FacetKey.restricted_values][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.restricted_values].
+         * 
+ * + * string order_by = 4; + * + * @return The orderBy. + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * The order in which [Facet.values][] are returned.
+         * Allowed values are:
+         * * "count desc", which means order by [Facet.FacetValue.count][]
+         * descending.
+         * * "value desc", which means order by [Facet.FacetValue.value][]
+         * descending.
+         *   Only applies to textual facets.
+         * If not set, textual values are sorted in [natural
+         * order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
+         * intervals are sorted in the order given by
+         * [FacetSpec.FacetKey.intervals][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.intervals];
+         * [FulfillmentInfo.ids][] are sorted in the order given by
+         * [FacetSpec.FacetKey.restricted_values][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.restricted_values].
+         * 
+ * + * string order_by = 4; + * + * @return The bytes for orderBy. + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * The order in which [Facet.values][] are returned.
+         * Allowed values are:
+         * * "count desc", which means order by [Facet.FacetValue.count][]
+         * descending.
+         * * "value desc", which means order by [Facet.FacetValue.value][]
+         * descending.
+         *   Only applies to textual facets.
+         * If not set, textual values are sorted in [natural
+         * order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
+         * intervals are sorted in the order given by
+         * [FacetSpec.FacetKey.intervals][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.intervals];
+         * [FulfillmentInfo.ids][] are sorted in the order given by
+         * [FacetSpec.FacetKey.restricted_values][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.restricted_values].
+         * 
+ * + * string order_by = 4; + * + * @param value The orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + orderBy_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * The order in which [Facet.values][] are returned.
+         * Allowed values are:
+         * * "count desc", which means order by [Facet.FacetValue.count][]
+         * descending.
+         * * "value desc", which means order by [Facet.FacetValue.value][]
+         * descending.
+         *   Only applies to textual facets.
+         * If not set, textual values are sorted in [natural
+         * order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
+         * intervals are sorted in the order given by
+         * [FacetSpec.FacetKey.intervals][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.intervals];
+         * [FulfillmentInfo.ids][] are sorted in the order given by
+         * [FacetSpec.FacetKey.restricted_values][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.restricted_values].
+         * 
+ * + * string order_by = 4; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + + orderBy_ = getDefaultInstance().getOrderBy(); + onChanged(); + return this; + } + /** + * + * + *
+         * The order in which [Facet.values][] are returned.
+         * Allowed values are:
+         * * "count desc", which means order by [Facet.FacetValue.count][]
+         * descending.
+         * * "value desc", which means order by [Facet.FacetValue.value][]
+         * descending.
+         *   Only applies to textual facets.
+         * If not set, textual values are sorted in [natural
+         * order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
+         * intervals are sorted in the order given by
+         * [FacetSpec.FacetKey.intervals][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.intervals];
+         * [FulfillmentInfo.ids][] are sorted in the order given by
+         * [FacetSpec.FacetKey.restricted_values][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.restricted_values].
+         * 
+ * + * string order_by = 4; + * + * @param value The bytes for orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + orderBy_ = value; + onChanged(); + return this; + } + + private java.lang.Object query_ = ""; + /** + * + * + *
+         * The query that is used to compute facet for the given facet key.
+         * When provided, it will override the default behavior of facet
+         * computation. The query syntax is the same as a filter expression. See
+         * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
+         * detail syntax and limitations. Notice that there is no limitation on
+         * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
+         * when query is specified.
+         * In the response, [FacetValue.value][] will be always "1" and
+         * [FacetValue.count][] will be the number of results that matches the
+         * query.
+         * For example, you can set a customized facet for "shipToStore",
+         * where
+         * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
+         * is "customizedShipToStore", and
+         * [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query]
+         * is "availability: ANY(\"IN_STOCK\") AND shipToStore: ANY(\"123\")".
+         * Then the facet will count the products that are both in stock and ship
+         * to store "123".
+         * 
+ * + * string query = 5; + * + * @return The query. + */ + public java.lang.String getQuery() { + java.lang.Object ref = query_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + query_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * The query that is used to compute facet for the given facet key.
+         * When provided, it will override the default behavior of facet
+         * computation. The query syntax is the same as a filter expression. See
+         * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
+         * detail syntax and limitations. Notice that there is no limitation on
+         * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
+         * when query is specified.
+         * In the response, [FacetValue.value][] will be always "1" and
+         * [FacetValue.count][] will be the number of results that matches the
+         * query.
+         * For example, you can set a customized facet for "shipToStore",
+         * where
+         * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
+         * is "customizedShipToStore", and
+         * [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query]
+         * is "availability: ANY(\"IN_STOCK\") AND shipToStore: ANY(\"123\")".
+         * Then the facet will count the products that are both in stock and ship
+         * to store "123".
+         * 
+ * + * string query = 5; + * + * @return The bytes for query. + */ + public com.google.protobuf.ByteString getQueryBytes() { + java.lang.Object ref = query_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + query_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * The query that is used to compute facet for the given facet key.
+         * When provided, it will override the default behavior of facet
+         * computation. The query syntax is the same as a filter expression. See
+         * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
+         * detail syntax and limitations. Notice that there is no limitation on
+         * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
+         * when query is specified.
+         * In the response, [FacetValue.value][] will be always "1" and
+         * [FacetValue.count][] will be the number of results that matches the
+         * query.
+         * For example, you can set a customized facet for "shipToStore",
+         * where
+         * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
+         * is "customizedShipToStore", and
+         * [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query]
+         * is "availability: ANY(\"IN_STOCK\") AND shipToStore: ANY(\"123\")".
+         * Then the facet will count the products that are both in stock and ship
+         * to store "123".
+         * 
+ * + * string query = 5; + * + * @param value The query to set. + * @return This builder for chaining. + */ + public Builder setQuery(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + query_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * The query that is used to compute facet for the given facet key.
+         * When provided, it will override the default behavior of facet
+         * computation. The query syntax is the same as a filter expression. See
+         * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
+         * detail syntax and limitations. Notice that there is no limitation on
+         * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
+         * when query is specified.
+         * In the response, [FacetValue.value][] will be always "1" and
+         * [FacetValue.count][] will be the number of results that matches the
+         * query.
+         * For example, you can set a customized facet for "shipToStore",
+         * where
+         * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
+         * is "customizedShipToStore", and
+         * [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query]
+         * is "availability: ANY(\"IN_STOCK\") AND shipToStore: ANY(\"123\")".
+         * Then the facet will count the products that are both in stock and ship
+         * to store "123".
+         * 
+ * + * string query = 5; + * + * @return This builder for chaining. + */ + public Builder clearQuery() { + + query_ = getDefaultInstance().getQuery(); + onChanged(); + return this; + } + /** + * + * + *
+         * The query that is used to compute facet for the given facet key.
+         * When provided, it will override the default behavior of facet
+         * computation. The query syntax is the same as a filter expression. See
+         * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
+         * detail syntax and limitations. Notice that there is no limitation on
+         * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
+         * when query is specified.
+         * In the response, [FacetValue.value][] will be always "1" and
+         * [FacetValue.count][] will be the number of results that matches the
+         * query.
+         * For example, you can set a customized facet for "shipToStore",
+         * where
+         * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
+         * is "customizedShipToStore", and
+         * [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query]
+         * is "availability: ANY(\"IN_STOCK\") AND shipToStore: ANY(\"123\")".
+         * Then the facet will count the products that are both in stock and ship
+         * to store "123".
+         * 
+ * + * string query = 5; + * + * @param value The bytes for query to set. + * @return This builder for chaining. + */ + public Builder setQueryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + query_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey) + private static final com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey(); + } + + public static com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FacetKey parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new FacetKey(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int FACET_KEY_FIELD_NUMBER = 1; + private com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey facetKey_; + /** + * + * + *
+     * Required. The facet key specification.
+     * 
+ * + * + * .google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the facetKey field is set. + */ + @java.lang.Override + public boolean hasFacetKey() { + return facetKey_ != null; + } + /** + * + * + *
+     * Required. The facet key specification.
+     * 
+ * + * + * .google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The facetKey. + */ + @java.lang.Override + public com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey getFacetKey() { + return facetKey_ == null + ? com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.getDefaultInstance() + : facetKey_; + } + /** + * + * + *
+     * Required. The facet key specification.
+     * 
+ * + * + * .google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKeyOrBuilder + getFacetKeyOrBuilder() { + return getFacetKey(); + } + + public static final int LIMIT_FIELD_NUMBER = 2; + private int limit_; + /** + * + * + *
+     * Maximum of facet values that should be returned for this facet. If
+     * unspecified, defaults to 20. The maximum allowed value is 300. Values
+     * above 300 will be coerced to 300.
+     * If this field is negative, an INVALID_ARGUMENT is returned.
+     * 
+ * + * int32 limit = 2; + * + * @return The limit. + */ + @java.lang.Override + public int getLimit() { + return limit_; + } + + public static final int EXCLUDED_FILTER_KEYS_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList excludedFilterKeys_; + /** + * + * + *
+     * List of keys to exclude when faceting.
+     * By default,
+     * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
+     * is not excluded from the filter unless it is listed in this field.
+     * For example, suppose there are 100 products with color facet "Red" and
+     * 200 products with color facet "Blue". A query containing the filter
+     * "colorFamilies:ANY("Red")" and have "colorFamilies" as
+     * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
+     * will by default return the "Red" with count 100.
+     * If this field contains "colorFamilies", then the query returns both the
+     * "Red" with count 100 and "Blue" with count 200, because the
+     * "colorFamilies" key is now excluded from the filter.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @return A list containing the excludedFilterKeys. + */ + public com.google.protobuf.ProtocolStringList getExcludedFilterKeysList() { + return excludedFilterKeys_; + } + /** + * + * + *
+     * List of keys to exclude when faceting.
+     * By default,
+     * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
+     * is not excluded from the filter unless it is listed in this field.
+     * For example, suppose there are 100 products with color facet "Red" and
+     * 200 products with color facet "Blue". A query containing the filter
+     * "colorFamilies:ANY("Red")" and have "colorFamilies" as
+     * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
+     * will by default return the "Red" with count 100.
+     * If this field contains "colorFamilies", then the query returns both the
+     * "Red" with count 100 and "Blue" with count 200, because the
+     * "colorFamilies" key is now excluded from the filter.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @return The count of excludedFilterKeys. + */ + public int getExcludedFilterKeysCount() { + return excludedFilterKeys_.size(); + } + /** + * + * + *
+     * List of keys to exclude when faceting.
+     * By default,
+     * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
+     * is not excluded from the filter unless it is listed in this field.
+     * For example, suppose there are 100 products with color facet "Red" and
+     * 200 products with color facet "Blue". A query containing the filter
+     * "colorFamilies:ANY("Red")" and have "colorFamilies" as
+     * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
+     * will by default return the "Red" with count 100.
+     * If this field contains "colorFamilies", then the query returns both the
+     * "Red" with count 100 and "Blue" with count 200, because the
+     * "colorFamilies" key is now excluded from the filter.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @param index The index of the element to return. + * @return The excludedFilterKeys at the given index. + */ + public java.lang.String getExcludedFilterKeys(int index) { + return excludedFilterKeys_.get(index); + } + /** + * + * + *
+     * List of keys to exclude when faceting.
+     * By default,
+     * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
+     * is not excluded from the filter unless it is listed in this field.
+     * For example, suppose there are 100 products with color facet "Red" and
+     * 200 products with color facet "Blue". A query containing the filter
+     * "colorFamilies:ANY("Red")" and have "colorFamilies" as
+     * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
+     * will by default return the "Red" with count 100.
+     * If this field contains "colorFamilies", then the query returns both the
+     * "Red" with count 100 and "Blue" with count 200, because the
+     * "colorFamilies" key is now excluded from the filter.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @param index The index of the value to return. + * @return The bytes of the excludedFilterKeys at the given index. + */ + public com.google.protobuf.ByteString getExcludedFilterKeysBytes(int index) { + return excludedFilterKeys_.getByteString(index); + } + + public static final int ENABLE_DYNAMIC_POSITION_FIELD_NUMBER = 4; + private boolean enableDynamicPosition_; + /** + * + * + *
+     * Enables dynamic position for this facet. If set to true, the position of
+     * this facet among all facets in the response is determined by Google
+     * Retail Search. It will be ordered together with dynamic facets if dynamic
+     * facets is enabled. If set to false, the position of this facet in the
+     * response will be the same as in the request, and it will be ranked before
+     * the facets with dynamic position enable and all dynamic facets.
+     * For example, you may always want to have rating facet returned in
+     * the response, but it's not necessarily to always display the rating facet
+     * at the top. In that case, you can set enable_dynamic_position to true so
+     * that the position of rating facet in response will be determined by
+     * Google Retail Search.
+     * Another example, assuming you have the following facets in the request:
+     * * "rating", enable_dynamic_position = true
+     * * "price", enable_dynamic_position = false
+     * * "brands", enable_dynamic_position = false
+     * And also you have a dynamic facets enable, which will generate a facet
+     * 'gender'. Then the final order of the facets in the response can be
+     * ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
+     * "rating") depends on how Google Retail Search orders "gender" and
+     * "rating" facets. However, notice that "price" and "brands" will always be
+     * ranked at 1st and 2nd position since their enable_dynamic_position are
+     * false.
+     * 
+ * + * bool enable_dynamic_position = 4; + * + * @return The enableDynamicPosition. + */ + @java.lang.Override + public boolean getEnableDynamicPosition() { + return enableDynamicPosition_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (facetKey_ != null) { + output.writeMessage(1, getFacetKey()); + } + if (limit_ != 0) { + output.writeInt32(2, limit_); + } + for (int i = 0; i < excludedFilterKeys_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 3, excludedFilterKeys_.getRaw(i)); + } + if (enableDynamicPosition_ != false) { + output.writeBool(4, enableDynamicPosition_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (facetKey_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getFacetKey()); + } + if (limit_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, limit_); + } + { + int dataSize = 0; + for (int i = 0; i < excludedFilterKeys_.size(); i++) { + dataSize += computeStringSizeNoTag(excludedFilterKeys_.getRaw(i)); + } + size += dataSize; + size += 1 * getExcludedFilterKeysList().size(); + } + if (enableDynamicPosition_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, enableDynamicPosition_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.retail.v2.SearchRequest.FacetSpec)) { + return super.equals(obj); + } + com.google.cloud.retail.v2.SearchRequest.FacetSpec other = + (com.google.cloud.retail.v2.SearchRequest.FacetSpec) obj; + + if (hasFacetKey() != other.hasFacetKey()) return false; + if (hasFacetKey()) { + if (!getFacetKey().equals(other.getFacetKey())) return false; + } + if (getLimit() != other.getLimit()) return false; + if (!getExcludedFilterKeysList().equals(other.getExcludedFilterKeysList())) return false; + if (getEnableDynamicPosition() != other.getEnableDynamicPosition()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasFacetKey()) { + hash = (37 * hash) + FACET_KEY_FIELD_NUMBER; + hash = (53 * hash) + getFacetKey().hashCode(); + } + hash = (37 * hash) + LIMIT_FIELD_NUMBER; + hash = (53 * hash) + getLimit(); + if (getExcludedFilterKeysCount() > 0) { + hash = (37 * hash) + EXCLUDED_FILTER_KEYS_FIELD_NUMBER; + hash = (53 * hash) + getExcludedFilterKeysList().hashCode(); + } + hash = (37 * hash) + ENABLE_DYNAMIC_POSITION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnableDynamicPosition()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2.SearchRequest.FacetSpec parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.SearchRequest.FacetSpec parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchRequest.FacetSpec parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.SearchRequest.FacetSpec parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchRequest.FacetSpec parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.SearchRequest.FacetSpec parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchRequest.FacetSpec parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.SearchRequest.FacetSpec parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchRequest.FacetSpec parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.SearchRequest.FacetSpec parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchRequest.FacetSpec parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.SearchRequest.FacetSpec parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2.SearchRequest.FacetSpec prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * A facet specification to perform faceted search.
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2.SearchRequest.FacetSpec} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.SearchRequest.FacetSpec) + com.google.cloud.retail.v2.SearchRequest.FacetSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchRequest_FacetSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchRequest_FacetSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.SearchRequest.FacetSpec.class, + com.google.cloud.retail.v2.SearchRequest.FacetSpec.Builder.class); + } + + // Construct using com.google.cloud.retail.v2.SearchRequest.FacetSpec.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (facetKeyBuilder_ == null) { + facetKey_ = null; + } else { + facetKey_ = null; + facetKeyBuilder_ = null; + } + limit_ = 0; + + excludedFilterKeys_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + enableDynamicPosition_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchRequest_FacetSpec_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2.SearchRequest.FacetSpec getDefaultInstanceForType() { + return com.google.cloud.retail.v2.SearchRequest.FacetSpec.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2.SearchRequest.FacetSpec build() { + com.google.cloud.retail.v2.SearchRequest.FacetSpec result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2.SearchRequest.FacetSpec buildPartial() { + com.google.cloud.retail.v2.SearchRequest.FacetSpec result = + new com.google.cloud.retail.v2.SearchRequest.FacetSpec(this); + int from_bitField0_ = bitField0_; + if (facetKeyBuilder_ == null) { + result.facetKey_ = facetKey_; + } else { + result.facetKey_ = facetKeyBuilder_.build(); + } + result.limit_ = limit_; + if (((bitField0_ & 0x00000001) != 0)) { + excludedFilterKeys_ = excludedFilterKeys_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.excludedFilterKeys_ = excludedFilterKeys_; + result.enableDynamicPosition_ = enableDynamicPosition_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.retail.v2.SearchRequest.FacetSpec) { + return mergeFrom((com.google.cloud.retail.v2.SearchRequest.FacetSpec) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2.SearchRequest.FacetSpec other) { + if (other == com.google.cloud.retail.v2.SearchRequest.FacetSpec.getDefaultInstance()) + return this; + if (other.hasFacetKey()) { + mergeFacetKey(other.getFacetKey()); + } + if (other.getLimit() != 0) { + setLimit(other.getLimit()); + } + if (!other.excludedFilterKeys_.isEmpty()) { + if (excludedFilterKeys_.isEmpty()) { + excludedFilterKeys_ = other.excludedFilterKeys_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureExcludedFilterKeysIsMutable(); + excludedFilterKeys_.addAll(other.excludedFilterKeys_); + } + onChanged(); + } + if (other.getEnableDynamicPosition() != false) { + setEnableDynamicPosition(other.getEnableDynamicPosition()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.retail.v2.SearchRequest.FacetSpec parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2.SearchRequest.FacetSpec) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey facetKey_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey, + com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.Builder, + com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKeyOrBuilder> + facetKeyBuilder_; + /** + * + * + *
+       * Required. The facet key specification.
+       * 
+ * + * + * .google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the facetKey field is set. + */ + public boolean hasFacetKey() { + return facetKeyBuilder_ != null || facetKey_ != null; + } + /** + * + * + *
+       * Required. The facet key specification.
+       * 
+ * + * + * .google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The facetKey. + */ + public com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey getFacetKey() { + if (facetKeyBuilder_ == null) { + return facetKey_ == null + ? com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.getDefaultInstance() + : facetKey_; + } else { + return facetKeyBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Required. The facet key specification.
+       * 
+ * + * + * .google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setFacetKey( + com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey value) { + if (facetKeyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + facetKey_ = value; + onChanged(); + } else { + facetKeyBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * Required. The facet key specification.
+       * 
+ * + * + * .google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setFacetKey( + com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.Builder builderForValue) { + if (facetKeyBuilder_ == null) { + facetKey_ = builderForValue.build(); + onChanged(); + } else { + facetKeyBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * Required. The facet key specification.
+       * 
+ * + * + * .google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeFacetKey( + com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey value) { + if (facetKeyBuilder_ == null) { + if (facetKey_ != null) { + facetKey_ = + com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.newBuilder(facetKey_) + .mergeFrom(value) + .buildPartial(); + } else { + facetKey_ = value; + } + onChanged(); + } else { + facetKeyBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * Required. The facet key specification.
+       * 
+ * + * + * .google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearFacetKey() { + if (facetKeyBuilder_ == null) { + facetKey_ = null; + onChanged(); + } else { + facetKey_ = null; + facetKeyBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * Required. The facet key specification.
+       * 
+ * + * + * .google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.Builder + getFacetKeyBuilder() { + + onChanged(); + return getFacetKeyFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Required. The facet key specification.
+       * 
+ * + * + * .google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKeyOrBuilder + getFacetKeyOrBuilder() { + if (facetKeyBuilder_ != null) { + return facetKeyBuilder_.getMessageOrBuilder(); + } else { + return facetKey_ == null + ? com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.getDefaultInstance() + : facetKey_; + } + } + /** + * + * + *
+       * Required. The facet key specification.
+       * 
+ * + * + * .google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey, + com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.Builder, + com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKeyOrBuilder> + getFacetKeyFieldBuilder() { + if (facetKeyBuilder_ == null) { + facetKeyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey, + com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.Builder, + com.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKeyOrBuilder>( + getFacetKey(), getParentForChildren(), isClean()); + facetKey_ = null; + } + return facetKeyBuilder_; + } + + private int limit_; + /** + * + * + *
+       * Maximum of facet values that should be returned for this facet. If
+       * unspecified, defaults to 20. The maximum allowed value is 300. Values
+       * above 300 will be coerced to 300.
+       * If this field is negative, an INVALID_ARGUMENT is returned.
+       * 
+ * + * int32 limit = 2; + * + * @return The limit. + */ + @java.lang.Override + public int getLimit() { + return limit_; + } + /** + * + * + *
+       * Maximum of facet values that should be returned for this facet. If
+       * unspecified, defaults to 20. The maximum allowed value is 300. Values
+       * above 300 will be coerced to 300.
+       * If this field is negative, an INVALID_ARGUMENT is returned.
+       * 
+ * + * int32 limit = 2; + * + * @param value The limit to set. + * @return This builder for chaining. + */ + public Builder setLimit(int value) { + + limit_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Maximum of facet values that should be returned for this facet. If
+       * unspecified, defaults to 20. The maximum allowed value is 300. Values
+       * above 300 will be coerced to 300.
+       * If this field is negative, an INVALID_ARGUMENT is returned.
+       * 
+ * + * int32 limit = 2; + * + * @return This builder for chaining. + */ + public Builder clearLimit() { + + limit_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList excludedFilterKeys_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureExcludedFilterKeysIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + excludedFilterKeys_ = new com.google.protobuf.LazyStringArrayList(excludedFilterKeys_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+       * List of keys to exclude when faceting.
+       * By default,
+       * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
+       * is not excluded from the filter unless it is listed in this field.
+       * For example, suppose there are 100 products with color facet "Red" and
+       * 200 products with color facet "Blue". A query containing the filter
+       * "colorFamilies:ANY("Red")" and have "colorFamilies" as
+       * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
+       * will by default return the "Red" with count 100.
+       * If this field contains "colorFamilies", then the query returns both the
+       * "Red" with count 100 and "Blue" with count 200, because the
+       * "colorFamilies" key is now excluded from the filter.
+       * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+       * is returned.
+       * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @return A list containing the excludedFilterKeys. + */ + public com.google.protobuf.ProtocolStringList getExcludedFilterKeysList() { + return excludedFilterKeys_.getUnmodifiableView(); + } + /** + * + * + *
+       * List of keys to exclude when faceting.
+       * By default,
+       * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
+       * is not excluded from the filter unless it is listed in this field.
+       * For example, suppose there are 100 products with color facet "Red" and
+       * 200 products with color facet "Blue". A query containing the filter
+       * "colorFamilies:ANY("Red")" and have "colorFamilies" as
+       * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
+       * will by default return the "Red" with count 100.
+       * If this field contains "colorFamilies", then the query returns both the
+       * "Red" with count 100 and "Blue" with count 200, because the
+       * "colorFamilies" key is now excluded from the filter.
+       * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+       * is returned.
+       * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @return The count of excludedFilterKeys. + */ + public int getExcludedFilterKeysCount() { + return excludedFilterKeys_.size(); + } + /** + * + * + *
+       * List of keys to exclude when faceting.
+       * By default,
+       * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
+       * is not excluded from the filter unless it is listed in this field.
+       * For example, suppose there are 100 products with color facet "Red" and
+       * 200 products with color facet "Blue". A query containing the filter
+       * "colorFamilies:ANY("Red")" and have "colorFamilies" as
+       * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
+       * will by default return the "Red" with count 100.
+       * If this field contains "colorFamilies", then the query returns both the
+       * "Red" with count 100 and "Blue" with count 200, because the
+       * "colorFamilies" key is now excluded from the filter.
+       * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+       * is returned.
+       * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @param index The index of the element to return. + * @return The excludedFilterKeys at the given index. + */ + public java.lang.String getExcludedFilterKeys(int index) { + return excludedFilterKeys_.get(index); + } + /** + * + * + *
+       * List of keys to exclude when faceting.
+       * By default,
+       * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
+       * is not excluded from the filter unless it is listed in this field.
+       * For example, suppose there are 100 products with color facet "Red" and
+       * 200 products with color facet "Blue". A query containing the filter
+       * "colorFamilies:ANY("Red")" and have "colorFamilies" as
+       * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
+       * will by default return the "Red" with count 100.
+       * If this field contains "colorFamilies", then the query returns both the
+       * "Red" with count 100 and "Blue" with count 200, because the
+       * "colorFamilies" key is now excluded from the filter.
+       * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+       * is returned.
+       * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @param index The index of the value to return. + * @return The bytes of the excludedFilterKeys at the given index. + */ + public com.google.protobuf.ByteString getExcludedFilterKeysBytes(int index) { + return excludedFilterKeys_.getByteString(index); + } + /** + * + * + *
+       * List of keys to exclude when faceting.
+       * By default,
+       * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
+       * is not excluded from the filter unless it is listed in this field.
+       * For example, suppose there are 100 products with color facet "Red" and
+       * 200 products with color facet "Blue". A query containing the filter
+       * "colorFamilies:ANY("Red")" and have "colorFamilies" as
+       * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
+       * will by default return the "Red" with count 100.
+       * If this field contains "colorFamilies", then the query returns both the
+       * "Red" with count 100 and "Blue" with count 200, because the
+       * "colorFamilies" key is now excluded from the filter.
+       * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+       * is returned.
+       * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @param index The index to set the value at. + * @param value The excludedFilterKeys to set. + * @return This builder for chaining. + */ + public Builder setExcludedFilterKeys(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureExcludedFilterKeysIsMutable(); + excludedFilterKeys_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * List of keys to exclude when faceting.
+       * By default,
+       * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
+       * is not excluded from the filter unless it is listed in this field.
+       * For example, suppose there are 100 products with color facet "Red" and
+       * 200 products with color facet "Blue". A query containing the filter
+       * "colorFamilies:ANY("Red")" and have "colorFamilies" as
+       * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
+       * will by default return the "Red" with count 100.
+       * If this field contains "colorFamilies", then the query returns both the
+       * "Red" with count 100 and "Blue" with count 200, because the
+       * "colorFamilies" key is now excluded from the filter.
+       * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+       * is returned.
+       * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @param value The excludedFilterKeys to add. + * @return This builder for chaining. + */ + public Builder addExcludedFilterKeys(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureExcludedFilterKeysIsMutable(); + excludedFilterKeys_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * List of keys to exclude when faceting.
+       * By default,
+       * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
+       * is not excluded from the filter unless it is listed in this field.
+       * For example, suppose there are 100 products with color facet "Red" and
+       * 200 products with color facet "Blue". A query containing the filter
+       * "colorFamilies:ANY("Red")" and have "colorFamilies" as
+       * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
+       * will by default return the "Red" with count 100.
+       * If this field contains "colorFamilies", then the query returns both the
+       * "Red" with count 100 and "Blue" with count 200, because the
+       * "colorFamilies" key is now excluded from the filter.
+       * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+       * is returned.
+       * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @param values The excludedFilterKeys to add. + * @return This builder for chaining. + */ + public Builder addAllExcludedFilterKeys(java.lang.Iterable values) { + ensureExcludedFilterKeysIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, excludedFilterKeys_); + onChanged(); + return this; + } + /** + * + * + *
+       * List of keys to exclude when faceting.
+       * By default,
+       * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
+       * is not excluded from the filter unless it is listed in this field.
+       * For example, suppose there are 100 products with color facet "Red" and
+       * 200 products with color facet "Blue". A query containing the filter
+       * "colorFamilies:ANY("Red")" and have "colorFamilies" as
+       * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
+       * will by default return the "Red" with count 100.
+       * If this field contains "colorFamilies", then the query returns both the
+       * "Red" with count 100 and "Blue" with count 200, because the
+       * "colorFamilies" key is now excluded from the filter.
+       * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+       * is returned.
+       * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @return This builder for chaining. + */ + public Builder clearExcludedFilterKeys() { + excludedFilterKeys_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * List of keys to exclude when faceting.
+       * By default,
+       * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
+       * is not excluded from the filter unless it is listed in this field.
+       * For example, suppose there are 100 products with color facet "Red" and
+       * 200 products with color facet "Blue". A query containing the filter
+       * "colorFamilies:ANY("Red")" and have "colorFamilies" as
+       * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key]
+       * will by default return the "Red" with count 100.
+       * If this field contains "colorFamilies", then the query returns both the
+       * "Red" with count 100 and "Blue" with count 200, because the
+       * "colorFamilies" key is now excluded from the filter.
+       * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+       * is returned.
+       * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @param value The bytes of the excludedFilterKeys to add. + * @return This builder for chaining. + */ + public Builder addExcludedFilterKeysBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureExcludedFilterKeysIsMutable(); + excludedFilterKeys_.add(value); + onChanged(); + return this; + } + + private boolean enableDynamicPosition_; + /** + * + * + *
+       * Enables dynamic position for this facet. If set to true, the position of
+       * this facet among all facets in the response is determined by Google
+       * Retail Search. It will be ordered together with dynamic facets if dynamic
+       * facets is enabled. If set to false, the position of this facet in the
+       * response will be the same as in the request, and it will be ranked before
+       * the facets with dynamic position enable and all dynamic facets.
+       * For example, you may always want to have rating facet returned in
+       * the response, but it's not necessarily to always display the rating facet
+       * at the top. In that case, you can set enable_dynamic_position to true so
+       * that the position of rating facet in response will be determined by
+       * Google Retail Search.
+       * Another example, assuming you have the following facets in the request:
+       * * "rating", enable_dynamic_position = true
+       * * "price", enable_dynamic_position = false
+       * * "brands", enable_dynamic_position = false
+       * And also you have a dynamic facets enable, which will generate a facet
+       * 'gender'. Then the final order of the facets in the response can be
+       * ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
+       * "rating") depends on how Google Retail Search orders "gender" and
+       * "rating" facets. However, notice that "price" and "brands" will always be
+       * ranked at 1st and 2nd position since their enable_dynamic_position are
+       * false.
+       * 
+ * + * bool enable_dynamic_position = 4; + * + * @return The enableDynamicPosition. + */ + @java.lang.Override + public boolean getEnableDynamicPosition() { + return enableDynamicPosition_; + } + /** + * + * + *
+       * Enables dynamic position for this facet. If set to true, the position of
+       * this facet among all facets in the response is determined by Google
+       * Retail Search. It will be ordered together with dynamic facets if dynamic
+       * facets is enabled. If set to false, the position of this facet in the
+       * response will be the same as in the request, and it will be ranked before
+       * the facets with dynamic position enable and all dynamic facets.
+       * For example, you may always want to have rating facet returned in
+       * the response, but it's not necessarily to always display the rating facet
+       * at the top. In that case, you can set enable_dynamic_position to true so
+       * that the position of rating facet in response will be determined by
+       * Google Retail Search.
+       * Another example, assuming you have the following facets in the request:
+       * * "rating", enable_dynamic_position = true
+       * * "price", enable_dynamic_position = false
+       * * "brands", enable_dynamic_position = false
+       * And also you have a dynamic facets enable, which will generate a facet
+       * 'gender'. Then the final order of the facets in the response can be
+       * ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
+       * "rating") depends on how Google Retail Search orders "gender" and
+       * "rating" facets. However, notice that "price" and "brands" will always be
+       * ranked at 1st and 2nd position since their enable_dynamic_position are
+       * false.
+       * 
+ * + * bool enable_dynamic_position = 4; + * + * @param value The enableDynamicPosition to set. + * @return This builder for chaining. + */ + public Builder setEnableDynamicPosition(boolean value) { + + enableDynamicPosition_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Enables dynamic position for this facet. If set to true, the position of
+       * this facet among all facets in the response is determined by Google
+       * Retail Search. It will be ordered together with dynamic facets if dynamic
+       * facets is enabled. If set to false, the position of this facet in the
+       * response will be the same as in the request, and it will be ranked before
+       * the facets with dynamic position enable and all dynamic facets.
+       * For example, you may always want to have rating facet returned in
+       * the response, but it's not necessarily to always display the rating facet
+       * at the top. In that case, you can set enable_dynamic_position to true so
+       * that the position of rating facet in response will be determined by
+       * Google Retail Search.
+       * Another example, assuming you have the following facets in the request:
+       * * "rating", enable_dynamic_position = true
+       * * "price", enable_dynamic_position = false
+       * * "brands", enable_dynamic_position = false
+       * And also you have a dynamic facets enable, which will generate a facet
+       * 'gender'. Then the final order of the facets in the response can be
+       * ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
+       * "rating") depends on how Google Retail Search orders "gender" and
+       * "rating" facets. However, notice that "price" and "brands" will always be
+       * ranked at 1st and 2nd position since their enable_dynamic_position are
+       * false.
+       * 
+ * + * bool enable_dynamic_position = 4; + * + * @return This builder for chaining. + */ + public Builder clearEnableDynamicPosition() { + + enableDynamicPosition_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.SearchRequest.FacetSpec) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.SearchRequest.FacetSpec) + private static final com.google.cloud.retail.v2.SearchRequest.FacetSpec DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2.SearchRequest.FacetSpec(); + } + + public static com.google.cloud.retail.v2.SearchRequest.FacetSpec getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FacetSpec parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new FacetSpec(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.retail.v2.SearchRequest.FacetSpec getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface DynamicFacetSpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2.SearchRequest.DynamicFacetSpec) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Mode of the DynamicFacet feature.
+     * Defaults to
+     * [Mode.DISABLED][google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode.DISABLED]
+     * if it's unset.
+     * 
+ * + * .google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode mode = 1; + * + * @return The enum numeric value on the wire for mode. + */ + int getModeValue(); + /** + * + * + *
+     * Mode of the DynamicFacet feature.
+     * Defaults to
+     * [Mode.DISABLED][google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode.DISABLED]
+     * if it's unset.
+     * 
+ * + * .google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode mode = 1; + * + * @return The mode. + */ + com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode getMode(); + } + /** + * + * + *
+   * The specifications of dynamically generated facets.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2.SearchRequest.DynamicFacetSpec} + */ + public static final class DynamicFacetSpec extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.SearchRequest.DynamicFacetSpec) + DynamicFacetSpecOrBuilder { + private static final long serialVersionUID = 0L; + // Use DynamicFacetSpec.newBuilder() to construct. + private DynamicFacetSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DynamicFacetSpec() { + mode_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DynamicFacetSpec(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DynamicFacetSpec( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + int rawValue = input.readEnum(); + + mode_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchRequest_DynamicFacetSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchRequest_DynamicFacetSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.class, + com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Builder.class); + } + + /** + * + * + *
+     * Enum to control DynamicFacet mode
+     * 
+ * + * Protobuf enum {@code google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode} + */ + public enum Mode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * Default value.
+       * 
+ * + * MODE_UNSPECIFIED = 0; + */ + MODE_UNSPECIFIED(0), + /** + * + * + *
+       * Disable Dynamic Facet.
+       * 
+ * + * DISABLED = 1; + */ + DISABLED(1), + /** + * + * + *
+       * Automatic mode built by Google Retail Search.
+       * 
+ * + * ENABLED = 2; + */ + ENABLED(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * Default value.
+       * 
+ * + * MODE_UNSPECIFIED = 0; + */ + public static final int MODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+       * Disable Dynamic Facet.
+       * 
+ * + * DISABLED = 1; + */ + public static final int DISABLED_VALUE = 1; + /** + * + * + *
+       * Automatic mode built by Google Retail Search.
+       * 
+ * + * ENABLED = 2; + */ + public static final int ENABLED_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Mode valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Mode forNumber(int value) { + switch (value) { + case 0: + return MODE_UNSPECIFIED; + case 1: + return DISABLED; + case 2: + return ENABLED; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Mode findValueByNumber(int number) { + return Mode.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Mode[] VALUES = values(); + + public static Mode valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Mode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode) + } + + public static final int MODE_FIELD_NUMBER = 1; + private int mode_; + /** + * + * + *
+     * Mode of the DynamicFacet feature.
+     * Defaults to
+     * [Mode.DISABLED][google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode.DISABLED]
+     * if it's unset.
+     * 
+ * + * .google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode mode = 1; + * + * @return The enum numeric value on the wire for mode. + */ + @java.lang.Override + public int getModeValue() { + return mode_; + } + /** + * + * + *
+     * Mode of the DynamicFacet feature.
+     * Defaults to
+     * [Mode.DISABLED][google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode.DISABLED]
+     * if it's unset.
+     * 
+ * + * .google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode mode = 1; + * + * @return The mode. + */ + @java.lang.Override + public com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode getMode() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode result = + com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode.valueOf(mode_); + return result == null + ? com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode.UNRECOGNIZED + : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (mode_ + != com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode.MODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, mode_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (mode_ + != com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode.MODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, mode_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec)) { + return super.equals(obj); + } + com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec other = + (com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec) obj; + + if (mode_ != other.mode_) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + MODE_FIELD_NUMBER; + hash = (53 * hash) + mode_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * The specifications of dynamically generated facets.
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2.SearchRequest.DynamicFacetSpec} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.SearchRequest.DynamicFacetSpec) + com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchRequest_DynamicFacetSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchRequest_DynamicFacetSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.class, + com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Builder.class); + } + + // Construct using com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + mode_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchRequest_DynamicFacetSpec_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec getDefaultInstanceForType() { + return com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec build() { + com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec buildPartial() { + com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec result = + new com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec(this); + result.mode_ = mode_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec) { + return mergeFrom((com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec other) { + if (other == com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.getDefaultInstance()) + return this; + if (other.mode_ != 0) { + setModeValue(other.getModeValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int mode_ = 0; + /** + * + * + *
+       * Mode of the DynamicFacet feature.
+       * Defaults to
+       * [Mode.DISABLED][google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode.DISABLED]
+       * if it's unset.
+       * 
+ * + * .google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode mode = 1; + * + * @return The enum numeric value on the wire for mode. + */ + @java.lang.Override + public int getModeValue() { + return mode_; + } + /** + * + * + *
+       * Mode of the DynamicFacet feature.
+       * Defaults to
+       * [Mode.DISABLED][google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode.DISABLED]
+       * if it's unset.
+       * 
+ * + * .google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode mode = 1; + * + * @param value The enum numeric value on the wire for mode to set. + * @return This builder for chaining. + */ + public Builder setModeValue(int value) { + + mode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Mode of the DynamicFacet feature.
+       * Defaults to
+       * [Mode.DISABLED][google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode.DISABLED]
+       * if it's unset.
+       * 
+ * + * .google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode mode = 1; + * + * @return The mode. + */ + @java.lang.Override + public com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode getMode() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode result = + com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode.valueOf(mode_); + return result == null + ? com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode.UNRECOGNIZED + : result; + } + /** + * + * + *
+       * Mode of the DynamicFacet feature.
+       * Defaults to
+       * [Mode.DISABLED][google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode.DISABLED]
+       * if it's unset.
+       * 
+ * + * .google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode mode = 1; + * + * @param value The mode to set. + * @return This builder for chaining. + */ + public Builder setMode(com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode value) { + if (value == null) { + throw new NullPointerException(); + } + + mode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * Mode of the DynamicFacet feature.
+       * Defaults to
+       * [Mode.DISABLED][google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode.DISABLED]
+       * if it's unset.
+       * 
+ * + * .google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode mode = 1; + * + * @return This builder for chaining. + */ + public Builder clearMode() { + + mode_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.SearchRequest.DynamicFacetSpec) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.SearchRequest.DynamicFacetSpec) + private static final com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec(); + } + + public static com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DynamicFacetSpec parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DynamicFacetSpec(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface BoostSpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2.SearchRequest.BoostSpec) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Condition boost specifications. If a product matches multiple conditions
+     * in the specifictions, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 10.
+     * 
+ * + * + * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + java.util.List + getConditionBoostSpecsList(); + /** + * + * + *
+     * Condition boost specifications. If a product matches multiple conditions
+     * in the specifictions, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 10.
+     * 
+ * + * + * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec getConditionBoostSpecs( + int index); + /** + * + * + *
+     * Condition boost specifications. If a product matches multiple conditions
+     * in the specifictions, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 10.
+     * 
+ * + * + * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + int getConditionBoostSpecsCount(); + /** + * + * + *
+     * Condition boost specifications. If a product matches multiple conditions
+     * in the specifictions, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 10.
+     * 
+ * + * + * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + java.util.List< + ? extends + com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder> + getConditionBoostSpecsOrBuilderList(); + /** + * + * + *
+     * Condition boost specifications. If a product matches multiple conditions
+     * in the specifictions, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 10.
+     * 
+ * + * + * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder + getConditionBoostSpecsOrBuilder(int index); + } + /** + * + * + *
+   * Boost specification to boost certain items.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2.SearchRequest.BoostSpec} + */ + public static final class BoostSpec extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.SearchRequest.BoostSpec) + BoostSpecOrBuilder { + private static final long serialVersionUID = 0L; + // Use BoostSpec.newBuilder() to construct. + private BoostSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BoostSpec() { + conditionBoostSpecs_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BoostSpec(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private BoostSpec( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + conditionBoostSpecs_ = + new java.util.ArrayList< + com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec>(); + mutable_bitField0_ |= 0x00000001; + } + conditionBoostSpecs_.add( + input.readMessage( + com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec + .parser(), + extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + conditionBoostSpecs_ = java.util.Collections.unmodifiableList(conditionBoostSpecs_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchRequest_BoostSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchRequest_BoostSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.SearchRequest.BoostSpec.class, + com.google.cloud.retail.v2.SearchRequest.BoostSpec.Builder.class); + } + + public interface ConditionBoostSpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * An expression which specifies a boost condition. The syntax and
+       * supported fields are the same as a filter expression. See
+       * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
+       * detail syntax and limitations.
+       * Examples:
+       * * To boost products with product ID "product_1" or "product_2", and
+       * color
+       *   "Red" or "Blue":<br>
+       *   *(id: ANY("product_1", "product_2"))<br>*
+       *   *AND<br>*
+       *   *(colorFamilies: ANY("Red", "Blue"))<br>*
+       * 
+ * + * string condition = 1; + * + * @return The condition. + */ + java.lang.String getCondition(); + /** + * + * + *
+       * An expression which specifies a boost condition. The syntax and
+       * supported fields are the same as a filter expression. See
+       * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
+       * detail syntax and limitations.
+       * Examples:
+       * * To boost products with product ID "product_1" or "product_2", and
+       * color
+       *   "Red" or "Blue":<br>
+       *   *(id: ANY("product_1", "product_2"))<br>*
+       *   *AND<br>*
+       *   *(colorFamilies: ANY("Red", "Blue"))<br>*
+       * 
+ * + * string condition = 1; + * + * @return The bytes for condition. + */ + com.google.protobuf.ByteString getConditionBytes(); + + /** + * + * + *
+       * Strength of the condition boost, which should be in [-1, 1]. Negative
+       * boost means demotion. Default is 0.0.
+       * Setting to 1.0 gives the item a big promotion. However, it does not
+       * necessarily mean that the boosted item will be the top result at all
+       * times, nor that other items will be excluded. Results could still be
+       * shown even when none of them matches the condition. And results that
+       * are significantly more relevant to the search query can still trump
+       * your heavily favored but irrelevant items.
+       * Setting to -1.0 gives the item a big demotion. However, results that
+       * are deeply relevant might still be shown. The item will have an
+       * upstream battle to get a fairly high ranking, but it is not blocked out
+       * completely.
+       * Setting to 0.0 means no boost applied. The boosting condition is
+       * ignored.
+       * 
+ * + * float boost = 2; + * + * @return The boost. + */ + float getBoost(); + } + /** + * + * + *
+     * Boost applies to products which match a condition.
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec} + */ + public static final class ConditionBoostSpec extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec) + ConditionBoostSpecOrBuilder { + private static final long serialVersionUID = 0L; + // Use ConditionBoostSpec.newBuilder() to construct. + private ConditionBoostSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ConditionBoostSpec() { + condition_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ConditionBoostSpec(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ConditionBoostSpec( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + condition_ = s; + break; + } + case 21: + { + boost_ = input.readFloat(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchRequest_BoostSpec_ConditionBoostSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchRequest_BoostSpec_ConditionBoostSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.class, + com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.Builder + .class); + } + + public static final int CONDITION_FIELD_NUMBER = 1; + private volatile java.lang.Object condition_; + /** + * + * + *
+       * An expression which specifies a boost condition. The syntax and
+       * supported fields are the same as a filter expression. See
+       * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
+       * detail syntax and limitations.
+       * Examples:
+       * * To boost products with product ID "product_1" or "product_2", and
+       * color
+       *   "Red" or "Blue":<br>
+       *   *(id: ANY("product_1", "product_2"))<br>*
+       *   *AND<br>*
+       *   *(colorFamilies: ANY("Red", "Blue"))<br>*
+       * 
+ * + * string condition = 1; + * + * @return The condition. + */ + @java.lang.Override + public java.lang.String getCondition() { + java.lang.Object ref = condition_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + condition_ = s; + return s; + } + } + /** + * + * + *
+       * An expression which specifies a boost condition. The syntax and
+       * supported fields are the same as a filter expression. See
+       * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
+       * detail syntax and limitations.
+       * Examples:
+       * * To boost products with product ID "product_1" or "product_2", and
+       * color
+       *   "Red" or "Blue":<br>
+       *   *(id: ANY("product_1", "product_2"))<br>*
+       *   *AND<br>*
+       *   *(colorFamilies: ANY("Red", "Blue"))<br>*
+       * 
+ * + * string condition = 1; + * + * @return The bytes for condition. + */ + @java.lang.Override + public com.google.protobuf.ByteString getConditionBytes() { + java.lang.Object ref = condition_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + condition_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BOOST_FIELD_NUMBER = 2; + private float boost_; + /** + * + * + *
+       * Strength of the condition boost, which should be in [-1, 1]. Negative
+       * boost means demotion. Default is 0.0.
+       * Setting to 1.0 gives the item a big promotion. However, it does not
+       * necessarily mean that the boosted item will be the top result at all
+       * times, nor that other items will be excluded. Results could still be
+       * shown even when none of them matches the condition. And results that
+       * are significantly more relevant to the search query can still trump
+       * your heavily favored but irrelevant items.
+       * Setting to -1.0 gives the item a big demotion. However, results that
+       * are deeply relevant might still be shown. The item will have an
+       * upstream battle to get a fairly high ranking, but it is not blocked out
+       * completely.
+       * Setting to 0.0 means no boost applied. The boosting condition is
+       * ignored.
+       * 
+ * + * float boost = 2; + * + * @return The boost. + */ + @java.lang.Override + public float getBoost() { + return boost_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getConditionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, condition_); + } + if (boost_ != 0F) { + output.writeFloat(2, boost_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getConditionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, condition_); + } + if (boost_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, boost_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec)) { + return super.equals(obj); + } + com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec other = + (com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec) obj; + + if (!getCondition().equals(other.getCondition())) return false; + if (java.lang.Float.floatToIntBits(getBoost()) + != java.lang.Float.floatToIntBits(other.getBoost())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CONDITION_FIELD_NUMBER; + hash = (53 * hash) + getCondition().hashCode(); + hash = (37 * hash) + BOOST_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getBoost()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+       * Boost applies to products which match a condition.
+       * 
+ * + * Protobuf type {@code google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec) + com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchRequest_BoostSpec_ConditionBoostSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchRequest_BoostSpec_ConditionBoostSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.class, + com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.Builder + .class); + } + + // Construct using + // com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + condition_ = ""; + + boost_ = 0F; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchRequest_BoostSpec_ConditionBoostSpec_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec + getDefaultInstanceForType() { + return com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec build() { + com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec + buildPartial() { + com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec result = + new com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec(this); + result.condition_ = condition_; + result.boost_ = boost_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec) { + return mergeFrom( + (com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec other) { + if (other + == com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec + .getDefaultInstance()) return this; + if (!other.getCondition().isEmpty()) { + condition_ = other.condition_; + onChanged(); + } + if (other.getBoost() != 0F) { + setBoost(other.getBoost()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec parsedMessage = + null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object condition_ = ""; + /** + * + * + *
+         * An expression which specifies a boost condition. The syntax and
+         * supported fields are the same as a filter expression. See
+         * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
+         * detail syntax and limitations.
+         * Examples:
+         * * To boost products with product ID "product_1" or "product_2", and
+         * color
+         *   "Red" or "Blue":<br>
+         *   *(id: ANY("product_1", "product_2"))<br>*
+         *   *AND<br>*
+         *   *(colorFamilies: ANY("Red", "Blue"))<br>*
+         * 
+ * + * string condition = 1; + * + * @return The condition. + */ + public java.lang.String getCondition() { + java.lang.Object ref = condition_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + condition_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * An expression which specifies a boost condition. The syntax and
+         * supported fields are the same as a filter expression. See
+         * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
+         * detail syntax and limitations.
+         * Examples:
+         * * To boost products with product ID "product_1" or "product_2", and
+         * color
+         *   "Red" or "Blue":<br>
+         *   *(id: ANY("product_1", "product_2"))<br>*
+         *   *AND<br>*
+         *   *(colorFamilies: ANY("Red", "Blue"))<br>*
+         * 
+ * + * string condition = 1; + * + * @return The bytes for condition. + */ + public com.google.protobuf.ByteString getConditionBytes() { + java.lang.Object ref = condition_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + condition_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * An expression which specifies a boost condition. The syntax and
+         * supported fields are the same as a filter expression. See
+         * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
+         * detail syntax and limitations.
+         * Examples:
+         * * To boost products with product ID "product_1" or "product_2", and
+         * color
+         *   "Red" or "Blue":<br>
+         *   *(id: ANY("product_1", "product_2"))<br>*
+         *   *AND<br>*
+         *   *(colorFamilies: ANY("Red", "Blue"))<br>*
+         * 
+ * + * string condition = 1; + * + * @param value The condition to set. + * @return This builder for chaining. + */ + public Builder setCondition(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + condition_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * An expression which specifies a boost condition. The syntax and
+         * supported fields are the same as a filter expression. See
+         * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
+         * detail syntax and limitations.
+         * Examples:
+         * * To boost products with product ID "product_1" or "product_2", and
+         * color
+         *   "Red" or "Blue":<br>
+         *   *(id: ANY("product_1", "product_2"))<br>*
+         *   *AND<br>*
+         *   *(colorFamilies: ANY("Red", "Blue"))<br>*
+         * 
+ * + * string condition = 1; + * + * @return This builder for chaining. + */ + public Builder clearCondition() { + + condition_ = getDefaultInstance().getCondition(); + onChanged(); + return this; + } + /** + * + * + *
+         * An expression which specifies a boost condition. The syntax and
+         * supported fields are the same as a filter expression. See
+         * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
+         * detail syntax and limitations.
+         * Examples:
+         * * To boost products with product ID "product_1" or "product_2", and
+         * color
+         *   "Red" or "Blue":<br>
+         *   *(id: ANY("product_1", "product_2"))<br>*
+         *   *AND<br>*
+         *   *(colorFamilies: ANY("Red", "Blue"))<br>*
+         * 
+ * + * string condition = 1; + * + * @param value The bytes for condition to set. + * @return This builder for chaining. + */ + public Builder setConditionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + condition_ = value; + onChanged(); + return this; + } + + private float boost_; + /** + * + * + *
+         * Strength of the condition boost, which should be in [-1, 1]. Negative
+         * boost means demotion. Default is 0.0.
+         * Setting to 1.0 gives the item a big promotion. However, it does not
+         * necessarily mean that the boosted item will be the top result at all
+         * times, nor that other items will be excluded. Results could still be
+         * shown even when none of them matches the condition. And results that
+         * are significantly more relevant to the search query can still trump
+         * your heavily favored but irrelevant items.
+         * Setting to -1.0 gives the item a big demotion. However, results that
+         * are deeply relevant might still be shown. The item will have an
+         * upstream battle to get a fairly high ranking, but it is not blocked out
+         * completely.
+         * Setting to 0.0 means no boost applied. The boosting condition is
+         * ignored.
+         * 
+ * + * float boost = 2; + * + * @return The boost. + */ + @java.lang.Override + public float getBoost() { + return boost_; + } + /** + * + * + *
+         * Strength of the condition boost, which should be in [-1, 1]. Negative
+         * boost means demotion. Default is 0.0.
+         * Setting to 1.0 gives the item a big promotion. However, it does not
+         * necessarily mean that the boosted item will be the top result at all
+         * times, nor that other items will be excluded. Results could still be
+         * shown even when none of them matches the condition. And results that
+         * are significantly more relevant to the search query can still trump
+         * your heavily favored but irrelevant items.
+         * Setting to -1.0 gives the item a big demotion. However, results that
+         * are deeply relevant might still be shown. The item will have an
+         * upstream battle to get a fairly high ranking, but it is not blocked out
+         * completely.
+         * Setting to 0.0 means no boost applied. The boosting condition is
+         * ignored.
+         * 
+ * + * float boost = 2; + * + * @param value The boost to set. + * @return This builder for chaining. + */ + public Builder setBoost(float value) { + + boost_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * Strength of the condition boost, which should be in [-1, 1]. Negative
+         * boost means demotion. Default is 0.0.
+         * Setting to 1.0 gives the item a big promotion. However, it does not
+         * necessarily mean that the boosted item will be the top result at all
+         * times, nor that other items will be excluded. Results could still be
+         * shown even when none of them matches the condition. And results that
+         * are significantly more relevant to the search query can still trump
+         * your heavily favored but irrelevant items.
+         * Setting to -1.0 gives the item a big demotion. However, results that
+         * are deeply relevant might still be shown. The item will have an
+         * upstream battle to get a fairly high ranking, but it is not blocked out
+         * completely.
+         * Setting to 0.0 means no boost applied. The boosting condition is
+         * ignored.
+         * 
+ * + * float boost = 2; + * + * @return This builder for chaining. + */ + public Builder clearBoost() { + + boost_ = 0F; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec) + private static final com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec(); + } + + public static com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ConditionBoostSpec parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ConditionBoostSpec(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int CONDITION_BOOST_SPECS_FIELD_NUMBER = 1; + private java.util.List + conditionBoostSpecs_; + /** + * + * + *
+     * Condition boost specifications. If a product matches multiple conditions
+     * in the specifictions, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 10.
+     * 
+ * + * + * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + @java.lang.Override + public java.util.List + getConditionBoostSpecsList() { + return conditionBoostSpecs_; + } + /** + * + * + *
+     * Condition boost specifications. If a product matches multiple conditions
+     * in the specifictions, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 10.
+     * 
+ * + * + * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + @java.lang.Override + public java.util.List< + ? extends + com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder> + getConditionBoostSpecsOrBuilderList() { + return conditionBoostSpecs_; + } + /** + * + * + *
+     * Condition boost specifications. If a product matches multiple conditions
+     * in the specifictions, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 10.
+     * 
+ * + * + * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + @java.lang.Override + public int getConditionBoostSpecsCount() { + return conditionBoostSpecs_.size(); + } + /** + * + * + *
+     * Condition boost specifications. If a product matches multiple conditions
+     * in the specifictions, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 10.
+     * 
+ * + * + * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec + getConditionBoostSpecs(int index) { + return conditionBoostSpecs_.get(index); + } + /** + * + * + *
+     * Condition boost specifications. If a product matches multiple conditions
+     * in the specifictions, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 10.
+     * 
+ * + * + * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder + getConditionBoostSpecsOrBuilder(int index) { + return conditionBoostSpecs_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < conditionBoostSpecs_.size(); i++) { + output.writeMessage(1, conditionBoostSpecs_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < conditionBoostSpecs_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, conditionBoostSpecs_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.retail.v2.SearchRequest.BoostSpec)) { + return super.equals(obj); + } + com.google.cloud.retail.v2.SearchRequest.BoostSpec other = + (com.google.cloud.retail.v2.SearchRequest.BoostSpec) obj; + + if (!getConditionBoostSpecsList().equals(other.getConditionBoostSpecsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getConditionBoostSpecsCount() > 0) { + hash = (37 * hash) + CONDITION_BOOST_SPECS_FIELD_NUMBER; + hash = (53 * hash) + getConditionBoostSpecsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2.SearchRequest.BoostSpec parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.SearchRequest.BoostSpec parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchRequest.BoostSpec parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.SearchRequest.BoostSpec parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchRequest.BoostSpec parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.SearchRequest.BoostSpec parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchRequest.BoostSpec parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.SearchRequest.BoostSpec parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchRequest.BoostSpec parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.SearchRequest.BoostSpec parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchRequest.BoostSpec parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.SearchRequest.BoostSpec parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2.SearchRequest.BoostSpec prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Boost specification to boost certain items.
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2.SearchRequest.BoostSpec} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.SearchRequest.BoostSpec) + com.google.cloud.retail.v2.SearchRequest.BoostSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchRequest_BoostSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchRequest_BoostSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.SearchRequest.BoostSpec.class, + com.google.cloud.retail.v2.SearchRequest.BoostSpec.Builder.class); + } + + // Construct using com.google.cloud.retail.v2.SearchRequest.BoostSpec.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getConditionBoostSpecsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (conditionBoostSpecsBuilder_ == null) { + conditionBoostSpecs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + conditionBoostSpecsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchRequest_BoostSpec_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2.SearchRequest.BoostSpec getDefaultInstanceForType() { + return com.google.cloud.retail.v2.SearchRequest.BoostSpec.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2.SearchRequest.BoostSpec build() { + com.google.cloud.retail.v2.SearchRequest.BoostSpec result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2.SearchRequest.BoostSpec buildPartial() { + com.google.cloud.retail.v2.SearchRequest.BoostSpec result = + new com.google.cloud.retail.v2.SearchRequest.BoostSpec(this); + int from_bitField0_ = bitField0_; + if (conditionBoostSpecsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + conditionBoostSpecs_ = java.util.Collections.unmodifiableList(conditionBoostSpecs_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.conditionBoostSpecs_ = conditionBoostSpecs_; + } else { + result.conditionBoostSpecs_ = conditionBoostSpecsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.retail.v2.SearchRequest.BoostSpec) { + return mergeFrom((com.google.cloud.retail.v2.SearchRequest.BoostSpec) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2.SearchRequest.BoostSpec other) { + if (other == com.google.cloud.retail.v2.SearchRequest.BoostSpec.getDefaultInstance()) + return this; + if (conditionBoostSpecsBuilder_ == null) { + if (!other.conditionBoostSpecs_.isEmpty()) { + if (conditionBoostSpecs_.isEmpty()) { + conditionBoostSpecs_ = other.conditionBoostSpecs_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureConditionBoostSpecsIsMutable(); + conditionBoostSpecs_.addAll(other.conditionBoostSpecs_); + } + onChanged(); + } + } else { + if (!other.conditionBoostSpecs_.isEmpty()) { + if (conditionBoostSpecsBuilder_.isEmpty()) { + conditionBoostSpecsBuilder_.dispose(); + conditionBoostSpecsBuilder_ = null; + conditionBoostSpecs_ = other.conditionBoostSpecs_; + bitField0_ = (bitField0_ & ~0x00000001); + conditionBoostSpecsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getConditionBoostSpecsFieldBuilder() + : null; + } else { + conditionBoostSpecsBuilder_.addAllMessages(other.conditionBoostSpecs_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.retail.v2.SearchRequest.BoostSpec parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2.SearchRequest.BoostSpec) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List + conditionBoostSpecs_ = java.util.Collections.emptyList(); + + private void ensureConditionBoostSpecsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + conditionBoostSpecs_ = + new java.util.ArrayList< + com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec>( + conditionBoostSpecs_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec, + com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.Builder, + com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder> + conditionBoostSpecsBuilder_; + + /** + * + * + *
+       * Condition boost specifications. If a product matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 10.
+       * 
+ * + * + * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public java.util.List + getConditionBoostSpecsList() { + if (conditionBoostSpecsBuilder_ == null) { + return java.util.Collections.unmodifiableList(conditionBoostSpecs_); + } else { + return conditionBoostSpecsBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * Condition boost specifications. If a product matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 10.
+       * 
+ * + * + * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public int getConditionBoostSpecsCount() { + if (conditionBoostSpecsBuilder_ == null) { + return conditionBoostSpecs_.size(); + } else { + return conditionBoostSpecsBuilder_.getCount(); + } + } + /** + * + * + *
+       * Condition boost specifications. If a product matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 10.
+       * 
+ * + * + * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec + getConditionBoostSpecs(int index) { + if (conditionBoostSpecsBuilder_ == null) { + return conditionBoostSpecs_.get(index); + } else { + return conditionBoostSpecsBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * Condition boost specifications. If a product matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 10.
+       * 
+ * + * + * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public Builder setConditionBoostSpecs( + int index, com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec value) { + if (conditionBoostSpecsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConditionBoostSpecsIsMutable(); + conditionBoostSpecs_.set(index, value); + onChanged(); + } else { + conditionBoostSpecsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Condition boost specifications. If a product matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 10.
+       * 
+ * + * + * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public Builder setConditionBoostSpecs( + int index, + com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.Builder + builderForValue) { + if (conditionBoostSpecsBuilder_ == null) { + ensureConditionBoostSpecsIsMutable(); + conditionBoostSpecs_.set(index, builderForValue.build()); + onChanged(); + } else { + conditionBoostSpecsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Condition boost specifications. If a product matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 10.
+       * 
+ * + * + * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public Builder addConditionBoostSpecs( + com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec value) { + if (conditionBoostSpecsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConditionBoostSpecsIsMutable(); + conditionBoostSpecs_.add(value); + onChanged(); + } else { + conditionBoostSpecsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * Condition boost specifications. If a product matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 10.
+       * 
+ * + * + * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public Builder addConditionBoostSpecs( + int index, com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec value) { + if (conditionBoostSpecsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConditionBoostSpecsIsMutable(); + conditionBoostSpecs_.add(index, value); + onChanged(); + } else { + conditionBoostSpecsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Condition boost specifications. If a product matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 10.
+       * 
+ * + * + * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public Builder addConditionBoostSpecs( + com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.Builder + builderForValue) { + if (conditionBoostSpecsBuilder_ == null) { + ensureConditionBoostSpecsIsMutable(); + conditionBoostSpecs_.add(builderForValue.build()); + onChanged(); + } else { + conditionBoostSpecsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Condition boost specifications. If a product matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 10.
+       * 
+ * + * + * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public Builder addConditionBoostSpecs( + int index, + com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.Builder + builderForValue) { + if (conditionBoostSpecsBuilder_ == null) { + ensureConditionBoostSpecsIsMutable(); + conditionBoostSpecs_.add(index, builderForValue.build()); + onChanged(); + } else { + conditionBoostSpecsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Condition boost specifications. If a product matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 10.
+       * 
+ * + * + * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public Builder addAllConditionBoostSpecs( + java.lang.Iterable< + ? extends com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec> + values) { + if (conditionBoostSpecsBuilder_ == null) { + ensureConditionBoostSpecsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, conditionBoostSpecs_); + onChanged(); + } else { + conditionBoostSpecsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * Condition boost specifications. If a product matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 10.
+       * 
+ * + * + * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public Builder clearConditionBoostSpecs() { + if (conditionBoostSpecsBuilder_ == null) { + conditionBoostSpecs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + conditionBoostSpecsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Condition boost specifications. If a product matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 10.
+       * 
+ * + * + * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public Builder removeConditionBoostSpecs(int index) { + if (conditionBoostSpecsBuilder_ == null) { + ensureConditionBoostSpecsIsMutable(); + conditionBoostSpecs_.remove(index); + onChanged(); + } else { + conditionBoostSpecsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * Condition boost specifications. If a product matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 10.
+       * 
+ * + * + * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.Builder + getConditionBoostSpecsBuilder(int index) { + return getConditionBoostSpecsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * Condition boost specifications. If a product matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 10.
+       * 
+ * + * + * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder + getConditionBoostSpecsOrBuilder(int index) { + if (conditionBoostSpecsBuilder_ == null) { + return conditionBoostSpecs_.get(index); + } else { + return conditionBoostSpecsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * Condition boost specifications. If a product matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 10.
+       * 
+ * + * + * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public java.util.List< + ? extends + com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder> + getConditionBoostSpecsOrBuilderList() { + if (conditionBoostSpecsBuilder_ != null) { + return conditionBoostSpecsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(conditionBoostSpecs_); + } + } + /** + * + * + *
+       * Condition boost specifications. If a product matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 10.
+       * 
+ * + * + * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.Builder + addConditionBoostSpecsBuilder() { + return getConditionBoostSpecsFieldBuilder() + .addBuilder( + com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec + .getDefaultInstance()); + } + /** + * + * + *
+       * Condition boost specifications. If a product matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 10.
+       * 
+ * + * + * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.Builder + addConditionBoostSpecsBuilder(int index) { + return getConditionBoostSpecsFieldBuilder() + .addBuilder( + index, + com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec + .getDefaultInstance()); + } + /** + * + * + *
+       * Condition boost specifications. If a product matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 10.
+       * 
+ * + * + * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public java.util.List< + com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.Builder> + getConditionBoostSpecsBuilderList() { + return getConditionBoostSpecsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec, + com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.Builder, + com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder> + getConditionBoostSpecsFieldBuilder() { + if (conditionBoostSpecsBuilder_ == null) { + conditionBoostSpecsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec, + com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.Builder, + com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder>( + conditionBoostSpecs_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + conditionBoostSpecs_ = null; + } + return conditionBoostSpecsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.SearchRequest.BoostSpec) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.SearchRequest.BoostSpec) + private static final com.google.cloud.retail.v2.SearchRequest.BoostSpec DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2.SearchRequest.BoostSpec(); + } + + public static com.google.cloud.retail.v2.SearchRequest.BoostSpec getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BoostSpec parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BoostSpec(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.retail.v2.SearchRequest.BoostSpec getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface QueryExpansionSpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2.SearchRequest.QueryExpansionSpec) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The condition under which query expansion should occur. Default to
+     * [Condition.DISABLED][google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+     * 
+ * + * .google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition condition = 1; + * + * + * @return The enum numeric value on the wire for condition. + */ + int getConditionValue(); + /** + * + * + *
+     * The condition under which query expansion should occur. Default to
+     * [Condition.DISABLED][google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+     * 
+ * + * .google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition condition = 1; + * + * + * @return The condition. + */ + com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition getCondition(); + } + /** + * + * + *
+   * Specification to determine under which conditions query expansion should
+   * occur.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2.SearchRequest.QueryExpansionSpec} + */ + public static final class QueryExpansionSpec extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.SearchRequest.QueryExpansionSpec) + QueryExpansionSpecOrBuilder { + private static final long serialVersionUID = 0L; + // Use QueryExpansionSpec.newBuilder() to construct. + private QueryExpansionSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private QueryExpansionSpec() { + condition_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new QueryExpansionSpec(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private QueryExpansionSpec( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + int rawValue = input.readEnum(); + + condition_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchRequest_QueryExpansionSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchRequest_QueryExpansionSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.class, + com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Builder.class); + } + + /** + * + * + *
+     * Enum describing under which condition query expansion should occur.
+     * 
+ * + * Protobuf enum {@code google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition} + */ + public enum Condition implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * Unspecified query expansion condition. This defaults to
+       * [Condition.DISABLED][google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+       * 
+ * + * CONDITION_UNSPECIFIED = 0; + */ + CONDITION_UNSPECIFIED(0), + /** + * + * + *
+       * Disabled query expansion. Only the exact search query is used, even if
+       * [SearchResponse.total_size][google.cloud.retail.v2.SearchResponse.total_size]
+       * is zero.
+       * 
+ * + * DISABLED = 1; + */ + DISABLED(1), + /** + * + * + *
+       * Automatic query expansion built by Google Retail Search.
+       * 
+ * + * AUTO = 3; + */ + AUTO(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * Unspecified query expansion condition. This defaults to
+       * [Condition.DISABLED][google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+       * 
+ * + * CONDITION_UNSPECIFIED = 0; + */ + public static final int CONDITION_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+       * Disabled query expansion. Only the exact search query is used, even if
+       * [SearchResponse.total_size][google.cloud.retail.v2.SearchResponse.total_size]
+       * is zero.
+       * 
+ * + * DISABLED = 1; + */ + public static final int DISABLED_VALUE = 1; + /** + * + * + *
+       * Automatic query expansion built by Google Retail Search.
+       * 
+ * + * AUTO = 3; + */ + public static final int AUTO_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Condition valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Condition forNumber(int value) { + switch (value) { + case 0: + return CONDITION_UNSPECIFIED; + case 1: + return DISABLED; + case 3: + return AUTO; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Condition findValueByNumber(int number) { + return Condition.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Condition[] VALUES = values(); + + public static Condition valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Condition(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition) + } + + public static final int CONDITION_FIELD_NUMBER = 1; + private int condition_; + /** + * + * + *
+     * The condition under which query expansion should occur. Default to
+     * [Condition.DISABLED][google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+     * 
+ * + * .google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition condition = 1; + * + * + * @return The enum numeric value on the wire for condition. + */ + @java.lang.Override + public int getConditionValue() { + return condition_; + } + /** + * + * + *
+     * The condition under which query expansion should occur. Default to
+     * [Condition.DISABLED][google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+     * 
+ * + * .google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition condition = 1; + * + * + * @return The condition. + */ + @java.lang.Override + public com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition getCondition() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition result = + com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition.valueOf(condition_); + return result == null + ? com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition.UNRECOGNIZED + : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (condition_ + != com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition + .CONDITION_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, condition_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (condition_ + != com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition + .CONDITION_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, condition_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec)) { + return super.equals(obj); + } + com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec other = + (com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec) obj; + + if (condition_ != other.condition_) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CONDITION_FIELD_NUMBER; + hash = (53 * hash) + condition_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Specification to determine under which conditions query expansion should
+     * occur.
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2.SearchRequest.QueryExpansionSpec} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.SearchRequest.QueryExpansionSpec) + com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchRequest_QueryExpansionSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchRequest_QueryExpansionSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.class, + com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Builder.class); + } + + // Construct using com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + condition_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchRequest_QueryExpansionSpec_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec + getDefaultInstanceForType() { + return com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec build() { + com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec buildPartial() { + com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec result = + new com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec(this); + result.condition_ = condition_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec) { + return mergeFrom((com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec other) { + if (other + == com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.getDefaultInstance()) + return this; + if (other.condition_ != 0) { + setConditionValue(other.getConditionValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int condition_ = 0; + /** + * + * + *
+       * The condition under which query expansion should occur. Default to
+       * [Condition.DISABLED][google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+       * 
+ * + * .google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition condition = 1; + * + * + * @return The enum numeric value on the wire for condition. + */ + @java.lang.Override + public int getConditionValue() { + return condition_; + } + /** + * + * + *
+       * The condition under which query expansion should occur. Default to
+       * [Condition.DISABLED][google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+       * 
+ * + * .google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition condition = 1; + * + * + * @param value The enum numeric value on the wire for condition to set. + * @return This builder for chaining. + */ + public Builder setConditionValue(int value) { + + condition_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The condition under which query expansion should occur. Default to
+       * [Condition.DISABLED][google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+       * 
+ * + * .google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition condition = 1; + * + * + * @return The condition. + */ + @java.lang.Override + public com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition getCondition() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition result = + com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition.valueOf( + condition_); + return result == null + ? com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition.UNRECOGNIZED + : result; + } + /** + * + * + *
+       * The condition under which query expansion should occur. Default to
+       * [Condition.DISABLED][google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+       * 
+ * + * .google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition condition = 1; + * + * + * @param value The condition to set. + * @return This builder for chaining. + */ + public Builder setCondition( + com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition value) { + if (value == null) { + throw new NullPointerException(); + } + + condition_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * The condition under which query expansion should occur. Default to
+       * [Condition.DISABLED][google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+       * 
+ * + * .google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition condition = 1; + * + * + * @return This builder for chaining. + */ + public Builder clearCondition() { + + condition_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.SearchRequest.QueryExpansionSpec) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.SearchRequest.QueryExpansionSpec) + private static final com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec(); + } + + public static com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public QueryExpansionSpec parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new QueryExpansionSpec(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int PLACEMENT_FIELD_NUMBER = 1; + private volatile java.lang.Object placement_; + /** + * + * + *
+   * Required. The resource name of the search engine placement, such as
+   * `projects/*/locations/global/catalogs/default_catalog/placements/default_search`.
+   * This field is used to identify the set of models that will be used to make
+   * the search.
+   * We currently support one placement with the following ID:
+   * * `default_search`.
+   * 
+ * + * string placement = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The placement. + */ + @java.lang.Override + public java.lang.String getPlacement() { + java.lang.Object ref = placement_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + placement_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name of the search engine placement, such as
+   * `projects/*/locations/global/catalogs/default_catalog/placements/default_search`.
+   * This field is used to identify the set of models that will be used to make
+   * the search.
+   * We currently support one placement with the following ID:
+   * * `default_search`.
+   * 
+ * + * string placement = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for placement. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPlacementBytes() { + java.lang.Object ref = placement_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + placement_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BRANCH_FIELD_NUMBER = 2; + private volatile java.lang.Object branch_; + /** + * + * + *
+   * The branch resource name, such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/0`.
+   * Use "default_branch" as the branch ID or leave this field empty, to search
+   * products under the default branch.
+   * 
+ * + * string branch = 2 [(.google.api.resource_reference) = { ... } + * + * @return The branch. + */ + @java.lang.Override + public java.lang.String getBranch() { + java.lang.Object ref = branch_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + branch_ = s; + return s; + } + } + /** + * + * + *
+   * The branch resource name, such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/0`.
+   * Use "default_branch" as the branch ID or leave this field empty, to search
+   * products under the default branch.
+   * 
+ * + * string branch = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for branch. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBranchBytes() { + java.lang.Object ref = branch_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + branch_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int QUERY_FIELD_NUMBER = 3; + private volatile java.lang.Object query_; + /** + * + * + *
+   * Raw search query.
+   * 
+ * + * string query = 3; + * + * @return The query. + */ + @java.lang.Override + public java.lang.String getQuery() { + java.lang.Object ref = query_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + query_ = s; + return s; + } + } + /** + * + * + *
+   * Raw search query.
+   * 
+ * + * string query = 3; + * + * @return The bytes for query. + */ + @java.lang.Override + public com.google.protobuf.ByteString getQueryBytes() { + java.lang.Object ref = query_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + query_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VISITOR_ID_FIELD_NUMBER = 4; + private volatile java.lang.Object visitorId_; + /** + * + * + *
+   * 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.
+   * 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]; + * + * @return The visitorId. + */ + @java.lang.Override + public java.lang.String getVisitorId() { + java.lang.Object ref = visitorId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + visitorId_ = s; + return s; + } + } + /** + * + * + *
+   * 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.
+   * 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]; + * + * @return The bytes for visitorId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVisitorIdBytes() { + java.lang.Object ref = visitorId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + visitorId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int USER_INFO_FIELD_NUMBER = 5; + private com.google.cloud.retail.v2.UserInfo userInfo_; + /** + * + * + *
+   * User information.
+   * 
+ * + * .google.cloud.retail.v2.UserInfo user_info = 5; + * + * @return Whether the userInfo field is set. + */ + @java.lang.Override + public boolean hasUserInfo() { + return userInfo_ != null; + } + /** + * + * + *
+   * User information.
+   * 
+ * + * .google.cloud.retail.v2.UserInfo user_info = 5; + * + * @return The userInfo. + */ + @java.lang.Override + public com.google.cloud.retail.v2.UserInfo getUserInfo() { + return userInfo_ == null ? com.google.cloud.retail.v2.UserInfo.getDefaultInstance() : userInfo_; + } + /** + * + * + *
+   * User information.
+   * 
+ * + * .google.cloud.retail.v2.UserInfo user_info = 5; + */ + @java.lang.Override + public com.google.cloud.retail.v2.UserInfoOrBuilder getUserInfoOrBuilder() { + return getUserInfo(); + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 7; + private int pageSize_; + /** + * + * + *
+   * Maximum number of [Product][google.cloud.retail.v2.Product]s to return. If
+   * unspecified, defaults to a reasonable value. The maximum allowed value is
+   * 120. Values above 120 will be coerced to 120.
+   * If this field is negative, an INVALID_ARGUMENT is returned.
+   * 
+ * + * int32 page_size = 7; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 8; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * A page token
+   * [SearchResponse.next_page_token][google.cloud.retail.v2.SearchResponse.next_page_token],
+   * received from a previous
+   * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to
+   * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] must
+   * match the call that provided the page token. Otherwise, an INVALID_ARGUMENT
+   * error is returned.
+   * 
+ * + * string page_token = 8; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A page token
+   * [SearchResponse.next_page_token][google.cloud.retail.v2.SearchResponse.next_page_token],
+   * received from a previous
+   * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to
+   * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] must
+   * match the call that provided the page token. Otherwise, an INVALID_ARGUMENT
+   * error is returned.
+   * 
+ * + * string page_token = 8; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OFFSET_FIELD_NUMBER = 9; + private int offset_; + /** + * + * + *
+   * A 0-indexed integer that specifies the current offset (that is, starting
+   * result location, amongst the [Product][google.cloud.retail.v2.Product]s
+   * deemed by the API as relevant) in search results. This field is only
+   * considered if [page_token][google.cloud.retail.v2.SearchRequest.page_token]
+   * is unset.
+   * If this field is negative, an INVALID_ARGUMENT is returned.
+   * 
+ * + * int32 offset = 9; + * + * @return The offset. + */ + @java.lang.Override + public int getOffset() { + return offset_; + } + + public static final int FILTER_FIELD_NUMBER = 10; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * The filter syntax consists of an expression language for constructing a
+   * predicate from one or more fields of the products being filtered. Filter
+   * expression is case-sensitive. See more details at this [user
+   * guide](/retail/private/docs/filter-and-order#filter).
+   * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
+   * 
+ * + * string filter = 10; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * The filter syntax consists of an expression language for constructing a
+   * predicate from one or more fields of the products being filtered. Filter
+   * expression is case-sensitive. See more details at this [user
+   * guide](/retail/private/docs/filter-and-order#filter).
+   * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
+   * 
+ * + * string filter = 10; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CANONICAL_FILTER_FIELD_NUMBER = 28; + private volatile java.lang.Object canonicalFilter_; + /** + * + * + *
+   * 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
+   * [SearchRequest.canonical_filter][google.cloud.retail.v2.SearchRequest.canonical_filter]
+   * will be returned as a supplement of the original query. This field is
+   * strongly recommended to achieve high search quality.
+   * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
+   * more details about filter syntax.
+   * 
+ * + * string canonical_filter = 28; + * + * @return The canonicalFilter. + */ + @java.lang.Override + public java.lang.String getCanonicalFilter() { + java.lang.Object ref = canonicalFilter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + canonicalFilter_ = s; + return s; + } + } + /** + * + * + *
+   * 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
+   * [SearchRequest.canonical_filter][google.cloud.retail.v2.SearchRequest.canonical_filter]
+   * will be returned as a supplement of the original query. This field is
+   * strongly recommended to achieve high search quality.
+   * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
+   * more details about filter syntax.
+   * 
+ * + * string canonical_filter = 28; + * + * @return The bytes for canonicalFilter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCanonicalFilterBytes() { + java.lang.Object ref = canonicalFilter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + canonicalFilter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 11; + private volatile java.lang.Object orderBy_; + /** + * + * + *
+   * The order in which products are returned. Products can be ordered by
+   * a field in an [Product][google.cloud.retail.v2.Product] object. Leave it
+   * unset if ordered by relevance. OrderBy expression is case-sensitive. See
+   * more details at this [user
+   * guide](/retail/private/docs/filter-and-order#order).
+   * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
+   * 
+ * + * string order_by = 11; + * + * @return The orderBy. + */ + @java.lang.Override + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } + } + /** + * + * + *
+   * The order in which products are returned. Products can be ordered by
+   * a field in an [Product][google.cloud.retail.v2.Product] object. Leave it
+   * unset if ordered by relevance. OrderBy expression is case-sensitive. See
+   * more details at this [user
+   * guide](/retail/private/docs/filter-and-order#order).
+   * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
+   * 
+ * + * string order_by = 11; + * + * @return The bytes for orderBy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FACET_SPECS_FIELD_NUMBER = 12; + private java.util.List facetSpecs_; + /** + * + * + *
+   * Facet specifications for faceted search. If empty, no facets are returned.
+   * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2.SearchRequest.FacetSpec facet_specs = 12; + */ + @java.lang.Override + public java.util.List getFacetSpecsList() { + return facetSpecs_; + } + /** + * + * + *
+   * Facet specifications for faceted search. If empty, no facets are returned.
+   * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2.SearchRequest.FacetSpec facet_specs = 12; + */ + @java.lang.Override + public java.util.List + getFacetSpecsOrBuilderList() { + return facetSpecs_; + } + /** + * + * + *
+   * Facet specifications for faceted search. If empty, no facets are returned.
+   * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2.SearchRequest.FacetSpec facet_specs = 12; + */ + @java.lang.Override + public int getFacetSpecsCount() { + return facetSpecs_.size(); + } + /** + * + * + *
+   * Facet specifications for faceted search. If empty, no facets are returned.
+   * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2.SearchRequest.FacetSpec facet_specs = 12; + */ + @java.lang.Override + public com.google.cloud.retail.v2.SearchRequest.FacetSpec getFacetSpecs(int index) { + return facetSpecs_.get(index); + } + /** + * + * + *
+   * Facet specifications for faceted search. If empty, no facets are returned.
+   * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2.SearchRequest.FacetSpec facet_specs = 12; + */ + @java.lang.Override + public com.google.cloud.retail.v2.SearchRequest.FacetSpecOrBuilder getFacetSpecsOrBuilder( + int index) { + return facetSpecs_.get(index); + } + + public static final int DYNAMIC_FACET_SPEC_FIELD_NUMBER = 21; + private com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec dynamicFacetSpec_; + /** + * + * + *
+   * The specification for dynamically generated facets. Notice that only
+   * textual facets can be dynamically generated.
+   * This feature requires additional allowlisting. Contact Retail Support
+   * (retail-search-support@google.com) if you are interested in using dynamic
+   * facet feature.
+   * 
+ * + * .google.cloud.retail.v2.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21; + * + * @return Whether the dynamicFacetSpec field is set. + */ + @java.lang.Override + public boolean hasDynamicFacetSpec() { + return dynamicFacetSpec_ != null; + } + /** + * + * + *
+   * The specification for dynamically generated facets. Notice that only
+   * textual facets can be dynamically generated.
+   * This feature requires additional allowlisting. Contact Retail Support
+   * (retail-search-support@google.com) if you are interested in using dynamic
+   * facet feature.
+   * 
+ * + * .google.cloud.retail.v2.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21; + * + * @return The dynamicFacetSpec. + */ + @java.lang.Override + public com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec getDynamicFacetSpec() { + return dynamicFacetSpec_ == null + ? com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.getDefaultInstance() + : dynamicFacetSpec_; + } + /** + * + * + *
+   * The specification for dynamically generated facets. Notice that only
+   * textual facets can be dynamically generated.
+   * This feature requires additional allowlisting. Contact Retail Support
+   * (retail-search-support@google.com) if you are interested in using dynamic
+   * facet feature.
+   * 
+ * + * .google.cloud.retail.v2.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21; + */ + @java.lang.Override + public com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpecOrBuilder + getDynamicFacetSpecOrBuilder() { + return getDynamicFacetSpec(); + } + + public static final int BOOST_SPEC_FIELD_NUMBER = 13; + private com.google.cloud.retail.v2.SearchRequest.BoostSpec boostSpec_; + /** + * + * + *
+   * Boost specification to boost certain products. See more details at this
+   * [user guide](/retail/private/docs/boosting).
+   * 
+ * + * .google.cloud.retail.v2.SearchRequest.BoostSpec boost_spec = 13; + * + * @return Whether the boostSpec field is set. + */ + @java.lang.Override + public boolean hasBoostSpec() { + return boostSpec_ != null; + } + /** + * + * + *
+   * Boost specification to boost certain products. See more details at this
+   * [user guide](/retail/private/docs/boosting).
+   * 
+ * + * .google.cloud.retail.v2.SearchRequest.BoostSpec boost_spec = 13; + * + * @return The boostSpec. + */ + @java.lang.Override + public com.google.cloud.retail.v2.SearchRequest.BoostSpec getBoostSpec() { + return boostSpec_ == null + ? com.google.cloud.retail.v2.SearchRequest.BoostSpec.getDefaultInstance() + : boostSpec_; + } + /** + * + * + *
+   * Boost specification to boost certain products. See more details at this
+   * [user guide](/retail/private/docs/boosting).
+   * 
+ * + * .google.cloud.retail.v2.SearchRequest.BoostSpec boost_spec = 13; + */ + @java.lang.Override + public com.google.cloud.retail.v2.SearchRequest.BoostSpecOrBuilder getBoostSpecOrBuilder() { + return getBoostSpec(); + } + + public static final int QUERY_EXPANSION_SPEC_FIELD_NUMBER = 14; + private com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec queryExpansionSpec_; + /** + * + * + *
+   * The query expansion specification that specifies the conditions under which
+   * query expansion will occur. See more details at this [user
+   * guide](/retail/private/docs/result-size#query_expansion).
+   * 
+ * + * .google.cloud.retail.v2.SearchRequest.QueryExpansionSpec query_expansion_spec = 14; + * + * + * @return Whether the queryExpansionSpec field is set. + */ + @java.lang.Override + public boolean hasQueryExpansionSpec() { + return queryExpansionSpec_ != null; + } + /** + * + * + *
+   * The query expansion specification that specifies the conditions under which
+   * query expansion will occur. See more details at this [user
+   * guide](/retail/private/docs/result-size#query_expansion).
+   * 
+ * + * .google.cloud.retail.v2.SearchRequest.QueryExpansionSpec query_expansion_spec = 14; + * + * + * @return The queryExpansionSpec. + */ + @java.lang.Override + public com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec getQueryExpansionSpec() { + return queryExpansionSpec_ == null + ? com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.getDefaultInstance() + : queryExpansionSpec_; + } + /** + * + * + *
+   * The query expansion specification that specifies the conditions under which
+   * query expansion will occur. See more details at this [user
+   * guide](/retail/private/docs/result-size#query_expansion).
+   * 
+ * + * .google.cloud.retail.v2.SearchRequest.QueryExpansionSpec query_expansion_spec = 14; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpecOrBuilder + getQueryExpansionSpecOrBuilder() { + return getQueryExpansionSpec(); + } + + public static final int VARIANT_ROLLUP_KEYS_FIELD_NUMBER = 17; + private com.google.protobuf.LazyStringList variantRollupKeys_; + /** + * + * + *
+   * 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.
+   * For
+   * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info],
+   * a fulfillment type and a fulfillment ID must be provided in the format of
+   * "fulfillmentType.filfillmentId". E.g., in "pickupInStore.store123",
+   * "pickupInStore" is fulfillment type and "store123" is the store ID.
+   * Supported keys are:
+   * * colorFamilies
+   * * price
+   * * originalPrice
+   * * discount
+   * * attributes.key, where key is any key in the
+   *   [Product.attributes][google.cloud.retail.v2.Product.attributes] map.
+   * * pickupInStore.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.PICKUP_IN_STORE][].
+   * * shipToStore.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.SHIP_TO_STORE][].
+   * * sameDayDelivery.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.SAME_DAY_DELIVERY][].
+   * * nextDayDelivery.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.NEXT_DAY_DELIVERY][].
+   * * customFulfillment1.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.CUSTOM_TYPE_1][].
+   * * customFulfillment2.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.CUSTOM_TYPE_2][].
+   * * customFulfillment3.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.CUSTOM_TYPE_3][].
+   * * customFulfillment4.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.CUSTOM_TYPE_4][].
+   * * customFulfillment5.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.CUSTOM_TYPE_5][].
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string variant_rollup_keys = 17; + * + * @return A list containing the variantRollupKeys. + */ + public com.google.protobuf.ProtocolStringList getVariantRollupKeysList() { + return variantRollupKeys_; + } + /** + * + * + *
+   * 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.
+   * For
+   * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info],
+   * a fulfillment type and a fulfillment ID must be provided in the format of
+   * "fulfillmentType.filfillmentId". E.g., in "pickupInStore.store123",
+   * "pickupInStore" is fulfillment type and "store123" is the store ID.
+   * Supported keys are:
+   * * colorFamilies
+   * * price
+   * * originalPrice
+   * * discount
+   * * attributes.key, where key is any key in the
+   *   [Product.attributes][google.cloud.retail.v2.Product.attributes] map.
+   * * pickupInStore.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.PICKUP_IN_STORE][].
+   * * shipToStore.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.SHIP_TO_STORE][].
+   * * sameDayDelivery.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.SAME_DAY_DELIVERY][].
+   * * nextDayDelivery.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.NEXT_DAY_DELIVERY][].
+   * * customFulfillment1.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.CUSTOM_TYPE_1][].
+   * * customFulfillment2.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.CUSTOM_TYPE_2][].
+   * * customFulfillment3.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.CUSTOM_TYPE_3][].
+   * * customFulfillment4.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.CUSTOM_TYPE_4][].
+   * * customFulfillment5.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.CUSTOM_TYPE_5][].
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string variant_rollup_keys = 17; + * + * @return The count of variantRollupKeys. + */ + public int getVariantRollupKeysCount() { + return variantRollupKeys_.size(); + } + /** + * + * + *
+   * 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.
+   * For
+   * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info],
+   * a fulfillment type and a fulfillment ID must be provided in the format of
+   * "fulfillmentType.filfillmentId". E.g., in "pickupInStore.store123",
+   * "pickupInStore" is fulfillment type and "store123" is the store ID.
+   * Supported keys are:
+   * * colorFamilies
+   * * price
+   * * originalPrice
+   * * discount
+   * * attributes.key, where key is any key in the
+   *   [Product.attributes][google.cloud.retail.v2.Product.attributes] map.
+   * * pickupInStore.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.PICKUP_IN_STORE][].
+   * * shipToStore.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.SHIP_TO_STORE][].
+   * * sameDayDelivery.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.SAME_DAY_DELIVERY][].
+   * * nextDayDelivery.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.NEXT_DAY_DELIVERY][].
+   * * customFulfillment1.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.CUSTOM_TYPE_1][].
+   * * customFulfillment2.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.CUSTOM_TYPE_2][].
+   * * customFulfillment3.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.CUSTOM_TYPE_3][].
+   * * customFulfillment4.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.CUSTOM_TYPE_4][].
+   * * customFulfillment5.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.CUSTOM_TYPE_5][].
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string variant_rollup_keys = 17; + * + * @param index The index of the element to return. + * @return The variantRollupKeys at the given index. + */ + public java.lang.String getVariantRollupKeys(int index) { + return variantRollupKeys_.get(index); + } + /** + * + * + *
+   * 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.
+   * For
+   * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info],
+   * a fulfillment type and a fulfillment ID must be provided in the format of
+   * "fulfillmentType.filfillmentId". E.g., in "pickupInStore.store123",
+   * "pickupInStore" is fulfillment type and "store123" is the store ID.
+   * Supported keys are:
+   * * colorFamilies
+   * * price
+   * * originalPrice
+   * * discount
+   * * attributes.key, where key is any key in the
+   *   [Product.attributes][google.cloud.retail.v2.Product.attributes] map.
+   * * pickupInStore.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.PICKUP_IN_STORE][].
+   * * shipToStore.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.SHIP_TO_STORE][].
+   * * sameDayDelivery.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.SAME_DAY_DELIVERY][].
+   * * nextDayDelivery.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.NEXT_DAY_DELIVERY][].
+   * * customFulfillment1.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.CUSTOM_TYPE_1][].
+   * * customFulfillment2.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.CUSTOM_TYPE_2][].
+   * * customFulfillment3.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.CUSTOM_TYPE_3][].
+   * * customFulfillment4.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.CUSTOM_TYPE_4][].
+   * * customFulfillment5.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.CUSTOM_TYPE_5][].
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string variant_rollup_keys = 17; + * + * @param index The index of the value to return. + * @return The bytes of the variantRollupKeys at the given index. + */ + public com.google.protobuf.ByteString getVariantRollupKeysBytes(int index) { + return variantRollupKeys_.getByteString(index); + } + + public static final int PAGE_CATEGORIES_FIELD_NUMBER = 23; + private com.google.protobuf.LazyStringList pageCategories_; + /** + * + * + *
+   * The categories associated with a category page. Required for category
+   * navigation queries to achieve good search quality. The format should be
+   * the same as
+   * [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories];
+   * To represent full path of category, use '>' sign to separate different
+   * hierarchies. If '>' is part of the category name, please replace it with
+   * other character(s).
+   * Category pages include special pages such as sales or promotions. For
+   * instance, a special sale page may have the category hierarchy:
+   * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+   * 
+ * + * repeated string page_categories = 23; + * + * @return A list containing the pageCategories. + */ + public com.google.protobuf.ProtocolStringList getPageCategoriesList() { + return pageCategories_; + } + /** + * + * + *
+   * The categories associated with a category page. Required for category
+   * navigation queries to achieve good search quality. The format should be
+   * the same as
+   * [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories];
+   * To represent full path of category, use '>' sign to separate different
+   * hierarchies. If '>' is part of the category name, please replace it with
+   * other character(s).
+   * Category pages include special pages such as sales or promotions. For
+   * instance, a special sale page may have the category hierarchy:
+   * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+   * 
+ * + * repeated string page_categories = 23; + * + * @return The count of pageCategories. + */ + public int getPageCategoriesCount() { + return pageCategories_.size(); + } + /** + * + * + *
+   * The categories associated with a category page. Required for category
+   * navigation queries to achieve good search quality. The format should be
+   * the same as
+   * [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories];
+   * To represent full path of category, use '>' sign to separate different
+   * hierarchies. If '>' is part of the category name, please replace it with
+   * other character(s).
+   * Category pages include special pages such as sales or promotions. For
+   * instance, a special sale page may have the category hierarchy:
+   * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+   * 
+ * + * repeated string page_categories = 23; + * + * @param index The index of the element to return. + * @return The pageCategories at the given index. + */ + public java.lang.String getPageCategories(int index) { + return pageCategories_.get(index); + } + /** + * + * + *
+   * The categories associated with a category page. Required for category
+   * navigation queries to achieve good search quality. The format should be
+   * the same as
+   * [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories];
+   * To represent full path of category, use '>' sign to separate different
+   * hierarchies. If '>' is part of the category name, please replace it with
+   * other character(s).
+   * Category pages include special pages such as sales or promotions. For
+   * instance, a special sale page may have the category hierarchy:
+   * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+   * 
+ * + * repeated string page_categories = 23; + * + * @param index The index of the value to return. + * @return The bytes of the pageCategories at the given index. + */ + public com.google.protobuf.ByteString getPageCategoriesBytes(int index) { + return pageCategories_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getPlacementBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, placement_); + } + if (!getBranchBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, branch_); + } + if (!getQueryBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, query_); + } + if (!getVisitorIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, visitorId_); + } + if (userInfo_ != null) { + output.writeMessage(5, getUserInfo()); + } + if (pageSize_ != 0) { + output.writeInt32(7, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, pageToken_); + } + if (offset_ != 0) { + output.writeInt32(9, offset_); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, filter_); + } + if (!getOrderByBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 11, orderBy_); + } + for (int i = 0; i < facetSpecs_.size(); i++) { + output.writeMessage(12, facetSpecs_.get(i)); + } + if (boostSpec_ != null) { + output.writeMessage(13, getBoostSpec()); + } + if (queryExpansionSpec_ != null) { + output.writeMessage(14, getQueryExpansionSpec()); + } + for (int i = 0; i < variantRollupKeys_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 17, variantRollupKeys_.getRaw(i)); + } + if (dynamicFacetSpec_ != null) { + output.writeMessage(21, getDynamicFacetSpec()); + } + for (int i = 0; i < pageCategories_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 23, pageCategories_.getRaw(i)); + } + if (!getCanonicalFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 28, canonicalFilter_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getPlacementBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, placement_); + } + if (!getBranchBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, branch_); + } + if (!getQueryBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, query_); + } + if (!getVisitorIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, visitorId_); + } + if (userInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getUserInfo()); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(7, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, pageToken_); + } + if (offset_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(9, offset_); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, filter_); + } + if (!getOrderByBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, orderBy_); + } + for (int i = 0; i < facetSpecs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, facetSpecs_.get(i)); + } + if (boostSpec_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(13, getBoostSpec()); + } + if (queryExpansionSpec_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(14, getQueryExpansionSpec()); + } + { + int dataSize = 0; + for (int i = 0; i < variantRollupKeys_.size(); i++) { + dataSize += computeStringSizeNoTag(variantRollupKeys_.getRaw(i)); + } + size += dataSize; + size += 2 * getVariantRollupKeysList().size(); + } + if (dynamicFacetSpec_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(21, getDynamicFacetSpec()); + } + { + int dataSize = 0; + for (int i = 0; i < pageCategories_.size(); i++) { + dataSize += computeStringSizeNoTag(pageCategories_.getRaw(i)); + } + size += dataSize; + size += 2 * getPageCategoriesList().size(); + } + if (!getCanonicalFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(28, canonicalFilter_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.retail.v2.SearchRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2.SearchRequest other = (com.google.cloud.retail.v2.SearchRequest) obj; + + if (!getPlacement().equals(other.getPlacement())) return false; + if (!getBranch().equals(other.getBranch())) return false; + if (!getQuery().equals(other.getQuery())) return false; + if (!getVisitorId().equals(other.getVisitorId())) return false; + if (hasUserInfo() != other.hasUserInfo()) return false; + if (hasUserInfo()) { + if (!getUserInfo().equals(other.getUserInfo())) return false; + } + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (getOffset() != other.getOffset()) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getCanonicalFilter().equals(other.getCanonicalFilter())) return false; + if (!getOrderBy().equals(other.getOrderBy())) return false; + if (!getFacetSpecsList().equals(other.getFacetSpecsList())) return false; + if (hasDynamicFacetSpec() != other.hasDynamicFacetSpec()) return false; + if (hasDynamicFacetSpec()) { + if (!getDynamicFacetSpec().equals(other.getDynamicFacetSpec())) return false; + } + if (hasBoostSpec() != other.hasBoostSpec()) return false; + if (hasBoostSpec()) { + if (!getBoostSpec().equals(other.getBoostSpec())) return false; + } + if (hasQueryExpansionSpec() != other.hasQueryExpansionSpec()) return false; + if (hasQueryExpansionSpec()) { + if (!getQueryExpansionSpec().equals(other.getQueryExpansionSpec())) return false; + } + if (!getVariantRollupKeysList().equals(other.getVariantRollupKeysList())) return false; + if (!getPageCategoriesList().equals(other.getPageCategoriesList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PLACEMENT_FIELD_NUMBER; + hash = (53 * hash) + getPlacement().hashCode(); + hash = (37 * hash) + BRANCH_FIELD_NUMBER; + hash = (53 * hash) + getBranch().hashCode(); + hash = (37 * hash) + QUERY_FIELD_NUMBER; + hash = (53 * hash) + getQuery().hashCode(); + hash = (37 * hash) + VISITOR_ID_FIELD_NUMBER; + hash = (53 * hash) + getVisitorId().hashCode(); + if (hasUserInfo()) { + hash = (37 * hash) + USER_INFO_FIELD_NUMBER; + hash = (53 * hash) + getUserInfo().hashCode(); + } + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + OFFSET_FIELD_NUMBER; + hash = (53 * hash) + getOffset(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + CANONICAL_FILTER_FIELD_NUMBER; + hash = (53 * hash) + getCanonicalFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + if (getFacetSpecsCount() > 0) { + hash = (37 * hash) + FACET_SPECS_FIELD_NUMBER; + hash = (53 * hash) + getFacetSpecsList().hashCode(); + } + if (hasDynamicFacetSpec()) { + hash = (37 * hash) + DYNAMIC_FACET_SPEC_FIELD_NUMBER; + hash = (53 * hash) + getDynamicFacetSpec().hashCode(); + } + if (hasBoostSpec()) { + hash = (37 * hash) + BOOST_SPEC_FIELD_NUMBER; + hash = (53 * hash) + getBoostSpec().hashCode(); + } + if (hasQueryExpansionSpec()) { + hash = (37 * hash) + QUERY_EXPANSION_SPEC_FIELD_NUMBER; + hash = (53 * hash) + getQueryExpansionSpec().hashCode(); + } + if (getVariantRollupKeysCount() > 0) { + hash = (37 * hash) + VARIANT_ROLLUP_KEYS_FIELD_NUMBER; + hash = (53 * hash) + getVariantRollupKeysList().hashCode(); + } + if (getPageCategoriesCount() > 0) { + hash = (37 * hash) + PAGE_CATEGORIES_FIELD_NUMBER; + hash = (53 * hash) + getPageCategoriesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2.SearchRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.SearchRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.SearchRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.SearchRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.SearchRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.SearchRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.SearchRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2.SearchRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for
+   * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2.SearchRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.SearchRequest) + com.google.cloud.retail.v2.SearchRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.SearchRequest.class, + com.google.cloud.retail.v2.SearchRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2.SearchRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getFacetSpecsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + placement_ = ""; + + branch_ = ""; + + query_ = ""; + + visitorId_ = ""; + + if (userInfoBuilder_ == null) { + userInfo_ = null; + } else { + userInfo_ = null; + userInfoBuilder_ = null; + } + pageSize_ = 0; + + pageToken_ = ""; + + offset_ = 0; + + filter_ = ""; + + canonicalFilter_ = ""; + + orderBy_ = ""; + + if (facetSpecsBuilder_ == null) { + facetSpecs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + facetSpecsBuilder_.clear(); + } + if (dynamicFacetSpecBuilder_ == null) { + dynamicFacetSpec_ = null; + } else { + dynamicFacetSpec_ = null; + dynamicFacetSpecBuilder_ = null; + } + if (boostSpecBuilder_ == null) { + boostSpec_ = null; + } else { + boostSpec_ = null; + boostSpecBuilder_ = null; + } + if (queryExpansionSpecBuilder_ == null) { + queryExpansionSpec_ = null; + } else { + queryExpansionSpec_ = null; + queryExpansionSpecBuilder_ = null; + } + variantRollupKeys_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + pageCategories_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2.SearchRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2.SearchRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2.SearchRequest build() { + com.google.cloud.retail.v2.SearchRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2.SearchRequest buildPartial() { + com.google.cloud.retail.v2.SearchRequest result = + new com.google.cloud.retail.v2.SearchRequest(this); + int from_bitField0_ = bitField0_; + result.placement_ = placement_; + result.branch_ = branch_; + result.query_ = query_; + result.visitorId_ = visitorId_; + if (userInfoBuilder_ == null) { + result.userInfo_ = userInfo_; + } else { + result.userInfo_ = userInfoBuilder_.build(); + } + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + result.offset_ = offset_; + result.filter_ = filter_; + result.canonicalFilter_ = canonicalFilter_; + result.orderBy_ = orderBy_; + if (facetSpecsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + facetSpecs_ = java.util.Collections.unmodifiableList(facetSpecs_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.facetSpecs_ = facetSpecs_; + } else { + result.facetSpecs_ = facetSpecsBuilder_.build(); + } + if (dynamicFacetSpecBuilder_ == null) { + result.dynamicFacetSpec_ = dynamicFacetSpec_; + } else { + result.dynamicFacetSpec_ = dynamicFacetSpecBuilder_.build(); + } + if (boostSpecBuilder_ == null) { + result.boostSpec_ = boostSpec_; + } else { + result.boostSpec_ = boostSpecBuilder_.build(); + } + if (queryExpansionSpecBuilder_ == null) { + result.queryExpansionSpec_ = queryExpansionSpec_; + } else { + result.queryExpansionSpec_ = queryExpansionSpecBuilder_.build(); + } + if (((bitField0_ & 0x00000002) != 0)) { + variantRollupKeys_ = variantRollupKeys_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.variantRollupKeys_ = variantRollupKeys_; + if (((bitField0_ & 0x00000004) != 0)) { + pageCategories_ = pageCategories_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.pageCategories_ = pageCategories_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.retail.v2.SearchRequest) { + return mergeFrom((com.google.cloud.retail.v2.SearchRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2.SearchRequest other) { + if (other == com.google.cloud.retail.v2.SearchRequest.getDefaultInstance()) return this; + if (!other.getPlacement().isEmpty()) { + placement_ = other.placement_; + onChanged(); + } + if (!other.getBranch().isEmpty()) { + branch_ = other.branch_; + onChanged(); + } + if (!other.getQuery().isEmpty()) { + query_ = other.query_; + onChanged(); + } + if (!other.getVisitorId().isEmpty()) { + visitorId_ = other.visitorId_; + onChanged(); + } + if (other.hasUserInfo()) { + mergeUserInfo(other.getUserInfo()); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (other.getOffset() != 0) { + setOffset(other.getOffset()); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (!other.getCanonicalFilter().isEmpty()) { + canonicalFilter_ = other.canonicalFilter_; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + onChanged(); + } + if (facetSpecsBuilder_ == null) { + if (!other.facetSpecs_.isEmpty()) { + if (facetSpecs_.isEmpty()) { + facetSpecs_ = other.facetSpecs_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureFacetSpecsIsMutable(); + facetSpecs_.addAll(other.facetSpecs_); + } + onChanged(); + } + } else { + if (!other.facetSpecs_.isEmpty()) { + if (facetSpecsBuilder_.isEmpty()) { + facetSpecsBuilder_.dispose(); + facetSpecsBuilder_ = null; + facetSpecs_ = other.facetSpecs_; + bitField0_ = (bitField0_ & ~0x00000001); + facetSpecsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getFacetSpecsFieldBuilder() + : null; + } else { + facetSpecsBuilder_.addAllMessages(other.facetSpecs_); + } + } + } + if (other.hasDynamicFacetSpec()) { + mergeDynamicFacetSpec(other.getDynamicFacetSpec()); + } + if (other.hasBoostSpec()) { + mergeBoostSpec(other.getBoostSpec()); + } + if (other.hasQueryExpansionSpec()) { + mergeQueryExpansionSpec(other.getQueryExpansionSpec()); + } + if (!other.variantRollupKeys_.isEmpty()) { + if (variantRollupKeys_.isEmpty()) { + variantRollupKeys_ = other.variantRollupKeys_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureVariantRollupKeysIsMutable(); + variantRollupKeys_.addAll(other.variantRollupKeys_); + } + onChanged(); + } + if (!other.pageCategories_.isEmpty()) { + if (pageCategories_.isEmpty()) { + pageCategories_ = other.pageCategories_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensurePageCategoriesIsMutable(); + pageCategories_.addAll(other.pageCategories_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.retail.v2.SearchRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2.SearchRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object placement_ = ""; + /** + * + * + *
+     * Required. The resource name of the search engine placement, such as
+     * `projects/*/locations/global/catalogs/default_catalog/placements/default_search`.
+     * This field is used to identify the set of models that will be used to make
+     * the search.
+     * We currently support one placement with the following ID:
+     * * `default_search`.
+     * 
+ * + * string placement = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The placement. + */ + public java.lang.String getPlacement() { + java.lang.Object ref = placement_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + placement_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the search engine placement, such as
+     * `projects/*/locations/global/catalogs/default_catalog/placements/default_search`.
+     * This field is used to identify the set of models that will be used to make
+     * the search.
+     * We currently support one placement with the following ID:
+     * * `default_search`.
+     * 
+ * + * string placement = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for placement. + */ + public com.google.protobuf.ByteString getPlacementBytes() { + java.lang.Object ref = placement_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + placement_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the search engine placement, such as
+     * `projects/*/locations/global/catalogs/default_catalog/placements/default_search`.
+     * This field is used to identify the set of models that will be used to make
+     * the search.
+     * We currently support one placement with the following ID:
+     * * `default_search`.
+     * 
+ * + * string placement = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The placement to set. + * @return This builder for chaining. + */ + public Builder setPlacement(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + placement_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the search engine placement, such as
+     * `projects/*/locations/global/catalogs/default_catalog/placements/default_search`.
+     * This field is used to identify the set of models that will be used to make
+     * the search.
+     * We currently support one placement with the following ID:
+     * * `default_search`.
+     * 
+ * + * string placement = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearPlacement() { + + placement_ = getDefaultInstance().getPlacement(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the search engine placement, such as
+     * `projects/*/locations/global/catalogs/default_catalog/placements/default_search`.
+     * This field is used to identify the set of models that will be used to make
+     * the search.
+     * We currently support one placement with the following ID:
+     * * `default_search`.
+     * 
+ * + * string placement = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for placement to set. + * @return This builder for chaining. + */ + public Builder setPlacementBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + placement_ = value; + onChanged(); + return this; + } + + private java.lang.Object branch_ = ""; + /** + * + * + *
+     * The branch resource name, such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/0`.
+     * Use "default_branch" as the branch ID or leave this field empty, to search
+     * products under the default branch.
+     * 
+ * + * string branch = 2 [(.google.api.resource_reference) = { ... } + * + * @return The branch. + */ + public java.lang.String getBranch() { + java.lang.Object ref = branch_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + branch_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The branch resource name, such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/0`.
+     * Use "default_branch" as the branch ID or leave this field empty, to search
+     * products under the default branch.
+     * 
+ * + * string branch = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for branch. + */ + public com.google.protobuf.ByteString getBranchBytes() { + java.lang.Object ref = branch_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + branch_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The branch resource name, such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/0`.
+     * Use "default_branch" as the branch ID or leave this field empty, to search
+     * products under the default branch.
+     * 
+ * + * string branch = 2 [(.google.api.resource_reference) = { ... } + * + * @param value The branch to set. + * @return This builder for chaining. + */ + public Builder setBranch(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + branch_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The branch resource name, such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/0`.
+     * Use "default_branch" as the branch ID or leave this field empty, to search
+     * products under the default branch.
+     * 
+ * + * string branch = 2 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearBranch() { + + branch_ = getDefaultInstance().getBranch(); + onChanged(); + return this; + } + /** + * + * + *
+     * The branch resource name, such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/0`.
+     * Use "default_branch" as the branch ID or leave this field empty, to search
+     * products under the default branch.
+     * 
+ * + * string branch = 2 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for branch to set. + * @return This builder for chaining. + */ + public Builder setBranchBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + branch_ = value; + onChanged(); + return this; + } + + private java.lang.Object query_ = ""; + /** + * + * + *
+     * Raw search query.
+     * 
+ * + * string query = 3; + * + * @return The query. + */ + public java.lang.String getQuery() { + java.lang.Object ref = query_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + query_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Raw search query.
+     * 
+ * + * string query = 3; + * + * @return The bytes for query. + */ + public com.google.protobuf.ByteString getQueryBytes() { + java.lang.Object ref = query_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + query_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Raw search query.
+     * 
+ * + * string query = 3; + * + * @param value The query to set. + * @return This builder for chaining. + */ + public Builder setQuery(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + query_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Raw search query.
+     * 
+ * + * string query = 3; + * + * @return This builder for chaining. + */ + public Builder clearQuery() { + + query_ = getDefaultInstance().getQuery(); + onChanged(); + return this; + } + /** + * + * + *
+     * Raw search query.
+     * 
+ * + * string query = 3; + * + * @param value The bytes for query to set. + * @return This builder for chaining. + */ + public Builder setQueryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + query_ = value; + onChanged(); + return this; + } + + private java.lang.Object visitorId_ = ""; + /** + * + * + *
+     * 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.
+     * 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]; + * + * @return The visitorId. + */ + public java.lang.String getVisitorId() { + java.lang.Object ref = visitorId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + visitorId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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.
+     * 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]; + * + * @return The bytes for visitorId. + */ + public com.google.protobuf.ByteString getVisitorIdBytes() { + java.lang.Object ref = visitorId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + visitorId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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.
+     * 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]; + * + * @param value The visitorId to set. + * @return This builder for chaining. + */ + public Builder setVisitorId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + visitorId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * 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]; + * + * @return This builder for chaining. + */ + public Builder clearVisitorId() { + + visitorId_ = getDefaultInstance().getVisitorId(); + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * 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]; + * + * @param value The bytes for visitorId to set. + * @return This builder for chaining. + */ + public Builder setVisitorIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + visitorId_ = value; + onChanged(); + return this; + } + + private com.google.cloud.retail.v2.UserInfo userInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2.UserInfo, + com.google.cloud.retail.v2.UserInfo.Builder, + com.google.cloud.retail.v2.UserInfoOrBuilder> + userInfoBuilder_; + /** + * + * + *
+     * User information.
+     * 
+ * + * .google.cloud.retail.v2.UserInfo user_info = 5; + * + * @return Whether the userInfo field is set. + */ + public boolean hasUserInfo() { + return userInfoBuilder_ != null || userInfo_ != null; + } + /** + * + * + *
+     * User information.
+     * 
+ * + * .google.cloud.retail.v2.UserInfo user_info = 5; + * + * @return The userInfo. + */ + public com.google.cloud.retail.v2.UserInfo getUserInfo() { + if (userInfoBuilder_ == null) { + return userInfo_ == null + ? com.google.cloud.retail.v2.UserInfo.getDefaultInstance() + : userInfo_; + } else { + return userInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * User information.
+     * 
+ * + * .google.cloud.retail.v2.UserInfo user_info = 5; + */ + public Builder setUserInfo(com.google.cloud.retail.v2.UserInfo value) { + if (userInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + userInfo_ = value; + onChanged(); + } else { + userInfoBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * User information.
+     * 
+ * + * .google.cloud.retail.v2.UserInfo user_info = 5; + */ + public Builder setUserInfo(com.google.cloud.retail.v2.UserInfo.Builder builderForValue) { + if (userInfoBuilder_ == null) { + userInfo_ = builderForValue.build(); + onChanged(); + } else { + userInfoBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * User information.
+     * 
+ * + * .google.cloud.retail.v2.UserInfo user_info = 5; + */ + public Builder mergeUserInfo(com.google.cloud.retail.v2.UserInfo value) { + if (userInfoBuilder_ == null) { + if (userInfo_ != null) { + userInfo_ = + com.google.cloud.retail.v2.UserInfo.newBuilder(userInfo_) + .mergeFrom(value) + .buildPartial(); + } else { + userInfo_ = value; + } + onChanged(); + } else { + userInfoBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * User information.
+     * 
+ * + * .google.cloud.retail.v2.UserInfo user_info = 5; + */ + public Builder clearUserInfo() { + if (userInfoBuilder_ == null) { + userInfo_ = null; + onChanged(); + } else { + userInfo_ = null; + userInfoBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * User information.
+     * 
+ * + * .google.cloud.retail.v2.UserInfo user_info = 5; + */ + public com.google.cloud.retail.v2.UserInfo.Builder getUserInfoBuilder() { + + onChanged(); + return getUserInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * User information.
+     * 
+ * + * .google.cloud.retail.v2.UserInfo user_info = 5; + */ + public com.google.cloud.retail.v2.UserInfoOrBuilder getUserInfoOrBuilder() { + if (userInfoBuilder_ != null) { + return userInfoBuilder_.getMessageOrBuilder(); + } else { + return userInfo_ == null + ? com.google.cloud.retail.v2.UserInfo.getDefaultInstance() + : userInfo_; + } + } + /** + * + * + *
+     * User information.
+     * 
+ * + * .google.cloud.retail.v2.UserInfo user_info = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2.UserInfo, + com.google.cloud.retail.v2.UserInfo.Builder, + com.google.cloud.retail.v2.UserInfoOrBuilder> + getUserInfoFieldBuilder() { + if (userInfoBuilder_ == null) { + userInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2.UserInfo, + com.google.cloud.retail.v2.UserInfo.Builder, + com.google.cloud.retail.v2.UserInfoOrBuilder>( + getUserInfo(), getParentForChildren(), isClean()); + userInfo_ = null; + } + return userInfoBuilder_; + } + + private int pageSize_; + /** + * + * + *
+     * Maximum number of [Product][google.cloud.retail.v2.Product]s to return. If
+     * unspecified, defaults to a reasonable value. The maximum allowed value is
+     * 120. Values above 120 will be coerced to 120.
+     * If this field is negative, an INVALID_ARGUMENT is returned.
+     * 
+ * + * int32 page_size = 7; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Maximum number of [Product][google.cloud.retail.v2.Product]s to return. If
+     * unspecified, defaults to a reasonable value. The maximum allowed value is
+     * 120. Values above 120 will be coerced to 120.
+     * If this field is negative, an INVALID_ARGUMENT is returned.
+     * 
+ * + * int32 page_size = 7; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Maximum number of [Product][google.cloud.retail.v2.Product]s to return. If
+     * unspecified, defaults to a reasonable value. The maximum allowed value is
+     * 120. Values above 120 will be coerced to 120.
+     * If this field is negative, an INVALID_ARGUMENT is returned.
+     * 
+ * + * int32 page_size = 7; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A page token
+     * [SearchResponse.next_page_token][google.cloud.retail.v2.SearchResponse.next_page_token],
+     * received from a previous
+     * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to
+     * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] must
+     * match the call that provided the page token. Otherwise, an INVALID_ARGUMENT
+     * error is returned.
+     * 
+ * + * string page_token = 8; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A page token
+     * [SearchResponse.next_page_token][google.cloud.retail.v2.SearchResponse.next_page_token],
+     * received from a previous
+     * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to
+     * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] must
+     * match the call that provided the page token. Otherwise, an INVALID_ARGUMENT
+     * error is returned.
+     * 
+ * + * string page_token = 8; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A page token
+     * [SearchResponse.next_page_token][google.cloud.retail.v2.SearchResponse.next_page_token],
+     * received from a previous
+     * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to
+     * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] must
+     * match the call that provided the page token. Otherwise, an INVALID_ARGUMENT
+     * error is returned.
+     * 
+ * + * string page_token = 8; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A page token
+     * [SearchResponse.next_page_token][google.cloud.retail.v2.SearchResponse.next_page_token],
+     * received from a previous
+     * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to
+     * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] must
+     * match the call that provided the page token. Otherwise, an INVALID_ARGUMENT
+     * error is returned.
+     * 
+ * + * string page_token = 8; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A page token
+     * [SearchResponse.next_page_token][google.cloud.retail.v2.SearchResponse.next_page_token],
+     * received from a previous
+     * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to
+     * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] must
+     * match the call that provided the page token. Otherwise, an INVALID_ARGUMENT
+     * error is returned.
+     * 
+ * + * string page_token = 8; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + private int offset_; + /** + * + * + *
+     * A 0-indexed integer that specifies the current offset (that is, starting
+     * result location, amongst the [Product][google.cloud.retail.v2.Product]s
+     * deemed by the API as relevant) in search results. This field is only
+     * considered if [page_token][google.cloud.retail.v2.SearchRequest.page_token]
+     * is unset.
+     * If this field is negative, an INVALID_ARGUMENT is returned.
+     * 
+ * + * int32 offset = 9; + * + * @return The offset. + */ + @java.lang.Override + public int getOffset() { + return offset_; + } + /** + * + * + *
+     * A 0-indexed integer that specifies the current offset (that is, starting
+     * result location, amongst the [Product][google.cloud.retail.v2.Product]s
+     * deemed by the API as relevant) in search results. This field is only
+     * considered if [page_token][google.cloud.retail.v2.SearchRequest.page_token]
+     * is unset.
+     * If this field is negative, an INVALID_ARGUMENT is returned.
+     * 
+ * + * int32 offset = 9; + * + * @param value The offset to set. + * @return This builder for chaining. + */ + public Builder setOffset(int value) { + + offset_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A 0-indexed integer that specifies the current offset (that is, starting
+     * result location, amongst the [Product][google.cloud.retail.v2.Product]s
+     * deemed by the API as relevant) in search results. This field is only
+     * considered if [page_token][google.cloud.retail.v2.SearchRequest.page_token]
+     * is unset.
+     * If this field is negative, an INVALID_ARGUMENT is returned.
+     * 
+ * + * int32 offset = 9; + * + * @return This builder for chaining. + */ + public Builder clearOffset() { + + offset_ = 0; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * The filter syntax consists of an expression language for constructing a
+     * predicate from one or more fields of the products being filtered. Filter
+     * expression is case-sensitive. See more details at this [user
+     * guide](/retail/private/docs/filter-and-order#filter).
+     * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
+     * 
+ * + * string filter = 10; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The filter syntax consists of an expression language for constructing a
+     * predicate from one or more fields of the products being filtered. Filter
+     * expression is case-sensitive. See more details at this [user
+     * guide](/retail/private/docs/filter-and-order#filter).
+     * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
+     * 
+ * + * string filter = 10; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The filter syntax consists of an expression language for constructing a
+     * predicate from one or more fields of the products being filtered. Filter
+     * expression is case-sensitive. See more details at this [user
+     * guide](/retail/private/docs/filter-and-order#filter).
+     * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
+     * 
+ * + * string filter = 10; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The filter syntax consists of an expression language for constructing a
+     * predicate from one or more fields of the products being filtered. Filter
+     * expression is case-sensitive. See more details at this [user
+     * guide](/retail/private/docs/filter-and-order#filter).
+     * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
+     * 
+ * + * string filter = 10; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * The filter syntax consists of an expression language for constructing a
+     * predicate from one or more fields of the products being filtered. Filter
+     * expression is case-sensitive. See more details at this [user
+     * guide](/retail/private/docs/filter-and-order#filter).
+     * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
+     * 
+ * + * string filter = 10; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private java.lang.Object canonicalFilter_ = ""; + /** + * + * + *
+     * 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
+     * [SearchRequest.canonical_filter][google.cloud.retail.v2.SearchRequest.canonical_filter]
+     * will be returned as a supplement of the original query. This field is
+     * strongly recommended to achieve high search quality.
+     * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
+     * more details about filter syntax.
+     * 
+ * + * string canonical_filter = 28; + * + * @return The canonicalFilter. + */ + public java.lang.String getCanonicalFilter() { + java.lang.Object ref = canonicalFilter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + canonicalFilter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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
+     * [SearchRequest.canonical_filter][google.cloud.retail.v2.SearchRequest.canonical_filter]
+     * will be returned as a supplement of the original query. This field is
+     * strongly recommended to achieve high search quality.
+     * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
+     * more details about filter syntax.
+     * 
+ * + * string canonical_filter = 28; + * + * @return The bytes for canonicalFilter. + */ + public com.google.protobuf.ByteString getCanonicalFilterBytes() { + java.lang.Object ref = canonicalFilter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + canonicalFilter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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
+     * [SearchRequest.canonical_filter][google.cloud.retail.v2.SearchRequest.canonical_filter]
+     * will be returned as a supplement of the original query. This field is
+     * strongly recommended to achieve high search quality.
+     * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
+     * more details about filter syntax.
+     * 
+ * + * string canonical_filter = 28; + * + * @param value The canonicalFilter to set. + * @return This builder for chaining. + */ + public Builder setCanonicalFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + canonicalFilter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 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
+     * [SearchRequest.canonical_filter][google.cloud.retail.v2.SearchRequest.canonical_filter]
+     * will be returned as a supplement of the original query. This field is
+     * strongly recommended to achieve high search quality.
+     * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
+     * more details about filter syntax.
+     * 
+ * + * string canonical_filter = 28; + * + * @return This builder for chaining. + */ + public Builder clearCanonicalFilter() { + + canonicalFilter_ = getDefaultInstance().getCanonicalFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * 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
+     * [SearchRequest.canonical_filter][google.cloud.retail.v2.SearchRequest.canonical_filter]
+     * will be returned as a supplement of the original query. This field is
+     * strongly recommended to achieve high search quality.
+     * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
+     * more details about filter syntax.
+     * 
+ * + * string canonical_filter = 28; + * + * @param value The bytes for canonicalFilter to set. + * @return This builder for chaining. + */ + public Builder setCanonicalFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + canonicalFilter_ = value; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * The order in which products are returned. Products can be ordered by
+     * a field in an [Product][google.cloud.retail.v2.Product] object. Leave it
+     * unset if ordered by relevance. OrderBy expression is case-sensitive. See
+     * more details at this [user
+     * guide](/retail/private/docs/filter-and-order#order).
+     * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
+     * 
+ * + * string order_by = 11; + * + * @return The orderBy. + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The order in which products are returned. Products can be ordered by
+     * a field in an [Product][google.cloud.retail.v2.Product] object. Leave it
+     * unset if ordered by relevance. OrderBy expression is case-sensitive. See
+     * more details at this [user
+     * guide](/retail/private/docs/filter-and-order#order).
+     * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
+     * 
+ * + * string order_by = 11; + * + * @return The bytes for orderBy. + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The order in which products are returned. Products can be ordered by
+     * a field in an [Product][google.cloud.retail.v2.Product] object. Leave it
+     * unset if ordered by relevance. OrderBy expression is case-sensitive. See
+     * more details at this [user
+     * guide](/retail/private/docs/filter-and-order#order).
+     * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
+     * 
+ * + * string order_by = 11; + * + * @param value The orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + orderBy_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The order in which products are returned. Products can be ordered by
+     * a field in an [Product][google.cloud.retail.v2.Product] object. Leave it
+     * unset if ordered by relevance. OrderBy expression is case-sensitive. See
+     * more details at this [user
+     * guide](/retail/private/docs/filter-and-order#order).
+     * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
+     * 
+ * + * string order_by = 11; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + + orderBy_ = getDefaultInstance().getOrderBy(); + onChanged(); + return this; + } + /** + * + * + *
+     * The order in which products are returned. Products can be ordered by
+     * a field in an [Product][google.cloud.retail.v2.Product] object. Leave it
+     * unset if ordered by relevance. OrderBy expression is case-sensitive. See
+     * more details at this [user
+     * guide](/retail/private/docs/filter-and-order#order).
+     * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
+     * 
+ * + * string order_by = 11; + * + * @param value The bytes for orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + orderBy_ = value; + onChanged(); + return this; + } + + private java.util.List facetSpecs_ = + java.util.Collections.emptyList(); + + private void ensureFacetSpecsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + facetSpecs_ = + new java.util.ArrayList( + facetSpecs_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2.SearchRequest.FacetSpec, + com.google.cloud.retail.v2.SearchRequest.FacetSpec.Builder, + com.google.cloud.retail.v2.SearchRequest.FacetSpecOrBuilder> + facetSpecsBuilder_; + + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchRequest.FacetSpec facet_specs = 12; + */ + public java.util.List getFacetSpecsList() { + if (facetSpecsBuilder_ == null) { + return java.util.Collections.unmodifiableList(facetSpecs_); + } else { + return facetSpecsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchRequest.FacetSpec facet_specs = 12; + */ + public int getFacetSpecsCount() { + if (facetSpecsBuilder_ == null) { + return facetSpecs_.size(); + } else { + return facetSpecsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchRequest.FacetSpec facet_specs = 12; + */ + public com.google.cloud.retail.v2.SearchRequest.FacetSpec getFacetSpecs(int index) { + if (facetSpecsBuilder_ == null) { + return facetSpecs_.get(index); + } else { + return facetSpecsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchRequest.FacetSpec facet_specs = 12; + */ + public Builder setFacetSpecs( + int index, com.google.cloud.retail.v2.SearchRequest.FacetSpec value) { + if (facetSpecsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFacetSpecsIsMutable(); + facetSpecs_.set(index, value); + onChanged(); + } else { + facetSpecsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchRequest.FacetSpec facet_specs = 12; + */ + public Builder setFacetSpecs( + int index, com.google.cloud.retail.v2.SearchRequest.FacetSpec.Builder builderForValue) { + if (facetSpecsBuilder_ == null) { + ensureFacetSpecsIsMutable(); + facetSpecs_.set(index, builderForValue.build()); + onChanged(); + } else { + facetSpecsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchRequest.FacetSpec facet_specs = 12; + */ + public Builder addFacetSpecs(com.google.cloud.retail.v2.SearchRequest.FacetSpec value) { + if (facetSpecsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFacetSpecsIsMutable(); + facetSpecs_.add(value); + onChanged(); + } else { + facetSpecsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchRequest.FacetSpec facet_specs = 12; + */ + public Builder addFacetSpecs( + int index, com.google.cloud.retail.v2.SearchRequest.FacetSpec value) { + if (facetSpecsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFacetSpecsIsMutable(); + facetSpecs_.add(index, value); + onChanged(); + } else { + facetSpecsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchRequest.FacetSpec facet_specs = 12; + */ + public Builder addFacetSpecs( + com.google.cloud.retail.v2.SearchRequest.FacetSpec.Builder builderForValue) { + if (facetSpecsBuilder_ == null) { + ensureFacetSpecsIsMutable(); + facetSpecs_.add(builderForValue.build()); + onChanged(); + } else { + facetSpecsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchRequest.FacetSpec facet_specs = 12; + */ + public Builder addFacetSpecs( + int index, com.google.cloud.retail.v2.SearchRequest.FacetSpec.Builder builderForValue) { + if (facetSpecsBuilder_ == null) { + ensureFacetSpecsIsMutable(); + facetSpecs_.add(index, builderForValue.build()); + onChanged(); + } else { + facetSpecsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchRequest.FacetSpec facet_specs = 12; + */ + public Builder addAllFacetSpecs( + java.lang.Iterable values) { + if (facetSpecsBuilder_ == null) { + ensureFacetSpecsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, facetSpecs_); + onChanged(); + } else { + facetSpecsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchRequest.FacetSpec facet_specs = 12; + */ + public Builder clearFacetSpecs() { + if (facetSpecsBuilder_ == null) { + facetSpecs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + facetSpecsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchRequest.FacetSpec facet_specs = 12; + */ + public Builder removeFacetSpecs(int index) { + if (facetSpecsBuilder_ == null) { + ensureFacetSpecsIsMutable(); + facetSpecs_.remove(index); + onChanged(); + } else { + facetSpecsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchRequest.FacetSpec facet_specs = 12; + */ + public com.google.cloud.retail.v2.SearchRequest.FacetSpec.Builder getFacetSpecsBuilder( + int index) { + return getFacetSpecsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchRequest.FacetSpec facet_specs = 12; + */ + public com.google.cloud.retail.v2.SearchRequest.FacetSpecOrBuilder getFacetSpecsOrBuilder( + int index) { + if (facetSpecsBuilder_ == null) { + return facetSpecs_.get(index); + } else { + return facetSpecsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchRequest.FacetSpec facet_specs = 12; + */ + public java.util.List + getFacetSpecsOrBuilderList() { + if (facetSpecsBuilder_ != null) { + return facetSpecsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(facetSpecs_); + } + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchRequest.FacetSpec facet_specs = 12; + */ + public com.google.cloud.retail.v2.SearchRequest.FacetSpec.Builder addFacetSpecsBuilder() { + return getFacetSpecsFieldBuilder() + .addBuilder(com.google.cloud.retail.v2.SearchRequest.FacetSpec.getDefaultInstance()); + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchRequest.FacetSpec facet_specs = 12; + */ + public com.google.cloud.retail.v2.SearchRequest.FacetSpec.Builder addFacetSpecsBuilder( + int index) { + return getFacetSpecsFieldBuilder() + .addBuilder( + index, com.google.cloud.retail.v2.SearchRequest.FacetSpec.getDefaultInstance()); + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchRequest.FacetSpec facet_specs = 12; + */ + public java.util.List + getFacetSpecsBuilderList() { + return getFacetSpecsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2.SearchRequest.FacetSpec, + com.google.cloud.retail.v2.SearchRequest.FacetSpec.Builder, + com.google.cloud.retail.v2.SearchRequest.FacetSpecOrBuilder> + getFacetSpecsFieldBuilder() { + if (facetSpecsBuilder_ == null) { + facetSpecsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2.SearchRequest.FacetSpec, + com.google.cloud.retail.v2.SearchRequest.FacetSpec.Builder, + com.google.cloud.retail.v2.SearchRequest.FacetSpecOrBuilder>( + facetSpecs_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + facetSpecs_ = null; + } + return facetSpecsBuilder_; + } + + private com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec dynamicFacetSpec_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec, + com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Builder, + com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpecOrBuilder> + dynamicFacetSpecBuilder_; + /** + * + * + *
+     * The specification for dynamically generated facets. Notice that only
+     * textual facets can be dynamically generated.
+     * This feature requires additional allowlisting. Contact Retail Support
+     * (retail-search-support@google.com) if you are interested in using dynamic
+     * facet feature.
+     * 
+ * + * .google.cloud.retail.v2.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21; + * + * @return Whether the dynamicFacetSpec field is set. + */ + public boolean hasDynamicFacetSpec() { + return dynamicFacetSpecBuilder_ != null || dynamicFacetSpec_ != null; + } + /** + * + * + *
+     * The specification for dynamically generated facets. Notice that only
+     * textual facets can be dynamically generated.
+     * This feature requires additional allowlisting. Contact Retail Support
+     * (retail-search-support@google.com) if you are interested in using dynamic
+     * facet feature.
+     * 
+ * + * .google.cloud.retail.v2.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21; + * + * @return The dynamicFacetSpec. + */ + public com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec getDynamicFacetSpec() { + if (dynamicFacetSpecBuilder_ == null) { + return dynamicFacetSpec_ == null + ? com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.getDefaultInstance() + : dynamicFacetSpec_; + } else { + return dynamicFacetSpecBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The specification for dynamically generated facets. Notice that only
+     * textual facets can be dynamically generated.
+     * This feature requires additional allowlisting. Contact Retail Support
+     * (retail-search-support@google.com) if you are interested in using dynamic
+     * facet feature.
+     * 
+ * + * .google.cloud.retail.v2.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21; + */ + public Builder setDynamicFacetSpec( + com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec value) { + if (dynamicFacetSpecBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + dynamicFacetSpec_ = value; + onChanged(); + } else { + dynamicFacetSpecBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The specification for dynamically generated facets. Notice that only
+     * textual facets can be dynamically generated.
+     * This feature requires additional allowlisting. Contact Retail Support
+     * (retail-search-support@google.com) if you are interested in using dynamic
+     * facet feature.
+     * 
+ * + * .google.cloud.retail.v2.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21; + */ + public Builder setDynamicFacetSpec( + com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Builder builderForValue) { + if (dynamicFacetSpecBuilder_ == null) { + dynamicFacetSpec_ = builderForValue.build(); + onChanged(); + } else { + dynamicFacetSpecBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The specification for dynamically generated facets. Notice that only
+     * textual facets can be dynamically generated.
+     * This feature requires additional allowlisting. Contact Retail Support
+     * (retail-search-support@google.com) if you are interested in using dynamic
+     * facet feature.
+     * 
+ * + * .google.cloud.retail.v2.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21; + */ + public Builder mergeDynamicFacetSpec( + com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec value) { + if (dynamicFacetSpecBuilder_ == null) { + if (dynamicFacetSpec_ != null) { + dynamicFacetSpec_ = + com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.newBuilder( + dynamicFacetSpec_) + .mergeFrom(value) + .buildPartial(); + } else { + dynamicFacetSpec_ = value; + } + onChanged(); + } else { + dynamicFacetSpecBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The specification for dynamically generated facets. Notice that only
+     * textual facets can be dynamically generated.
+     * This feature requires additional allowlisting. Contact Retail Support
+     * (retail-search-support@google.com) if you are interested in using dynamic
+     * facet feature.
+     * 
+ * + * .google.cloud.retail.v2.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21; + */ + public Builder clearDynamicFacetSpec() { + if (dynamicFacetSpecBuilder_ == null) { + dynamicFacetSpec_ = null; + onChanged(); + } else { + dynamicFacetSpec_ = null; + dynamicFacetSpecBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The specification for dynamically generated facets. Notice that only
+     * textual facets can be dynamically generated.
+     * This feature requires additional allowlisting. Contact Retail Support
+     * (retail-search-support@google.com) if you are interested in using dynamic
+     * facet feature.
+     * 
+ * + * .google.cloud.retail.v2.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21; + */ + public com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Builder + getDynamicFacetSpecBuilder() { + + onChanged(); + return getDynamicFacetSpecFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The specification for dynamically generated facets. Notice that only
+     * textual facets can be dynamically generated.
+     * This feature requires additional allowlisting. Contact Retail Support
+     * (retail-search-support@google.com) if you are interested in using dynamic
+     * facet feature.
+     * 
+ * + * .google.cloud.retail.v2.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21; + */ + public com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpecOrBuilder + getDynamicFacetSpecOrBuilder() { + if (dynamicFacetSpecBuilder_ != null) { + return dynamicFacetSpecBuilder_.getMessageOrBuilder(); + } else { + return dynamicFacetSpec_ == null + ? com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.getDefaultInstance() + : dynamicFacetSpec_; + } + } + /** + * + * + *
+     * The specification for dynamically generated facets. Notice that only
+     * textual facets can be dynamically generated.
+     * This feature requires additional allowlisting. Contact Retail Support
+     * (retail-search-support@google.com) if you are interested in using dynamic
+     * facet feature.
+     * 
+ * + * .google.cloud.retail.v2.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec, + com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Builder, + com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpecOrBuilder> + getDynamicFacetSpecFieldBuilder() { + if (dynamicFacetSpecBuilder_ == null) { + dynamicFacetSpecBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec, + com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Builder, + com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpecOrBuilder>( + getDynamicFacetSpec(), getParentForChildren(), isClean()); + dynamicFacetSpec_ = null; + } + return dynamicFacetSpecBuilder_; + } + + private com.google.cloud.retail.v2.SearchRequest.BoostSpec boostSpec_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2.SearchRequest.BoostSpec, + com.google.cloud.retail.v2.SearchRequest.BoostSpec.Builder, + com.google.cloud.retail.v2.SearchRequest.BoostSpecOrBuilder> + boostSpecBuilder_; + /** + * + * + *
+     * Boost specification to boost certain products. See more details at this
+     * [user guide](/retail/private/docs/boosting).
+     * 
+ * + * .google.cloud.retail.v2.SearchRequest.BoostSpec boost_spec = 13; + * + * @return Whether the boostSpec field is set. + */ + public boolean hasBoostSpec() { + return boostSpecBuilder_ != null || boostSpec_ != null; + } + /** + * + * + *
+     * Boost specification to boost certain products. See more details at this
+     * [user guide](/retail/private/docs/boosting).
+     * 
+ * + * .google.cloud.retail.v2.SearchRequest.BoostSpec boost_spec = 13; + * + * @return The boostSpec. + */ + public com.google.cloud.retail.v2.SearchRequest.BoostSpec getBoostSpec() { + if (boostSpecBuilder_ == null) { + return boostSpec_ == null + ? com.google.cloud.retail.v2.SearchRequest.BoostSpec.getDefaultInstance() + : boostSpec_; + } else { + return boostSpecBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Boost specification to boost certain products. See more details at this
+     * [user guide](/retail/private/docs/boosting).
+     * 
+ * + * .google.cloud.retail.v2.SearchRequest.BoostSpec boost_spec = 13; + */ + public Builder setBoostSpec(com.google.cloud.retail.v2.SearchRequest.BoostSpec value) { + if (boostSpecBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + boostSpec_ = value; + onChanged(); + } else { + boostSpecBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Boost specification to boost certain products. See more details at this
+     * [user guide](/retail/private/docs/boosting).
+     * 
+ * + * .google.cloud.retail.v2.SearchRequest.BoostSpec boost_spec = 13; + */ + public Builder setBoostSpec( + com.google.cloud.retail.v2.SearchRequest.BoostSpec.Builder builderForValue) { + if (boostSpecBuilder_ == null) { + boostSpec_ = builderForValue.build(); + onChanged(); + } else { + boostSpecBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Boost specification to boost certain products. See more details at this
+     * [user guide](/retail/private/docs/boosting).
+     * 
+ * + * .google.cloud.retail.v2.SearchRequest.BoostSpec boost_spec = 13; + */ + public Builder mergeBoostSpec(com.google.cloud.retail.v2.SearchRequest.BoostSpec value) { + if (boostSpecBuilder_ == null) { + if (boostSpec_ != null) { + boostSpec_ = + com.google.cloud.retail.v2.SearchRequest.BoostSpec.newBuilder(boostSpec_) + .mergeFrom(value) + .buildPartial(); + } else { + boostSpec_ = value; + } + onChanged(); + } else { + boostSpecBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Boost specification to boost certain products. See more details at this
+     * [user guide](/retail/private/docs/boosting).
+     * 
+ * + * .google.cloud.retail.v2.SearchRequest.BoostSpec boost_spec = 13; + */ + public Builder clearBoostSpec() { + if (boostSpecBuilder_ == null) { + boostSpec_ = null; + onChanged(); + } else { + boostSpec_ = null; + boostSpecBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Boost specification to boost certain products. See more details at this
+     * [user guide](/retail/private/docs/boosting).
+     * 
+ * + * .google.cloud.retail.v2.SearchRequest.BoostSpec boost_spec = 13; + */ + public com.google.cloud.retail.v2.SearchRequest.BoostSpec.Builder getBoostSpecBuilder() { + + onChanged(); + return getBoostSpecFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Boost specification to boost certain products. See more details at this
+     * [user guide](/retail/private/docs/boosting).
+     * 
+ * + * .google.cloud.retail.v2.SearchRequest.BoostSpec boost_spec = 13; + */ + public com.google.cloud.retail.v2.SearchRequest.BoostSpecOrBuilder getBoostSpecOrBuilder() { + if (boostSpecBuilder_ != null) { + return boostSpecBuilder_.getMessageOrBuilder(); + } else { + return boostSpec_ == null + ? com.google.cloud.retail.v2.SearchRequest.BoostSpec.getDefaultInstance() + : boostSpec_; + } + } + /** + * + * + *
+     * Boost specification to boost certain products. See more details at this
+     * [user guide](/retail/private/docs/boosting).
+     * 
+ * + * .google.cloud.retail.v2.SearchRequest.BoostSpec boost_spec = 13; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2.SearchRequest.BoostSpec, + com.google.cloud.retail.v2.SearchRequest.BoostSpec.Builder, + com.google.cloud.retail.v2.SearchRequest.BoostSpecOrBuilder> + getBoostSpecFieldBuilder() { + if (boostSpecBuilder_ == null) { + boostSpecBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2.SearchRequest.BoostSpec, + com.google.cloud.retail.v2.SearchRequest.BoostSpec.Builder, + com.google.cloud.retail.v2.SearchRequest.BoostSpecOrBuilder>( + getBoostSpec(), getParentForChildren(), isClean()); + boostSpec_ = null; + } + return boostSpecBuilder_; + } + + private com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec queryExpansionSpec_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec, + com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Builder, + com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpecOrBuilder> + queryExpansionSpecBuilder_; + /** + * + * + *
+     * The query expansion specification that specifies the conditions under which
+     * query expansion will occur. See more details at this [user
+     * guide](/retail/private/docs/result-size#query_expansion).
+     * 
+ * + * .google.cloud.retail.v2.SearchRequest.QueryExpansionSpec query_expansion_spec = 14; + * + * + * @return Whether the queryExpansionSpec field is set. + */ + public boolean hasQueryExpansionSpec() { + return queryExpansionSpecBuilder_ != null || queryExpansionSpec_ != null; + } + /** + * + * + *
+     * The query expansion specification that specifies the conditions under which
+     * query expansion will occur. See more details at this [user
+     * guide](/retail/private/docs/result-size#query_expansion).
+     * 
+ * + * .google.cloud.retail.v2.SearchRequest.QueryExpansionSpec query_expansion_spec = 14; + * + * + * @return The queryExpansionSpec. + */ + public com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec getQueryExpansionSpec() { + if (queryExpansionSpecBuilder_ == null) { + return queryExpansionSpec_ == null + ? com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.getDefaultInstance() + : queryExpansionSpec_; + } else { + return queryExpansionSpecBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The query expansion specification that specifies the conditions under which
+     * query expansion will occur. See more details at this [user
+     * guide](/retail/private/docs/result-size#query_expansion).
+     * 
+ * + * .google.cloud.retail.v2.SearchRequest.QueryExpansionSpec query_expansion_spec = 14; + * + */ + public Builder setQueryExpansionSpec( + com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec value) { + if (queryExpansionSpecBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + queryExpansionSpec_ = value; + onChanged(); + } else { + queryExpansionSpecBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The query expansion specification that specifies the conditions under which
+     * query expansion will occur. See more details at this [user
+     * guide](/retail/private/docs/result-size#query_expansion).
+     * 
+ * + * .google.cloud.retail.v2.SearchRequest.QueryExpansionSpec query_expansion_spec = 14; + * + */ + public Builder setQueryExpansionSpec( + com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Builder builderForValue) { + if (queryExpansionSpecBuilder_ == null) { + queryExpansionSpec_ = builderForValue.build(); + onChanged(); + } else { + queryExpansionSpecBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The query expansion specification that specifies the conditions under which
+     * query expansion will occur. See more details at this [user
+     * guide](/retail/private/docs/result-size#query_expansion).
+     * 
+ * + * .google.cloud.retail.v2.SearchRequest.QueryExpansionSpec query_expansion_spec = 14; + * + */ + public Builder mergeQueryExpansionSpec( + com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec value) { + if (queryExpansionSpecBuilder_ == null) { + if (queryExpansionSpec_ != null) { + queryExpansionSpec_ = + com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.newBuilder( + queryExpansionSpec_) + .mergeFrom(value) + .buildPartial(); + } else { + queryExpansionSpec_ = value; + } + onChanged(); + } else { + queryExpansionSpecBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The query expansion specification that specifies the conditions under which
+     * query expansion will occur. See more details at this [user
+     * guide](/retail/private/docs/result-size#query_expansion).
+     * 
+ * + * .google.cloud.retail.v2.SearchRequest.QueryExpansionSpec query_expansion_spec = 14; + * + */ + public Builder clearQueryExpansionSpec() { + if (queryExpansionSpecBuilder_ == null) { + queryExpansionSpec_ = null; + onChanged(); + } else { + queryExpansionSpec_ = null; + queryExpansionSpecBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The query expansion specification that specifies the conditions under which
+     * query expansion will occur. See more details at this [user
+     * guide](/retail/private/docs/result-size#query_expansion).
+     * 
+ * + * .google.cloud.retail.v2.SearchRequest.QueryExpansionSpec query_expansion_spec = 14; + * + */ + public com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Builder + getQueryExpansionSpecBuilder() { + + onChanged(); + return getQueryExpansionSpecFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The query expansion specification that specifies the conditions under which
+     * query expansion will occur. See more details at this [user
+     * guide](/retail/private/docs/result-size#query_expansion).
+     * 
+ * + * .google.cloud.retail.v2.SearchRequest.QueryExpansionSpec query_expansion_spec = 14; + * + */ + public com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpecOrBuilder + getQueryExpansionSpecOrBuilder() { + if (queryExpansionSpecBuilder_ != null) { + return queryExpansionSpecBuilder_.getMessageOrBuilder(); + } else { + return queryExpansionSpec_ == null + ? com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.getDefaultInstance() + : queryExpansionSpec_; + } + } + /** + * + * + *
+     * The query expansion specification that specifies the conditions under which
+     * query expansion will occur. See more details at this [user
+     * guide](/retail/private/docs/result-size#query_expansion).
+     * 
+ * + * .google.cloud.retail.v2.SearchRequest.QueryExpansionSpec query_expansion_spec = 14; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec, + com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Builder, + com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpecOrBuilder> + getQueryExpansionSpecFieldBuilder() { + if (queryExpansionSpecBuilder_ == null) { + queryExpansionSpecBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec, + com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Builder, + com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpecOrBuilder>( + getQueryExpansionSpec(), getParentForChildren(), isClean()); + queryExpansionSpec_ = null; + } + return queryExpansionSpecBuilder_; + } + + private com.google.protobuf.LazyStringList variantRollupKeys_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureVariantRollupKeysIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + variantRollupKeys_ = new com.google.protobuf.LazyStringArrayList(variantRollupKeys_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * 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.
+     * For
+     * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info],
+     * a fulfillment type and a fulfillment ID must be provided in the format of
+     * "fulfillmentType.filfillmentId". E.g., in "pickupInStore.store123",
+     * "pickupInStore" is fulfillment type and "store123" is the store ID.
+     * Supported keys are:
+     * * colorFamilies
+     * * price
+     * * originalPrice
+     * * discount
+     * * attributes.key, where key is any key in the
+     *   [Product.attributes][google.cloud.retail.v2.Product.attributes] map.
+     * * pickupInStore.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.PICKUP_IN_STORE][].
+     * * shipToStore.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.SHIP_TO_STORE][].
+     * * sameDayDelivery.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.SAME_DAY_DELIVERY][].
+     * * nextDayDelivery.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.NEXT_DAY_DELIVERY][].
+     * * customFulfillment1.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.CUSTOM_TYPE_1][].
+     * * customFulfillment2.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.CUSTOM_TYPE_2][].
+     * * customFulfillment3.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.CUSTOM_TYPE_3][].
+     * * customFulfillment4.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.CUSTOM_TYPE_4][].
+     * * customFulfillment5.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.CUSTOM_TYPE_5][].
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string variant_rollup_keys = 17; + * + * @return A list containing the variantRollupKeys. + */ + public com.google.protobuf.ProtocolStringList getVariantRollupKeysList() { + return variantRollupKeys_.getUnmodifiableView(); + } + /** + * + * + *
+     * 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.
+     * For
+     * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info],
+     * a fulfillment type and a fulfillment ID must be provided in the format of
+     * "fulfillmentType.filfillmentId". E.g., in "pickupInStore.store123",
+     * "pickupInStore" is fulfillment type and "store123" is the store ID.
+     * Supported keys are:
+     * * colorFamilies
+     * * price
+     * * originalPrice
+     * * discount
+     * * attributes.key, where key is any key in the
+     *   [Product.attributes][google.cloud.retail.v2.Product.attributes] map.
+     * * pickupInStore.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.PICKUP_IN_STORE][].
+     * * shipToStore.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.SHIP_TO_STORE][].
+     * * sameDayDelivery.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.SAME_DAY_DELIVERY][].
+     * * nextDayDelivery.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.NEXT_DAY_DELIVERY][].
+     * * customFulfillment1.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.CUSTOM_TYPE_1][].
+     * * customFulfillment2.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.CUSTOM_TYPE_2][].
+     * * customFulfillment3.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.CUSTOM_TYPE_3][].
+     * * customFulfillment4.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.CUSTOM_TYPE_4][].
+     * * customFulfillment5.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.CUSTOM_TYPE_5][].
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string variant_rollup_keys = 17; + * + * @return The count of variantRollupKeys. + */ + public int getVariantRollupKeysCount() { + return variantRollupKeys_.size(); + } + /** + * + * + *
+     * 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.
+     * For
+     * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info],
+     * a fulfillment type and a fulfillment ID must be provided in the format of
+     * "fulfillmentType.filfillmentId". E.g., in "pickupInStore.store123",
+     * "pickupInStore" is fulfillment type and "store123" is the store ID.
+     * Supported keys are:
+     * * colorFamilies
+     * * price
+     * * originalPrice
+     * * discount
+     * * attributes.key, where key is any key in the
+     *   [Product.attributes][google.cloud.retail.v2.Product.attributes] map.
+     * * pickupInStore.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.PICKUP_IN_STORE][].
+     * * shipToStore.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.SHIP_TO_STORE][].
+     * * sameDayDelivery.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.SAME_DAY_DELIVERY][].
+     * * nextDayDelivery.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.NEXT_DAY_DELIVERY][].
+     * * customFulfillment1.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.CUSTOM_TYPE_1][].
+     * * customFulfillment2.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.CUSTOM_TYPE_2][].
+     * * customFulfillment3.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.CUSTOM_TYPE_3][].
+     * * customFulfillment4.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.CUSTOM_TYPE_4][].
+     * * customFulfillment5.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.CUSTOM_TYPE_5][].
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string variant_rollup_keys = 17; + * + * @param index The index of the element to return. + * @return The variantRollupKeys at the given index. + */ + public java.lang.String getVariantRollupKeys(int index) { + return variantRollupKeys_.get(index); + } + /** + * + * + *
+     * 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.
+     * For
+     * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info],
+     * a fulfillment type and a fulfillment ID must be provided in the format of
+     * "fulfillmentType.filfillmentId". E.g., in "pickupInStore.store123",
+     * "pickupInStore" is fulfillment type and "store123" is the store ID.
+     * Supported keys are:
+     * * colorFamilies
+     * * price
+     * * originalPrice
+     * * discount
+     * * attributes.key, where key is any key in the
+     *   [Product.attributes][google.cloud.retail.v2.Product.attributes] map.
+     * * pickupInStore.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.PICKUP_IN_STORE][].
+     * * shipToStore.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.SHIP_TO_STORE][].
+     * * sameDayDelivery.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.SAME_DAY_DELIVERY][].
+     * * nextDayDelivery.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.NEXT_DAY_DELIVERY][].
+     * * customFulfillment1.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.CUSTOM_TYPE_1][].
+     * * customFulfillment2.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.CUSTOM_TYPE_2][].
+     * * customFulfillment3.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.CUSTOM_TYPE_3][].
+     * * customFulfillment4.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.CUSTOM_TYPE_4][].
+     * * customFulfillment5.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.CUSTOM_TYPE_5][].
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string variant_rollup_keys = 17; + * + * @param index The index of the value to return. + * @return The bytes of the variantRollupKeys at the given index. + */ + public com.google.protobuf.ByteString getVariantRollupKeysBytes(int index) { + return variantRollupKeys_.getByteString(index); + } + /** + * + * + *
+     * 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.
+     * For
+     * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info],
+     * a fulfillment type and a fulfillment ID must be provided in the format of
+     * "fulfillmentType.filfillmentId". E.g., in "pickupInStore.store123",
+     * "pickupInStore" is fulfillment type and "store123" is the store ID.
+     * Supported keys are:
+     * * colorFamilies
+     * * price
+     * * originalPrice
+     * * discount
+     * * attributes.key, where key is any key in the
+     *   [Product.attributes][google.cloud.retail.v2.Product.attributes] map.
+     * * pickupInStore.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.PICKUP_IN_STORE][].
+     * * shipToStore.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.SHIP_TO_STORE][].
+     * * sameDayDelivery.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.SAME_DAY_DELIVERY][].
+     * * nextDayDelivery.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.NEXT_DAY_DELIVERY][].
+     * * customFulfillment1.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.CUSTOM_TYPE_1][].
+     * * customFulfillment2.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.CUSTOM_TYPE_2][].
+     * * customFulfillment3.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.CUSTOM_TYPE_3][].
+     * * customFulfillment4.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.CUSTOM_TYPE_4][].
+     * * customFulfillment5.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.CUSTOM_TYPE_5][].
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string variant_rollup_keys = 17; + * + * @param index The index to set the value at. + * @param value The variantRollupKeys to set. + * @return This builder for chaining. + */ + public Builder setVariantRollupKeys(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureVariantRollupKeysIsMutable(); + variantRollupKeys_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * For
+     * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info],
+     * a fulfillment type and a fulfillment ID must be provided in the format of
+     * "fulfillmentType.filfillmentId". E.g., in "pickupInStore.store123",
+     * "pickupInStore" is fulfillment type and "store123" is the store ID.
+     * Supported keys are:
+     * * colorFamilies
+     * * price
+     * * originalPrice
+     * * discount
+     * * attributes.key, where key is any key in the
+     *   [Product.attributes][google.cloud.retail.v2.Product.attributes] map.
+     * * pickupInStore.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.PICKUP_IN_STORE][].
+     * * shipToStore.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.SHIP_TO_STORE][].
+     * * sameDayDelivery.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.SAME_DAY_DELIVERY][].
+     * * nextDayDelivery.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.NEXT_DAY_DELIVERY][].
+     * * customFulfillment1.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.CUSTOM_TYPE_1][].
+     * * customFulfillment2.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.CUSTOM_TYPE_2][].
+     * * customFulfillment3.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.CUSTOM_TYPE_3][].
+     * * customFulfillment4.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.CUSTOM_TYPE_4][].
+     * * customFulfillment5.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.CUSTOM_TYPE_5][].
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string variant_rollup_keys = 17; + * + * @param value The variantRollupKeys to add. + * @return This builder for chaining. + */ + public Builder addVariantRollupKeys(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureVariantRollupKeysIsMutable(); + variantRollupKeys_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * For
+     * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info],
+     * a fulfillment type and a fulfillment ID must be provided in the format of
+     * "fulfillmentType.filfillmentId". E.g., in "pickupInStore.store123",
+     * "pickupInStore" is fulfillment type and "store123" is the store ID.
+     * Supported keys are:
+     * * colorFamilies
+     * * price
+     * * originalPrice
+     * * discount
+     * * attributes.key, where key is any key in the
+     *   [Product.attributes][google.cloud.retail.v2.Product.attributes] map.
+     * * pickupInStore.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.PICKUP_IN_STORE][].
+     * * shipToStore.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.SHIP_TO_STORE][].
+     * * sameDayDelivery.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.SAME_DAY_DELIVERY][].
+     * * nextDayDelivery.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.NEXT_DAY_DELIVERY][].
+     * * customFulfillment1.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.CUSTOM_TYPE_1][].
+     * * customFulfillment2.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.CUSTOM_TYPE_2][].
+     * * customFulfillment3.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.CUSTOM_TYPE_3][].
+     * * customFulfillment4.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.CUSTOM_TYPE_4][].
+     * * customFulfillment5.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.CUSTOM_TYPE_5][].
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string variant_rollup_keys = 17; + * + * @param values The variantRollupKeys to add. + * @return This builder for chaining. + */ + public Builder addAllVariantRollupKeys(java.lang.Iterable values) { + ensureVariantRollupKeysIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, variantRollupKeys_); + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * For
+     * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info],
+     * a fulfillment type and a fulfillment ID must be provided in the format of
+     * "fulfillmentType.filfillmentId". E.g., in "pickupInStore.store123",
+     * "pickupInStore" is fulfillment type and "store123" is the store ID.
+     * Supported keys are:
+     * * colorFamilies
+     * * price
+     * * originalPrice
+     * * discount
+     * * attributes.key, where key is any key in the
+     *   [Product.attributes][google.cloud.retail.v2.Product.attributes] map.
+     * * pickupInStore.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.PICKUP_IN_STORE][].
+     * * shipToStore.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.SHIP_TO_STORE][].
+     * * sameDayDelivery.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.SAME_DAY_DELIVERY][].
+     * * nextDayDelivery.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.NEXT_DAY_DELIVERY][].
+     * * customFulfillment1.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.CUSTOM_TYPE_1][].
+     * * customFulfillment2.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.CUSTOM_TYPE_2][].
+     * * customFulfillment3.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.CUSTOM_TYPE_3][].
+     * * customFulfillment4.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.CUSTOM_TYPE_4][].
+     * * customFulfillment5.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.CUSTOM_TYPE_5][].
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string variant_rollup_keys = 17; + * + * @return This builder for chaining. + */ + public Builder clearVariantRollupKeys() { + variantRollupKeys_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * For
+     * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info],
+     * a fulfillment type and a fulfillment ID must be provided in the format of
+     * "fulfillmentType.filfillmentId". E.g., in "pickupInStore.store123",
+     * "pickupInStore" is fulfillment type and "store123" is the store ID.
+     * Supported keys are:
+     * * colorFamilies
+     * * price
+     * * originalPrice
+     * * discount
+     * * attributes.key, where key is any key in the
+     *   [Product.attributes][google.cloud.retail.v2.Product.attributes] map.
+     * * pickupInStore.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.PICKUP_IN_STORE][].
+     * * shipToStore.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.SHIP_TO_STORE][].
+     * * sameDayDelivery.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.SAME_DAY_DELIVERY][].
+     * * nextDayDelivery.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.NEXT_DAY_DELIVERY][].
+     * * customFulfillment1.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.CUSTOM_TYPE_1][].
+     * * customFulfillment2.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.CUSTOM_TYPE_2][].
+     * * customFulfillment3.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.CUSTOM_TYPE_3][].
+     * * customFulfillment4.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.CUSTOM_TYPE_4][].
+     * * customFulfillment5.id, where id is any [FulfillmentInfo.ids][] for type
+     *   [FulfillmentInfo.Type.CUSTOM_TYPE_5][].
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string variant_rollup_keys = 17; + * + * @param value The bytes of the variantRollupKeys to add. + * @return This builder for chaining. + */ + public Builder addVariantRollupKeysBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureVariantRollupKeysIsMutable(); + variantRollupKeys_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList pageCategories_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensurePageCategoriesIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + pageCategories_ = new com.google.protobuf.LazyStringArrayList(pageCategories_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+     * The categories associated with a category page. Required for category
+     * navigation queries to achieve good search quality. The format should be
+     * the same as
+     * [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories];
+     * To represent full path of category, use '>' sign to separate different
+     * hierarchies. If '>' is part of the category name, please replace it with
+     * other character(s).
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+     * 
+ * + * repeated string page_categories = 23; + * + * @return A list containing the pageCategories. + */ + public com.google.protobuf.ProtocolStringList getPageCategoriesList() { + return pageCategories_.getUnmodifiableView(); + } + /** + * + * + *
+     * The categories associated with a category page. Required for category
+     * navigation queries to achieve good search quality. The format should be
+     * the same as
+     * [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories];
+     * To represent full path of category, use '>' sign to separate different
+     * hierarchies. If '>' is part of the category name, please replace it with
+     * other character(s).
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+     * 
+ * + * repeated string page_categories = 23; + * + * @return The count of pageCategories. + */ + public int getPageCategoriesCount() { + return pageCategories_.size(); + } + /** + * + * + *
+     * The categories associated with a category page. Required for category
+     * navigation queries to achieve good search quality. The format should be
+     * the same as
+     * [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories];
+     * To represent full path of category, use '>' sign to separate different
+     * hierarchies. If '>' is part of the category name, please replace it with
+     * other character(s).
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+     * 
+ * + * repeated string page_categories = 23; + * + * @param index The index of the element to return. + * @return The pageCategories at the given index. + */ + public java.lang.String getPageCategories(int index) { + return pageCategories_.get(index); + } + /** + * + * + *
+     * The categories associated with a category page. Required for category
+     * navigation queries to achieve good search quality. The format should be
+     * the same as
+     * [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories];
+     * To represent full path of category, use '>' sign to separate different
+     * hierarchies. If '>' is part of the category name, please replace it with
+     * other character(s).
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+     * 
+ * + * repeated string page_categories = 23; + * + * @param index The index of the value to return. + * @return The bytes of the pageCategories at the given index. + */ + public com.google.protobuf.ByteString getPageCategoriesBytes(int index) { + return pageCategories_.getByteString(index); + } + /** + * + * + *
+     * The categories associated with a category page. Required for category
+     * navigation queries to achieve good search quality. The format should be
+     * the same as
+     * [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories];
+     * To represent full path of category, use '>' sign to separate different
+     * hierarchies. If '>' is part of the category name, please replace it with
+     * other character(s).
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+     * 
+ * + * repeated string page_categories = 23; + * + * @param index The index to set the value at. + * @param value The pageCategories to set. + * @return This builder for chaining. + */ + public Builder setPageCategories(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePageCategoriesIsMutable(); + pageCategories_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The categories associated with a category page. Required for category
+     * navigation queries to achieve good search quality. The format should be
+     * the same as
+     * [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories];
+     * To represent full path of category, use '>' sign to separate different
+     * hierarchies. If '>' is part of the category name, please replace it with
+     * other character(s).
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+     * 
+ * + * repeated string page_categories = 23; + * + * @param value The pageCategories to add. + * @return This builder for chaining. + */ + public Builder addPageCategories(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePageCategoriesIsMutable(); + pageCategories_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The categories associated with a category page. Required for category
+     * navigation queries to achieve good search quality. The format should be
+     * the same as
+     * [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories];
+     * To represent full path of category, use '>' sign to separate different
+     * hierarchies. If '>' is part of the category name, please replace it with
+     * other character(s).
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+     * 
+ * + * repeated string page_categories = 23; + * + * @param values The pageCategories to add. + * @return This builder for chaining. + */ + public Builder addAllPageCategories(java.lang.Iterable values) { + ensurePageCategoriesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, pageCategories_); + onChanged(); + return this; + } + /** + * + * + *
+     * The categories associated with a category page. Required for category
+     * navigation queries to achieve good search quality. The format should be
+     * the same as
+     * [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories];
+     * To represent full path of category, use '>' sign to separate different
+     * hierarchies. If '>' is part of the category name, please replace it with
+     * other character(s).
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+     * 
+ * + * repeated string page_categories = 23; + * + * @return This builder for chaining. + */ + public Builder clearPageCategories() { + pageCategories_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * The categories associated with a category page. Required for category
+     * navigation queries to achieve good search quality. The format should be
+     * the same as
+     * [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories];
+     * To represent full path of category, use '>' sign to separate different
+     * hierarchies. If '>' is part of the category name, please replace it with
+     * other character(s).
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+     * 
+ * + * repeated string page_categories = 23; + * + * @param value The bytes of the pageCategories to add. + * @return This builder for chaining. + */ + public Builder addPageCategoriesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensurePageCategoriesIsMutable(); + pageCategories_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.SearchRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.SearchRequest) + private static final com.google.cloud.retail.v2.SearchRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2.SearchRequest(); + } + + public static com.google.cloud.retail.v2.SearchRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SearchRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SearchRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.retail.v2.SearchRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/SearchRequestOrBuilder.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/SearchRequestOrBuilder.java new file mode 100644 index 00000000..1ccb103c --- /dev/null +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/SearchRequestOrBuilder.java @@ -0,0 +1,854 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2/search_service.proto + +package com.google.cloud.retail.v2; + +public interface SearchRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2.SearchRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the search engine placement, such as
+   * `projects/*/locations/global/catalogs/default_catalog/placements/default_search`.
+   * This field is used to identify the set of models that will be used to make
+   * the search.
+   * We currently support one placement with the following ID:
+   * * `default_search`.
+   * 
+ * + * string placement = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The placement. + */ + java.lang.String getPlacement(); + /** + * + * + *
+   * Required. The resource name of the search engine placement, such as
+   * `projects/*/locations/global/catalogs/default_catalog/placements/default_search`.
+   * This field is used to identify the set of models that will be used to make
+   * the search.
+   * We currently support one placement with the following ID:
+   * * `default_search`.
+   * 
+ * + * string placement = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for placement. + */ + com.google.protobuf.ByteString getPlacementBytes(); + + /** + * + * + *
+   * The branch resource name, such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/0`.
+   * Use "default_branch" as the branch ID or leave this field empty, to search
+   * products under the default branch.
+   * 
+ * + * string branch = 2 [(.google.api.resource_reference) = { ... } + * + * @return The branch. + */ + java.lang.String getBranch(); + /** + * + * + *
+   * The branch resource name, such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/0`.
+   * Use "default_branch" as the branch ID or leave this field empty, to search
+   * products under the default branch.
+   * 
+ * + * string branch = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for branch. + */ + com.google.protobuf.ByteString getBranchBytes(); + + /** + * + * + *
+   * Raw search query.
+   * 
+ * + * string query = 3; + * + * @return The query. + */ + java.lang.String getQuery(); + /** + * + * + *
+   * Raw search query.
+   * 
+ * + * string query = 3; + * + * @return The bytes for query. + */ + com.google.protobuf.ByteString getQueryBytes(); + + /** + * + * + *
+   * 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.
+   * 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]; + * + * @return The visitorId. + */ + java.lang.String getVisitorId(); + /** + * + * + *
+   * 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.
+   * 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]; + * + * @return The bytes for visitorId. + */ + com.google.protobuf.ByteString getVisitorIdBytes(); + + /** + * + * + *
+   * User information.
+   * 
+ * + * .google.cloud.retail.v2.UserInfo user_info = 5; + * + * @return Whether the userInfo field is set. + */ + boolean hasUserInfo(); + /** + * + * + *
+   * User information.
+   * 
+ * + * .google.cloud.retail.v2.UserInfo user_info = 5; + * + * @return The userInfo. + */ + com.google.cloud.retail.v2.UserInfo getUserInfo(); + /** + * + * + *
+   * User information.
+   * 
+ * + * .google.cloud.retail.v2.UserInfo user_info = 5; + */ + com.google.cloud.retail.v2.UserInfoOrBuilder getUserInfoOrBuilder(); + + /** + * + * + *
+   * Maximum number of [Product][google.cloud.retail.v2.Product]s to return. If
+   * unspecified, defaults to a reasonable value. The maximum allowed value is
+   * 120. Values above 120 will be coerced to 120.
+   * If this field is negative, an INVALID_ARGUMENT is returned.
+   * 
+ * + * int32 page_size = 7; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * A page token
+   * [SearchResponse.next_page_token][google.cloud.retail.v2.SearchResponse.next_page_token],
+   * received from a previous
+   * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to
+   * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] must
+   * match the call that provided the page token. Otherwise, an INVALID_ARGUMENT
+   * error is returned.
+   * 
+ * + * string page_token = 8; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A page token
+   * [SearchResponse.next_page_token][google.cloud.retail.v2.SearchResponse.next_page_token],
+   * received from a previous
+   * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to
+   * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] must
+   * match the call that provided the page token. Otherwise, an INVALID_ARGUMENT
+   * error is returned.
+   * 
+ * + * string page_token = 8; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * A 0-indexed integer that specifies the current offset (that is, starting
+   * result location, amongst the [Product][google.cloud.retail.v2.Product]s
+   * deemed by the API as relevant) in search results. This field is only
+   * considered if [page_token][google.cloud.retail.v2.SearchRequest.page_token]
+   * is unset.
+   * If this field is negative, an INVALID_ARGUMENT is returned.
+   * 
+ * + * int32 offset = 9; + * + * @return The offset. + */ + int getOffset(); + + /** + * + * + *
+   * The filter syntax consists of an expression language for constructing a
+   * predicate from one or more fields of the products being filtered. Filter
+   * expression is case-sensitive. See more details at this [user
+   * guide](/retail/private/docs/filter-and-order#filter).
+   * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
+   * 
+ * + * string filter = 10; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * The filter syntax consists of an expression language for constructing a
+   * predicate from one or more fields of the products being filtered. Filter
+   * expression is case-sensitive. See more details at this [user
+   * guide](/retail/private/docs/filter-and-order#filter).
+   * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
+   * 
+ * + * string filter = 10; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * 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
+   * [SearchRequest.canonical_filter][google.cloud.retail.v2.SearchRequest.canonical_filter]
+   * will be returned as a supplement of the original query. This field is
+   * strongly recommended to achieve high search quality.
+   * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
+   * more details about filter syntax.
+   * 
+ * + * string canonical_filter = 28; + * + * @return The canonicalFilter. + */ + java.lang.String getCanonicalFilter(); + /** + * + * + *
+   * 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
+   * [SearchRequest.canonical_filter][google.cloud.retail.v2.SearchRequest.canonical_filter]
+   * will be returned as a supplement of the original query. This field is
+   * strongly recommended to achieve high search quality.
+   * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
+   * more details about filter syntax.
+   * 
+ * + * string canonical_filter = 28; + * + * @return The bytes for canonicalFilter. + */ + com.google.protobuf.ByteString getCanonicalFilterBytes(); + + /** + * + * + *
+   * The order in which products are returned. Products can be ordered by
+   * a field in an [Product][google.cloud.retail.v2.Product] object. Leave it
+   * unset if ordered by relevance. OrderBy expression is case-sensitive. See
+   * more details at this [user
+   * guide](/retail/private/docs/filter-and-order#order).
+   * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
+   * 
+ * + * string order_by = 11; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * The order in which products are returned. Products can be ordered by
+   * a field in an [Product][google.cloud.retail.v2.Product] object. Leave it
+   * unset if ordered by relevance. OrderBy expression is case-sensitive. See
+   * more details at this [user
+   * guide](/retail/private/docs/filter-and-order#order).
+   * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
+   * 
+ * + * string order_by = 11; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); + + /** + * + * + *
+   * Facet specifications for faceted search. If empty, no facets are returned.
+   * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2.SearchRequest.FacetSpec facet_specs = 12; + */ + java.util.List getFacetSpecsList(); + /** + * + * + *
+   * Facet specifications for faceted search. If empty, no facets are returned.
+   * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2.SearchRequest.FacetSpec facet_specs = 12; + */ + com.google.cloud.retail.v2.SearchRequest.FacetSpec getFacetSpecs(int index); + /** + * + * + *
+   * Facet specifications for faceted search. If empty, no facets are returned.
+   * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2.SearchRequest.FacetSpec facet_specs = 12; + */ + int getFacetSpecsCount(); + /** + * + * + *
+   * Facet specifications for faceted search. If empty, no facets are returned.
+   * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2.SearchRequest.FacetSpec facet_specs = 12; + */ + java.util.List + getFacetSpecsOrBuilderList(); + /** + * + * + *
+   * Facet specifications for faceted search. If empty, no facets are returned.
+   * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2.SearchRequest.FacetSpec facet_specs = 12; + */ + com.google.cloud.retail.v2.SearchRequest.FacetSpecOrBuilder getFacetSpecsOrBuilder(int index); + + /** + * + * + *
+   * The specification for dynamically generated facets. Notice that only
+   * textual facets can be dynamically generated.
+   * This feature requires additional allowlisting. Contact Retail Support
+   * (retail-search-support@google.com) if you are interested in using dynamic
+   * facet feature.
+   * 
+ * + * .google.cloud.retail.v2.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21; + * + * @return Whether the dynamicFacetSpec field is set. + */ + boolean hasDynamicFacetSpec(); + /** + * + * + *
+   * The specification for dynamically generated facets. Notice that only
+   * textual facets can be dynamically generated.
+   * This feature requires additional allowlisting. Contact Retail Support
+   * (retail-search-support@google.com) if you are interested in using dynamic
+   * facet feature.
+   * 
+ * + * .google.cloud.retail.v2.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21; + * + * @return The dynamicFacetSpec. + */ + com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec getDynamicFacetSpec(); + /** + * + * + *
+   * The specification for dynamically generated facets. Notice that only
+   * textual facets can be dynamically generated.
+   * This feature requires additional allowlisting. Contact Retail Support
+   * (retail-search-support@google.com) if you are interested in using dynamic
+   * facet feature.
+   * 
+ * + * .google.cloud.retail.v2.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21; + */ + com.google.cloud.retail.v2.SearchRequest.DynamicFacetSpecOrBuilder getDynamicFacetSpecOrBuilder(); + + /** + * + * + *
+   * Boost specification to boost certain products. See more details at this
+   * [user guide](/retail/private/docs/boosting).
+   * 
+ * + * .google.cloud.retail.v2.SearchRequest.BoostSpec boost_spec = 13; + * + * @return Whether the boostSpec field is set. + */ + boolean hasBoostSpec(); + /** + * + * + *
+   * Boost specification to boost certain products. See more details at this
+   * [user guide](/retail/private/docs/boosting).
+   * 
+ * + * .google.cloud.retail.v2.SearchRequest.BoostSpec boost_spec = 13; + * + * @return The boostSpec. + */ + com.google.cloud.retail.v2.SearchRequest.BoostSpec getBoostSpec(); + /** + * + * + *
+   * Boost specification to boost certain products. See more details at this
+   * [user guide](/retail/private/docs/boosting).
+   * 
+ * + * .google.cloud.retail.v2.SearchRequest.BoostSpec boost_spec = 13; + */ + com.google.cloud.retail.v2.SearchRequest.BoostSpecOrBuilder getBoostSpecOrBuilder(); + + /** + * + * + *
+   * The query expansion specification that specifies the conditions under which
+   * query expansion will occur. See more details at this [user
+   * guide](/retail/private/docs/result-size#query_expansion).
+   * 
+ * + * .google.cloud.retail.v2.SearchRequest.QueryExpansionSpec query_expansion_spec = 14; + * + * + * @return Whether the queryExpansionSpec field is set. + */ + boolean hasQueryExpansionSpec(); + /** + * + * + *
+   * The query expansion specification that specifies the conditions under which
+   * query expansion will occur. See more details at this [user
+   * guide](/retail/private/docs/result-size#query_expansion).
+   * 
+ * + * .google.cloud.retail.v2.SearchRequest.QueryExpansionSpec query_expansion_spec = 14; + * + * + * @return The queryExpansionSpec. + */ + com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec getQueryExpansionSpec(); + /** + * + * + *
+   * The query expansion specification that specifies the conditions under which
+   * query expansion will occur. See more details at this [user
+   * guide](/retail/private/docs/result-size#query_expansion).
+   * 
+ * + * .google.cloud.retail.v2.SearchRequest.QueryExpansionSpec query_expansion_spec = 14; + * + */ + com.google.cloud.retail.v2.SearchRequest.QueryExpansionSpecOrBuilder + getQueryExpansionSpecOrBuilder(); + + /** + * + * + *
+   * 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.
+   * For
+   * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info],
+   * a fulfillment type and a fulfillment ID must be provided in the format of
+   * "fulfillmentType.filfillmentId". E.g., in "pickupInStore.store123",
+   * "pickupInStore" is fulfillment type and "store123" is the store ID.
+   * Supported keys are:
+   * * colorFamilies
+   * * price
+   * * originalPrice
+   * * discount
+   * * attributes.key, where key is any key in the
+   *   [Product.attributes][google.cloud.retail.v2.Product.attributes] map.
+   * * pickupInStore.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.PICKUP_IN_STORE][].
+   * * shipToStore.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.SHIP_TO_STORE][].
+   * * sameDayDelivery.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.SAME_DAY_DELIVERY][].
+   * * nextDayDelivery.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.NEXT_DAY_DELIVERY][].
+   * * customFulfillment1.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.CUSTOM_TYPE_1][].
+   * * customFulfillment2.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.CUSTOM_TYPE_2][].
+   * * customFulfillment3.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.CUSTOM_TYPE_3][].
+   * * customFulfillment4.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.CUSTOM_TYPE_4][].
+   * * customFulfillment5.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.CUSTOM_TYPE_5][].
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string variant_rollup_keys = 17; + * + * @return A list containing the variantRollupKeys. + */ + java.util.List getVariantRollupKeysList(); + /** + * + * + *
+   * 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.
+   * For
+   * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info],
+   * a fulfillment type and a fulfillment ID must be provided in the format of
+   * "fulfillmentType.filfillmentId". E.g., in "pickupInStore.store123",
+   * "pickupInStore" is fulfillment type and "store123" is the store ID.
+   * Supported keys are:
+   * * colorFamilies
+   * * price
+   * * originalPrice
+   * * discount
+   * * attributes.key, where key is any key in the
+   *   [Product.attributes][google.cloud.retail.v2.Product.attributes] map.
+   * * pickupInStore.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.PICKUP_IN_STORE][].
+   * * shipToStore.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.SHIP_TO_STORE][].
+   * * sameDayDelivery.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.SAME_DAY_DELIVERY][].
+   * * nextDayDelivery.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.NEXT_DAY_DELIVERY][].
+   * * customFulfillment1.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.CUSTOM_TYPE_1][].
+   * * customFulfillment2.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.CUSTOM_TYPE_2][].
+   * * customFulfillment3.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.CUSTOM_TYPE_3][].
+   * * customFulfillment4.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.CUSTOM_TYPE_4][].
+   * * customFulfillment5.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.CUSTOM_TYPE_5][].
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string variant_rollup_keys = 17; + * + * @return The count of variantRollupKeys. + */ + int getVariantRollupKeysCount(); + /** + * + * + *
+   * 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.
+   * For
+   * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info],
+   * a fulfillment type and a fulfillment ID must be provided in the format of
+   * "fulfillmentType.filfillmentId". E.g., in "pickupInStore.store123",
+   * "pickupInStore" is fulfillment type and "store123" is the store ID.
+   * Supported keys are:
+   * * colorFamilies
+   * * price
+   * * originalPrice
+   * * discount
+   * * attributes.key, where key is any key in the
+   *   [Product.attributes][google.cloud.retail.v2.Product.attributes] map.
+   * * pickupInStore.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.PICKUP_IN_STORE][].
+   * * shipToStore.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.SHIP_TO_STORE][].
+   * * sameDayDelivery.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.SAME_DAY_DELIVERY][].
+   * * nextDayDelivery.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.NEXT_DAY_DELIVERY][].
+   * * customFulfillment1.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.CUSTOM_TYPE_1][].
+   * * customFulfillment2.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.CUSTOM_TYPE_2][].
+   * * customFulfillment3.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.CUSTOM_TYPE_3][].
+   * * customFulfillment4.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.CUSTOM_TYPE_4][].
+   * * customFulfillment5.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.CUSTOM_TYPE_5][].
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string variant_rollup_keys = 17; + * + * @param index The index of the element to return. + * @return The variantRollupKeys at the given index. + */ + java.lang.String getVariantRollupKeys(int index); + /** + * + * + *
+   * 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.
+   * For
+   * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info],
+   * a fulfillment type and a fulfillment ID must be provided in the format of
+   * "fulfillmentType.filfillmentId". E.g., in "pickupInStore.store123",
+   * "pickupInStore" is fulfillment type and "store123" is the store ID.
+   * Supported keys are:
+   * * colorFamilies
+   * * price
+   * * originalPrice
+   * * discount
+   * * attributes.key, where key is any key in the
+   *   [Product.attributes][google.cloud.retail.v2.Product.attributes] map.
+   * * pickupInStore.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.PICKUP_IN_STORE][].
+   * * shipToStore.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.SHIP_TO_STORE][].
+   * * sameDayDelivery.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.SAME_DAY_DELIVERY][].
+   * * nextDayDelivery.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.NEXT_DAY_DELIVERY][].
+   * * customFulfillment1.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.CUSTOM_TYPE_1][].
+   * * customFulfillment2.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.CUSTOM_TYPE_2][].
+   * * customFulfillment3.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.CUSTOM_TYPE_3][].
+   * * customFulfillment4.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.CUSTOM_TYPE_4][].
+   * * customFulfillment5.id, where id is any [FulfillmentInfo.ids][] for type
+   *   [FulfillmentInfo.Type.CUSTOM_TYPE_5][].
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string variant_rollup_keys = 17; + * + * @param index The index of the value to return. + * @return The bytes of the variantRollupKeys at the given index. + */ + com.google.protobuf.ByteString getVariantRollupKeysBytes(int index); + + /** + * + * + *
+   * The categories associated with a category page. Required for category
+   * navigation queries to achieve good search quality. The format should be
+   * the same as
+   * [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories];
+   * To represent full path of category, use '>' sign to separate different
+   * hierarchies. If '>' is part of the category name, please replace it with
+   * other character(s).
+   * Category pages include special pages such as sales or promotions. For
+   * instance, a special sale page may have the category hierarchy:
+   * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+   * 
+ * + * repeated string page_categories = 23; + * + * @return A list containing the pageCategories. + */ + java.util.List getPageCategoriesList(); + /** + * + * + *
+   * The categories associated with a category page. Required for category
+   * navigation queries to achieve good search quality. The format should be
+   * the same as
+   * [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories];
+   * To represent full path of category, use '>' sign to separate different
+   * hierarchies. If '>' is part of the category name, please replace it with
+   * other character(s).
+   * Category pages include special pages such as sales or promotions. For
+   * instance, a special sale page may have the category hierarchy:
+   * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+   * 
+ * + * repeated string page_categories = 23; + * + * @return The count of pageCategories. + */ + int getPageCategoriesCount(); + /** + * + * + *
+   * The categories associated with a category page. Required for category
+   * navigation queries to achieve good search quality. The format should be
+   * the same as
+   * [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories];
+   * To represent full path of category, use '>' sign to separate different
+   * hierarchies. If '>' is part of the category name, please replace it with
+   * other character(s).
+   * Category pages include special pages such as sales or promotions. For
+   * instance, a special sale page may have the category hierarchy:
+   * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+   * 
+ * + * repeated string page_categories = 23; + * + * @param index The index of the element to return. + * @return The pageCategories at the given index. + */ + java.lang.String getPageCategories(int index); + /** + * + * + *
+   * The categories associated with a category page. Required for category
+   * navigation queries to achieve good search quality. The format should be
+   * the same as
+   * [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories];
+   * To represent full path of category, use '>' sign to separate different
+   * hierarchies. If '>' is part of the category name, please replace it with
+   * other character(s).
+   * Category pages include special pages such as sales or promotions. For
+   * instance, a special sale page may have the category hierarchy:
+   * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+   * 
+ * + * repeated string page_categories = 23; + * + * @param index The index of the value to return. + * @return The bytes of the pageCategories at the given index. + */ + com.google.protobuf.ByteString getPageCategoriesBytes(int index); +} diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/SearchResponse.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/SearchResponse.java new file mode 100644 index 00000000..bd7d674b --- /dev/null +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/SearchResponse.java @@ -0,0 +1,8390 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2/search_service.proto + +package com.google.cloud.retail.v2; + +/** + * + * + *
+ * Response message for
+ * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2.SearchResponse} + */ +public final class SearchResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.SearchResponse) + SearchResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use SearchResponse.newBuilder() to construct. + private SearchResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SearchResponse() { + results_ = java.util.Collections.emptyList(); + facets_ = java.util.Collections.emptyList(); + correctedQuery_ = ""; + attributionToken_ = ""; + nextPageToken_ = ""; + redirectUri_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SearchResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SearchResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + results_ = + new java.util.ArrayList< + com.google.cloud.retail.v2.SearchResponse.SearchResult>(); + mutable_bitField0_ |= 0x00000001; + } + results_.add( + input.readMessage( + com.google.cloud.retail.v2.SearchResponse.SearchResult.parser(), + extensionRegistry)); + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + facets_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + facets_.add( + input.readMessage( + com.google.cloud.retail.v2.SearchResponse.Facet.parser(), extensionRegistry)); + break; + } + case 24: + { + totalSize_ = input.readInt32(); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + correctedQuery_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + attributionToken_ = s; + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + case 58: + { + com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo.Builder subBuilder = + null; + if (queryExpansionInfo_ != null) { + subBuilder = queryExpansionInfo_.toBuilder(); + } + queryExpansionInfo_ = + input.readMessage( + com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(queryExpansionInfo_); + queryExpansionInfo_ = subBuilder.buildPartial(); + } + + break; + } + case 82: + { + java.lang.String s = input.readStringRequireUtf8(); + + redirectUri_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + results_ = java.util.Collections.unmodifiableList(results_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + facets_ = java.util.Collections.unmodifiableList(facets_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.SearchResponse.class, + com.google.cloud.retail.v2.SearchResponse.Builder.class); + } + + public interface SearchResultOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2.SearchResponse.SearchResult) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * [Product.id][google.cloud.retail.v2.Product.id] of the searched
+     * [Product][google.cloud.retail.v2.Product].
+     * 
+ * + * string id = 1; + * + * @return The id. + */ + java.lang.String getId(); + /** + * + * + *
+     * [Product.id][google.cloud.retail.v2.Product.id] of the searched
+     * [Product][google.cloud.retail.v2.Product].
+     * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + com.google.protobuf.ByteString getIdBytes(); + + /** + * + * + *
+     * The product data snippet in the search response. Only
+     * [Product.name][google.cloud.retail.v2.Product.name] is guaranteed to be
+     * populated.
+     * [Product.variants][google.cloud.retail.v2.Product.variants] contains the
+     * product variants that match the search query. If there are multiple
+     * product variants matching the query, top 5 most relevant product variants
+     * are returned and ordered by relevancy.
+     * If relevancy can be deternmined, use
+     * [matching_variant_fields][google.cloud.retail.v2.SearchResponse.SearchResult.matching_variant_fields]
+     * to look up matched product variants fields. If relevancy cannot be
+     * determined, e.g. when searching "shoe" all products in a shoe product can
+     * be a match, 5 product variants are returned but order is meaningless.
+     * 
+ * + * .google.cloud.retail.v2.Product product = 2; + * + * @return Whether the product field is set. + */ + boolean hasProduct(); + /** + * + * + *
+     * The product data snippet in the search response. Only
+     * [Product.name][google.cloud.retail.v2.Product.name] is guaranteed to be
+     * populated.
+     * [Product.variants][google.cloud.retail.v2.Product.variants] contains the
+     * product variants that match the search query. If there are multiple
+     * product variants matching the query, top 5 most relevant product variants
+     * are returned and ordered by relevancy.
+     * If relevancy can be deternmined, use
+     * [matching_variant_fields][google.cloud.retail.v2.SearchResponse.SearchResult.matching_variant_fields]
+     * to look up matched product variants fields. If relevancy cannot be
+     * determined, e.g. when searching "shoe" all products in a shoe product can
+     * be a match, 5 product variants are returned but order is meaningless.
+     * 
+ * + * .google.cloud.retail.v2.Product product = 2; + * + * @return The product. + */ + com.google.cloud.retail.v2.Product getProduct(); + /** + * + * + *
+     * The product data snippet in the search response. Only
+     * [Product.name][google.cloud.retail.v2.Product.name] is guaranteed to be
+     * populated.
+     * [Product.variants][google.cloud.retail.v2.Product.variants] contains the
+     * product variants that match the search query. If there are multiple
+     * product variants matching the query, top 5 most relevant product variants
+     * are returned and ordered by relevancy.
+     * If relevancy can be deternmined, use
+     * [matching_variant_fields][google.cloud.retail.v2.SearchResponse.SearchResult.matching_variant_fields]
+     * to look up matched product variants fields. If relevancy cannot be
+     * determined, e.g. when searching "shoe" all products in a shoe product can
+     * be a match, 5 product variants are returned but order is meaningless.
+     * 
+ * + * .google.cloud.retail.v2.Product product = 2; + */ + com.google.cloud.retail.v2.ProductOrBuilder getProductOrBuilder(); + + /** + * + * + *
+     * The count of matched
+     * [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2.Product]s.
+     * 
+ * + * int32 matching_variant_count = 3; + * + * @return The matchingVariantCount. + */ + int getMatchingVariantCount(); + + /** + * + * + *
+     * If a [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2.Product] matches the search query, this
+     * map indicates which [Product][google.cloud.retail.v2.Product] fields are
+     * matched. The key is the
+     * [Product.name][google.cloud.retail.v2.Product.name], the value is a field
+     * mask of the matched [Product][google.cloud.retail.v2.Product] fields. If
+     * matched attributes cannot be determined, this map will be empty.
+     * For example, a key "sku1" with field mask
+     * "products.color_info" indicates there is a match between
+     * "sku1" [ColorInfo][google.cloud.retail.v2.ColorInfo] and the query.
+     * 
+ * + * map<string, .google.protobuf.FieldMask> matching_variant_fields = 4; + */ + int getMatchingVariantFieldsCount(); + /** + * + * + *
+     * If a [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2.Product] matches the search query, this
+     * map indicates which [Product][google.cloud.retail.v2.Product] fields are
+     * matched. The key is the
+     * [Product.name][google.cloud.retail.v2.Product.name], the value is a field
+     * mask of the matched [Product][google.cloud.retail.v2.Product] fields. If
+     * matched attributes cannot be determined, this map will be empty.
+     * For example, a key "sku1" with field mask
+     * "products.color_info" indicates there is a match between
+     * "sku1" [ColorInfo][google.cloud.retail.v2.ColorInfo] and the query.
+     * 
+ * + * map<string, .google.protobuf.FieldMask> matching_variant_fields = 4; + */ + boolean containsMatchingVariantFields(java.lang.String key); + /** Use {@link #getMatchingVariantFieldsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getMatchingVariantFields(); + /** + * + * + *
+     * If a [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2.Product] matches the search query, this
+     * map indicates which [Product][google.cloud.retail.v2.Product] fields are
+     * matched. The key is the
+     * [Product.name][google.cloud.retail.v2.Product.name], the value is a field
+     * mask of the matched [Product][google.cloud.retail.v2.Product] fields. If
+     * matched attributes cannot be determined, this map will be empty.
+     * For example, a key "sku1" with field mask
+     * "products.color_info" indicates there is a match between
+     * "sku1" [ColorInfo][google.cloud.retail.v2.ColorInfo] and the query.
+     * 
+ * + * map<string, .google.protobuf.FieldMask> matching_variant_fields = 4; + */ + java.util.Map getMatchingVariantFieldsMap(); + /** + * + * + *
+     * If a [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2.Product] matches the search query, this
+     * map indicates which [Product][google.cloud.retail.v2.Product] fields are
+     * matched. The key is the
+     * [Product.name][google.cloud.retail.v2.Product.name], the value is a field
+     * mask of the matched [Product][google.cloud.retail.v2.Product] fields. If
+     * matched attributes cannot be determined, this map will be empty.
+     * For example, a key "sku1" with field mask
+     * "products.color_info" indicates there is a match between
+     * "sku1" [ColorInfo][google.cloud.retail.v2.ColorInfo] and the query.
+     * 
+ * + * map<string, .google.protobuf.FieldMask> matching_variant_fields = 4; + */ + com.google.protobuf.FieldMask getMatchingVariantFieldsOrDefault( + java.lang.String key, com.google.protobuf.FieldMask defaultValue); + /** + * + * + *
+     * If a [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2.Product] matches the search query, this
+     * map indicates which [Product][google.cloud.retail.v2.Product] fields are
+     * matched. The key is the
+     * [Product.name][google.cloud.retail.v2.Product.name], the value is a field
+     * mask of the matched [Product][google.cloud.retail.v2.Product] fields. If
+     * matched attributes cannot be determined, this map will be empty.
+     * For example, a key "sku1" with field mask
+     * "products.color_info" indicates there is a match between
+     * "sku1" [ColorInfo][google.cloud.retail.v2.ColorInfo] and the query.
+     * 
+ * + * map<string, .google.protobuf.FieldMask> matching_variant_fields = 4; + */ + com.google.protobuf.FieldMask getMatchingVariantFieldsOrThrow(java.lang.String key); + + /** + * + * + *
+     * The rollup matching
+     * [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2.Product] attributes. The key is one of
+     * the
+     * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2.SearchRequest.variant_rollup_keys].
+     * The values are the merged and de-duplicated
+     * [Product][google.cloud.retail.v2.Product] attributes. Notice that the
+     * rollup values are respect filter. For example, when filtering by
+     * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
+     * returned.
+     * For textual and numerical attributes, the rollup values is a list of
+     * string or double values with type
+     * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if
+     * there are two variants with colors "red" and "blue", the rollup values
+     * are { key: "colorFamilies"
+     *   value {
+     *     list_value {
+     *       values { string_value: "red" }
+     *       values { string_value: "blue" }
+     *      }
+     *   }
+     * }
+     * For
+     * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info],
+     * the rollup values is a double value with type
+     * [google.protobuf.Value][google.protobuf.Value]. For example, {key:
+     * "pickupInStore.store1" value { number_value: 10 }} means a there are 10
+     * variants in this product are available in the store "store1".
+     * 
+ * + * map<string, .google.protobuf.Value> variant_rollup_values = 5; + */ + int getVariantRollupValuesCount(); + /** + * + * + *
+     * The rollup matching
+     * [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2.Product] attributes. The key is one of
+     * the
+     * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2.SearchRequest.variant_rollup_keys].
+     * The values are the merged and de-duplicated
+     * [Product][google.cloud.retail.v2.Product] attributes. Notice that the
+     * rollup values are respect filter. For example, when filtering by
+     * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
+     * returned.
+     * For textual and numerical attributes, the rollup values is a list of
+     * string or double values with type
+     * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if
+     * there are two variants with colors "red" and "blue", the rollup values
+     * are { key: "colorFamilies"
+     *   value {
+     *     list_value {
+     *       values { string_value: "red" }
+     *       values { string_value: "blue" }
+     *      }
+     *   }
+     * }
+     * For
+     * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info],
+     * the rollup values is a double value with type
+     * [google.protobuf.Value][google.protobuf.Value]. For example, {key:
+     * "pickupInStore.store1" value { number_value: 10 }} means a there are 10
+     * variants in this product are available in the store "store1".
+     * 
+ * + * map<string, .google.protobuf.Value> variant_rollup_values = 5; + */ + boolean containsVariantRollupValues(java.lang.String key); + /** Use {@link #getVariantRollupValuesMap()} instead. */ + @java.lang.Deprecated + java.util.Map getVariantRollupValues(); + /** + * + * + *
+     * The rollup matching
+     * [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2.Product] attributes. The key is one of
+     * the
+     * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2.SearchRequest.variant_rollup_keys].
+     * The values are the merged and de-duplicated
+     * [Product][google.cloud.retail.v2.Product] attributes. Notice that the
+     * rollup values are respect filter. For example, when filtering by
+     * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
+     * returned.
+     * For textual and numerical attributes, the rollup values is a list of
+     * string or double values with type
+     * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if
+     * there are two variants with colors "red" and "blue", the rollup values
+     * are { key: "colorFamilies"
+     *   value {
+     *     list_value {
+     *       values { string_value: "red" }
+     *       values { string_value: "blue" }
+     *      }
+     *   }
+     * }
+     * For
+     * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info],
+     * the rollup values is a double value with type
+     * [google.protobuf.Value][google.protobuf.Value]. For example, {key:
+     * "pickupInStore.store1" value { number_value: 10 }} means a there are 10
+     * variants in this product are available in the store "store1".
+     * 
+ * + * map<string, .google.protobuf.Value> variant_rollup_values = 5; + */ + java.util.Map getVariantRollupValuesMap(); + /** + * + * + *
+     * The rollup matching
+     * [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2.Product] attributes. The key is one of
+     * the
+     * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2.SearchRequest.variant_rollup_keys].
+     * The values are the merged and de-duplicated
+     * [Product][google.cloud.retail.v2.Product] attributes. Notice that the
+     * rollup values are respect filter. For example, when filtering by
+     * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
+     * returned.
+     * For textual and numerical attributes, the rollup values is a list of
+     * string or double values with type
+     * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if
+     * there are two variants with colors "red" and "blue", the rollup values
+     * are { key: "colorFamilies"
+     *   value {
+     *     list_value {
+     *       values { string_value: "red" }
+     *       values { string_value: "blue" }
+     *      }
+     *   }
+     * }
+     * For
+     * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info],
+     * the rollup values is a double value with type
+     * [google.protobuf.Value][google.protobuf.Value]. For example, {key:
+     * "pickupInStore.store1" value { number_value: 10 }} means a there are 10
+     * variants in this product are available in the store "store1".
+     * 
+ * + * map<string, .google.protobuf.Value> variant_rollup_values = 5; + */ + com.google.protobuf.Value getVariantRollupValuesOrDefault( + java.lang.String key, com.google.protobuf.Value defaultValue); + /** + * + * + *
+     * The rollup matching
+     * [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2.Product] attributes. The key is one of
+     * the
+     * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2.SearchRequest.variant_rollup_keys].
+     * The values are the merged and de-duplicated
+     * [Product][google.cloud.retail.v2.Product] attributes. Notice that the
+     * rollup values are respect filter. For example, when filtering by
+     * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
+     * returned.
+     * For textual and numerical attributes, the rollup values is a list of
+     * string or double values with type
+     * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if
+     * there are two variants with colors "red" and "blue", the rollup values
+     * are { key: "colorFamilies"
+     *   value {
+     *     list_value {
+     *       values { string_value: "red" }
+     *       values { string_value: "blue" }
+     *      }
+     *   }
+     * }
+     * For
+     * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info],
+     * the rollup values is a double value with type
+     * [google.protobuf.Value][google.protobuf.Value]. For example, {key:
+     * "pickupInStore.store1" value { number_value: 10 }} means a there are 10
+     * variants in this product are available in the store "store1".
+     * 
+ * + * map<string, .google.protobuf.Value> variant_rollup_values = 5; + */ + com.google.protobuf.Value getVariantRollupValuesOrThrow(java.lang.String key); + } + /** + * + * + *
+   * Represents the search results.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2.SearchResponse.SearchResult} + */ + public static final class SearchResult extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.SearchResponse.SearchResult) + SearchResultOrBuilder { + private static final long serialVersionUID = 0L; + // Use SearchResult.newBuilder() to construct. + private SearchResult(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SearchResult() { + id_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SearchResult(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SearchResult( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + id_ = s; + break; + } + case 18: + { + com.google.cloud.retail.v2.Product.Builder subBuilder = null; + if (product_ != null) { + subBuilder = product_.toBuilder(); + } + product_ = + input.readMessage( + com.google.cloud.retail.v2.Product.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(product_); + product_ = subBuilder.buildPartial(); + } + + break; + } + case 24: + { + matchingVariantCount_ = input.readInt32(); + break; + } + case 34: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + matchingVariantFields_ = + com.google.protobuf.MapField.newMapField( + MatchingVariantFieldsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry + matchingVariantFields__ = + input.readMessage( + MatchingVariantFieldsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + matchingVariantFields_ + .getMutableMap() + .put(matchingVariantFields__.getKey(), matchingVariantFields__.getValue()); + break; + } + case 42: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + variantRollupValues_ = + com.google.protobuf.MapField.newMapField( + VariantRollupValuesDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000002; + } + com.google.protobuf.MapEntry + variantRollupValues__ = + input.readMessage( + VariantRollupValuesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + variantRollupValues_ + .getMutableMap() + .put(variantRollupValues__.getKey(), variantRollupValues__.getValue()); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchResponse_SearchResult_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetMatchingVariantFields(); + case 5: + return internalGetVariantRollupValues(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchResponse_SearchResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.SearchResponse.SearchResult.class, + com.google.cloud.retail.v2.SearchResponse.SearchResult.Builder.class); + } + + public static final int ID_FIELD_NUMBER = 1; + private volatile java.lang.Object id_; + /** + * + * + *
+     * [Product.id][google.cloud.retail.v2.Product.id] of the searched
+     * [Product][google.cloud.retail.v2.Product].
+     * 
+ * + * string id = 1; + * + * @return The id. + */ + @java.lang.Override + public java.lang.String getId() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } + } + /** + * + * + *
+     * [Product.id][google.cloud.retail.v2.Product.id] of the searched
+     * [Product][google.cloud.retail.v2.Product].
+     * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PRODUCT_FIELD_NUMBER = 2; + private com.google.cloud.retail.v2.Product product_; + /** + * + * + *
+     * The product data snippet in the search response. Only
+     * [Product.name][google.cloud.retail.v2.Product.name] is guaranteed to be
+     * populated.
+     * [Product.variants][google.cloud.retail.v2.Product.variants] contains the
+     * product variants that match the search query. If there are multiple
+     * product variants matching the query, top 5 most relevant product variants
+     * are returned and ordered by relevancy.
+     * If relevancy can be deternmined, use
+     * [matching_variant_fields][google.cloud.retail.v2.SearchResponse.SearchResult.matching_variant_fields]
+     * to look up matched product variants fields. If relevancy cannot be
+     * determined, e.g. when searching "shoe" all products in a shoe product can
+     * be a match, 5 product variants are returned but order is meaningless.
+     * 
+ * + * .google.cloud.retail.v2.Product product = 2; + * + * @return Whether the product field is set. + */ + @java.lang.Override + public boolean hasProduct() { + return product_ != null; + } + /** + * + * + *
+     * The product data snippet in the search response. Only
+     * [Product.name][google.cloud.retail.v2.Product.name] is guaranteed to be
+     * populated.
+     * [Product.variants][google.cloud.retail.v2.Product.variants] contains the
+     * product variants that match the search query. If there are multiple
+     * product variants matching the query, top 5 most relevant product variants
+     * are returned and ordered by relevancy.
+     * If relevancy can be deternmined, use
+     * [matching_variant_fields][google.cloud.retail.v2.SearchResponse.SearchResult.matching_variant_fields]
+     * to look up matched product variants fields. If relevancy cannot be
+     * determined, e.g. when searching "shoe" all products in a shoe product can
+     * be a match, 5 product variants are returned but order is meaningless.
+     * 
+ * + * .google.cloud.retail.v2.Product product = 2; + * + * @return The product. + */ + @java.lang.Override + public com.google.cloud.retail.v2.Product getProduct() { + return product_ == null ? com.google.cloud.retail.v2.Product.getDefaultInstance() : product_; + } + /** + * + * + *
+     * The product data snippet in the search response. Only
+     * [Product.name][google.cloud.retail.v2.Product.name] is guaranteed to be
+     * populated.
+     * [Product.variants][google.cloud.retail.v2.Product.variants] contains the
+     * product variants that match the search query. If there are multiple
+     * product variants matching the query, top 5 most relevant product variants
+     * are returned and ordered by relevancy.
+     * If relevancy can be deternmined, use
+     * [matching_variant_fields][google.cloud.retail.v2.SearchResponse.SearchResult.matching_variant_fields]
+     * to look up matched product variants fields. If relevancy cannot be
+     * determined, e.g. when searching "shoe" all products in a shoe product can
+     * be a match, 5 product variants are returned but order is meaningless.
+     * 
+ * + * .google.cloud.retail.v2.Product product = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2.ProductOrBuilder getProductOrBuilder() { + return getProduct(); + } + + public static final int MATCHING_VARIANT_COUNT_FIELD_NUMBER = 3; + private int matchingVariantCount_; + /** + * + * + *
+     * The count of matched
+     * [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2.Product]s.
+     * 
+ * + * int32 matching_variant_count = 3; + * + * @return The matchingVariantCount. + */ + @java.lang.Override + public int getMatchingVariantCount() { + return matchingVariantCount_; + } + + public static final int MATCHING_VARIANT_FIELDS_FIELD_NUMBER = 4; + + private static final class MatchingVariantFieldsDefaultEntryHolder { + static final com.google.protobuf.MapEntry + defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchResponse_SearchResult_MatchingVariantFieldsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.protobuf.FieldMask.getDefaultInstance()); + } + + private com.google.protobuf.MapField + matchingVariantFields_; + + private com.google.protobuf.MapField + internalGetMatchingVariantFields() { + if (matchingVariantFields_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MatchingVariantFieldsDefaultEntryHolder.defaultEntry); + } + return matchingVariantFields_; + } + + public int getMatchingVariantFieldsCount() { + return internalGetMatchingVariantFields().getMap().size(); + } + /** + * + * + *
+     * If a [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2.Product] matches the search query, this
+     * map indicates which [Product][google.cloud.retail.v2.Product] fields are
+     * matched. The key is the
+     * [Product.name][google.cloud.retail.v2.Product.name], the value is a field
+     * mask of the matched [Product][google.cloud.retail.v2.Product] fields. If
+     * matched attributes cannot be determined, this map will be empty.
+     * For example, a key "sku1" with field mask
+     * "products.color_info" indicates there is a match between
+     * "sku1" [ColorInfo][google.cloud.retail.v2.ColorInfo] and the query.
+     * 
+ * + * map<string, .google.protobuf.FieldMask> matching_variant_fields = 4; + */ + @java.lang.Override + public boolean containsMatchingVariantFields(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetMatchingVariantFields().getMap().containsKey(key); + } + /** Use {@link #getMatchingVariantFieldsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getMatchingVariantFields() { + return getMatchingVariantFieldsMap(); + } + /** + * + * + *
+     * If a [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2.Product] matches the search query, this
+     * map indicates which [Product][google.cloud.retail.v2.Product] fields are
+     * matched. The key is the
+     * [Product.name][google.cloud.retail.v2.Product.name], the value is a field
+     * mask of the matched [Product][google.cloud.retail.v2.Product] fields. If
+     * matched attributes cannot be determined, this map will be empty.
+     * For example, a key "sku1" with field mask
+     * "products.color_info" indicates there is a match between
+     * "sku1" [ColorInfo][google.cloud.retail.v2.ColorInfo] and the query.
+     * 
+ * + * map<string, .google.protobuf.FieldMask> matching_variant_fields = 4; + */ + @java.lang.Override + public java.util.Map + getMatchingVariantFieldsMap() { + return internalGetMatchingVariantFields().getMap(); + } + /** + * + * + *
+     * If a [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2.Product] matches the search query, this
+     * map indicates which [Product][google.cloud.retail.v2.Product] fields are
+     * matched. The key is the
+     * [Product.name][google.cloud.retail.v2.Product.name], the value is a field
+     * mask of the matched [Product][google.cloud.retail.v2.Product] fields. If
+     * matched attributes cannot be determined, this map will be empty.
+     * For example, a key "sku1" with field mask
+     * "products.color_info" indicates there is a match between
+     * "sku1" [ColorInfo][google.cloud.retail.v2.ColorInfo] and the query.
+     * 
+ * + * map<string, .google.protobuf.FieldMask> matching_variant_fields = 4; + */ + @java.lang.Override + public com.google.protobuf.FieldMask getMatchingVariantFieldsOrDefault( + java.lang.String key, com.google.protobuf.FieldMask defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetMatchingVariantFields().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * If a [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2.Product] matches the search query, this
+     * map indicates which [Product][google.cloud.retail.v2.Product] fields are
+     * matched. The key is the
+     * [Product.name][google.cloud.retail.v2.Product.name], the value is a field
+     * mask of the matched [Product][google.cloud.retail.v2.Product] fields. If
+     * matched attributes cannot be determined, this map will be empty.
+     * For example, a key "sku1" with field mask
+     * "products.color_info" indicates there is a match between
+     * "sku1" [ColorInfo][google.cloud.retail.v2.ColorInfo] and the query.
+     * 
+ * + * map<string, .google.protobuf.FieldMask> matching_variant_fields = 4; + */ + @java.lang.Override + public com.google.protobuf.FieldMask getMatchingVariantFieldsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetMatchingVariantFields().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int VARIANT_ROLLUP_VALUES_FIELD_NUMBER = 5; + + private static final class VariantRollupValuesDefaultEntryHolder { + static final com.google.protobuf.MapEntry + defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchResponse_SearchResult_VariantRollupValuesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.protobuf.Value.getDefaultInstance()); + } + + private com.google.protobuf.MapField + variantRollupValues_; + + private com.google.protobuf.MapField + internalGetVariantRollupValues() { + if (variantRollupValues_ == null) { + return com.google.protobuf.MapField.emptyMapField( + VariantRollupValuesDefaultEntryHolder.defaultEntry); + } + return variantRollupValues_; + } + + public int getVariantRollupValuesCount() { + return internalGetVariantRollupValues().getMap().size(); + } + /** + * + * + *
+     * The rollup matching
+     * [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2.Product] attributes. The key is one of
+     * the
+     * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2.SearchRequest.variant_rollup_keys].
+     * The values are the merged and de-duplicated
+     * [Product][google.cloud.retail.v2.Product] attributes. Notice that the
+     * rollup values are respect filter. For example, when filtering by
+     * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
+     * returned.
+     * For textual and numerical attributes, the rollup values is a list of
+     * string or double values with type
+     * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if
+     * there are two variants with colors "red" and "blue", the rollup values
+     * are { key: "colorFamilies"
+     *   value {
+     *     list_value {
+     *       values { string_value: "red" }
+     *       values { string_value: "blue" }
+     *      }
+     *   }
+     * }
+     * For
+     * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info],
+     * the rollup values is a double value with type
+     * [google.protobuf.Value][google.protobuf.Value]. For example, {key:
+     * "pickupInStore.store1" value { number_value: 10 }} means a there are 10
+     * variants in this product are available in the store "store1".
+     * 
+ * + * map<string, .google.protobuf.Value> variant_rollup_values = 5; + */ + @java.lang.Override + public boolean containsVariantRollupValues(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetVariantRollupValues().getMap().containsKey(key); + } + /** Use {@link #getVariantRollupValuesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getVariantRollupValues() { + return getVariantRollupValuesMap(); + } + /** + * + * + *
+     * The rollup matching
+     * [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2.Product] attributes. The key is one of
+     * the
+     * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2.SearchRequest.variant_rollup_keys].
+     * The values are the merged and de-duplicated
+     * [Product][google.cloud.retail.v2.Product] attributes. Notice that the
+     * rollup values are respect filter. For example, when filtering by
+     * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
+     * returned.
+     * For textual and numerical attributes, the rollup values is a list of
+     * string or double values with type
+     * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if
+     * there are two variants with colors "red" and "blue", the rollup values
+     * are { key: "colorFamilies"
+     *   value {
+     *     list_value {
+     *       values { string_value: "red" }
+     *       values { string_value: "blue" }
+     *      }
+     *   }
+     * }
+     * For
+     * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info],
+     * the rollup values is a double value with type
+     * [google.protobuf.Value][google.protobuf.Value]. For example, {key:
+     * "pickupInStore.store1" value { number_value: 10 }} means a there are 10
+     * variants in this product are available in the store "store1".
+     * 
+ * + * map<string, .google.protobuf.Value> variant_rollup_values = 5; + */ + @java.lang.Override + public java.util.Map getVariantRollupValuesMap() { + return internalGetVariantRollupValues().getMap(); + } + /** + * + * + *
+     * The rollup matching
+     * [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2.Product] attributes. The key is one of
+     * the
+     * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2.SearchRequest.variant_rollup_keys].
+     * The values are the merged and de-duplicated
+     * [Product][google.cloud.retail.v2.Product] attributes. Notice that the
+     * rollup values are respect filter. For example, when filtering by
+     * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
+     * returned.
+     * For textual and numerical attributes, the rollup values is a list of
+     * string or double values with type
+     * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if
+     * there are two variants with colors "red" and "blue", the rollup values
+     * are { key: "colorFamilies"
+     *   value {
+     *     list_value {
+     *       values { string_value: "red" }
+     *       values { string_value: "blue" }
+     *      }
+     *   }
+     * }
+     * For
+     * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info],
+     * the rollup values is a double value with type
+     * [google.protobuf.Value][google.protobuf.Value]. For example, {key:
+     * "pickupInStore.store1" value { number_value: 10 }} means a there are 10
+     * variants in this product are available in the store "store1".
+     * 
+ * + * map<string, .google.protobuf.Value> variant_rollup_values = 5; + */ + @java.lang.Override + public com.google.protobuf.Value getVariantRollupValuesOrDefault( + java.lang.String key, com.google.protobuf.Value defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetVariantRollupValues().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * The rollup matching
+     * [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2.Product] attributes. The key is one of
+     * the
+     * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2.SearchRequest.variant_rollup_keys].
+     * The values are the merged and de-duplicated
+     * [Product][google.cloud.retail.v2.Product] attributes. Notice that the
+     * rollup values are respect filter. For example, when filtering by
+     * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
+     * returned.
+     * For textual and numerical attributes, the rollup values is a list of
+     * string or double values with type
+     * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if
+     * there are two variants with colors "red" and "blue", the rollup values
+     * are { key: "colorFamilies"
+     *   value {
+     *     list_value {
+     *       values { string_value: "red" }
+     *       values { string_value: "blue" }
+     *      }
+     *   }
+     * }
+     * For
+     * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info],
+     * the rollup values is a double value with type
+     * [google.protobuf.Value][google.protobuf.Value]. For example, {key:
+     * "pickupInStore.store1" value { number_value: 10 }} means a there are 10
+     * variants in this product are available in the store "store1".
+     * 
+ * + * map<string, .google.protobuf.Value> variant_rollup_values = 5; + */ + @java.lang.Override + public com.google.protobuf.Value getVariantRollupValuesOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetVariantRollupValues().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_); + } + if (product_ != null) { + output.writeMessage(2, getProduct()); + } + if (matchingVariantCount_ != 0) { + output.writeInt32(3, matchingVariantCount_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, + internalGetMatchingVariantFields(), + MatchingVariantFieldsDefaultEntryHolder.defaultEntry, + 4); + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, + internalGetVariantRollupValues(), + VariantRollupValuesDefaultEntryHolder.defaultEntry, + 5); + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_); + } + if (product_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getProduct()); + } + if (matchingVariantCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, matchingVariantCount_); + } + for (java.util.Map.Entry entry : + internalGetMatchingVariantFields().getMap().entrySet()) { + com.google.protobuf.MapEntry + matchingVariantFields__ = + MatchingVariantFieldsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(4, matchingVariantFields__); + } + for (java.util.Map.Entry entry : + internalGetVariantRollupValues().getMap().entrySet()) { + com.google.protobuf.MapEntry + variantRollupValues__ = + VariantRollupValuesDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, variantRollupValues__); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.retail.v2.SearchResponse.SearchResult)) { + return super.equals(obj); + } + com.google.cloud.retail.v2.SearchResponse.SearchResult other = + (com.google.cloud.retail.v2.SearchResponse.SearchResult) obj; + + if (!getId().equals(other.getId())) return false; + if (hasProduct() != other.hasProduct()) return false; + if (hasProduct()) { + if (!getProduct().equals(other.getProduct())) return false; + } + if (getMatchingVariantCount() != other.getMatchingVariantCount()) return false; + if (!internalGetMatchingVariantFields().equals(other.internalGetMatchingVariantFields())) + return false; + if (!internalGetVariantRollupValues().equals(other.internalGetVariantRollupValues())) + return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + if (hasProduct()) { + hash = (37 * hash) + PRODUCT_FIELD_NUMBER; + hash = (53 * hash) + getProduct().hashCode(); + } + hash = (37 * hash) + MATCHING_VARIANT_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getMatchingVariantCount(); + if (!internalGetMatchingVariantFields().getMap().isEmpty()) { + hash = (37 * hash) + MATCHING_VARIANT_FIELDS_FIELD_NUMBER; + hash = (53 * hash) + internalGetMatchingVariantFields().hashCode(); + } + if (!internalGetVariantRollupValues().getMap().isEmpty()) { + hash = (37 * hash) + VARIANT_ROLLUP_VALUES_FIELD_NUMBER; + hash = (53 * hash) + internalGetVariantRollupValues().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2.SearchResponse.SearchResult parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.SearchResponse.SearchResult parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchResponse.SearchResult parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.SearchResponse.SearchResult parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchResponse.SearchResult parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.SearchResponse.SearchResult parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchResponse.SearchResult parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.SearchResponse.SearchResult parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchResponse.SearchResult parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.SearchResponse.SearchResult parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchResponse.SearchResult parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.SearchResponse.SearchResult parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2.SearchResponse.SearchResult prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Represents the search results.
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2.SearchResponse.SearchResult} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.SearchResponse.SearchResult) + com.google.cloud.retail.v2.SearchResponse.SearchResultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchResponse_SearchResult_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetMatchingVariantFields(); + case 5: + return internalGetVariantRollupValues(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 4: + return internalGetMutableMatchingVariantFields(); + case 5: + return internalGetMutableVariantRollupValues(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchResponse_SearchResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.SearchResponse.SearchResult.class, + com.google.cloud.retail.v2.SearchResponse.SearchResult.Builder.class); + } + + // Construct using com.google.cloud.retail.v2.SearchResponse.SearchResult.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + id_ = ""; + + if (productBuilder_ == null) { + product_ = null; + } else { + product_ = null; + productBuilder_ = null; + } + matchingVariantCount_ = 0; + + internalGetMutableMatchingVariantFields().clear(); + internalGetMutableVariantRollupValues().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchResponse_SearchResult_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2.SearchResponse.SearchResult getDefaultInstanceForType() { + return com.google.cloud.retail.v2.SearchResponse.SearchResult.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2.SearchResponse.SearchResult build() { + com.google.cloud.retail.v2.SearchResponse.SearchResult result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2.SearchResponse.SearchResult buildPartial() { + com.google.cloud.retail.v2.SearchResponse.SearchResult result = + new com.google.cloud.retail.v2.SearchResponse.SearchResult(this); + int from_bitField0_ = bitField0_; + result.id_ = id_; + if (productBuilder_ == null) { + result.product_ = product_; + } else { + result.product_ = productBuilder_.build(); + } + result.matchingVariantCount_ = matchingVariantCount_; + result.matchingVariantFields_ = internalGetMatchingVariantFields(); + result.matchingVariantFields_.makeImmutable(); + result.variantRollupValues_ = internalGetVariantRollupValues(); + result.variantRollupValues_.makeImmutable(); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.retail.v2.SearchResponse.SearchResult) { + return mergeFrom((com.google.cloud.retail.v2.SearchResponse.SearchResult) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2.SearchResponse.SearchResult other) { + if (other == com.google.cloud.retail.v2.SearchResponse.SearchResult.getDefaultInstance()) + return this; + if (!other.getId().isEmpty()) { + id_ = other.id_; + onChanged(); + } + if (other.hasProduct()) { + mergeProduct(other.getProduct()); + } + if (other.getMatchingVariantCount() != 0) { + setMatchingVariantCount(other.getMatchingVariantCount()); + } + internalGetMutableMatchingVariantFields() + .mergeFrom(other.internalGetMatchingVariantFields()); + internalGetMutableVariantRollupValues().mergeFrom(other.internalGetVariantRollupValues()); + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.retail.v2.SearchResponse.SearchResult parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2.SearchResponse.SearchResult) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object id_ = ""; + /** + * + * + *
+       * [Product.id][google.cloud.retail.v2.Product.id] of the searched
+       * [Product][google.cloud.retail.v2.Product].
+       * 
+ * + * string id = 1; + * + * @return The id. + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * [Product.id][google.cloud.retail.v2.Product.id] of the searched
+       * [Product][google.cloud.retail.v2.Product].
+       * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * [Product.id][google.cloud.retail.v2.Product.id] of the searched
+       * [Product][google.cloud.retail.v2.Product].
+       * 
+ * + * string id = 1; + * + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + id_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * [Product.id][google.cloud.retail.v2.Product.id] of the searched
+       * [Product][google.cloud.retail.v2.Product].
+       * 
+ * + * string id = 1; + * + * @return This builder for chaining. + */ + public Builder clearId() { + + id_ = getDefaultInstance().getId(); + onChanged(); + return this; + } + /** + * + * + *
+       * [Product.id][google.cloud.retail.v2.Product.id] of the searched
+       * [Product][google.cloud.retail.v2.Product].
+       * 
+ * + * string id = 1; + * + * @param value The bytes for id to set. + * @return This builder for chaining. + */ + public Builder setIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + id_ = value; + onChanged(); + return this; + } + + private com.google.cloud.retail.v2.Product product_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2.Product, + com.google.cloud.retail.v2.Product.Builder, + com.google.cloud.retail.v2.ProductOrBuilder> + productBuilder_; + /** + * + * + *
+       * The product data snippet in the search response. Only
+       * [Product.name][google.cloud.retail.v2.Product.name] is guaranteed to be
+       * populated.
+       * [Product.variants][google.cloud.retail.v2.Product.variants] contains the
+       * product variants that match the search query. If there are multiple
+       * product variants matching the query, top 5 most relevant product variants
+       * are returned and ordered by relevancy.
+       * If relevancy can be deternmined, use
+       * [matching_variant_fields][google.cloud.retail.v2.SearchResponse.SearchResult.matching_variant_fields]
+       * to look up matched product variants fields. If relevancy cannot be
+       * determined, e.g. when searching "shoe" all products in a shoe product can
+       * be a match, 5 product variants are returned but order is meaningless.
+       * 
+ * + * .google.cloud.retail.v2.Product product = 2; + * + * @return Whether the product field is set. + */ + public boolean hasProduct() { + return productBuilder_ != null || product_ != null; + } + /** + * + * + *
+       * The product data snippet in the search response. Only
+       * [Product.name][google.cloud.retail.v2.Product.name] is guaranteed to be
+       * populated.
+       * [Product.variants][google.cloud.retail.v2.Product.variants] contains the
+       * product variants that match the search query. If there are multiple
+       * product variants matching the query, top 5 most relevant product variants
+       * are returned and ordered by relevancy.
+       * If relevancy can be deternmined, use
+       * [matching_variant_fields][google.cloud.retail.v2.SearchResponse.SearchResult.matching_variant_fields]
+       * to look up matched product variants fields. If relevancy cannot be
+       * determined, e.g. when searching "shoe" all products in a shoe product can
+       * be a match, 5 product variants are returned but order is meaningless.
+       * 
+ * + * .google.cloud.retail.v2.Product product = 2; + * + * @return The product. + */ + public com.google.cloud.retail.v2.Product getProduct() { + if (productBuilder_ == null) { + return product_ == null + ? com.google.cloud.retail.v2.Product.getDefaultInstance() + : product_; + } else { + return productBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The product data snippet in the search response. Only
+       * [Product.name][google.cloud.retail.v2.Product.name] is guaranteed to be
+       * populated.
+       * [Product.variants][google.cloud.retail.v2.Product.variants] contains the
+       * product variants that match the search query. If there are multiple
+       * product variants matching the query, top 5 most relevant product variants
+       * are returned and ordered by relevancy.
+       * If relevancy can be deternmined, use
+       * [matching_variant_fields][google.cloud.retail.v2.SearchResponse.SearchResult.matching_variant_fields]
+       * to look up matched product variants fields. If relevancy cannot be
+       * determined, e.g. when searching "shoe" all products in a shoe product can
+       * be a match, 5 product variants are returned but order is meaningless.
+       * 
+ * + * .google.cloud.retail.v2.Product product = 2; + */ + public Builder setProduct(com.google.cloud.retail.v2.Product value) { + if (productBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + product_ = value; + onChanged(); + } else { + productBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * The product data snippet in the search response. Only
+       * [Product.name][google.cloud.retail.v2.Product.name] is guaranteed to be
+       * populated.
+       * [Product.variants][google.cloud.retail.v2.Product.variants] contains the
+       * product variants that match the search query. If there are multiple
+       * product variants matching the query, top 5 most relevant product variants
+       * are returned and ordered by relevancy.
+       * If relevancy can be deternmined, use
+       * [matching_variant_fields][google.cloud.retail.v2.SearchResponse.SearchResult.matching_variant_fields]
+       * to look up matched product variants fields. If relevancy cannot be
+       * determined, e.g. when searching "shoe" all products in a shoe product can
+       * be a match, 5 product variants are returned but order is meaningless.
+       * 
+ * + * .google.cloud.retail.v2.Product product = 2; + */ + public Builder setProduct(com.google.cloud.retail.v2.Product.Builder builderForValue) { + if (productBuilder_ == null) { + product_ = builderForValue.build(); + onChanged(); + } else { + productBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * The product data snippet in the search response. Only
+       * [Product.name][google.cloud.retail.v2.Product.name] is guaranteed to be
+       * populated.
+       * [Product.variants][google.cloud.retail.v2.Product.variants] contains the
+       * product variants that match the search query. If there are multiple
+       * product variants matching the query, top 5 most relevant product variants
+       * are returned and ordered by relevancy.
+       * If relevancy can be deternmined, use
+       * [matching_variant_fields][google.cloud.retail.v2.SearchResponse.SearchResult.matching_variant_fields]
+       * to look up matched product variants fields. If relevancy cannot be
+       * determined, e.g. when searching "shoe" all products in a shoe product can
+       * be a match, 5 product variants are returned but order is meaningless.
+       * 
+ * + * .google.cloud.retail.v2.Product product = 2; + */ + public Builder mergeProduct(com.google.cloud.retail.v2.Product value) { + if (productBuilder_ == null) { + if (product_ != null) { + product_ = + com.google.cloud.retail.v2.Product.newBuilder(product_) + .mergeFrom(value) + .buildPartial(); + } else { + product_ = value; + } + onChanged(); + } else { + productBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * The product data snippet in the search response. Only
+       * [Product.name][google.cloud.retail.v2.Product.name] is guaranteed to be
+       * populated.
+       * [Product.variants][google.cloud.retail.v2.Product.variants] contains the
+       * product variants that match the search query. If there are multiple
+       * product variants matching the query, top 5 most relevant product variants
+       * are returned and ordered by relevancy.
+       * If relevancy can be deternmined, use
+       * [matching_variant_fields][google.cloud.retail.v2.SearchResponse.SearchResult.matching_variant_fields]
+       * to look up matched product variants fields. If relevancy cannot be
+       * determined, e.g. when searching "shoe" all products in a shoe product can
+       * be a match, 5 product variants are returned but order is meaningless.
+       * 
+ * + * .google.cloud.retail.v2.Product product = 2; + */ + public Builder clearProduct() { + if (productBuilder_ == null) { + product_ = null; + onChanged(); + } else { + product_ = null; + productBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * The product data snippet in the search response. Only
+       * [Product.name][google.cloud.retail.v2.Product.name] is guaranteed to be
+       * populated.
+       * [Product.variants][google.cloud.retail.v2.Product.variants] contains the
+       * product variants that match the search query. If there are multiple
+       * product variants matching the query, top 5 most relevant product variants
+       * are returned and ordered by relevancy.
+       * If relevancy can be deternmined, use
+       * [matching_variant_fields][google.cloud.retail.v2.SearchResponse.SearchResult.matching_variant_fields]
+       * to look up matched product variants fields. If relevancy cannot be
+       * determined, e.g. when searching "shoe" all products in a shoe product can
+       * be a match, 5 product variants are returned but order is meaningless.
+       * 
+ * + * .google.cloud.retail.v2.Product product = 2; + */ + public com.google.cloud.retail.v2.Product.Builder getProductBuilder() { + + onChanged(); + return getProductFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The product data snippet in the search response. Only
+       * [Product.name][google.cloud.retail.v2.Product.name] is guaranteed to be
+       * populated.
+       * [Product.variants][google.cloud.retail.v2.Product.variants] contains the
+       * product variants that match the search query. If there are multiple
+       * product variants matching the query, top 5 most relevant product variants
+       * are returned and ordered by relevancy.
+       * If relevancy can be deternmined, use
+       * [matching_variant_fields][google.cloud.retail.v2.SearchResponse.SearchResult.matching_variant_fields]
+       * to look up matched product variants fields. If relevancy cannot be
+       * determined, e.g. when searching "shoe" all products in a shoe product can
+       * be a match, 5 product variants are returned but order is meaningless.
+       * 
+ * + * .google.cloud.retail.v2.Product product = 2; + */ + public com.google.cloud.retail.v2.ProductOrBuilder getProductOrBuilder() { + if (productBuilder_ != null) { + return productBuilder_.getMessageOrBuilder(); + } else { + return product_ == null + ? com.google.cloud.retail.v2.Product.getDefaultInstance() + : product_; + } + } + /** + * + * + *
+       * The product data snippet in the search response. Only
+       * [Product.name][google.cloud.retail.v2.Product.name] is guaranteed to be
+       * populated.
+       * [Product.variants][google.cloud.retail.v2.Product.variants] contains the
+       * product variants that match the search query. If there are multiple
+       * product variants matching the query, top 5 most relevant product variants
+       * are returned and ordered by relevancy.
+       * If relevancy can be deternmined, use
+       * [matching_variant_fields][google.cloud.retail.v2.SearchResponse.SearchResult.matching_variant_fields]
+       * to look up matched product variants fields. If relevancy cannot be
+       * determined, e.g. when searching "shoe" all products in a shoe product can
+       * be a match, 5 product variants are returned but order is meaningless.
+       * 
+ * + * .google.cloud.retail.v2.Product product = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2.Product, + com.google.cloud.retail.v2.Product.Builder, + com.google.cloud.retail.v2.ProductOrBuilder> + getProductFieldBuilder() { + if (productBuilder_ == null) { + productBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2.Product, + com.google.cloud.retail.v2.Product.Builder, + com.google.cloud.retail.v2.ProductOrBuilder>( + getProduct(), getParentForChildren(), isClean()); + product_ = null; + } + return productBuilder_; + } + + private int matchingVariantCount_; + /** + * + * + *
+       * The count of matched
+       * [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2.Product]s.
+       * 
+ * + * int32 matching_variant_count = 3; + * + * @return The matchingVariantCount. + */ + @java.lang.Override + public int getMatchingVariantCount() { + return matchingVariantCount_; + } + /** + * + * + *
+       * The count of matched
+       * [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2.Product]s.
+       * 
+ * + * int32 matching_variant_count = 3; + * + * @param value The matchingVariantCount to set. + * @return This builder for chaining. + */ + public Builder setMatchingVariantCount(int value) { + + matchingVariantCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The count of matched
+       * [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2.Product]s.
+       * 
+ * + * int32 matching_variant_count = 3; + * + * @return This builder for chaining. + */ + public Builder clearMatchingVariantCount() { + + matchingVariantCount_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.MapField + matchingVariantFields_; + + private com.google.protobuf.MapField + internalGetMatchingVariantFields() { + if (matchingVariantFields_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MatchingVariantFieldsDefaultEntryHolder.defaultEntry); + } + return matchingVariantFields_; + } + + private com.google.protobuf.MapField + internalGetMutableMatchingVariantFields() { + onChanged(); + ; + if (matchingVariantFields_ == null) { + matchingVariantFields_ = + com.google.protobuf.MapField.newMapField( + MatchingVariantFieldsDefaultEntryHolder.defaultEntry); + } + if (!matchingVariantFields_.isMutable()) { + matchingVariantFields_ = matchingVariantFields_.copy(); + } + return matchingVariantFields_; + } + + public int getMatchingVariantFieldsCount() { + return internalGetMatchingVariantFields().getMap().size(); + } + /** + * + * + *
+       * If a [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2.Product] matches the search query, this
+       * map indicates which [Product][google.cloud.retail.v2.Product] fields are
+       * matched. The key is the
+       * [Product.name][google.cloud.retail.v2.Product.name], the value is a field
+       * mask of the matched [Product][google.cloud.retail.v2.Product] fields. If
+       * matched attributes cannot be determined, this map will be empty.
+       * For example, a key "sku1" with field mask
+       * "products.color_info" indicates there is a match between
+       * "sku1" [ColorInfo][google.cloud.retail.v2.ColorInfo] and the query.
+       * 
+ * + * map<string, .google.protobuf.FieldMask> matching_variant_fields = 4; + */ + @java.lang.Override + public boolean containsMatchingVariantFields(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetMatchingVariantFields().getMap().containsKey(key); + } + /** Use {@link #getMatchingVariantFieldsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getMatchingVariantFields() { + return getMatchingVariantFieldsMap(); + } + /** + * + * + *
+       * If a [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2.Product] matches the search query, this
+       * map indicates which [Product][google.cloud.retail.v2.Product] fields are
+       * matched. The key is the
+       * [Product.name][google.cloud.retail.v2.Product.name], the value is a field
+       * mask of the matched [Product][google.cloud.retail.v2.Product] fields. If
+       * matched attributes cannot be determined, this map will be empty.
+       * For example, a key "sku1" with field mask
+       * "products.color_info" indicates there is a match between
+       * "sku1" [ColorInfo][google.cloud.retail.v2.ColorInfo] and the query.
+       * 
+ * + * map<string, .google.protobuf.FieldMask> matching_variant_fields = 4; + */ + @java.lang.Override + public java.util.Map + getMatchingVariantFieldsMap() { + return internalGetMatchingVariantFields().getMap(); + } + /** + * + * + *
+       * If a [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2.Product] matches the search query, this
+       * map indicates which [Product][google.cloud.retail.v2.Product] fields are
+       * matched. The key is the
+       * [Product.name][google.cloud.retail.v2.Product.name], the value is a field
+       * mask of the matched [Product][google.cloud.retail.v2.Product] fields. If
+       * matched attributes cannot be determined, this map will be empty.
+       * For example, a key "sku1" with field mask
+       * "products.color_info" indicates there is a match between
+       * "sku1" [ColorInfo][google.cloud.retail.v2.ColorInfo] and the query.
+       * 
+ * + * map<string, .google.protobuf.FieldMask> matching_variant_fields = 4; + */ + @java.lang.Override + public com.google.protobuf.FieldMask getMatchingVariantFieldsOrDefault( + java.lang.String key, com.google.protobuf.FieldMask defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetMatchingVariantFields().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+       * If a [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2.Product] matches the search query, this
+       * map indicates which [Product][google.cloud.retail.v2.Product] fields are
+       * matched. The key is the
+       * [Product.name][google.cloud.retail.v2.Product.name], the value is a field
+       * mask of the matched [Product][google.cloud.retail.v2.Product] fields. If
+       * matched attributes cannot be determined, this map will be empty.
+       * For example, a key "sku1" with field mask
+       * "products.color_info" indicates there is a match between
+       * "sku1" [ColorInfo][google.cloud.retail.v2.ColorInfo] and the query.
+       * 
+ * + * map<string, .google.protobuf.FieldMask> matching_variant_fields = 4; + */ + @java.lang.Override + public com.google.protobuf.FieldMask getMatchingVariantFieldsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetMatchingVariantFields().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearMatchingVariantFields() { + internalGetMutableMatchingVariantFields().getMutableMap().clear(); + return this; + } + /** + * + * + *
+       * If a [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2.Product] matches the search query, this
+       * map indicates which [Product][google.cloud.retail.v2.Product] fields are
+       * matched. The key is the
+       * [Product.name][google.cloud.retail.v2.Product.name], the value is a field
+       * mask of the matched [Product][google.cloud.retail.v2.Product] fields. If
+       * matched attributes cannot be determined, this map will be empty.
+       * For example, a key "sku1" with field mask
+       * "products.color_info" indicates there is a match between
+       * "sku1" [ColorInfo][google.cloud.retail.v2.ColorInfo] and the query.
+       * 
+ * + * map<string, .google.protobuf.FieldMask> matching_variant_fields = 4; + */ + public Builder removeMatchingVariantFields(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableMatchingVariantFields().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableMatchingVariantFields() { + return internalGetMutableMatchingVariantFields().getMutableMap(); + } + /** + * + * + *
+       * If a [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2.Product] matches the search query, this
+       * map indicates which [Product][google.cloud.retail.v2.Product] fields are
+       * matched. The key is the
+       * [Product.name][google.cloud.retail.v2.Product.name], the value is a field
+       * mask of the matched [Product][google.cloud.retail.v2.Product] fields. If
+       * matched attributes cannot be determined, this map will be empty.
+       * For example, a key "sku1" with field mask
+       * "products.color_info" indicates there is a match between
+       * "sku1" [ColorInfo][google.cloud.retail.v2.ColorInfo] and the query.
+       * 
+ * + * map<string, .google.protobuf.FieldMask> matching_variant_fields = 4; + */ + public Builder putMatchingVariantFields( + java.lang.String key, com.google.protobuf.FieldMask value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableMatchingVariantFields().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+       * If a [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2.Product] matches the search query, this
+       * map indicates which [Product][google.cloud.retail.v2.Product] fields are
+       * matched. The key is the
+       * [Product.name][google.cloud.retail.v2.Product.name], the value is a field
+       * mask of the matched [Product][google.cloud.retail.v2.Product] fields. If
+       * matched attributes cannot be determined, this map will be empty.
+       * For example, a key "sku1" with field mask
+       * "products.color_info" indicates there is a match between
+       * "sku1" [ColorInfo][google.cloud.retail.v2.ColorInfo] and the query.
+       * 
+ * + * map<string, .google.protobuf.FieldMask> matching_variant_fields = 4; + */ + public Builder putAllMatchingVariantFields( + java.util.Map values) { + internalGetMutableMatchingVariantFields().getMutableMap().putAll(values); + return this; + } + + private com.google.protobuf.MapField + variantRollupValues_; + + private com.google.protobuf.MapField + internalGetVariantRollupValues() { + if (variantRollupValues_ == null) { + return com.google.protobuf.MapField.emptyMapField( + VariantRollupValuesDefaultEntryHolder.defaultEntry); + } + return variantRollupValues_; + } + + private com.google.protobuf.MapField + internalGetMutableVariantRollupValues() { + onChanged(); + ; + if (variantRollupValues_ == null) { + variantRollupValues_ = + com.google.protobuf.MapField.newMapField( + VariantRollupValuesDefaultEntryHolder.defaultEntry); + } + if (!variantRollupValues_.isMutable()) { + variantRollupValues_ = variantRollupValues_.copy(); + } + return variantRollupValues_; + } + + public int getVariantRollupValuesCount() { + return internalGetVariantRollupValues().getMap().size(); + } + /** + * + * + *
+       * The rollup matching
+       * [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2.Product] attributes. The key is one of
+       * the
+       * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2.SearchRequest.variant_rollup_keys].
+       * The values are the merged and de-duplicated
+       * [Product][google.cloud.retail.v2.Product] attributes. Notice that the
+       * rollup values are respect filter. For example, when filtering by
+       * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
+       * returned.
+       * For textual and numerical attributes, the rollup values is a list of
+       * string or double values with type
+       * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if
+       * there are two variants with colors "red" and "blue", the rollup values
+       * are { key: "colorFamilies"
+       *   value {
+       *     list_value {
+       *       values { string_value: "red" }
+       *       values { string_value: "blue" }
+       *      }
+       *   }
+       * }
+       * For
+       * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info],
+       * the rollup values is a double value with type
+       * [google.protobuf.Value][google.protobuf.Value]. For example, {key:
+       * "pickupInStore.store1" value { number_value: 10 }} means a there are 10
+       * variants in this product are available in the store "store1".
+       * 
+ * + * map<string, .google.protobuf.Value> variant_rollup_values = 5; + */ + @java.lang.Override + public boolean containsVariantRollupValues(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetVariantRollupValues().getMap().containsKey(key); + } + /** Use {@link #getVariantRollupValuesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getVariantRollupValues() { + return getVariantRollupValuesMap(); + } + /** + * + * + *
+       * The rollup matching
+       * [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2.Product] attributes. The key is one of
+       * the
+       * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2.SearchRequest.variant_rollup_keys].
+       * The values are the merged and de-duplicated
+       * [Product][google.cloud.retail.v2.Product] attributes. Notice that the
+       * rollup values are respect filter. For example, when filtering by
+       * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
+       * returned.
+       * For textual and numerical attributes, the rollup values is a list of
+       * string or double values with type
+       * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if
+       * there are two variants with colors "red" and "blue", the rollup values
+       * are { key: "colorFamilies"
+       *   value {
+       *     list_value {
+       *       values { string_value: "red" }
+       *       values { string_value: "blue" }
+       *      }
+       *   }
+       * }
+       * For
+       * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info],
+       * the rollup values is a double value with type
+       * [google.protobuf.Value][google.protobuf.Value]. For example, {key:
+       * "pickupInStore.store1" value { number_value: 10 }} means a there are 10
+       * variants in this product are available in the store "store1".
+       * 
+ * + * map<string, .google.protobuf.Value> variant_rollup_values = 5; + */ + @java.lang.Override + public java.util.Map + getVariantRollupValuesMap() { + return internalGetVariantRollupValues().getMap(); + } + /** + * + * + *
+       * The rollup matching
+       * [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2.Product] attributes. The key is one of
+       * the
+       * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2.SearchRequest.variant_rollup_keys].
+       * The values are the merged and de-duplicated
+       * [Product][google.cloud.retail.v2.Product] attributes. Notice that the
+       * rollup values are respect filter. For example, when filtering by
+       * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
+       * returned.
+       * For textual and numerical attributes, the rollup values is a list of
+       * string or double values with type
+       * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if
+       * there are two variants with colors "red" and "blue", the rollup values
+       * are { key: "colorFamilies"
+       *   value {
+       *     list_value {
+       *       values { string_value: "red" }
+       *       values { string_value: "blue" }
+       *      }
+       *   }
+       * }
+       * For
+       * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info],
+       * the rollup values is a double value with type
+       * [google.protobuf.Value][google.protobuf.Value]. For example, {key:
+       * "pickupInStore.store1" value { number_value: 10 }} means a there are 10
+       * variants in this product are available in the store "store1".
+       * 
+ * + * map<string, .google.protobuf.Value> variant_rollup_values = 5; + */ + @java.lang.Override + public com.google.protobuf.Value getVariantRollupValuesOrDefault( + java.lang.String key, com.google.protobuf.Value defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetVariantRollupValues().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+       * The rollup matching
+       * [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2.Product] attributes. The key is one of
+       * the
+       * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2.SearchRequest.variant_rollup_keys].
+       * The values are the merged and de-duplicated
+       * [Product][google.cloud.retail.v2.Product] attributes. Notice that the
+       * rollup values are respect filter. For example, when filtering by
+       * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
+       * returned.
+       * For textual and numerical attributes, the rollup values is a list of
+       * string or double values with type
+       * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if
+       * there are two variants with colors "red" and "blue", the rollup values
+       * are { key: "colorFamilies"
+       *   value {
+       *     list_value {
+       *       values { string_value: "red" }
+       *       values { string_value: "blue" }
+       *      }
+       *   }
+       * }
+       * For
+       * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info],
+       * the rollup values is a double value with type
+       * [google.protobuf.Value][google.protobuf.Value]. For example, {key:
+       * "pickupInStore.store1" value { number_value: 10 }} means a there are 10
+       * variants in this product are available in the store "store1".
+       * 
+ * + * map<string, .google.protobuf.Value> variant_rollup_values = 5; + */ + @java.lang.Override + public com.google.protobuf.Value getVariantRollupValuesOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetVariantRollupValues().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearVariantRollupValues() { + internalGetMutableVariantRollupValues().getMutableMap().clear(); + return this; + } + /** + * + * + *
+       * The rollup matching
+       * [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2.Product] attributes. The key is one of
+       * the
+       * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2.SearchRequest.variant_rollup_keys].
+       * The values are the merged and de-duplicated
+       * [Product][google.cloud.retail.v2.Product] attributes. Notice that the
+       * rollup values are respect filter. For example, when filtering by
+       * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
+       * returned.
+       * For textual and numerical attributes, the rollup values is a list of
+       * string or double values with type
+       * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if
+       * there are two variants with colors "red" and "blue", the rollup values
+       * are { key: "colorFamilies"
+       *   value {
+       *     list_value {
+       *       values { string_value: "red" }
+       *       values { string_value: "blue" }
+       *      }
+       *   }
+       * }
+       * For
+       * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info],
+       * the rollup values is a double value with type
+       * [google.protobuf.Value][google.protobuf.Value]. For example, {key:
+       * "pickupInStore.store1" value { number_value: 10 }} means a there are 10
+       * variants in this product are available in the store "store1".
+       * 
+ * + * map<string, .google.protobuf.Value> variant_rollup_values = 5; + */ + public Builder removeVariantRollupValues(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableVariantRollupValues().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableVariantRollupValues() { + return internalGetMutableVariantRollupValues().getMutableMap(); + } + /** + * + * + *
+       * The rollup matching
+       * [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2.Product] attributes. The key is one of
+       * the
+       * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2.SearchRequest.variant_rollup_keys].
+       * The values are the merged and de-duplicated
+       * [Product][google.cloud.retail.v2.Product] attributes. Notice that the
+       * rollup values are respect filter. For example, when filtering by
+       * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
+       * returned.
+       * For textual and numerical attributes, the rollup values is a list of
+       * string or double values with type
+       * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if
+       * there are two variants with colors "red" and "blue", the rollup values
+       * are { key: "colorFamilies"
+       *   value {
+       *     list_value {
+       *       values { string_value: "red" }
+       *       values { string_value: "blue" }
+       *      }
+       *   }
+       * }
+       * For
+       * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info],
+       * the rollup values is a double value with type
+       * [google.protobuf.Value][google.protobuf.Value]. For example, {key:
+       * "pickupInStore.store1" value { number_value: 10 }} means a there are 10
+       * variants in this product are available in the store "store1".
+       * 
+ * + * map<string, .google.protobuf.Value> variant_rollup_values = 5; + */ + public Builder putVariantRollupValues(java.lang.String key, com.google.protobuf.Value value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableVariantRollupValues().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+       * The rollup matching
+       * [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2.Product] attributes. The key is one of
+       * the
+       * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2.SearchRequest.variant_rollup_keys].
+       * The values are the merged and de-duplicated
+       * [Product][google.cloud.retail.v2.Product] attributes. Notice that the
+       * rollup values are respect filter. For example, when filtering by
+       * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
+       * returned.
+       * For textual and numerical attributes, the rollup values is a list of
+       * string or double values with type
+       * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if
+       * there are two variants with colors "red" and "blue", the rollup values
+       * are { key: "colorFamilies"
+       *   value {
+       *     list_value {
+       *       values { string_value: "red" }
+       *       values { string_value: "blue" }
+       *      }
+       *   }
+       * }
+       * For
+       * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info],
+       * the rollup values is a double value with type
+       * [google.protobuf.Value][google.protobuf.Value]. For example, {key:
+       * "pickupInStore.store1" value { number_value: 10 }} means a there are 10
+       * variants in this product are available in the store "store1".
+       * 
+ * + * map<string, .google.protobuf.Value> variant_rollup_values = 5; + */ + public Builder putAllVariantRollupValues( + java.util.Map values) { + internalGetMutableVariantRollupValues().getMutableMap().putAll(values); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.SearchResponse.SearchResult) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.SearchResponse.SearchResult) + private static final com.google.cloud.retail.v2.SearchResponse.SearchResult DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2.SearchResponse.SearchResult(); + } + + public static com.google.cloud.retail.v2.SearchResponse.SearchResult getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SearchResult parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SearchResult(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.retail.v2.SearchResponse.SearchResult getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface FacetOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2.SearchResponse.Facet) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The key for this facet. E.g., "colorFamilies" or "price" or
+     * "attributes.attr1".
+     * 
+ * + * string key = 1; + * + * @return The key. + */ + java.lang.String getKey(); + /** + * + * + *
+     * The key for this facet. E.g., "colorFamilies" or "price" or
+     * "attributes.attr1".
+     * 
+ * + * string key = 1; + * + * @return The bytes for key. + */ + com.google.protobuf.ByteString getKeyBytes(); + + /** + * + * + *
+     * The facet values for this field.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2; + */ + java.util.List getValuesList(); + /** + * + * + *
+     * The facet values for this field.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2; + */ + com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue getValues(int index); + /** + * + * + *
+     * The facet values for this field.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2; + */ + int getValuesCount(); + /** + * + * + *
+     * The facet values for this field.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2; + */ + java.util.List + getValuesOrBuilderList(); + /** + * + * + *
+     * The facet values for this field.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2; + */ + com.google.cloud.retail.v2.SearchResponse.Facet.FacetValueOrBuilder getValuesOrBuilder( + int index); + + /** + * + * + *
+     * Whether the facet is dynamically generated.
+     * 
+ * + * bool dynamic_facet = 3; + * + * @return The dynamicFacet. + */ + boolean getDynamicFacet(); + } + /** + * + * + *
+   * A facet result.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2.SearchResponse.Facet} + */ + public static final class Facet extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.SearchResponse.Facet) + FacetOrBuilder { + private static final long serialVersionUID = 0L; + // Use Facet.newBuilder() to construct. + private Facet(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Facet() { + key_ = ""; + values_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Facet(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Facet( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + key_ = s; + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + values_ = + new java.util.ArrayList< + com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue>(); + mutable_bitField0_ |= 0x00000001; + } + values_.add( + input.readMessage( + com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue.parser(), + extensionRegistry)); + break; + } + case 24: + { + dynamicFacet_ = input.readBool(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + values_ = java.util.Collections.unmodifiableList(values_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchResponse_Facet_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchResponse_Facet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.SearchResponse.Facet.class, + com.google.cloud.retail.v2.SearchResponse.Facet.Builder.class); + } + + public interface FacetValueOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2.SearchResponse.Facet.FacetValue) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Text value of a facet, such as "Black" for facet "colorFamilies".
+       * 
+ * + * string value = 1; + * + * @return Whether the value field is set. + */ + boolean hasValue(); + /** + * + * + *
+       * Text value of a facet, such as "Black" for facet "colorFamilies".
+       * 
+ * + * string value = 1; + * + * @return The value. + */ + java.lang.String getValue(); + /** + * + * + *
+       * Text value of a facet, such as "Black" for facet "colorFamilies".
+       * 
+ * + * string value = 1; + * + * @return The bytes for value. + */ + com.google.protobuf.ByteString getValueBytes(); + + /** + * + * + *
+       * Interval value for a facet, such as [10, 20) for facet "price".
+       * 
+ * + * .google.cloud.retail.v2.Interval interval = 2; + * + * @return Whether the interval field is set. + */ + boolean hasInterval(); + /** + * + * + *
+       * Interval value for a facet, such as [10, 20) for facet "price".
+       * 
+ * + * .google.cloud.retail.v2.Interval interval = 2; + * + * @return The interval. + */ + com.google.cloud.retail.v2.Interval getInterval(); + /** + * + * + *
+       * Interval value for a facet, such as [10, 20) for facet "price".
+       * 
+ * + * .google.cloud.retail.v2.Interval interval = 2; + */ + com.google.cloud.retail.v2.IntervalOrBuilder getIntervalOrBuilder(); + + /** + * + * + *
+       * Number of items that have this facet value.
+       * 
+ * + * int64 count = 3; + * + * @return The count. + */ + long getCount(); + + public com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue.FacetValueCase + getFacetValueCase(); + } + /** + * + * + *
+     * A facet value which contains value names and their count.
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2.SearchResponse.Facet.FacetValue} + */ + public static final class FacetValue extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.SearchResponse.Facet.FacetValue) + FacetValueOrBuilder { + private static final long serialVersionUID = 0L; + // Use FacetValue.newBuilder() to construct. + private FacetValue(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FacetValue() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FacetValue(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private FacetValue( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + facetValueCase_ = 1; + facetValue_ = s; + break; + } + case 18: + { + com.google.cloud.retail.v2.Interval.Builder subBuilder = null; + if (facetValueCase_ == 2) { + subBuilder = ((com.google.cloud.retail.v2.Interval) facetValue_).toBuilder(); + } + facetValue_ = + input.readMessage( + com.google.cloud.retail.v2.Interval.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.retail.v2.Interval) facetValue_); + facetValue_ = subBuilder.buildPartial(); + } + facetValueCase_ = 2; + break; + } + case 24: + { + count_ = input.readInt64(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchResponse_Facet_FacetValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchResponse_Facet_FacetValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue.class, + com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue.Builder.class); + } + + private int facetValueCase_ = 0; + private java.lang.Object facetValue_; + + public enum FacetValueCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + VALUE(1), + INTERVAL(2), + FACETVALUE_NOT_SET(0); + private final int value; + + private FacetValueCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static FacetValueCase valueOf(int value) { + return forNumber(value); + } + + public static FacetValueCase forNumber(int value) { + switch (value) { + case 1: + return VALUE; + case 2: + return INTERVAL; + case 0: + return FACETVALUE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public FacetValueCase getFacetValueCase() { + return FacetValueCase.forNumber(facetValueCase_); + } + + public static final int VALUE_FIELD_NUMBER = 1; + /** + * + * + *
+       * Text value of a facet, such as "Black" for facet "colorFamilies".
+       * 
+ * + * string value = 1; + * + * @return Whether the value field is set. + */ + public boolean hasValue() { + return facetValueCase_ == 1; + } + /** + * + * + *
+       * Text value of a facet, such as "Black" for facet "colorFamilies".
+       * 
+ * + * string value = 1; + * + * @return The value. + */ + public java.lang.String getValue() { + java.lang.Object ref = ""; + if (facetValueCase_ == 1) { + ref = facetValue_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (facetValueCase_ == 1) { + facetValue_ = s; + } + return s; + } + } + /** + * + * + *
+       * Text value of a facet, such as "Black" for facet "colorFamilies".
+       * 
+ * + * string value = 1; + * + * @return The bytes for value. + */ + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = ""; + if (facetValueCase_ == 1) { + ref = facetValue_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (facetValueCase_ == 1) { + facetValue_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INTERVAL_FIELD_NUMBER = 2; + /** + * + * + *
+       * Interval value for a facet, such as [10, 20) for facet "price".
+       * 
+ * + * .google.cloud.retail.v2.Interval interval = 2; + * + * @return Whether the interval field is set. + */ + @java.lang.Override + public boolean hasInterval() { + return facetValueCase_ == 2; + } + /** + * + * + *
+       * Interval value for a facet, such as [10, 20) for facet "price".
+       * 
+ * + * .google.cloud.retail.v2.Interval interval = 2; + * + * @return The interval. + */ + @java.lang.Override + public com.google.cloud.retail.v2.Interval getInterval() { + if (facetValueCase_ == 2) { + return (com.google.cloud.retail.v2.Interval) facetValue_; + } + return com.google.cloud.retail.v2.Interval.getDefaultInstance(); + } + /** + * + * + *
+       * Interval value for a facet, such as [10, 20) for facet "price".
+       * 
+ * + * .google.cloud.retail.v2.Interval interval = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2.IntervalOrBuilder getIntervalOrBuilder() { + if (facetValueCase_ == 2) { + return (com.google.cloud.retail.v2.Interval) facetValue_; + } + return com.google.cloud.retail.v2.Interval.getDefaultInstance(); + } + + public static final int COUNT_FIELD_NUMBER = 3; + private long count_; + /** + * + * + *
+       * Number of items that have this facet value.
+       * 
+ * + * int64 count = 3; + * + * @return The count. + */ + @java.lang.Override + public long getCount() { + return count_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (facetValueCase_ == 1) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, facetValue_); + } + if (facetValueCase_ == 2) { + output.writeMessage(2, (com.google.cloud.retail.v2.Interval) facetValue_); + } + if (count_ != 0L) { + output.writeInt64(3, count_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (facetValueCase_ == 1) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, facetValue_); + } + if (facetValueCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.cloud.retail.v2.Interval) facetValue_); + } + if (count_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, count_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue)) { + return super.equals(obj); + } + com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue other = + (com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue) obj; + + if (getCount() != other.getCount()) return false; + if (!getFacetValueCase().equals(other.getFacetValueCase())) return false; + switch (facetValueCase_) { + case 1: + if (!getValue().equals(other.getValue())) return false; + break; + case 2: + if (!getInterval().equals(other.getInterval())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getCount()); + switch (facetValueCase_) { + case 1: + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + break; + case 2: + hash = (37 * hash) + INTERVAL_FIELD_NUMBER; + hash = (53 * hash) + getInterval().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+       * A facet value which contains value names and their count.
+       * 
+ * + * Protobuf type {@code google.cloud.retail.v2.SearchResponse.Facet.FacetValue} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.SearchResponse.Facet.FacetValue) + com.google.cloud.retail.v2.SearchResponse.Facet.FacetValueOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchResponse_Facet_FacetValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchResponse_Facet_FacetValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue.class, + com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue.Builder.class); + } + + // Construct using com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + count_ = 0L; + + facetValueCase_ = 0; + facetValue_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchResponse_Facet_FacetValue_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue + getDefaultInstanceForType() { + return com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue build() { + com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue buildPartial() { + com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue result = + new com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue(this); + if (facetValueCase_ == 1) { + result.facetValue_ = facetValue_; + } + if (facetValueCase_ == 2) { + if (intervalBuilder_ == null) { + result.facetValue_ = facetValue_; + } else { + result.facetValue_ = intervalBuilder_.build(); + } + } + result.count_ = count_; + result.facetValueCase_ = facetValueCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue) { + return mergeFrom((com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue other) { + if (other + == com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue.getDefaultInstance()) + return this; + if (other.getCount() != 0L) { + setCount(other.getCount()); + } + switch (other.getFacetValueCase()) { + case VALUE: + { + facetValueCase_ = 1; + facetValue_ = other.facetValue_; + onChanged(); + break; + } + case INTERVAL: + { + mergeInterval(other.getInterval()); + break; + } + case FACETVALUE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int facetValueCase_ = 0; + private java.lang.Object facetValue_; + + public FacetValueCase getFacetValueCase() { + return FacetValueCase.forNumber(facetValueCase_); + } + + public Builder clearFacetValue() { + facetValueCase_ = 0; + facetValue_ = null; + onChanged(); + return this; + } + + /** + * + * + *
+         * Text value of a facet, such as "Black" for facet "colorFamilies".
+         * 
+ * + * string value = 1; + * + * @return Whether the value field is set. + */ + @java.lang.Override + public boolean hasValue() { + return facetValueCase_ == 1; + } + /** + * + * + *
+         * Text value of a facet, such as "Black" for facet "colorFamilies".
+         * 
+ * + * string value = 1; + * + * @return The value. + */ + @java.lang.Override + public java.lang.String getValue() { + java.lang.Object ref = ""; + if (facetValueCase_ == 1) { + ref = facetValue_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (facetValueCase_ == 1) { + facetValue_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * Text value of a facet, such as "Black" for facet "colorFamilies".
+         * 
+ * + * string value = 1; + * + * @return The bytes for value. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = ""; + if (facetValueCase_ == 1) { + ref = facetValue_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (facetValueCase_ == 1) { + facetValue_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * Text value of a facet, such as "Black" for facet "colorFamilies".
+         * 
+ * + * string value = 1; + * + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + facetValueCase_ = 1; + facetValue_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * Text value of a facet, such as "Black" for facet "colorFamilies".
+         * 
+ * + * string value = 1; + * + * @return This builder for chaining. + */ + public Builder clearValue() { + if (facetValueCase_ == 1) { + facetValueCase_ = 0; + facetValue_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+         * Text value of a facet, such as "Black" for facet "colorFamilies".
+         * 
+ * + * string value = 1; + * + * @param value The bytes for value to set. + * @return This builder for chaining. + */ + public Builder setValueBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + facetValueCase_ = 1; + facetValue_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2.Interval, + com.google.cloud.retail.v2.Interval.Builder, + com.google.cloud.retail.v2.IntervalOrBuilder> + intervalBuilder_; + /** + * + * + *
+         * Interval value for a facet, such as [10, 20) for facet "price".
+         * 
+ * + * .google.cloud.retail.v2.Interval interval = 2; + * + * @return Whether the interval field is set. + */ + @java.lang.Override + public boolean hasInterval() { + return facetValueCase_ == 2; + } + /** + * + * + *
+         * Interval value for a facet, such as [10, 20) for facet "price".
+         * 
+ * + * .google.cloud.retail.v2.Interval interval = 2; + * + * @return The interval. + */ + @java.lang.Override + public com.google.cloud.retail.v2.Interval getInterval() { + if (intervalBuilder_ == null) { + if (facetValueCase_ == 2) { + return (com.google.cloud.retail.v2.Interval) facetValue_; + } + return com.google.cloud.retail.v2.Interval.getDefaultInstance(); + } else { + if (facetValueCase_ == 2) { + return intervalBuilder_.getMessage(); + } + return com.google.cloud.retail.v2.Interval.getDefaultInstance(); + } + } + /** + * + * + *
+         * Interval value for a facet, such as [10, 20) for facet "price".
+         * 
+ * + * .google.cloud.retail.v2.Interval interval = 2; + */ + public Builder setInterval(com.google.cloud.retail.v2.Interval value) { + if (intervalBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + facetValue_ = value; + onChanged(); + } else { + intervalBuilder_.setMessage(value); + } + facetValueCase_ = 2; + return this; + } + /** + * + * + *
+         * Interval value for a facet, such as [10, 20) for facet "price".
+         * 
+ * + * .google.cloud.retail.v2.Interval interval = 2; + */ + public Builder setInterval(com.google.cloud.retail.v2.Interval.Builder builderForValue) { + if (intervalBuilder_ == null) { + facetValue_ = builderForValue.build(); + onChanged(); + } else { + intervalBuilder_.setMessage(builderForValue.build()); + } + facetValueCase_ = 2; + return this; + } + /** + * + * + *
+         * Interval value for a facet, such as [10, 20) for facet "price".
+         * 
+ * + * .google.cloud.retail.v2.Interval interval = 2; + */ + public Builder mergeInterval(com.google.cloud.retail.v2.Interval value) { + if (intervalBuilder_ == null) { + if (facetValueCase_ == 2 + && facetValue_ != com.google.cloud.retail.v2.Interval.getDefaultInstance()) { + facetValue_ = + com.google.cloud.retail.v2.Interval.newBuilder( + (com.google.cloud.retail.v2.Interval) facetValue_) + .mergeFrom(value) + .buildPartial(); + } else { + facetValue_ = value; + } + onChanged(); + } else { + if (facetValueCase_ == 2) { + intervalBuilder_.mergeFrom(value); + } + intervalBuilder_.setMessage(value); + } + facetValueCase_ = 2; + return this; + } + /** + * + * + *
+         * Interval value for a facet, such as [10, 20) for facet "price".
+         * 
+ * + * .google.cloud.retail.v2.Interval interval = 2; + */ + public Builder clearInterval() { + if (intervalBuilder_ == null) { + if (facetValueCase_ == 2) { + facetValueCase_ = 0; + facetValue_ = null; + onChanged(); + } + } else { + if (facetValueCase_ == 2) { + facetValueCase_ = 0; + facetValue_ = null; + } + intervalBuilder_.clear(); + } + return this; + } + /** + * + * + *
+         * Interval value for a facet, such as [10, 20) for facet "price".
+         * 
+ * + * .google.cloud.retail.v2.Interval interval = 2; + */ + public com.google.cloud.retail.v2.Interval.Builder getIntervalBuilder() { + return getIntervalFieldBuilder().getBuilder(); + } + /** + * + * + *
+         * Interval value for a facet, such as [10, 20) for facet "price".
+         * 
+ * + * .google.cloud.retail.v2.Interval interval = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2.IntervalOrBuilder getIntervalOrBuilder() { + if ((facetValueCase_ == 2) && (intervalBuilder_ != null)) { + return intervalBuilder_.getMessageOrBuilder(); + } else { + if (facetValueCase_ == 2) { + return (com.google.cloud.retail.v2.Interval) facetValue_; + } + return com.google.cloud.retail.v2.Interval.getDefaultInstance(); + } + } + /** + * + * + *
+         * Interval value for a facet, such as [10, 20) for facet "price".
+         * 
+ * + * .google.cloud.retail.v2.Interval interval = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2.Interval, + com.google.cloud.retail.v2.Interval.Builder, + com.google.cloud.retail.v2.IntervalOrBuilder> + getIntervalFieldBuilder() { + if (intervalBuilder_ == null) { + if (!(facetValueCase_ == 2)) { + facetValue_ = com.google.cloud.retail.v2.Interval.getDefaultInstance(); + } + intervalBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2.Interval, + com.google.cloud.retail.v2.Interval.Builder, + com.google.cloud.retail.v2.IntervalOrBuilder>( + (com.google.cloud.retail.v2.Interval) facetValue_, + getParentForChildren(), + isClean()); + facetValue_ = null; + } + facetValueCase_ = 2; + onChanged(); + ; + return intervalBuilder_; + } + + private long count_; + /** + * + * + *
+         * Number of items that have this facet value.
+         * 
+ * + * int64 count = 3; + * + * @return The count. + */ + @java.lang.Override + public long getCount() { + return count_; + } + /** + * + * + *
+         * Number of items that have this facet value.
+         * 
+ * + * int64 count = 3; + * + * @param value The count to set. + * @return This builder for chaining. + */ + public Builder setCount(long value) { + + count_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * Number of items that have this facet value.
+         * 
+ * + * int64 count = 3; + * + * @return This builder for chaining. + */ + public Builder clearCount() { + + count_ = 0L; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.SearchResponse.Facet.FacetValue) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.SearchResponse.Facet.FacetValue) + private static final com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue(); + } + + public static com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FacetValue parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new FacetValue(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int KEY_FIELD_NUMBER = 1; + private volatile java.lang.Object key_; + /** + * + * + *
+     * The key for this facet. E.g., "colorFamilies" or "price" or
+     * "attributes.attr1".
+     * 
+ * + * string key = 1; + * + * @return The key. + */ + @java.lang.Override + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } + } + /** + * + * + *
+     * The key for this facet. E.g., "colorFamilies" or "price" or
+     * "attributes.attr1".
+     * 
+ * + * string key = 1; + * + * @return The bytes for key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALUES_FIELD_NUMBER = 2; + private java.util.List values_; + /** + * + * + *
+     * The facet values for this field.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2; + */ + @java.lang.Override + public java.util.List + getValuesList() { + return values_; + } + /** + * + * + *
+     * The facet values for this field.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2; + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.retail.v2.SearchResponse.Facet.FacetValueOrBuilder> + getValuesOrBuilderList() { + return values_; + } + /** + * + * + *
+     * The facet values for this field.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2; + */ + @java.lang.Override + public int getValuesCount() { + return values_.size(); + } + /** + * + * + *
+     * The facet values for this field.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue getValues(int index) { + return values_.get(index); + } + /** + * + * + *
+     * The facet values for this field.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2.SearchResponse.Facet.FacetValueOrBuilder getValuesOrBuilder( + int index) { + return values_.get(index); + } + + public static final int DYNAMIC_FACET_FIELD_NUMBER = 3; + private boolean dynamicFacet_; + /** + * + * + *
+     * Whether the facet is dynamically generated.
+     * 
+ * + * bool dynamic_facet = 3; + * + * @return The dynamicFacet. + */ + @java.lang.Override + public boolean getDynamicFacet() { + return dynamicFacet_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getKeyBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, key_); + } + for (int i = 0; i < values_.size(); i++) { + output.writeMessage(2, values_.get(i)); + } + if (dynamicFacet_ != false) { + output.writeBool(3, dynamicFacet_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getKeyBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, key_); + } + for (int i = 0; i < values_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, values_.get(i)); + } + if (dynamicFacet_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, dynamicFacet_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.retail.v2.SearchResponse.Facet)) { + return super.equals(obj); + } + com.google.cloud.retail.v2.SearchResponse.Facet other = + (com.google.cloud.retail.v2.SearchResponse.Facet) obj; + + if (!getKey().equals(other.getKey())) return false; + if (!getValuesList().equals(other.getValuesList())) return false; + if (getDynamicFacet() != other.getDynamicFacet()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + if (getValuesCount() > 0) { + hash = (37 * hash) + VALUES_FIELD_NUMBER; + hash = (53 * hash) + getValuesList().hashCode(); + } + hash = (37 * hash) + DYNAMIC_FACET_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDynamicFacet()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2.SearchResponse.Facet parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.SearchResponse.Facet parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchResponse.Facet parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.SearchResponse.Facet parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchResponse.Facet parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.SearchResponse.Facet parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchResponse.Facet parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.SearchResponse.Facet parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchResponse.Facet parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.SearchResponse.Facet parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchResponse.Facet parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.SearchResponse.Facet parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2.SearchResponse.Facet prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * A facet result.
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2.SearchResponse.Facet} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.SearchResponse.Facet) + com.google.cloud.retail.v2.SearchResponse.FacetOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchResponse_Facet_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchResponse_Facet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.SearchResponse.Facet.class, + com.google.cloud.retail.v2.SearchResponse.Facet.Builder.class); + } + + // Construct using com.google.cloud.retail.v2.SearchResponse.Facet.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getValuesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + key_ = ""; + + if (valuesBuilder_ == null) { + values_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + valuesBuilder_.clear(); + } + dynamicFacet_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchResponse_Facet_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2.SearchResponse.Facet getDefaultInstanceForType() { + return com.google.cloud.retail.v2.SearchResponse.Facet.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2.SearchResponse.Facet build() { + com.google.cloud.retail.v2.SearchResponse.Facet result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2.SearchResponse.Facet buildPartial() { + com.google.cloud.retail.v2.SearchResponse.Facet result = + new com.google.cloud.retail.v2.SearchResponse.Facet(this); + int from_bitField0_ = bitField0_; + result.key_ = key_; + if (valuesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + values_ = java.util.Collections.unmodifiableList(values_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.values_ = values_; + } else { + result.values_ = valuesBuilder_.build(); + } + result.dynamicFacet_ = dynamicFacet_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.retail.v2.SearchResponse.Facet) { + return mergeFrom((com.google.cloud.retail.v2.SearchResponse.Facet) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2.SearchResponse.Facet other) { + if (other == com.google.cloud.retail.v2.SearchResponse.Facet.getDefaultInstance()) + return this; + if (!other.getKey().isEmpty()) { + key_ = other.key_; + onChanged(); + } + if (valuesBuilder_ == null) { + if (!other.values_.isEmpty()) { + if (values_.isEmpty()) { + values_ = other.values_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureValuesIsMutable(); + values_.addAll(other.values_); + } + onChanged(); + } + } else { + if (!other.values_.isEmpty()) { + if (valuesBuilder_.isEmpty()) { + valuesBuilder_.dispose(); + valuesBuilder_ = null; + values_ = other.values_; + bitField0_ = (bitField0_ & ~0x00000001); + valuesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getValuesFieldBuilder() + : null; + } else { + valuesBuilder_.addAllMessages(other.values_); + } + } + } + if (other.getDynamicFacet() != false) { + setDynamicFacet(other.getDynamicFacet()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.retail.v2.SearchResponse.Facet parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2.SearchResponse.Facet) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object key_ = ""; + /** + * + * + *
+       * The key for this facet. E.g., "colorFamilies" or "price" or
+       * "attributes.attr1".
+       * 
+ * + * string key = 1; + * + * @return The key. + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The key for this facet. E.g., "colorFamilies" or "price" or
+       * "attributes.attr1".
+       * 
+ * + * string key = 1; + * + * @return The bytes for key. + */ + public com.google.protobuf.ByteString getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The key for this facet. E.g., "colorFamilies" or "price" or
+       * "attributes.attr1".
+       * 
+ * + * string key = 1; + * + * @param value The key to set. + * @return This builder for chaining. + */ + public Builder setKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + key_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The key for this facet. E.g., "colorFamilies" or "price" or
+       * "attributes.attr1".
+       * 
+ * + * string key = 1; + * + * @return This builder for chaining. + */ + public Builder clearKey() { + + key_ = getDefaultInstance().getKey(); + onChanged(); + return this; + } + /** + * + * + *
+       * The key for this facet. E.g., "colorFamilies" or "price" or
+       * "attributes.attr1".
+       * 
+ * + * string key = 1; + * + * @param value The bytes for key to set. + * @return This builder for chaining. + */ + public Builder setKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + key_ = value; + onChanged(); + return this; + } + + private java.util.List values_ = + java.util.Collections.emptyList(); + + private void ensureValuesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + values_ = + new java.util.ArrayList( + values_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue, + com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue.Builder, + com.google.cloud.retail.v2.SearchResponse.Facet.FacetValueOrBuilder> + valuesBuilder_; + + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2; + */ + public java.util.List + getValuesList() { + if (valuesBuilder_ == null) { + return java.util.Collections.unmodifiableList(values_); + } else { + return valuesBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2; + */ + public int getValuesCount() { + if (valuesBuilder_ == null) { + return values_.size(); + } else { + return valuesBuilder_.getCount(); + } + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2; + */ + public com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue getValues(int index) { + if (valuesBuilder_ == null) { + return values_.get(index); + } else { + return valuesBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2; + */ + public Builder setValues( + int index, com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue value) { + if (valuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.set(index, value); + onChanged(); + } else { + valuesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2; + */ + public Builder setValues( + int index, + com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue.Builder builderForValue) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.set(index, builderForValue.build()); + onChanged(); + } else { + valuesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2; + */ + public Builder addValues(com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue value) { + if (valuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.add(value); + onChanged(); + } else { + valuesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2; + */ + public Builder addValues( + int index, com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue value) { + if (valuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.add(index, value); + onChanged(); + } else { + valuesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2; + */ + public Builder addValues( + com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue.Builder builderForValue) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.add(builderForValue.build()); + onChanged(); + } else { + valuesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2; + */ + public Builder addValues( + int index, + com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue.Builder builderForValue) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.add(index, builderForValue.build()); + onChanged(); + } else { + valuesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2; + */ + public Builder addAllValues( + java.lang.Iterable + values) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, values_); + onChanged(); + } else { + valuesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2; + */ + public Builder clearValues() { + if (valuesBuilder_ == null) { + values_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + valuesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2; + */ + public Builder removeValues(int index) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.remove(index); + onChanged(); + } else { + valuesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2; + */ + public com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue.Builder getValuesBuilder( + int index) { + return getValuesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2; + */ + public com.google.cloud.retail.v2.SearchResponse.Facet.FacetValueOrBuilder getValuesOrBuilder( + int index) { + if (valuesBuilder_ == null) { + return values_.get(index); + } else { + return valuesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2; + */ + public java.util.List< + ? extends com.google.cloud.retail.v2.SearchResponse.Facet.FacetValueOrBuilder> + getValuesOrBuilderList() { + if (valuesBuilder_ != null) { + return valuesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(values_); + } + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2; + */ + public com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue.Builder addValuesBuilder() { + return getValuesFieldBuilder() + .addBuilder( + com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue.getDefaultInstance()); + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2; + */ + public com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue.Builder addValuesBuilder( + int index) { + return getValuesFieldBuilder() + .addBuilder( + index, + com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue.getDefaultInstance()); + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2; + */ + public java.util.List + getValuesBuilderList() { + return getValuesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue, + com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue.Builder, + com.google.cloud.retail.v2.SearchResponse.Facet.FacetValueOrBuilder> + getValuesFieldBuilder() { + if (valuesBuilder_ == null) { + valuesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue, + com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue.Builder, + com.google.cloud.retail.v2.SearchResponse.Facet.FacetValueOrBuilder>( + values_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + values_ = null; + } + return valuesBuilder_; + } + + private boolean dynamicFacet_; + /** + * + * + *
+       * Whether the facet is dynamically generated.
+       * 
+ * + * bool dynamic_facet = 3; + * + * @return The dynamicFacet. + */ + @java.lang.Override + public boolean getDynamicFacet() { + return dynamicFacet_; + } + /** + * + * + *
+       * Whether the facet is dynamically generated.
+       * 
+ * + * bool dynamic_facet = 3; + * + * @param value The dynamicFacet to set. + * @return This builder for chaining. + */ + public Builder setDynamicFacet(boolean value) { + + dynamicFacet_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Whether the facet is dynamically generated.
+       * 
+ * + * bool dynamic_facet = 3; + * + * @return This builder for chaining. + */ + public Builder clearDynamicFacet() { + + dynamicFacet_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.SearchResponse.Facet) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.SearchResponse.Facet) + private static final com.google.cloud.retail.v2.SearchResponse.Facet DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2.SearchResponse.Facet(); + } + + public static com.google.cloud.retail.v2.SearchResponse.Facet getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Facet parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Facet(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.retail.v2.SearchResponse.Facet getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface QueryExpansionInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2.SearchResponse.QueryExpansionInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Bool describing whether query expansion has occurred.
+     * 
+ * + * bool expanded_query = 1; + * + * @return The expandedQuery. + */ + boolean getExpandedQuery(); + } + /** + * + * + *
+   * Information describing query expansion including whether expansion has
+   * occurred.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2.SearchResponse.QueryExpansionInfo} + */ + public static final class QueryExpansionInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.SearchResponse.QueryExpansionInfo) + QueryExpansionInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use QueryExpansionInfo.newBuilder() to construct. + private QueryExpansionInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private QueryExpansionInfo() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new QueryExpansionInfo(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private QueryExpansionInfo( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + expandedQuery_ = input.readBool(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchResponse_QueryExpansionInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchResponse_QueryExpansionInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo.class, + com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo.Builder.class); + } + + public static final int EXPANDED_QUERY_FIELD_NUMBER = 1; + private boolean expandedQuery_; + /** + * + * + *
+     * Bool describing whether query expansion has occurred.
+     * 
+ * + * bool expanded_query = 1; + * + * @return The expandedQuery. + */ + @java.lang.Override + public boolean getExpandedQuery() { + return expandedQuery_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (expandedQuery_ != false) { + output.writeBool(1, expandedQuery_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (expandedQuery_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, expandedQuery_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo)) { + return super.equals(obj); + } + com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo other = + (com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo) obj; + + if (getExpandedQuery() != other.getExpandedQuery()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + EXPANDED_QUERY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getExpandedQuery()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Information describing query expansion including whether expansion has
+     * occurred.
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2.SearchResponse.QueryExpansionInfo} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.SearchResponse.QueryExpansionInfo) + com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchResponse_QueryExpansionInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchResponse_QueryExpansionInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo.class, + com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo.Builder.class); + } + + // Construct using com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + expandedQuery_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchResponse_QueryExpansionInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo + getDefaultInstanceForType() { + return com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo build() { + com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo buildPartial() { + com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo result = + new com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo(this); + result.expandedQuery_ = expandedQuery_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo) { + return mergeFrom((com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo other) { + if (other + == com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo.getDefaultInstance()) + return this; + if (other.getExpandedQuery() != false) { + setExpandedQuery(other.getExpandedQuery()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private boolean expandedQuery_; + /** + * + * + *
+       * Bool describing whether query expansion has occurred.
+       * 
+ * + * bool expanded_query = 1; + * + * @return The expandedQuery. + */ + @java.lang.Override + public boolean getExpandedQuery() { + return expandedQuery_; + } + /** + * + * + *
+       * Bool describing whether query expansion has occurred.
+       * 
+ * + * bool expanded_query = 1; + * + * @param value The expandedQuery to set. + * @return This builder for chaining. + */ + public Builder setExpandedQuery(boolean value) { + + expandedQuery_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Bool describing whether query expansion has occurred.
+       * 
+ * + * bool expanded_query = 1; + * + * @return This builder for chaining. + */ + public Builder clearExpandedQuery() { + + expandedQuery_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.SearchResponse.QueryExpansionInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.SearchResponse.QueryExpansionInfo) + private static final com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo(); + } + + public static com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public QueryExpansionInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new QueryExpansionInfo(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int RESULTS_FIELD_NUMBER = 1; + private java.util.List results_; + /** + * + * + *
+   * A list of matched items. The order represents the ranking.
+   * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.SearchResult results = 1; + */ + @java.lang.Override + public java.util.List getResultsList() { + return results_; + } + /** + * + * + *
+   * A list of matched items. The order represents the ranking.
+   * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.SearchResult results = 1; + */ + @java.lang.Override + public java.util.List + getResultsOrBuilderList() { + return results_; + } + /** + * + * + *
+   * A list of matched items. The order represents the ranking.
+   * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.SearchResult results = 1; + */ + @java.lang.Override + public int getResultsCount() { + return results_.size(); + } + /** + * + * + *
+   * A list of matched items. The order represents the ranking.
+   * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.SearchResult results = 1; + */ + @java.lang.Override + public com.google.cloud.retail.v2.SearchResponse.SearchResult getResults(int index) { + return results_.get(index); + } + /** + * + * + *
+   * A list of matched items. The order represents the ranking.
+   * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.SearchResult results = 1; + */ + @java.lang.Override + public com.google.cloud.retail.v2.SearchResponse.SearchResultOrBuilder getResultsOrBuilder( + int index) { + return results_.get(index); + } + + public static final int FACETS_FIELD_NUMBER = 2; + private java.util.List facets_; + /** + * + * + *
+   * Results of facets requested by user.
+   * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.Facet facets = 2; + */ + @java.lang.Override + public java.util.List getFacetsList() { + return facets_; + } + /** + * + * + *
+   * Results of facets requested by user.
+   * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.Facet facets = 2; + */ + @java.lang.Override + public java.util.List + getFacetsOrBuilderList() { + return facets_; + } + /** + * + * + *
+   * Results of facets requested by user.
+   * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.Facet facets = 2; + */ + @java.lang.Override + public int getFacetsCount() { + return facets_.size(); + } + /** + * + * + *
+   * Results of facets requested by user.
+   * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.Facet facets = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2.SearchResponse.Facet getFacets(int index) { + return facets_.get(index); + } + /** + * + * + *
+   * Results of facets requested by user.
+   * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.Facet facets = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2.SearchResponse.FacetOrBuilder getFacetsOrBuilder(int index) { + return facets_.get(index); + } + + public static final int TOTAL_SIZE_FIELD_NUMBER = 3; + private int totalSize_; + /** + * + * + *
+   * The estimated total count of matched items irrespective of pagination. The
+   * count of [results][google.cloud.retail.v2.SearchResponse.results] returned
+   * by pagination may be less than the
+   * [total_size][google.cloud.retail.v2.SearchResponse.total_size] that
+   * matches.
+   * 
+ * + * int32 total_size = 3; + * + * @return The totalSize. + */ + @java.lang.Override + public int getTotalSize() { + return totalSize_; + } + + public static final int CORRECTED_QUERY_FIELD_NUMBER = 4; + private volatile java.lang.Object correctedQuery_; + /** + * + * + *
+   * If spell correction applies, the corrected query. Otherwise, empty.
+   * 
+ * + * string corrected_query = 4; + * + * @return The correctedQuery. + */ + @java.lang.Override + public java.lang.String getCorrectedQuery() { + java.lang.Object ref = correctedQuery_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + correctedQuery_ = s; + return s; + } + } + /** + * + * + *
+   * If spell correction applies, the corrected query. Otherwise, empty.
+   * 
+ * + * string corrected_query = 4; + * + * @return The bytes for correctedQuery. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCorrectedQueryBytes() { + java.lang.Object ref = correctedQuery_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + correctedQuery_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ATTRIBUTION_TOKEN_FIELD_NUMBER = 5; + private volatile java.lang.Object attributionToken_; + /** + * + * + *
+   * A unique search token. This should be included in the
+   * [UserEvent][google.cloud.retail.v2.UserEvent] logs resulting from this
+   * search, which enables accurate attribution of search model performance.
+   * 
+ * + * string attribution_token = 5; + * + * @return The attributionToken. + */ + @java.lang.Override + public java.lang.String getAttributionToken() { + java.lang.Object ref = attributionToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + attributionToken_ = s; + return s; + } + } + /** + * + * + *
+   * A unique search token. This should be included in the
+   * [UserEvent][google.cloud.retail.v2.UserEvent] logs resulting from this
+   * search, which enables accurate attribution of search model performance.
+   * 
+ * + * string attribution_token = 5; + * + * @return The bytes for attributionToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAttributionTokenBytes() { + java.lang.Object ref = attributionToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + attributionToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 6; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * A token that can be sent as
+   * [SearchRequest.page_token][google.cloud.retail.v2.SearchRequest.page_token]
+   * to retrieve the next page. If this field is omitted, there are no
+   * subsequent pages.
+   * 
+ * + * string next_page_token = 6; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A token that can be sent as
+   * [SearchRequest.page_token][google.cloud.retail.v2.SearchRequest.page_token]
+   * to retrieve the next page. If this field is omitted, there are no
+   * subsequent pages.
+   * 
+ * + * string next_page_token = 6; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int QUERY_EXPANSION_INFO_FIELD_NUMBER = 7; + private com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo queryExpansionInfo_; + /** + * + * + *
+   * Query expansion information for the returned results.
+   * 
+ * + * .google.cloud.retail.v2.SearchResponse.QueryExpansionInfo query_expansion_info = 7; + * + * + * @return Whether the queryExpansionInfo field is set. + */ + @java.lang.Override + public boolean hasQueryExpansionInfo() { + return queryExpansionInfo_ != null; + } + /** + * + * + *
+   * Query expansion information for the returned results.
+   * 
+ * + * .google.cloud.retail.v2.SearchResponse.QueryExpansionInfo query_expansion_info = 7; + * + * + * @return The queryExpansionInfo. + */ + @java.lang.Override + public com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo getQueryExpansionInfo() { + return queryExpansionInfo_ == null + ? com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo.getDefaultInstance() + : queryExpansionInfo_; + } + /** + * + * + *
+   * Query expansion information for the returned results.
+   * 
+ * + * .google.cloud.retail.v2.SearchResponse.QueryExpansionInfo query_expansion_info = 7; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfoOrBuilder + getQueryExpansionInfoOrBuilder() { + return getQueryExpansionInfo(); + } + + public static final int REDIRECT_URI_FIELD_NUMBER = 10; + private volatile java.lang.Object redirectUri_; + /** + * + * + *
+   * The URI of a customer-defined redirect page. If redirect action is
+   * triggered, no search will be performed, and only
+   * [redirect_uri][google.cloud.retail.v2.SearchResponse.redirect_uri] and
+   * [attribution_token][google.cloud.retail.v2.SearchResponse.attribution_token]
+   * will be set in the response.
+   * 
+ * + * string redirect_uri = 10; + * + * @return The redirectUri. + */ + @java.lang.Override + public java.lang.String getRedirectUri() { + java.lang.Object ref = redirectUri_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + redirectUri_ = s; + return s; + } + } + /** + * + * + *
+   * The URI of a customer-defined redirect page. If redirect action is
+   * triggered, no search will be performed, and only
+   * [redirect_uri][google.cloud.retail.v2.SearchResponse.redirect_uri] and
+   * [attribution_token][google.cloud.retail.v2.SearchResponse.attribution_token]
+   * will be set in the response.
+   * 
+ * + * string redirect_uri = 10; + * + * @return The bytes for redirectUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRedirectUriBytes() { + java.lang.Object ref = redirectUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + redirectUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < results_.size(); i++) { + output.writeMessage(1, results_.get(i)); + } + for (int i = 0; i < facets_.size(); i++) { + output.writeMessage(2, facets_.get(i)); + } + if (totalSize_ != 0) { + output.writeInt32(3, totalSize_); + } + if (!getCorrectedQueryBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, correctedQuery_); + } + if (!getAttributionTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, attributionToken_); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, nextPageToken_); + } + if (queryExpansionInfo_ != null) { + output.writeMessage(7, getQueryExpansionInfo()); + } + if (!getRedirectUriBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, redirectUri_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < results_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, results_.get(i)); + } + for (int i = 0; i < facets_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, facets_.get(i)); + } + if (totalSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, totalSize_); + } + if (!getCorrectedQueryBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, correctedQuery_); + } + if (!getAttributionTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, attributionToken_); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, nextPageToken_); + } + if (queryExpansionInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getQueryExpansionInfo()); + } + if (!getRedirectUriBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, redirectUri_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.retail.v2.SearchResponse)) { + return super.equals(obj); + } + com.google.cloud.retail.v2.SearchResponse other = + (com.google.cloud.retail.v2.SearchResponse) obj; + + if (!getResultsList().equals(other.getResultsList())) return false; + if (!getFacetsList().equals(other.getFacetsList())) return false; + if (getTotalSize() != other.getTotalSize()) return false; + if (!getCorrectedQuery().equals(other.getCorrectedQuery())) return false; + if (!getAttributionToken().equals(other.getAttributionToken())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (hasQueryExpansionInfo() != other.hasQueryExpansionInfo()) return false; + if (hasQueryExpansionInfo()) { + if (!getQueryExpansionInfo().equals(other.getQueryExpansionInfo())) return false; + } + if (!getRedirectUri().equals(other.getRedirectUri())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getResultsCount() > 0) { + hash = (37 * hash) + RESULTS_FIELD_NUMBER; + hash = (53 * hash) + getResultsList().hashCode(); + } + if (getFacetsCount() > 0) { + hash = (37 * hash) + FACETS_FIELD_NUMBER; + hash = (53 * hash) + getFacetsList().hashCode(); + } + hash = (37 * hash) + TOTAL_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getTotalSize(); + hash = (37 * hash) + CORRECTED_QUERY_FIELD_NUMBER; + hash = (53 * hash) + getCorrectedQuery().hashCode(); + hash = (37 * hash) + ATTRIBUTION_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getAttributionToken().hashCode(); + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + if (hasQueryExpansionInfo()) { + hash = (37 * hash) + QUERY_EXPANSION_INFO_FIELD_NUMBER; + hash = (53 * hash) + getQueryExpansionInfo().hashCode(); + } + hash = (37 * hash) + REDIRECT_URI_FIELD_NUMBER; + hash = (53 * hash) + getRedirectUri().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2.SearchResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.SearchResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.SearchResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.SearchResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.SearchResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.SearchResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SearchResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.SearchResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2.SearchResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for
+   * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2.SearchResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.SearchResponse) + com.google.cloud.retail.v2.SearchResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.SearchResponse.class, + com.google.cloud.retail.v2.SearchResponse.Builder.class); + } + + // Construct using com.google.cloud.retail.v2.SearchResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getResultsFieldBuilder(); + getFacetsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (resultsBuilder_ == null) { + results_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + resultsBuilder_.clear(); + } + if (facetsBuilder_ == null) { + facets_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + facetsBuilder_.clear(); + } + totalSize_ = 0; + + correctedQuery_ = ""; + + attributionToken_ = ""; + + nextPageToken_ = ""; + + if (queryExpansionInfoBuilder_ == null) { + queryExpansionInfo_ = null; + } else { + queryExpansionInfo_ = null; + queryExpansionInfoBuilder_ = null; + } + redirectUri_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2.SearchServiceProto + .internal_static_google_cloud_retail_v2_SearchResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2.SearchResponse getDefaultInstanceForType() { + return com.google.cloud.retail.v2.SearchResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2.SearchResponse build() { + com.google.cloud.retail.v2.SearchResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2.SearchResponse buildPartial() { + com.google.cloud.retail.v2.SearchResponse result = + new com.google.cloud.retail.v2.SearchResponse(this); + int from_bitField0_ = bitField0_; + if (resultsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + results_ = java.util.Collections.unmodifiableList(results_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.results_ = results_; + } else { + result.results_ = resultsBuilder_.build(); + } + if (facetsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + facets_ = java.util.Collections.unmodifiableList(facets_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.facets_ = facets_; + } else { + result.facets_ = facetsBuilder_.build(); + } + result.totalSize_ = totalSize_; + result.correctedQuery_ = correctedQuery_; + result.attributionToken_ = attributionToken_; + result.nextPageToken_ = nextPageToken_; + if (queryExpansionInfoBuilder_ == null) { + result.queryExpansionInfo_ = queryExpansionInfo_; + } else { + result.queryExpansionInfo_ = queryExpansionInfoBuilder_.build(); + } + result.redirectUri_ = redirectUri_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.retail.v2.SearchResponse) { + return mergeFrom((com.google.cloud.retail.v2.SearchResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2.SearchResponse other) { + if (other == com.google.cloud.retail.v2.SearchResponse.getDefaultInstance()) return this; + if (resultsBuilder_ == null) { + if (!other.results_.isEmpty()) { + if (results_.isEmpty()) { + results_ = other.results_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureResultsIsMutable(); + results_.addAll(other.results_); + } + onChanged(); + } + } else { + if (!other.results_.isEmpty()) { + if (resultsBuilder_.isEmpty()) { + resultsBuilder_.dispose(); + resultsBuilder_ = null; + results_ = other.results_; + bitField0_ = (bitField0_ & ~0x00000001); + resultsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getResultsFieldBuilder() + : null; + } else { + resultsBuilder_.addAllMessages(other.results_); + } + } + } + if (facetsBuilder_ == null) { + if (!other.facets_.isEmpty()) { + if (facets_.isEmpty()) { + facets_ = other.facets_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureFacetsIsMutable(); + facets_.addAll(other.facets_); + } + onChanged(); + } + } else { + if (!other.facets_.isEmpty()) { + if (facetsBuilder_.isEmpty()) { + facetsBuilder_.dispose(); + facetsBuilder_ = null; + facets_ = other.facets_; + bitField0_ = (bitField0_ & ~0x00000002); + facetsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getFacetsFieldBuilder() + : null; + } else { + facetsBuilder_.addAllMessages(other.facets_); + } + } + } + if (other.getTotalSize() != 0) { + setTotalSize(other.getTotalSize()); + } + if (!other.getCorrectedQuery().isEmpty()) { + correctedQuery_ = other.correctedQuery_; + onChanged(); + } + if (!other.getAttributionToken().isEmpty()) { + attributionToken_ = other.attributionToken_; + onChanged(); + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + if (other.hasQueryExpansionInfo()) { + mergeQueryExpansionInfo(other.getQueryExpansionInfo()); + } + if (!other.getRedirectUri().isEmpty()) { + redirectUri_ = other.redirectUri_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.retail.v2.SearchResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2.SearchResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List results_ = + java.util.Collections.emptyList(); + + private void ensureResultsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + results_ = + new java.util.ArrayList( + results_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2.SearchResponse.SearchResult, + com.google.cloud.retail.v2.SearchResponse.SearchResult.Builder, + com.google.cloud.retail.v2.SearchResponse.SearchResultOrBuilder> + resultsBuilder_; + + /** + * + * + *
+     * A list of matched items. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.SearchResult results = 1; + */ + public java.util.List getResultsList() { + if (resultsBuilder_ == null) { + return java.util.Collections.unmodifiableList(results_); + } else { + return resultsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A list of matched items. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.SearchResult results = 1; + */ + public int getResultsCount() { + if (resultsBuilder_ == null) { + return results_.size(); + } else { + return resultsBuilder_.getCount(); + } + } + /** + * + * + *
+     * A list of matched items. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.SearchResult results = 1; + */ + public com.google.cloud.retail.v2.SearchResponse.SearchResult getResults(int index) { + if (resultsBuilder_ == null) { + return results_.get(index); + } else { + return resultsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A list of matched items. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.SearchResult results = 1; + */ + public Builder setResults( + int index, com.google.cloud.retail.v2.SearchResponse.SearchResult value) { + if (resultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResultsIsMutable(); + results_.set(index, value); + onChanged(); + } else { + resultsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of matched items. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.SearchResult results = 1; + */ + public Builder setResults( + int index, com.google.cloud.retail.v2.SearchResponse.SearchResult.Builder builderForValue) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.set(index, builderForValue.build()); + onChanged(); + } else { + resultsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of matched items. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.SearchResult results = 1; + */ + public Builder addResults(com.google.cloud.retail.v2.SearchResponse.SearchResult value) { + if (resultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResultsIsMutable(); + results_.add(value); + onChanged(); + } else { + resultsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A list of matched items. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.SearchResult results = 1; + */ + public Builder addResults( + int index, com.google.cloud.retail.v2.SearchResponse.SearchResult value) { + if (resultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResultsIsMutable(); + results_.add(index, value); + onChanged(); + } else { + resultsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of matched items. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.SearchResult results = 1; + */ + public Builder addResults( + com.google.cloud.retail.v2.SearchResponse.SearchResult.Builder builderForValue) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.add(builderForValue.build()); + onChanged(); + } else { + resultsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of matched items. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.SearchResult results = 1; + */ + public Builder addResults( + int index, com.google.cloud.retail.v2.SearchResponse.SearchResult.Builder builderForValue) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.add(index, builderForValue.build()); + onChanged(); + } else { + resultsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of matched items. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.SearchResult results = 1; + */ + public Builder addAllResults( + java.lang.Iterable + values) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, results_); + onChanged(); + } else { + resultsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A list of matched items. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.SearchResult results = 1; + */ + public Builder clearResults() { + if (resultsBuilder_ == null) { + results_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + resultsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A list of matched items. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.SearchResult results = 1; + */ + public Builder removeResults(int index) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.remove(index); + onChanged(); + } else { + resultsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A list of matched items. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.SearchResult results = 1; + */ + public com.google.cloud.retail.v2.SearchResponse.SearchResult.Builder getResultsBuilder( + int index) { + return getResultsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A list of matched items. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.SearchResult results = 1; + */ + public com.google.cloud.retail.v2.SearchResponse.SearchResultOrBuilder getResultsOrBuilder( + int index) { + if (resultsBuilder_ == null) { + return results_.get(index); + } else { + return resultsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A list of matched items. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.SearchResult results = 1; + */ + public java.util.List + getResultsOrBuilderList() { + if (resultsBuilder_ != null) { + return resultsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(results_); + } + } + /** + * + * + *
+     * A list of matched items. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.SearchResult results = 1; + */ + public com.google.cloud.retail.v2.SearchResponse.SearchResult.Builder addResultsBuilder() { + return getResultsFieldBuilder() + .addBuilder(com.google.cloud.retail.v2.SearchResponse.SearchResult.getDefaultInstance()); + } + /** + * + * + *
+     * A list of matched items. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.SearchResult results = 1; + */ + public com.google.cloud.retail.v2.SearchResponse.SearchResult.Builder addResultsBuilder( + int index) { + return getResultsFieldBuilder() + .addBuilder( + index, com.google.cloud.retail.v2.SearchResponse.SearchResult.getDefaultInstance()); + } + /** + * + * + *
+     * A list of matched items. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.SearchResult results = 1; + */ + public java.util.List + getResultsBuilderList() { + return getResultsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2.SearchResponse.SearchResult, + com.google.cloud.retail.v2.SearchResponse.SearchResult.Builder, + com.google.cloud.retail.v2.SearchResponse.SearchResultOrBuilder> + getResultsFieldBuilder() { + if (resultsBuilder_ == null) { + resultsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2.SearchResponse.SearchResult, + com.google.cloud.retail.v2.SearchResponse.SearchResult.Builder, + com.google.cloud.retail.v2.SearchResponse.SearchResultOrBuilder>( + results_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + results_ = null; + } + return resultsBuilder_; + } + + private java.util.List facets_ = + java.util.Collections.emptyList(); + + private void ensureFacetsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + facets_ = new java.util.ArrayList(facets_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2.SearchResponse.Facet, + com.google.cloud.retail.v2.SearchResponse.Facet.Builder, + com.google.cloud.retail.v2.SearchResponse.FacetOrBuilder> + facetsBuilder_; + + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.Facet facets = 2; + */ + public java.util.List getFacetsList() { + if (facetsBuilder_ == null) { + return java.util.Collections.unmodifiableList(facets_); + } else { + return facetsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.Facet facets = 2; + */ + public int getFacetsCount() { + if (facetsBuilder_ == null) { + return facets_.size(); + } else { + return facetsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.Facet facets = 2; + */ + public com.google.cloud.retail.v2.SearchResponse.Facet getFacets(int index) { + if (facetsBuilder_ == null) { + return facets_.get(index); + } else { + return facetsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.Facet facets = 2; + */ + public Builder setFacets(int index, com.google.cloud.retail.v2.SearchResponse.Facet value) { + if (facetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFacetsIsMutable(); + facets_.set(index, value); + onChanged(); + } else { + facetsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.Facet facets = 2; + */ + public Builder setFacets( + int index, com.google.cloud.retail.v2.SearchResponse.Facet.Builder builderForValue) { + if (facetsBuilder_ == null) { + ensureFacetsIsMutable(); + facets_.set(index, builderForValue.build()); + onChanged(); + } else { + facetsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.Facet facets = 2; + */ + public Builder addFacets(com.google.cloud.retail.v2.SearchResponse.Facet value) { + if (facetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFacetsIsMutable(); + facets_.add(value); + onChanged(); + } else { + facetsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.Facet facets = 2; + */ + public Builder addFacets(int index, com.google.cloud.retail.v2.SearchResponse.Facet value) { + if (facetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFacetsIsMutable(); + facets_.add(index, value); + onChanged(); + } else { + facetsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.Facet facets = 2; + */ + public Builder addFacets( + com.google.cloud.retail.v2.SearchResponse.Facet.Builder builderForValue) { + if (facetsBuilder_ == null) { + ensureFacetsIsMutable(); + facets_.add(builderForValue.build()); + onChanged(); + } else { + facetsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.Facet facets = 2; + */ + public Builder addFacets( + int index, com.google.cloud.retail.v2.SearchResponse.Facet.Builder builderForValue) { + if (facetsBuilder_ == null) { + ensureFacetsIsMutable(); + facets_.add(index, builderForValue.build()); + onChanged(); + } else { + facetsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.Facet facets = 2; + */ + public Builder addAllFacets( + java.lang.Iterable values) { + if (facetsBuilder_ == null) { + ensureFacetsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, facets_); + onChanged(); + } else { + facetsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.Facet facets = 2; + */ + public Builder clearFacets() { + if (facetsBuilder_ == null) { + facets_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + facetsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.Facet facets = 2; + */ + public Builder removeFacets(int index) { + if (facetsBuilder_ == null) { + ensureFacetsIsMutable(); + facets_.remove(index); + onChanged(); + } else { + facetsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.Facet facets = 2; + */ + public com.google.cloud.retail.v2.SearchResponse.Facet.Builder getFacetsBuilder(int index) { + return getFacetsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.Facet facets = 2; + */ + public com.google.cloud.retail.v2.SearchResponse.FacetOrBuilder getFacetsOrBuilder(int index) { + if (facetsBuilder_ == null) { + return facets_.get(index); + } else { + return facetsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.Facet facets = 2; + */ + public java.util.List + getFacetsOrBuilderList() { + if (facetsBuilder_ != null) { + return facetsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(facets_); + } + } + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.Facet facets = 2; + */ + public com.google.cloud.retail.v2.SearchResponse.Facet.Builder addFacetsBuilder() { + return getFacetsFieldBuilder() + .addBuilder(com.google.cloud.retail.v2.SearchResponse.Facet.getDefaultInstance()); + } + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.Facet facets = 2; + */ + public com.google.cloud.retail.v2.SearchResponse.Facet.Builder addFacetsBuilder(int index) { + return getFacetsFieldBuilder() + .addBuilder(index, com.google.cloud.retail.v2.SearchResponse.Facet.getDefaultInstance()); + } + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.Facet facets = 2; + */ + public java.util.List + getFacetsBuilderList() { + return getFacetsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2.SearchResponse.Facet, + com.google.cloud.retail.v2.SearchResponse.Facet.Builder, + com.google.cloud.retail.v2.SearchResponse.FacetOrBuilder> + getFacetsFieldBuilder() { + if (facetsBuilder_ == null) { + facetsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2.SearchResponse.Facet, + com.google.cloud.retail.v2.SearchResponse.Facet.Builder, + com.google.cloud.retail.v2.SearchResponse.FacetOrBuilder>( + facets_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + facets_ = null; + } + return facetsBuilder_; + } + + private int totalSize_; + /** + * + * + *
+     * The estimated total count of matched items irrespective of pagination. The
+     * count of [results][google.cloud.retail.v2.SearchResponse.results] returned
+     * by pagination may be less than the
+     * [total_size][google.cloud.retail.v2.SearchResponse.total_size] that
+     * matches.
+     * 
+ * + * int32 total_size = 3; + * + * @return The totalSize. + */ + @java.lang.Override + public int getTotalSize() { + return totalSize_; + } + /** + * + * + *
+     * The estimated total count of matched items irrespective of pagination. The
+     * count of [results][google.cloud.retail.v2.SearchResponse.results] returned
+     * by pagination may be less than the
+     * [total_size][google.cloud.retail.v2.SearchResponse.total_size] that
+     * matches.
+     * 
+ * + * int32 total_size = 3; + * + * @param value The totalSize to set. + * @return This builder for chaining. + */ + public Builder setTotalSize(int value) { + + totalSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The estimated total count of matched items irrespective of pagination. The
+     * count of [results][google.cloud.retail.v2.SearchResponse.results] returned
+     * by pagination may be less than the
+     * [total_size][google.cloud.retail.v2.SearchResponse.total_size] that
+     * matches.
+     * 
+ * + * int32 total_size = 3; + * + * @return This builder for chaining. + */ + public Builder clearTotalSize() { + + totalSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object correctedQuery_ = ""; + /** + * + * + *
+     * If spell correction applies, the corrected query. Otherwise, empty.
+     * 
+ * + * string corrected_query = 4; + * + * @return The correctedQuery. + */ + public java.lang.String getCorrectedQuery() { + java.lang.Object ref = correctedQuery_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + correctedQuery_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * If spell correction applies, the corrected query. Otherwise, empty.
+     * 
+ * + * string corrected_query = 4; + * + * @return The bytes for correctedQuery. + */ + public com.google.protobuf.ByteString getCorrectedQueryBytes() { + java.lang.Object ref = correctedQuery_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + correctedQuery_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * If spell correction applies, the corrected query. Otherwise, empty.
+     * 
+ * + * string corrected_query = 4; + * + * @param value The correctedQuery to set. + * @return This builder for chaining. + */ + public Builder setCorrectedQuery(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + correctedQuery_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If spell correction applies, the corrected query. Otherwise, empty.
+     * 
+ * + * string corrected_query = 4; + * + * @return This builder for chaining. + */ + public Builder clearCorrectedQuery() { + + correctedQuery_ = getDefaultInstance().getCorrectedQuery(); + onChanged(); + return this; + } + /** + * + * + *
+     * If spell correction applies, the corrected query. Otherwise, empty.
+     * 
+ * + * string corrected_query = 4; + * + * @param value The bytes for correctedQuery to set. + * @return This builder for chaining. + */ + public Builder setCorrectedQueryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + correctedQuery_ = value; + onChanged(); + return this; + } + + private java.lang.Object attributionToken_ = ""; + /** + * + * + *
+     * A unique search token. This should be included in the
+     * [UserEvent][google.cloud.retail.v2.UserEvent] logs resulting from this
+     * search, which enables accurate attribution of search model performance.
+     * 
+ * + * string attribution_token = 5; + * + * @return The attributionToken. + */ + public java.lang.String getAttributionToken() { + java.lang.Object ref = attributionToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + attributionToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A unique search token. This should be included in the
+     * [UserEvent][google.cloud.retail.v2.UserEvent] logs resulting from this
+     * search, which enables accurate attribution of search model performance.
+     * 
+ * + * string attribution_token = 5; + * + * @return The bytes for attributionToken. + */ + public com.google.protobuf.ByteString getAttributionTokenBytes() { + java.lang.Object ref = attributionToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + attributionToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A unique search token. This should be included in the
+     * [UserEvent][google.cloud.retail.v2.UserEvent] logs resulting from this
+     * search, which enables accurate attribution of search model performance.
+     * 
+ * + * string attribution_token = 5; + * + * @param value The attributionToken to set. + * @return This builder for chaining. + */ + public Builder setAttributionToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + attributionToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A unique search token. This should be included in the
+     * [UserEvent][google.cloud.retail.v2.UserEvent] logs resulting from this
+     * search, which enables accurate attribution of search model performance.
+     * 
+ * + * string attribution_token = 5; + * + * @return This builder for chaining. + */ + public Builder clearAttributionToken() { + + attributionToken_ = getDefaultInstance().getAttributionToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A unique search token. This should be included in the
+     * [UserEvent][google.cloud.retail.v2.UserEvent] logs resulting from this
+     * search, which enables accurate attribution of search model performance.
+     * 
+ * + * string attribution_token = 5; + * + * @param value The bytes for attributionToken to set. + * @return This builder for chaining. + */ + public Builder setAttributionTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + attributionToken_ = value; + onChanged(); + return this; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token that can be sent as
+     * [SearchRequest.page_token][google.cloud.retail.v2.SearchRequest.page_token]
+     * to retrieve the next page. If this field is omitted, there are no
+     * subsequent pages.
+     * 
+ * + * string next_page_token = 6; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A token that can be sent as
+     * [SearchRequest.page_token][google.cloud.retail.v2.SearchRequest.page_token]
+     * to retrieve the next page. If this field is omitted, there are no
+     * subsequent pages.
+     * 
+ * + * string next_page_token = 6; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A token that can be sent as
+     * [SearchRequest.page_token][google.cloud.retail.v2.SearchRequest.page_token]
+     * to retrieve the next page. If this field is omitted, there are no
+     * subsequent pages.
+     * 
+ * + * string next_page_token = 6; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A token that can be sent as
+     * [SearchRequest.page_token][google.cloud.retail.v2.SearchRequest.page_token]
+     * to retrieve the next page. If this field is omitted, there are no
+     * subsequent pages.
+     * 
+ * + * string next_page_token = 6; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A token that can be sent as
+     * [SearchRequest.page_token][google.cloud.retail.v2.SearchRequest.page_token]
+     * to retrieve the next page. If this field is omitted, there are no
+     * subsequent pages.
+     * 
+ * + * string next_page_token = 6; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + private com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo queryExpansionInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo, + com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo.Builder, + com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfoOrBuilder> + queryExpansionInfoBuilder_; + /** + * + * + *
+     * Query expansion information for the returned results.
+     * 
+ * + * .google.cloud.retail.v2.SearchResponse.QueryExpansionInfo query_expansion_info = 7; + * + * + * @return Whether the queryExpansionInfo field is set. + */ + public boolean hasQueryExpansionInfo() { + return queryExpansionInfoBuilder_ != null || queryExpansionInfo_ != null; + } + /** + * + * + *
+     * Query expansion information for the returned results.
+     * 
+ * + * .google.cloud.retail.v2.SearchResponse.QueryExpansionInfo query_expansion_info = 7; + * + * + * @return The queryExpansionInfo. + */ + public com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo getQueryExpansionInfo() { + if (queryExpansionInfoBuilder_ == null) { + return queryExpansionInfo_ == null + ? com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo.getDefaultInstance() + : queryExpansionInfo_; + } else { + return queryExpansionInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Query expansion information for the returned results.
+     * 
+ * + * .google.cloud.retail.v2.SearchResponse.QueryExpansionInfo query_expansion_info = 7; + * + */ + public Builder setQueryExpansionInfo( + com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo value) { + if (queryExpansionInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + queryExpansionInfo_ = value; + onChanged(); + } else { + queryExpansionInfoBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Query expansion information for the returned results.
+     * 
+ * + * .google.cloud.retail.v2.SearchResponse.QueryExpansionInfo query_expansion_info = 7; + * + */ + public Builder setQueryExpansionInfo( + com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo.Builder builderForValue) { + if (queryExpansionInfoBuilder_ == null) { + queryExpansionInfo_ = builderForValue.build(); + onChanged(); + } else { + queryExpansionInfoBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Query expansion information for the returned results.
+     * 
+ * + * .google.cloud.retail.v2.SearchResponse.QueryExpansionInfo query_expansion_info = 7; + * + */ + public Builder mergeQueryExpansionInfo( + com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo value) { + if (queryExpansionInfoBuilder_ == null) { + if (queryExpansionInfo_ != null) { + queryExpansionInfo_ = + com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo.newBuilder( + queryExpansionInfo_) + .mergeFrom(value) + .buildPartial(); + } else { + queryExpansionInfo_ = value; + } + onChanged(); + } else { + queryExpansionInfoBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Query expansion information for the returned results.
+     * 
+ * + * .google.cloud.retail.v2.SearchResponse.QueryExpansionInfo query_expansion_info = 7; + * + */ + public Builder clearQueryExpansionInfo() { + if (queryExpansionInfoBuilder_ == null) { + queryExpansionInfo_ = null; + onChanged(); + } else { + queryExpansionInfo_ = null; + queryExpansionInfoBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Query expansion information for the returned results.
+     * 
+ * + * .google.cloud.retail.v2.SearchResponse.QueryExpansionInfo query_expansion_info = 7; + * + */ + public com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo.Builder + getQueryExpansionInfoBuilder() { + + onChanged(); + return getQueryExpansionInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Query expansion information for the returned results.
+     * 
+ * + * .google.cloud.retail.v2.SearchResponse.QueryExpansionInfo query_expansion_info = 7; + * + */ + public com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfoOrBuilder + getQueryExpansionInfoOrBuilder() { + if (queryExpansionInfoBuilder_ != null) { + return queryExpansionInfoBuilder_.getMessageOrBuilder(); + } else { + return queryExpansionInfo_ == null + ? com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo.getDefaultInstance() + : queryExpansionInfo_; + } + } + /** + * + * + *
+     * Query expansion information for the returned results.
+     * 
+ * + * .google.cloud.retail.v2.SearchResponse.QueryExpansionInfo query_expansion_info = 7; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo, + com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo.Builder, + com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfoOrBuilder> + getQueryExpansionInfoFieldBuilder() { + if (queryExpansionInfoBuilder_ == null) { + queryExpansionInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo, + com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo.Builder, + com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfoOrBuilder>( + getQueryExpansionInfo(), getParentForChildren(), isClean()); + queryExpansionInfo_ = null; + } + return queryExpansionInfoBuilder_; + } + + private java.lang.Object redirectUri_ = ""; + /** + * + * + *
+     * The URI of a customer-defined redirect page. If redirect action is
+     * triggered, no search will be performed, and only
+     * [redirect_uri][google.cloud.retail.v2.SearchResponse.redirect_uri] and
+     * [attribution_token][google.cloud.retail.v2.SearchResponse.attribution_token]
+     * will be set in the response.
+     * 
+ * + * string redirect_uri = 10; + * + * @return The redirectUri. + */ + public java.lang.String getRedirectUri() { + java.lang.Object ref = redirectUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + redirectUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The URI of a customer-defined redirect page. If redirect action is
+     * triggered, no search will be performed, and only
+     * [redirect_uri][google.cloud.retail.v2.SearchResponse.redirect_uri] and
+     * [attribution_token][google.cloud.retail.v2.SearchResponse.attribution_token]
+     * will be set in the response.
+     * 
+ * + * string redirect_uri = 10; + * + * @return The bytes for redirectUri. + */ + public com.google.protobuf.ByteString getRedirectUriBytes() { + java.lang.Object ref = redirectUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + redirectUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The URI of a customer-defined redirect page. If redirect action is
+     * triggered, no search will be performed, and only
+     * [redirect_uri][google.cloud.retail.v2.SearchResponse.redirect_uri] and
+     * [attribution_token][google.cloud.retail.v2.SearchResponse.attribution_token]
+     * will be set in the response.
+     * 
+ * + * string redirect_uri = 10; + * + * @param value The redirectUri to set. + * @return This builder for chaining. + */ + public Builder setRedirectUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + redirectUri_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The URI of a customer-defined redirect page. If redirect action is
+     * triggered, no search will be performed, and only
+     * [redirect_uri][google.cloud.retail.v2.SearchResponse.redirect_uri] and
+     * [attribution_token][google.cloud.retail.v2.SearchResponse.attribution_token]
+     * will be set in the response.
+     * 
+ * + * string redirect_uri = 10; + * + * @return This builder for chaining. + */ + public Builder clearRedirectUri() { + + redirectUri_ = getDefaultInstance().getRedirectUri(); + onChanged(); + return this; + } + /** + * + * + *
+     * The URI of a customer-defined redirect page. If redirect action is
+     * triggered, no search will be performed, and only
+     * [redirect_uri][google.cloud.retail.v2.SearchResponse.redirect_uri] and
+     * [attribution_token][google.cloud.retail.v2.SearchResponse.attribution_token]
+     * will be set in the response.
+     * 
+ * + * string redirect_uri = 10; + * + * @param value The bytes for redirectUri to set. + * @return This builder for chaining. + */ + public Builder setRedirectUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + redirectUri_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.SearchResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.SearchResponse) + private static final com.google.cloud.retail.v2.SearchResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2.SearchResponse(); + } + + public static com.google.cloud.retail.v2.SearchResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SearchResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SearchResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.retail.v2.SearchResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/SearchResponseOrBuilder.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/SearchResponseOrBuilder.java new file mode 100644 index 00000000..4ebff591 --- /dev/null +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/SearchResponseOrBuilder.java @@ -0,0 +1,303 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2/search_service.proto + +package com.google.cloud.retail.v2; + +public interface SearchResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2.SearchResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A list of matched items. The order represents the ranking.
+   * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.SearchResult results = 1; + */ + java.util.List getResultsList(); + /** + * + * + *
+   * A list of matched items. The order represents the ranking.
+   * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.SearchResult results = 1; + */ + com.google.cloud.retail.v2.SearchResponse.SearchResult getResults(int index); + /** + * + * + *
+   * A list of matched items. The order represents the ranking.
+   * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.SearchResult results = 1; + */ + int getResultsCount(); + /** + * + * + *
+   * A list of matched items. The order represents the ranking.
+   * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.SearchResult results = 1; + */ + java.util.List + getResultsOrBuilderList(); + /** + * + * + *
+   * A list of matched items. The order represents the ranking.
+   * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.SearchResult results = 1; + */ + com.google.cloud.retail.v2.SearchResponse.SearchResultOrBuilder getResultsOrBuilder(int index); + + /** + * + * + *
+   * Results of facets requested by user.
+   * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.Facet facets = 2; + */ + java.util.List getFacetsList(); + /** + * + * + *
+   * Results of facets requested by user.
+   * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.Facet facets = 2; + */ + com.google.cloud.retail.v2.SearchResponse.Facet getFacets(int index); + /** + * + * + *
+   * Results of facets requested by user.
+   * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.Facet facets = 2; + */ + int getFacetsCount(); + /** + * + * + *
+   * Results of facets requested by user.
+   * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.Facet facets = 2; + */ + java.util.List + getFacetsOrBuilderList(); + /** + * + * + *
+   * Results of facets requested by user.
+   * 
+ * + * repeated .google.cloud.retail.v2.SearchResponse.Facet facets = 2; + */ + com.google.cloud.retail.v2.SearchResponse.FacetOrBuilder getFacetsOrBuilder(int index); + + /** + * + * + *
+   * The estimated total count of matched items irrespective of pagination. The
+   * count of [results][google.cloud.retail.v2.SearchResponse.results] returned
+   * by pagination may be less than the
+   * [total_size][google.cloud.retail.v2.SearchResponse.total_size] that
+   * matches.
+   * 
+ * + * int32 total_size = 3; + * + * @return The totalSize. + */ + int getTotalSize(); + + /** + * + * + *
+   * If spell correction applies, the corrected query. Otherwise, empty.
+   * 
+ * + * string corrected_query = 4; + * + * @return The correctedQuery. + */ + java.lang.String getCorrectedQuery(); + /** + * + * + *
+   * If spell correction applies, the corrected query. Otherwise, empty.
+   * 
+ * + * string corrected_query = 4; + * + * @return The bytes for correctedQuery. + */ + com.google.protobuf.ByteString getCorrectedQueryBytes(); + + /** + * + * + *
+   * A unique search token. This should be included in the
+   * [UserEvent][google.cloud.retail.v2.UserEvent] logs resulting from this
+   * search, which enables accurate attribution of search model performance.
+   * 
+ * + * string attribution_token = 5; + * + * @return The attributionToken. + */ + java.lang.String getAttributionToken(); + /** + * + * + *
+   * A unique search token. This should be included in the
+   * [UserEvent][google.cloud.retail.v2.UserEvent] logs resulting from this
+   * search, which enables accurate attribution of search model performance.
+   * 
+ * + * string attribution_token = 5; + * + * @return The bytes for attributionToken. + */ + com.google.protobuf.ByteString getAttributionTokenBytes(); + + /** + * + * + *
+   * A token that can be sent as
+   * [SearchRequest.page_token][google.cloud.retail.v2.SearchRequest.page_token]
+   * to retrieve the next page. If this field is omitted, there are no
+   * subsequent pages.
+   * 
+ * + * string next_page_token = 6; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token that can be sent as
+   * [SearchRequest.page_token][google.cloud.retail.v2.SearchRequest.page_token]
+   * to retrieve the next page. If this field is omitted, there are no
+   * subsequent pages.
+   * 
+ * + * string next_page_token = 6; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * Query expansion information for the returned results.
+   * 
+ * + * .google.cloud.retail.v2.SearchResponse.QueryExpansionInfo query_expansion_info = 7; + * + * + * @return Whether the queryExpansionInfo field is set. + */ + boolean hasQueryExpansionInfo(); + /** + * + * + *
+   * Query expansion information for the returned results.
+   * 
+ * + * .google.cloud.retail.v2.SearchResponse.QueryExpansionInfo query_expansion_info = 7; + * + * + * @return The queryExpansionInfo. + */ + com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo getQueryExpansionInfo(); + /** + * + * + *
+   * Query expansion information for the returned results.
+   * 
+ * + * .google.cloud.retail.v2.SearchResponse.QueryExpansionInfo query_expansion_info = 7; + * + */ + com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfoOrBuilder + getQueryExpansionInfoOrBuilder(); + + /** + * + * + *
+   * The URI of a customer-defined redirect page. If redirect action is
+   * triggered, no search will be performed, and only
+   * [redirect_uri][google.cloud.retail.v2.SearchResponse.redirect_uri] and
+   * [attribution_token][google.cloud.retail.v2.SearchResponse.attribution_token]
+   * will be set in the response.
+   * 
+ * + * string redirect_uri = 10; + * + * @return The redirectUri. + */ + java.lang.String getRedirectUri(); + /** + * + * + *
+   * The URI of a customer-defined redirect page. If redirect action is
+   * triggered, no search will be performed, and only
+   * [redirect_uri][google.cloud.retail.v2.SearchResponse.redirect_uri] and
+   * [attribution_token][google.cloud.retail.v2.SearchResponse.attribution_token]
+   * will be set in the response.
+   * 
+ * + * string redirect_uri = 10; + * + * @return The bytes for redirectUri. + */ + com.google.protobuf.ByteString getRedirectUriBytes(); +} diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/SearchServiceProto.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/SearchServiceProto.java new file mode 100644 index 00000000..a50b5b12 --- /dev/null +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/SearchServiceProto.java @@ -0,0 +1,371 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2/search_service.proto + +package com.google.cloud.retail.v2; + +public final class SearchServiceProto { + private SearchServiceProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2_SearchRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2_SearchRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2_SearchRequest_FacetSpec_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2_SearchRequest_FacetSpec_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2_SearchRequest_FacetSpec_FacetKey_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2_SearchRequest_FacetSpec_FacetKey_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2_SearchRequest_DynamicFacetSpec_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2_SearchRequest_DynamicFacetSpec_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2_SearchRequest_BoostSpec_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2_SearchRequest_BoostSpec_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2_SearchRequest_BoostSpec_ConditionBoostSpec_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2_SearchRequest_BoostSpec_ConditionBoostSpec_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2_SearchRequest_QueryExpansionSpec_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2_SearchRequest_QueryExpansionSpec_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2_SearchResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2_SearchResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2_SearchResponse_SearchResult_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2_SearchResponse_SearchResult_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2_SearchResponse_SearchResult_MatchingVariantFieldsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2_SearchResponse_SearchResult_MatchingVariantFieldsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2_SearchResponse_SearchResult_VariantRollupValuesEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2_SearchResponse_SearchResult_VariantRollupValuesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2_SearchResponse_Facet_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2_SearchResponse_Facet_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2_SearchResponse_Facet_FacetValue_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2_SearchResponse_Facet_FacetValue_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2_SearchResponse_QueryExpansionInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2_SearchResponse_QueryExpansionInfo_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n+google/cloud/retail/v2/search_service." + + "proto\022\026google.cloud.retail.v2\032\034google/ap" + + "i/annotations.proto\032\027google/api/client.p" + + "roto\032\037google/api/field_behavior.proto\032\031g" + + "oogle/api/resource.proto\032#google/cloud/r" + + "etail/v2/common.proto\032$google/cloud/reta" + + "il/v2/product.proto\032 google/protobuf/fie" + + "ld_mask.proto\032\034google/protobuf/struct.pr" + + "oto\032\037google/protobuf/timestamp.proto\032\036go" + + "ogle/protobuf/wrappers.proto\"\351\013\n\rSearchR" + + "equest\022\026\n\tplacement\030\001 \001(\tB\003\340A\002\0221\n\006branch" + + "\030\002 \001(\tB!\372A\036\n\034retail.googleapis.com/Branc" + + "h\022\r\n\005query\030\003 \001(\t\022\027\n\nvisitor_id\030\004 \001(\tB\003\340A" + + "\002\0223\n\tuser_info\030\005 \001(\0132 .google.cloud.reta" + + "il.v2.UserInfo\022\021\n\tpage_size\030\007 \001(\005\022\022\n\npag" + + "e_token\030\010 \001(\t\022\016\n\006offset\030\t \001(\005\022\016\n\006filter\030" + + "\n \001(\t\022\030\n\020canonical_filter\030\034 \001(\t\022\020\n\010order" + + "_by\030\013 \001(\t\022D\n\013facet_specs\030\014 \003(\0132/.google." + + "cloud.retail.v2.SearchRequest.FacetSpec\022" + + "R\n\022dynamic_facet_spec\030\025 \001(\01326.google.clo" + + "ud.retail.v2.SearchRequest.DynamicFacetS" + + "pec\022C\n\nboost_spec\030\r \001(\0132/.google.cloud.r" + + "etail.v2.SearchRequest.BoostSpec\022V\n\024quer" + + "y_expansion_spec\030\016 \001(\01328.google.cloud.re" + + "tail.v2.SearchRequest.QueryExpansionSpec" + + "\022\033\n\023variant_rollup_keys\030\021 \003(\t\022\027\n\017page_ca" + + "tegories\030\027 \003(\t\032\337\002\n\tFacetSpec\022P\n\tfacet_ke" + + "y\030\001 \001(\01328.google.cloud.retail.v2.SearchR" + + "equest.FacetSpec.FacetKeyB\003\340A\002\022\r\n\005limit\030" + + "\002 \001(\005\022\034\n\024excluded_filter_keys\030\003 \003(\t\022\037\n\027e" + + "nable_dynamic_position\030\004 \001(\010\032\261\001\n\010FacetKe" + + "y\022\020\n\003key\030\001 \001(\tB\003\340A\002\0223\n\tintervals\030\002 \003(\0132 " + + ".google.cloud.retail.v2.Interval\022\031\n\021rest" + + "ricted_values\030\003 \003(\t\022\020\n\010prefixes\030\010 \003(\t\022\020\n" + + "\010contains\030\t \003(\t\022\020\n\010order_by\030\004 \001(\t\022\r\n\005que" + + "ry\030\005 \001(\t\032\226\001\n\020DynamicFacetSpec\022I\n\004mode\030\001 " + + "\001(\0162;.google.cloud.retail.v2.SearchReque" + + "st.DynamicFacetSpec.Mode\"7\n\004Mode\022\024\n\020MODE" + + "_UNSPECIFIED\020\000\022\014\n\010DISABLED\020\001\022\013\n\007ENABLED\020" + + "\002\032\246\001\n\tBoostSpec\022a\n\025condition_boost_specs" + + "\030\001 \003(\0132B.google.cloud.retail.v2.SearchRe" + + "quest.BoostSpec.ConditionBoostSpec\0326\n\022Co" + + "nditionBoostSpec\022\021\n\tcondition\030\001 \001(\t\022\r\n\005b" + + "oost\030\002 \001(\002\032\253\001\n\022QueryExpansionSpec\022U\n\tcon" + + "dition\030\001 \001(\0162B.google.cloud.retail.v2.Se" + + "archRequest.QueryExpansionSpec.Condition" + + "\">\n\tCondition\022\031\n\025CONDITION_UNSPECIFIED\020\000" + + "\022\014\n\010DISABLED\020\001\022\010\n\004AUTO\020\003\"\367\010\n\016SearchRespo" + + "nse\022D\n\007results\030\001 \003(\01323.google.cloud.reta" + + "il.v2.SearchResponse.SearchResult\022<\n\006fac" + + "ets\030\002 \003(\0132,.google.cloud.retail.v2.Searc" + + "hResponse.Facet\022\022\n\ntotal_size\030\003 \001(\005\022\027\n\017c" + + "orrected_query\030\004 \001(\t\022\031\n\021attribution_toke" + + "n\030\005 \001(\t\022\027\n\017next_page_token\030\006 \001(\t\022W\n\024quer" + + "y_expansion_info\030\007 \001(\01329.google.cloud.re" + + "tail.v2.SearchResponse.QueryExpansionInf" + + "o\022\024\n\014redirect_uri\030\n \001(\t\032\370\003\n\014SearchResult" + + "\022\n\n\002id\030\001 \001(\t\0220\n\007product\030\002 \001(\0132\037.google.c" + + "loud.retail.v2.Product\022\036\n\026matching_varia" + + "nt_count\030\003 \001(\005\022o\n\027matching_variant_field" + + "s\030\004 \003(\0132N.google.cloud.retail.v2.SearchR" + + "esponse.SearchResult.MatchingVariantFiel" + + "dsEntry\022k\n\025variant_rollup_values\030\005 \003(\0132L" + + ".google.cloud.retail.v2.SearchResponse.S" + + "earchResult.VariantRollupValuesEntry\032X\n\032" + + "MatchingVariantFieldsEntry\022\013\n\003key\030\001 \001(\t\022" + + ")\n\005value\030\002 \001(\0132\032.google.protobuf.FieldMa" + + "sk:\0028\001\032R\n\030VariantRollupValuesEntry\022\013\n\003ke" + + "y\030\001 \001(\t\022%\n\005value\030\002 \001(\0132\026.google.protobuf" + + ".Value:\0028\001\032\347\001\n\005Facet\022\013\n\003key\030\001 \001(\t\022G\n\006val" + + "ues\030\002 \003(\01327.google.cloud.retail.v2.Searc" + + "hResponse.Facet.FacetValue\022\025\n\rdynamic_fa" + + "cet\030\003 \001(\010\032q\n\nFacetValue\022\017\n\005value\030\001 \001(\tH\000" + + "\0224\n\010interval\030\002 \001(\0132 .google.cloud.retail" + + ".v2.IntervalH\000\022\r\n\005count\030\003 \001(\003B\r\n\013facet_v" + + "alue\032,\n\022QueryExpansionInfo\022\026\n\016expanded_q" + + "uery\030\001 \001(\0102\206\002\n\rSearchService\022\251\001\n\006Search\022" + + "%.google.cloud.retail.v2.SearchRequest\032&" + + ".google.cloud.retail.v2.SearchResponse\"P" + + "\202\323\344\223\002J\"E/v2/{placement=projects/*/locati" + + "ons/*/catalogs/*/placements/*}:search:\001*" + + "\032I\312A\025retail.googleapis.com\322A.https://www" + + ".googleapis.com/auth/cloud-platformB\307\001\n\032" + + "com.google.cloud.retail.v2B\022SearchServic" + + "eProtoP\001Z + * Request message to set a specified branch as new default_branch. + *
+ * + * Protobuf type {@code google.cloud.retail.v2.SetDefaultBranchRequest} + */ +public final class SetDefaultBranchRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.SetDefaultBranchRequest) + SetDefaultBranchRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use SetDefaultBranchRequest.newBuilder() to construct. + private SetDefaultBranchRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SetDefaultBranchRequest() { + catalog_ = ""; + branchId_ = ""; + note_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SetDefaultBranchRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SetDefaultBranchRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + catalog_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + branchId_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + note_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.CatalogServiceProto + .internal_static_google_cloud_retail_v2_SetDefaultBranchRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.CatalogServiceProto + .internal_static_google_cloud_retail_v2_SetDefaultBranchRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.SetDefaultBranchRequest.class, + com.google.cloud.retail.v2.SetDefaultBranchRequest.Builder.class); + } + + public static final int CATALOG_FIELD_NUMBER = 1; + private volatile java.lang.Object catalog_; + /** + * + * + *
+   * Full resource name of the catalog, such as
+   * `projects/*/locations/global/catalogs/default_catalog`.
+   * 
+ * + * string catalog = 1 [(.google.api.resource_reference) = { ... } + * + * @return The catalog. + */ + @java.lang.Override + public java.lang.String getCatalog() { + java.lang.Object ref = catalog_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + catalog_ = s; + return s; + } + } + /** + * + * + *
+   * Full resource name of the catalog, such as
+   * `projects/*/locations/global/catalogs/default_catalog`.
+   * 
+ * + * string catalog = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for catalog. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCatalogBytes() { + java.lang.Object ref = catalog_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + catalog_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BRANCH_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object 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.
+   * 
+ * + * string branch_id = 2 [(.google.api.resource_reference) = { ... } + * + * @return The branchId. + */ + @java.lang.Override + public java.lang.String getBranchId() { + java.lang.Object ref = branchId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + branchId_ = s; + return s; + } + } + /** + * + * + *
+   * 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.
+   * 
+ * + * string branch_id = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for branchId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBranchIdBytes() { + java.lang.Object ref = branchId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + branchId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NOTE_FIELD_NUMBER = 3; + private volatile java.lang.Object note_; + /** + * + * + *
+   * Some note on this request, this can be retrieved by
+   * [CatalogService.GetDefaultBranch][google.cloud.retail.v2.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.
+   * 
+ * + * string note = 3; + * + * @return The note. + */ + @java.lang.Override + public java.lang.String getNote() { + java.lang.Object ref = note_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + note_ = s; + return s; + } + } + /** + * + * + *
+   * Some note on this request, this can be retrieved by
+   * [CatalogService.GetDefaultBranch][google.cloud.retail.v2.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.
+   * 
+ * + * string note = 3; + * + * @return The bytes for note. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNoteBytes() { + java.lang.Object ref = note_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + note_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getCatalogBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, catalog_); + } + if (!getBranchIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, branchId_); + } + if (!getNoteBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, note_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getCatalogBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, catalog_); + } + if (!getBranchIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, branchId_); + } + if (!getNoteBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, note_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.retail.v2.SetDefaultBranchRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2.SetDefaultBranchRequest other = + (com.google.cloud.retail.v2.SetDefaultBranchRequest) obj; + + if (!getCatalog().equals(other.getCatalog())) return false; + if (!getBranchId().equals(other.getBranchId())) return false; + if (!getNote().equals(other.getNote())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CATALOG_FIELD_NUMBER; + hash = (53 * hash) + getCatalog().hashCode(); + hash = (37 * hash) + BRANCH_ID_FIELD_NUMBER; + hash = (53 * hash) + getBranchId().hashCode(); + hash = (37 * hash) + NOTE_FIELD_NUMBER; + hash = (53 * hash) + getNote().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2.SetDefaultBranchRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.SetDefaultBranchRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SetDefaultBranchRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.SetDefaultBranchRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SetDefaultBranchRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.SetDefaultBranchRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SetDefaultBranchRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.SetDefaultBranchRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SetDefaultBranchRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.SetDefaultBranchRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SetDefaultBranchRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.SetDefaultBranchRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2.SetDefaultBranchRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message to set a specified branch as new default_branch.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2.SetDefaultBranchRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.SetDefaultBranchRequest) + com.google.cloud.retail.v2.SetDefaultBranchRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.CatalogServiceProto + .internal_static_google_cloud_retail_v2_SetDefaultBranchRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.CatalogServiceProto + .internal_static_google_cloud_retail_v2_SetDefaultBranchRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.SetDefaultBranchRequest.class, + com.google.cloud.retail.v2.SetDefaultBranchRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2.SetDefaultBranchRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + catalog_ = ""; + + branchId_ = ""; + + note_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2.CatalogServiceProto + .internal_static_google_cloud_retail_v2_SetDefaultBranchRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2.SetDefaultBranchRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2.SetDefaultBranchRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2.SetDefaultBranchRequest build() { + com.google.cloud.retail.v2.SetDefaultBranchRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2.SetDefaultBranchRequest buildPartial() { + com.google.cloud.retail.v2.SetDefaultBranchRequest result = + new com.google.cloud.retail.v2.SetDefaultBranchRequest(this); + result.catalog_ = catalog_; + result.branchId_ = branchId_; + result.note_ = note_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.retail.v2.SetDefaultBranchRequest) { + return mergeFrom((com.google.cloud.retail.v2.SetDefaultBranchRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2.SetDefaultBranchRequest other) { + if (other == com.google.cloud.retail.v2.SetDefaultBranchRequest.getDefaultInstance()) + return this; + if (!other.getCatalog().isEmpty()) { + catalog_ = other.catalog_; + onChanged(); + } + if (!other.getBranchId().isEmpty()) { + branchId_ = other.branchId_; + onChanged(); + } + if (!other.getNote().isEmpty()) { + note_ = other.note_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.retail.v2.SetDefaultBranchRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2.SetDefaultBranchRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object catalog_ = ""; + /** + * + * + *
+     * Full resource name of the catalog, such as
+     * `projects/*/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string catalog = 1 [(.google.api.resource_reference) = { ... } + * + * @return The catalog. + */ + public java.lang.String getCatalog() { + java.lang.Object ref = catalog_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + catalog_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Full resource name of the catalog, such as
+     * `projects/*/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string catalog = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for catalog. + */ + public com.google.protobuf.ByteString getCatalogBytes() { + java.lang.Object ref = catalog_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + catalog_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Full resource name of the catalog, such as
+     * `projects/*/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string catalog = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The catalog to set. + * @return This builder for chaining. + */ + public Builder setCatalog(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + catalog_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Full resource name of the catalog, such as
+     * `projects/*/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string catalog = 1 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearCatalog() { + + catalog_ = getDefaultInstance().getCatalog(); + onChanged(); + return this; + } + /** + * + * + *
+     * Full resource name of the catalog, such as
+     * `projects/*/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string catalog = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for catalog to set. + * @return This builder for chaining. + */ + public Builder setCatalogBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + catalog_ = value; + onChanged(); + return this; + } + + private java.lang.Object 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.
+     * 
+ * + * string branch_id = 2 [(.google.api.resource_reference) = { ... } + * + * @return The branchId. + */ + public java.lang.String getBranchId() { + java.lang.Object ref = branchId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + branchId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * string branch_id = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for branchId. + */ + public com.google.protobuf.ByteString getBranchIdBytes() { + java.lang.Object ref = branchId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + branchId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * string branch_id = 2 [(.google.api.resource_reference) = { ... } + * + * @param value The branchId to set. + * @return This builder for chaining. + */ + public Builder setBranchId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + branchId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * string branch_id = 2 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearBranchId() { + + branchId_ = getDefaultInstance().getBranchId(); + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * string branch_id = 2 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for branchId to set. + * @return This builder for chaining. + */ + public Builder setBranchIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + branchId_ = value; + onChanged(); + return this; + } + + private java.lang.Object note_ = ""; + /** + * + * + *
+     * Some note on this request, this can be retrieved by
+     * [CatalogService.GetDefaultBranch][google.cloud.retail.v2.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.
+     * 
+ * + * string note = 3; + * + * @return The note. + */ + public java.lang.String getNote() { + java.lang.Object ref = note_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + note_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Some note on this request, this can be retrieved by
+     * [CatalogService.GetDefaultBranch][google.cloud.retail.v2.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.
+     * 
+ * + * string note = 3; + * + * @return The bytes for note. + */ + public com.google.protobuf.ByteString getNoteBytes() { + java.lang.Object ref = note_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + note_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Some note on this request, this can be retrieved by
+     * [CatalogService.GetDefaultBranch][google.cloud.retail.v2.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.
+     * 
+ * + * string note = 3; + * + * @param value The note to set. + * @return This builder for chaining. + */ + public Builder setNote(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + note_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Some note on this request, this can be retrieved by
+     * [CatalogService.GetDefaultBranch][google.cloud.retail.v2.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.
+     * 
+ * + * string note = 3; + * + * @return This builder for chaining. + */ + public Builder clearNote() { + + note_ = getDefaultInstance().getNote(); + onChanged(); + return this; + } + /** + * + * + *
+     * Some note on this request, this can be retrieved by
+     * [CatalogService.GetDefaultBranch][google.cloud.retail.v2.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.
+     * 
+ * + * string note = 3; + * + * @param value The bytes for note to set. + * @return This builder for chaining. + */ + public Builder setNoteBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + note_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.SetDefaultBranchRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.SetDefaultBranchRequest) + private static final com.google.cloud.retail.v2.SetDefaultBranchRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2.SetDefaultBranchRequest(); + } + + public static com.google.cloud.retail.v2.SetDefaultBranchRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SetDefaultBranchRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SetDefaultBranchRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.retail.v2.SetDefaultBranchRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/SetDefaultBranchRequestOrBuilder.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/SetDefaultBranchRequestOrBuilder.java new file mode 100644 index 00000000..20d0926a --- /dev/null +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/SetDefaultBranchRequestOrBuilder.java @@ -0,0 +1,114 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2/catalog_service.proto + +package com.google.cloud.retail.v2; + +public interface SetDefaultBranchRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2.SetDefaultBranchRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Full resource name of the catalog, such as
+   * `projects/*/locations/global/catalogs/default_catalog`.
+   * 
+ * + * string catalog = 1 [(.google.api.resource_reference) = { ... } + * + * @return The catalog. + */ + java.lang.String getCatalog(); + /** + * + * + *
+   * Full resource name of the catalog, such as
+   * `projects/*/locations/global/catalogs/default_catalog`.
+   * 
+ * + * string catalog = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for catalog. + */ + com.google.protobuf.ByteString getCatalogBytes(); + + /** + * + * + *
+   * 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.
+   * 
+ * + * string branch_id = 2 [(.google.api.resource_reference) = { ... } + * + * @return The branchId. + */ + java.lang.String getBranchId(); + /** + * + * + *
+   * 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.
+   * 
+ * + * string branch_id = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for branchId. + */ + com.google.protobuf.ByteString getBranchIdBytes(); + + /** + * + * + *
+   * Some note on this request, this can be retrieved by
+   * [CatalogService.GetDefaultBranch][google.cloud.retail.v2.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.
+   * 
+ * + * string note = 3; + * + * @return The note. + */ + java.lang.String getNote(); + /** + * + * + *
+   * Some note on this request, this can be retrieved by
+   * [CatalogService.GetDefaultBranch][google.cloud.retail.v2.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.
+   * 
+ * + * string note = 3; + * + * @return The bytes for note. + */ + com.google.protobuf.ByteString getNoteBytes(); +} diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/SetInventoryMetadata.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/SetInventoryMetadata.java new file mode 100644 index 00000000..bd8e0b3d --- /dev/null +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/SetInventoryMetadata.java @@ -0,0 +1,459 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2/product_service.proto + +package com.google.cloud.retail.v2; + +/** + * + * + *
+ * Metadata related to the progress of the SetInventory operation.
+ * Currently empty because there is no meaningful metadata populated from the
+ * [SetInventory][] method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2.SetInventoryMetadata} + */ +public final class SetInventoryMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.SetInventoryMetadata) + SetInventoryMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use SetInventoryMetadata.newBuilder() to construct. + private SetInventoryMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SetInventoryMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SetInventoryMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SetInventoryMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.ProductServiceProto + .internal_static_google_cloud_retail_v2_SetInventoryMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.ProductServiceProto + .internal_static_google_cloud_retail_v2_SetInventoryMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.SetInventoryMetadata.class, + com.google.cloud.retail.v2.SetInventoryMetadata.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.retail.v2.SetInventoryMetadata)) { + return super.equals(obj); + } + com.google.cloud.retail.v2.SetInventoryMetadata other = + (com.google.cloud.retail.v2.SetInventoryMetadata) obj; + + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2.SetInventoryMetadata parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.SetInventoryMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SetInventoryMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.SetInventoryMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SetInventoryMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.SetInventoryMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SetInventoryMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.SetInventoryMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SetInventoryMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.SetInventoryMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SetInventoryMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.SetInventoryMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2.SetInventoryMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Metadata related to the progress of the SetInventory operation.
+   * Currently empty because there is no meaningful metadata populated from the
+   * [SetInventory][] method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2.SetInventoryMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.SetInventoryMetadata) + com.google.cloud.retail.v2.SetInventoryMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.ProductServiceProto + .internal_static_google_cloud_retail_v2_SetInventoryMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.ProductServiceProto + .internal_static_google_cloud_retail_v2_SetInventoryMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.SetInventoryMetadata.class, + com.google.cloud.retail.v2.SetInventoryMetadata.Builder.class); + } + + // Construct using com.google.cloud.retail.v2.SetInventoryMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2.ProductServiceProto + .internal_static_google_cloud_retail_v2_SetInventoryMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2.SetInventoryMetadata getDefaultInstanceForType() { + return com.google.cloud.retail.v2.SetInventoryMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2.SetInventoryMetadata build() { + com.google.cloud.retail.v2.SetInventoryMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2.SetInventoryMetadata buildPartial() { + com.google.cloud.retail.v2.SetInventoryMetadata result = + new com.google.cloud.retail.v2.SetInventoryMetadata(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.retail.v2.SetInventoryMetadata) { + return mergeFrom((com.google.cloud.retail.v2.SetInventoryMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2.SetInventoryMetadata other) { + if (other == com.google.cloud.retail.v2.SetInventoryMetadata.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.retail.v2.SetInventoryMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2.SetInventoryMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.SetInventoryMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.SetInventoryMetadata) + private static final com.google.cloud.retail.v2.SetInventoryMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2.SetInventoryMetadata(); + } + + public static com.google.cloud.retail.v2.SetInventoryMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SetInventoryMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SetInventoryMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.retail.v2.SetInventoryMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/SetInventoryMetadataOrBuilder.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/SetInventoryMetadataOrBuilder.java new file mode 100644 index 00000000..cf57d85a --- /dev/null +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/SetInventoryMetadataOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2/product_service.proto + +package com.google.cloud.retail.v2; + +public interface SetInventoryMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2.SetInventoryMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/SetInventoryRequest.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/SetInventoryRequest.java new file mode 100644 index 00000000..0ac9fc0b --- /dev/null +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/SetInventoryRequest.java @@ -0,0 +1,1805 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2/product_service.proto + +package com.google.cloud.retail.v2; + +/** + * + * + *
+ * Request message for [SetInventory][] method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2.SetInventoryRequest} + */ +public final class SetInventoryRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.SetInventoryRequest) + SetInventoryRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use SetInventoryRequest.newBuilder() to construct. + private SetInventoryRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SetInventoryRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SetInventoryRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SetInventoryRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.retail.v2.Product.Builder subBuilder = null; + if (inventory_ != null) { + subBuilder = inventory_.toBuilder(); + } + inventory_ = + input.readMessage(com.google.cloud.retail.v2.Product.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(inventory_); + inventory_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (setMask_ != null) { + subBuilder = setMask_.toBuilder(); + } + setMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(setMask_); + setMask_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (setTime_ != null) { + subBuilder = setTime_.toBuilder(); + } + setTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(setTime_); + setTime_ = subBuilder.buildPartial(); + } + + break; + } + case 32: + { + allowMissing_ = input.readBool(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.ProductServiceProto + .internal_static_google_cloud_retail_v2_SetInventoryRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.ProductServiceProto + .internal_static_google_cloud_retail_v2_SetInventoryRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.SetInventoryRequest.class, + com.google.cloud.retail.v2.SetInventoryRequest.Builder.class); + } + + public static final int INVENTORY_FIELD_NUMBER = 1; + private com.google.cloud.retail.v2.Product inventory_; + /** + * + * + *
+   * Required. The inventory information to update. The allowable fields to
+   * update are:
+   * * [Product.price_info][google.cloud.retail.v2.Product.price_info]
+   * * [Product.availability][google.cloud.retail.v2.Product.availability]
+   * * [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity]
+   * * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info]
+   * The updated inventory fields must be specified in
+   * [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask].
+   * If [SetInventoryRequest.inventory.name][] is empty or invalid, an
+   * INVALID_ARGUMENT error is returned.
+   * If the caller does not have permission to update the
+   * [Product][google.cloud.retail.v2.Product] named in
+   * [Product.name][google.cloud.retail.v2.Product.name], regardless of whether
+   * or not it exists, a PERMISSION_DENIED error is returned.
+   * If the [Product][google.cloud.retail.v2.Product] to update does not have
+   * existing inventory information, the provided inventory information will be
+   * inserted.
+   * If the [Product][google.cloud.retail.v2.Product] to update has existing
+   * inventory information, the provided inventory information will be merged
+   * 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 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]
+   * * [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity]
+   * * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info]
+   * If a full overwrite of inventory information while ignoring timestamps is
+   * needed, [UpdateProduct][] should be invoked instead.
+   * 
+ * + * .google.cloud.retail.v2.Product inventory = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the inventory field is set. + */ + @java.lang.Override + public boolean hasInventory() { + return inventory_ != null; + } + /** + * + * + *
+   * Required. The inventory information to update. The allowable fields to
+   * update are:
+   * * [Product.price_info][google.cloud.retail.v2.Product.price_info]
+   * * [Product.availability][google.cloud.retail.v2.Product.availability]
+   * * [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity]
+   * * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info]
+   * The updated inventory fields must be specified in
+   * [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask].
+   * If [SetInventoryRequest.inventory.name][] is empty or invalid, an
+   * INVALID_ARGUMENT error is returned.
+   * If the caller does not have permission to update the
+   * [Product][google.cloud.retail.v2.Product] named in
+   * [Product.name][google.cloud.retail.v2.Product.name], regardless of whether
+   * or not it exists, a PERMISSION_DENIED error is returned.
+   * If the [Product][google.cloud.retail.v2.Product] to update does not have
+   * existing inventory information, the provided inventory information will be
+   * inserted.
+   * If the [Product][google.cloud.retail.v2.Product] to update has existing
+   * inventory information, the provided inventory information will be merged
+   * 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 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]
+   * * [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity]
+   * * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info]
+   * If a full overwrite of inventory information while ignoring timestamps is
+   * needed, [UpdateProduct][] should be invoked instead.
+   * 
+ * + * .google.cloud.retail.v2.Product inventory = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The inventory. + */ + @java.lang.Override + public com.google.cloud.retail.v2.Product getInventory() { + return inventory_ == null + ? com.google.cloud.retail.v2.Product.getDefaultInstance() + : inventory_; + } + /** + * + * + *
+   * Required. The inventory information to update. The allowable fields to
+   * update are:
+   * * [Product.price_info][google.cloud.retail.v2.Product.price_info]
+   * * [Product.availability][google.cloud.retail.v2.Product.availability]
+   * * [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity]
+   * * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info]
+   * The updated inventory fields must be specified in
+   * [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask].
+   * If [SetInventoryRequest.inventory.name][] is empty or invalid, an
+   * INVALID_ARGUMENT error is returned.
+   * If the caller does not have permission to update the
+   * [Product][google.cloud.retail.v2.Product] named in
+   * [Product.name][google.cloud.retail.v2.Product.name], regardless of whether
+   * or not it exists, a PERMISSION_DENIED error is returned.
+   * If the [Product][google.cloud.retail.v2.Product] to update does not have
+   * existing inventory information, the provided inventory information will be
+   * inserted.
+   * If the [Product][google.cloud.retail.v2.Product] to update has existing
+   * inventory information, the provided inventory information will be merged
+   * 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 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]
+   * * [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity]
+   * * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info]
+   * If a full overwrite of inventory information while ignoring timestamps is
+   * needed, [UpdateProduct][] should be invoked instead.
+   * 
+ * + * .google.cloud.retail.v2.Product inventory = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2.ProductOrBuilder getInventoryOrBuilder() { + return getInventory(); + } + + public static final int SET_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask setMask_; + /** + * + * + *
+   * 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.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned and the entire update will be ignored.
+   * 
+ * + * .google.protobuf.FieldMask set_mask = 2; + * + * @return Whether the setMask field is set. + */ + @java.lang.Override + public boolean hasSetMask() { + return setMask_ != null; + } + /** + * + * + *
+   * 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.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned and the entire update will be ignored.
+   * 
+ * + * .google.protobuf.FieldMask set_mask = 2; + * + * @return The setMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getSetMask() { + return setMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : setMask_; + } + /** + * + * + *
+   * 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.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned and the entire update will be ignored.
+   * 
+ * + * .google.protobuf.FieldMask set_mask = 2; + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getSetMaskOrBuilder() { + return getSetMask(); + } + + public static final int SET_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp setTime_; + /** + * + * + *
+   * The time when the request is issued, used to prevent
+   * out-of-order updates on inventory fields with the last update time
+   * recorded. If not provided, the internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp set_time = 3; + * + * @return Whether the setTime field is set. + */ + @java.lang.Override + public boolean hasSetTime() { + return setTime_ != null; + } + /** + * + * + *
+   * The time when the request is issued, used to prevent
+   * out-of-order updates on inventory fields with the last update time
+   * recorded. If not provided, the internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp set_time = 3; + * + * @return The setTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getSetTime() { + return setTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : setTime_; + } + /** + * + * + *
+   * The time when the request is issued, used to prevent
+   * out-of-order updates on inventory fields with the last update time
+   * recorded. If not provided, the internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp set_time = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getSetTimeOrBuilder() { + return getSetTime(); + } + + public static final int ALLOW_MISSING_FIELD_NUMBER = 4; + private boolean allowMissing_; + /** + * + * + *
+   * If set to true, and the [Product][google.cloud.retail.v2.Product] with name
+   * [Product.name][google.cloud.retail.v2.Product.name] is not found, the
+   * inventory update will still be processed and retained for at most 1 day
+   * until the [Product][google.cloud.retail.v2.Product] is created. If set to
+   * false, an INVALID_ARGUMENT error is returned if the
+   * [Product][google.cloud.retail.v2.Product] is not found.
+   * 
+ * + * bool allow_missing = 4; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (inventory_ != null) { + output.writeMessage(1, getInventory()); + } + if (setMask_ != null) { + output.writeMessage(2, getSetMask()); + } + if (setTime_ != null) { + output.writeMessage(3, getSetTime()); + } + if (allowMissing_ != false) { + output.writeBool(4, allowMissing_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (inventory_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getInventory()); + } + if (setMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getSetMask()); + } + if (setTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getSetTime()); + } + if (allowMissing_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, allowMissing_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.retail.v2.SetInventoryRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2.SetInventoryRequest other = + (com.google.cloud.retail.v2.SetInventoryRequest) obj; + + if (hasInventory() != other.hasInventory()) return false; + if (hasInventory()) { + if (!getInventory().equals(other.getInventory())) return false; + } + if (hasSetMask() != other.hasSetMask()) return false; + if (hasSetMask()) { + if (!getSetMask().equals(other.getSetMask())) return false; + } + if (hasSetTime() != other.hasSetTime()) return false; + if (hasSetTime()) { + if (!getSetTime().equals(other.getSetTime())) return false; + } + if (getAllowMissing() != other.getAllowMissing()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasInventory()) { + hash = (37 * hash) + INVENTORY_FIELD_NUMBER; + hash = (53 * hash) + getInventory().hashCode(); + } + if (hasSetMask()) { + hash = (37 * hash) + SET_MASK_FIELD_NUMBER; + hash = (53 * hash) + getSetMask().hashCode(); + } + if (hasSetTime()) { + hash = (37 * hash) + SET_TIME_FIELD_NUMBER; + hash = (53 * hash) + getSetTime().hashCode(); + } + hash = (37 * hash) + ALLOW_MISSING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowMissing()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2.SetInventoryRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.SetInventoryRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SetInventoryRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.SetInventoryRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SetInventoryRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.SetInventoryRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SetInventoryRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.SetInventoryRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SetInventoryRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.SetInventoryRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SetInventoryRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.SetInventoryRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2.SetInventoryRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for [SetInventory][] method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2.SetInventoryRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.SetInventoryRequest) + com.google.cloud.retail.v2.SetInventoryRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.ProductServiceProto + .internal_static_google_cloud_retail_v2_SetInventoryRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.ProductServiceProto + .internal_static_google_cloud_retail_v2_SetInventoryRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.SetInventoryRequest.class, + com.google.cloud.retail.v2.SetInventoryRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2.SetInventoryRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (inventoryBuilder_ == null) { + inventory_ = null; + } else { + inventory_ = null; + inventoryBuilder_ = null; + } + if (setMaskBuilder_ == null) { + setMask_ = null; + } else { + setMask_ = null; + setMaskBuilder_ = null; + } + if (setTimeBuilder_ == null) { + setTime_ = null; + } else { + setTime_ = null; + setTimeBuilder_ = null; + } + allowMissing_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2.ProductServiceProto + .internal_static_google_cloud_retail_v2_SetInventoryRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2.SetInventoryRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2.SetInventoryRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2.SetInventoryRequest build() { + com.google.cloud.retail.v2.SetInventoryRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2.SetInventoryRequest buildPartial() { + com.google.cloud.retail.v2.SetInventoryRequest result = + new com.google.cloud.retail.v2.SetInventoryRequest(this); + if (inventoryBuilder_ == null) { + result.inventory_ = inventory_; + } else { + result.inventory_ = inventoryBuilder_.build(); + } + if (setMaskBuilder_ == null) { + result.setMask_ = setMask_; + } else { + result.setMask_ = setMaskBuilder_.build(); + } + if (setTimeBuilder_ == null) { + result.setTime_ = setTime_; + } else { + result.setTime_ = setTimeBuilder_.build(); + } + result.allowMissing_ = allowMissing_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.retail.v2.SetInventoryRequest) { + return mergeFrom((com.google.cloud.retail.v2.SetInventoryRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2.SetInventoryRequest other) { + if (other == com.google.cloud.retail.v2.SetInventoryRequest.getDefaultInstance()) return this; + if (other.hasInventory()) { + mergeInventory(other.getInventory()); + } + if (other.hasSetMask()) { + mergeSetMask(other.getSetMask()); + } + if (other.hasSetTime()) { + mergeSetTime(other.getSetTime()); + } + if (other.getAllowMissing() != false) { + setAllowMissing(other.getAllowMissing()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.retail.v2.SetInventoryRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2.SetInventoryRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.retail.v2.Product inventory_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2.Product, + com.google.cloud.retail.v2.Product.Builder, + com.google.cloud.retail.v2.ProductOrBuilder> + inventoryBuilder_; + /** + * + * + *
+     * Required. The inventory information to update. The allowable fields to
+     * update are:
+     * * [Product.price_info][google.cloud.retail.v2.Product.price_info]
+     * * [Product.availability][google.cloud.retail.v2.Product.availability]
+     * * [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity]
+     * * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info]
+     * The updated inventory fields must be specified in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask].
+     * If [SetInventoryRequest.inventory.name][] is empty or invalid, an
+     * INVALID_ARGUMENT error is returned.
+     * If the caller does not have permission to update the
+     * [Product][google.cloud.retail.v2.Product] named in
+     * [Product.name][google.cloud.retail.v2.Product.name], regardless of whether
+     * or not it exists, a PERMISSION_DENIED error is returned.
+     * If the [Product][google.cloud.retail.v2.Product] to update does not have
+     * existing inventory information, the provided inventory information will be
+     * inserted.
+     * If the [Product][google.cloud.retail.v2.Product] to update has existing
+     * inventory information, the provided inventory information will be merged
+     * 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 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]
+     * * [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity]
+     * * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info]
+     * If a full overwrite of inventory information while ignoring timestamps is
+     * needed, [UpdateProduct][] should be invoked instead.
+     * 
+ * + * + * .google.cloud.retail.v2.Product inventory = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the inventory field is set. + */ + public boolean hasInventory() { + return inventoryBuilder_ != null || inventory_ != null; + } + /** + * + * + *
+     * Required. The inventory information to update. The allowable fields to
+     * update are:
+     * * [Product.price_info][google.cloud.retail.v2.Product.price_info]
+     * * [Product.availability][google.cloud.retail.v2.Product.availability]
+     * * [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity]
+     * * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info]
+     * The updated inventory fields must be specified in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask].
+     * If [SetInventoryRequest.inventory.name][] is empty or invalid, an
+     * INVALID_ARGUMENT error is returned.
+     * If the caller does not have permission to update the
+     * [Product][google.cloud.retail.v2.Product] named in
+     * [Product.name][google.cloud.retail.v2.Product.name], regardless of whether
+     * or not it exists, a PERMISSION_DENIED error is returned.
+     * If the [Product][google.cloud.retail.v2.Product] to update does not have
+     * existing inventory information, the provided inventory information will be
+     * inserted.
+     * If the [Product][google.cloud.retail.v2.Product] to update has existing
+     * inventory information, the provided inventory information will be merged
+     * 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 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]
+     * * [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity]
+     * * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info]
+     * If a full overwrite of inventory information while ignoring timestamps is
+     * needed, [UpdateProduct][] should be invoked instead.
+     * 
+ * + * + * .google.cloud.retail.v2.Product inventory = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The inventory. + */ + public com.google.cloud.retail.v2.Product getInventory() { + if (inventoryBuilder_ == null) { + return inventory_ == null + ? com.google.cloud.retail.v2.Product.getDefaultInstance() + : inventory_; + } else { + return inventoryBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The inventory information to update. The allowable fields to
+     * update are:
+     * * [Product.price_info][google.cloud.retail.v2.Product.price_info]
+     * * [Product.availability][google.cloud.retail.v2.Product.availability]
+     * * [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity]
+     * * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info]
+     * The updated inventory fields must be specified in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask].
+     * If [SetInventoryRequest.inventory.name][] is empty or invalid, an
+     * INVALID_ARGUMENT error is returned.
+     * If the caller does not have permission to update the
+     * [Product][google.cloud.retail.v2.Product] named in
+     * [Product.name][google.cloud.retail.v2.Product.name], regardless of whether
+     * or not it exists, a PERMISSION_DENIED error is returned.
+     * If the [Product][google.cloud.retail.v2.Product] to update does not have
+     * existing inventory information, the provided inventory information will be
+     * inserted.
+     * If the [Product][google.cloud.retail.v2.Product] to update has existing
+     * inventory information, the provided inventory information will be merged
+     * 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 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]
+     * * [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity]
+     * * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info]
+     * If a full overwrite of inventory information while ignoring timestamps is
+     * needed, [UpdateProduct][] should be invoked instead.
+     * 
+ * + * + * .google.cloud.retail.v2.Product inventory = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInventory(com.google.cloud.retail.v2.Product value) { + if (inventoryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + inventory_ = value; + onChanged(); + } else { + inventoryBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The inventory information to update. The allowable fields to
+     * update are:
+     * * [Product.price_info][google.cloud.retail.v2.Product.price_info]
+     * * [Product.availability][google.cloud.retail.v2.Product.availability]
+     * * [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity]
+     * * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info]
+     * The updated inventory fields must be specified in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask].
+     * If [SetInventoryRequest.inventory.name][] is empty or invalid, an
+     * INVALID_ARGUMENT error is returned.
+     * If the caller does not have permission to update the
+     * [Product][google.cloud.retail.v2.Product] named in
+     * [Product.name][google.cloud.retail.v2.Product.name], regardless of whether
+     * or not it exists, a PERMISSION_DENIED error is returned.
+     * If the [Product][google.cloud.retail.v2.Product] to update does not have
+     * existing inventory information, the provided inventory information will be
+     * inserted.
+     * If the [Product][google.cloud.retail.v2.Product] to update has existing
+     * inventory information, the provided inventory information will be merged
+     * 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 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]
+     * * [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity]
+     * * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info]
+     * If a full overwrite of inventory information while ignoring timestamps is
+     * needed, [UpdateProduct][] should be invoked instead.
+     * 
+ * + * + * .google.cloud.retail.v2.Product inventory = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInventory(com.google.cloud.retail.v2.Product.Builder builderForValue) { + if (inventoryBuilder_ == null) { + inventory_ = builderForValue.build(); + onChanged(); + } else { + inventoryBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The inventory information to update. The allowable fields to
+     * update are:
+     * * [Product.price_info][google.cloud.retail.v2.Product.price_info]
+     * * [Product.availability][google.cloud.retail.v2.Product.availability]
+     * * [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity]
+     * * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info]
+     * The updated inventory fields must be specified in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask].
+     * If [SetInventoryRequest.inventory.name][] is empty or invalid, an
+     * INVALID_ARGUMENT error is returned.
+     * If the caller does not have permission to update the
+     * [Product][google.cloud.retail.v2.Product] named in
+     * [Product.name][google.cloud.retail.v2.Product.name], regardless of whether
+     * or not it exists, a PERMISSION_DENIED error is returned.
+     * If the [Product][google.cloud.retail.v2.Product] to update does not have
+     * existing inventory information, the provided inventory information will be
+     * inserted.
+     * If the [Product][google.cloud.retail.v2.Product] to update has existing
+     * inventory information, the provided inventory information will be merged
+     * 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 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]
+     * * [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity]
+     * * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info]
+     * If a full overwrite of inventory information while ignoring timestamps is
+     * needed, [UpdateProduct][] should be invoked instead.
+     * 
+ * + * + * .google.cloud.retail.v2.Product inventory = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeInventory(com.google.cloud.retail.v2.Product value) { + if (inventoryBuilder_ == null) { + if (inventory_ != null) { + inventory_ = + com.google.cloud.retail.v2.Product.newBuilder(inventory_) + .mergeFrom(value) + .buildPartial(); + } else { + inventory_ = value; + } + onChanged(); + } else { + inventoryBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The inventory information to update. The allowable fields to
+     * update are:
+     * * [Product.price_info][google.cloud.retail.v2.Product.price_info]
+     * * [Product.availability][google.cloud.retail.v2.Product.availability]
+     * * [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity]
+     * * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info]
+     * The updated inventory fields must be specified in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask].
+     * If [SetInventoryRequest.inventory.name][] is empty or invalid, an
+     * INVALID_ARGUMENT error is returned.
+     * If the caller does not have permission to update the
+     * [Product][google.cloud.retail.v2.Product] named in
+     * [Product.name][google.cloud.retail.v2.Product.name], regardless of whether
+     * or not it exists, a PERMISSION_DENIED error is returned.
+     * If the [Product][google.cloud.retail.v2.Product] to update does not have
+     * existing inventory information, the provided inventory information will be
+     * inserted.
+     * If the [Product][google.cloud.retail.v2.Product] to update has existing
+     * inventory information, the provided inventory information will be merged
+     * 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 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]
+     * * [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity]
+     * * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info]
+     * If a full overwrite of inventory information while ignoring timestamps is
+     * needed, [UpdateProduct][] should be invoked instead.
+     * 
+ * + * + * .google.cloud.retail.v2.Product inventory = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearInventory() { + if (inventoryBuilder_ == null) { + inventory_ = null; + onChanged(); + } else { + inventory_ = null; + inventoryBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The inventory information to update. The allowable fields to
+     * update are:
+     * * [Product.price_info][google.cloud.retail.v2.Product.price_info]
+     * * [Product.availability][google.cloud.retail.v2.Product.availability]
+     * * [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity]
+     * * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info]
+     * The updated inventory fields must be specified in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask].
+     * If [SetInventoryRequest.inventory.name][] is empty or invalid, an
+     * INVALID_ARGUMENT error is returned.
+     * If the caller does not have permission to update the
+     * [Product][google.cloud.retail.v2.Product] named in
+     * [Product.name][google.cloud.retail.v2.Product.name], regardless of whether
+     * or not it exists, a PERMISSION_DENIED error is returned.
+     * If the [Product][google.cloud.retail.v2.Product] to update does not have
+     * existing inventory information, the provided inventory information will be
+     * inserted.
+     * If the [Product][google.cloud.retail.v2.Product] to update has existing
+     * inventory information, the provided inventory information will be merged
+     * 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 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]
+     * * [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity]
+     * * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info]
+     * If a full overwrite of inventory information while ignoring timestamps is
+     * needed, [UpdateProduct][] should be invoked instead.
+     * 
+ * + * + * .google.cloud.retail.v2.Product inventory = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2.Product.Builder getInventoryBuilder() { + + onChanged(); + return getInventoryFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The inventory information to update. The allowable fields to
+     * update are:
+     * * [Product.price_info][google.cloud.retail.v2.Product.price_info]
+     * * [Product.availability][google.cloud.retail.v2.Product.availability]
+     * * [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity]
+     * * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info]
+     * The updated inventory fields must be specified in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask].
+     * If [SetInventoryRequest.inventory.name][] is empty or invalid, an
+     * INVALID_ARGUMENT error is returned.
+     * If the caller does not have permission to update the
+     * [Product][google.cloud.retail.v2.Product] named in
+     * [Product.name][google.cloud.retail.v2.Product.name], regardless of whether
+     * or not it exists, a PERMISSION_DENIED error is returned.
+     * If the [Product][google.cloud.retail.v2.Product] to update does not have
+     * existing inventory information, the provided inventory information will be
+     * inserted.
+     * If the [Product][google.cloud.retail.v2.Product] to update has existing
+     * inventory information, the provided inventory information will be merged
+     * 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 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]
+     * * [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity]
+     * * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info]
+     * If a full overwrite of inventory information while ignoring timestamps is
+     * needed, [UpdateProduct][] should be invoked instead.
+     * 
+ * + * + * .google.cloud.retail.v2.Product inventory = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2.ProductOrBuilder getInventoryOrBuilder() { + if (inventoryBuilder_ != null) { + return inventoryBuilder_.getMessageOrBuilder(); + } else { + return inventory_ == null + ? com.google.cloud.retail.v2.Product.getDefaultInstance() + : inventory_; + } + } + /** + * + * + *
+     * Required. The inventory information to update. The allowable fields to
+     * update are:
+     * * [Product.price_info][google.cloud.retail.v2.Product.price_info]
+     * * [Product.availability][google.cloud.retail.v2.Product.availability]
+     * * [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity]
+     * * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info]
+     * The updated inventory fields must be specified in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask].
+     * If [SetInventoryRequest.inventory.name][] is empty or invalid, an
+     * INVALID_ARGUMENT error is returned.
+     * If the caller does not have permission to update the
+     * [Product][google.cloud.retail.v2.Product] named in
+     * [Product.name][google.cloud.retail.v2.Product.name], regardless of whether
+     * or not it exists, a PERMISSION_DENIED error is returned.
+     * If the [Product][google.cloud.retail.v2.Product] to update does not have
+     * existing inventory information, the provided inventory information will be
+     * inserted.
+     * If the [Product][google.cloud.retail.v2.Product] to update has existing
+     * inventory information, the provided inventory information will be merged
+     * 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 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]
+     * * [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity]
+     * * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info]
+     * If a full overwrite of inventory information while ignoring timestamps is
+     * needed, [UpdateProduct][] should be invoked instead.
+     * 
+ * + * + * .google.cloud.retail.v2.Product inventory = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2.Product, + com.google.cloud.retail.v2.Product.Builder, + com.google.cloud.retail.v2.ProductOrBuilder> + getInventoryFieldBuilder() { + if (inventoryBuilder_ == null) { + inventoryBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2.Product, + com.google.cloud.retail.v2.Product.Builder, + com.google.cloud.retail.v2.ProductOrBuilder>( + getInventory(), getParentForChildren(), isClean()); + inventory_ = null; + } + return inventoryBuilder_; + } + + private com.google.protobuf.FieldMask setMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + setMaskBuilder_; + /** + * + * + *
+     * 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.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned and the entire update will be ignored.
+     * 
+ * + * .google.protobuf.FieldMask set_mask = 2; + * + * @return Whether the setMask field is set. + */ + public boolean hasSetMask() { + return setMaskBuilder_ != null || setMask_ != null; + } + /** + * + * + *
+     * 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.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned and the entire update will be ignored.
+     * 
+ * + * .google.protobuf.FieldMask set_mask = 2; + * + * @return The setMask. + */ + public com.google.protobuf.FieldMask getSetMask() { + if (setMaskBuilder_ == null) { + return setMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : setMask_; + } else { + return setMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * 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.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned and the entire update will be ignored.
+     * 
+ * + * .google.protobuf.FieldMask set_mask = 2; + */ + public Builder setSetMask(com.google.protobuf.FieldMask value) { + if (setMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + setMask_ = value; + onChanged(); + } else { + setMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * 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.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned and the entire update will be ignored.
+     * 
+ * + * .google.protobuf.FieldMask set_mask = 2; + */ + public Builder setSetMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (setMaskBuilder_ == null) { + setMask_ = builderForValue.build(); + onChanged(); + } else { + setMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * 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.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned and the entire update will be ignored.
+     * 
+ * + * .google.protobuf.FieldMask set_mask = 2; + */ + public Builder mergeSetMask(com.google.protobuf.FieldMask value) { + if (setMaskBuilder_ == null) { + if (setMask_ != null) { + setMask_ = + com.google.protobuf.FieldMask.newBuilder(setMask_).mergeFrom(value).buildPartial(); + } else { + setMask_ = value; + } + onChanged(); + } else { + setMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * 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.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned and the entire update will be ignored.
+     * 
+ * + * .google.protobuf.FieldMask set_mask = 2; + */ + public Builder clearSetMask() { + if (setMaskBuilder_ == null) { + setMask_ = null; + onChanged(); + } else { + setMask_ = null; + setMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * 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.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned and the entire update will be ignored.
+     * 
+ * + * .google.protobuf.FieldMask set_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getSetMaskBuilder() { + + onChanged(); + return getSetMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * 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.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned and the entire update will be ignored.
+     * 
+ * + * .google.protobuf.FieldMask set_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getSetMaskOrBuilder() { + if (setMaskBuilder_ != null) { + return setMaskBuilder_.getMessageOrBuilder(); + } else { + return setMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : setMask_; + } + } + /** + * + * + *
+     * 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.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned and the entire update will be ignored.
+     * 
+ * + * .google.protobuf.FieldMask set_mask = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getSetMaskFieldBuilder() { + if (setMaskBuilder_ == null) { + setMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getSetMask(), getParentForChildren(), isClean()); + setMask_ = null; + } + return setMaskBuilder_; + } + + private com.google.protobuf.Timestamp setTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + setTimeBuilder_; + /** + * + * + *
+     * The time when the request is issued, used to prevent
+     * out-of-order updates on inventory fields with the last update time
+     * recorded. If not provided, the internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp set_time = 3; + * + * @return Whether the setTime field is set. + */ + public boolean hasSetTime() { + return setTimeBuilder_ != null || setTime_ != null; + } + /** + * + * + *
+     * The time when the request is issued, used to prevent
+     * out-of-order updates on inventory fields with the last update time
+     * recorded. If not provided, the internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp set_time = 3; + * + * @return The setTime. + */ + public com.google.protobuf.Timestamp getSetTime() { + if (setTimeBuilder_ == null) { + return setTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : setTime_; + } else { + return setTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time when the request is issued, used to prevent
+     * out-of-order updates on inventory fields with the last update time
+     * recorded. If not provided, the internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp set_time = 3; + */ + public Builder setSetTime(com.google.protobuf.Timestamp value) { + if (setTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + setTime_ = value; + onChanged(); + } else { + setTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The time when the request is issued, used to prevent
+     * out-of-order updates on inventory fields with the last update time
+     * recorded. If not provided, the internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp set_time = 3; + */ + public Builder setSetTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (setTimeBuilder_ == null) { + setTime_ = builderForValue.build(); + onChanged(); + } else { + setTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time when the request is issued, used to prevent
+     * out-of-order updates on inventory fields with the last update time
+     * recorded. If not provided, the internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp set_time = 3; + */ + public Builder mergeSetTime(com.google.protobuf.Timestamp value) { + if (setTimeBuilder_ == null) { + if (setTime_ != null) { + setTime_ = + com.google.protobuf.Timestamp.newBuilder(setTime_).mergeFrom(value).buildPartial(); + } else { + setTime_ = value; + } + onChanged(); + } else { + setTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The time when the request is issued, used to prevent
+     * out-of-order updates on inventory fields with the last update time
+     * recorded. If not provided, the internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp set_time = 3; + */ + public Builder clearSetTime() { + if (setTimeBuilder_ == null) { + setTime_ = null; + onChanged(); + } else { + setTime_ = null; + setTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time when the request is issued, used to prevent
+     * out-of-order updates on inventory fields with the last update time
+     * recorded. If not provided, the internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp set_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getSetTimeBuilder() { + + onChanged(); + return getSetTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time when the request is issued, used to prevent
+     * out-of-order updates on inventory fields with the last update time
+     * recorded. If not provided, the internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp set_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getSetTimeOrBuilder() { + if (setTimeBuilder_ != null) { + return setTimeBuilder_.getMessageOrBuilder(); + } else { + return setTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : setTime_; + } + } + /** + * + * + *
+     * The time when the request is issued, used to prevent
+     * out-of-order updates on inventory fields with the last update time
+     * recorded. If not provided, the internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp set_time = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getSetTimeFieldBuilder() { + if (setTimeBuilder_ == null) { + setTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getSetTime(), getParentForChildren(), isClean()); + setTime_ = null; + } + return setTimeBuilder_; + } + + private boolean allowMissing_; + /** + * + * + *
+     * If set to true, and the [Product][google.cloud.retail.v2.Product] with name
+     * [Product.name][google.cloud.retail.v2.Product.name] is not found, the
+     * inventory update will still be processed and retained for at most 1 day
+     * until the [Product][google.cloud.retail.v2.Product] is created. If set to
+     * false, an INVALID_ARGUMENT error is returned if the
+     * [Product][google.cloud.retail.v2.Product] is not found.
+     * 
+ * + * bool allow_missing = 4; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + /** + * + * + *
+     * If set to true, and the [Product][google.cloud.retail.v2.Product] with name
+     * [Product.name][google.cloud.retail.v2.Product.name] is not found, the
+     * inventory update will still be processed and retained for at most 1 day
+     * until the [Product][google.cloud.retail.v2.Product] is created. If set to
+     * false, an INVALID_ARGUMENT error is returned if the
+     * [Product][google.cloud.retail.v2.Product] is not found.
+     * 
+ * + * bool allow_missing = 4; + * + * @param value The allowMissing to set. + * @return This builder for chaining. + */ + public Builder setAllowMissing(boolean value) { + + allowMissing_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If set to true, and the [Product][google.cloud.retail.v2.Product] with name
+     * [Product.name][google.cloud.retail.v2.Product.name] is not found, the
+     * inventory update will still be processed and retained for at most 1 day
+     * until the [Product][google.cloud.retail.v2.Product] is created. If set to
+     * false, an INVALID_ARGUMENT error is returned if the
+     * [Product][google.cloud.retail.v2.Product] is not found.
+     * 
+ * + * bool allow_missing = 4; + * + * @return This builder for chaining. + */ + public Builder clearAllowMissing() { + + allowMissing_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.SetInventoryRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.SetInventoryRequest) + private static final com.google.cloud.retail.v2.SetInventoryRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2.SetInventoryRequest(); + } + + public static com.google.cloud.retail.v2.SetInventoryRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SetInventoryRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SetInventoryRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.retail.v2.SetInventoryRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/SetInventoryRequestOrBuilder.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/SetInventoryRequestOrBuilder.java new file mode 100644 index 00000000..aad5aff4 --- /dev/null +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/SetInventoryRequestOrBuilder.java @@ -0,0 +1,253 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2/product_service.proto + +package com.google.cloud.retail.v2; + +public interface SetInventoryRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2.SetInventoryRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The inventory information to update. The allowable fields to
+   * update are:
+   * * [Product.price_info][google.cloud.retail.v2.Product.price_info]
+   * * [Product.availability][google.cloud.retail.v2.Product.availability]
+   * * [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity]
+   * * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info]
+   * The updated inventory fields must be specified in
+   * [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask].
+   * If [SetInventoryRequest.inventory.name][] is empty or invalid, an
+   * INVALID_ARGUMENT error is returned.
+   * If the caller does not have permission to update the
+   * [Product][google.cloud.retail.v2.Product] named in
+   * [Product.name][google.cloud.retail.v2.Product.name], regardless of whether
+   * or not it exists, a PERMISSION_DENIED error is returned.
+   * If the [Product][google.cloud.retail.v2.Product] to update does not have
+   * existing inventory information, the provided inventory information will be
+   * inserted.
+   * If the [Product][google.cloud.retail.v2.Product] to update has existing
+   * inventory information, the provided inventory information will be merged
+   * 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 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]
+   * * [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity]
+   * * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info]
+   * If a full overwrite of inventory information while ignoring timestamps is
+   * needed, [UpdateProduct][] should be invoked instead.
+   * 
+ * + * .google.cloud.retail.v2.Product inventory = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the inventory field is set. + */ + boolean hasInventory(); + /** + * + * + *
+   * Required. The inventory information to update. The allowable fields to
+   * update are:
+   * * [Product.price_info][google.cloud.retail.v2.Product.price_info]
+   * * [Product.availability][google.cloud.retail.v2.Product.availability]
+   * * [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity]
+   * * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info]
+   * The updated inventory fields must be specified in
+   * [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask].
+   * If [SetInventoryRequest.inventory.name][] is empty or invalid, an
+   * INVALID_ARGUMENT error is returned.
+   * If the caller does not have permission to update the
+   * [Product][google.cloud.retail.v2.Product] named in
+   * [Product.name][google.cloud.retail.v2.Product.name], regardless of whether
+   * or not it exists, a PERMISSION_DENIED error is returned.
+   * If the [Product][google.cloud.retail.v2.Product] to update does not have
+   * existing inventory information, the provided inventory information will be
+   * inserted.
+   * If the [Product][google.cloud.retail.v2.Product] to update has existing
+   * inventory information, the provided inventory information will be merged
+   * 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 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]
+   * * [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity]
+   * * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info]
+   * If a full overwrite of inventory information while ignoring timestamps is
+   * needed, [UpdateProduct][] should be invoked instead.
+   * 
+ * + * .google.cloud.retail.v2.Product inventory = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The inventory. + */ + com.google.cloud.retail.v2.Product getInventory(); + /** + * + * + *
+   * Required. The inventory information to update. The allowable fields to
+   * update are:
+   * * [Product.price_info][google.cloud.retail.v2.Product.price_info]
+   * * [Product.availability][google.cloud.retail.v2.Product.availability]
+   * * [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity]
+   * * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info]
+   * The updated inventory fields must be specified in
+   * [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask].
+   * If [SetInventoryRequest.inventory.name][] is empty or invalid, an
+   * INVALID_ARGUMENT error is returned.
+   * If the caller does not have permission to update the
+   * [Product][google.cloud.retail.v2.Product] named in
+   * [Product.name][google.cloud.retail.v2.Product.name], regardless of whether
+   * or not it exists, a PERMISSION_DENIED error is returned.
+   * If the [Product][google.cloud.retail.v2.Product] to update does not have
+   * existing inventory information, the provided inventory information will be
+   * inserted.
+   * If the [Product][google.cloud.retail.v2.Product] to update has existing
+   * inventory information, the provided inventory information will be merged
+   * 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 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]
+   * * [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity]
+   * * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info]
+   * If a full overwrite of inventory information while ignoring timestamps is
+   * needed, [UpdateProduct][] should be invoked instead.
+   * 
+ * + * .google.cloud.retail.v2.Product inventory = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2.ProductOrBuilder getInventoryOrBuilder(); + + /** + * + * + *
+   * 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.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned and the entire update will be ignored.
+   * 
+ * + * .google.protobuf.FieldMask set_mask = 2; + * + * @return Whether the setMask field is set. + */ + boolean hasSetMask(); + /** + * + * + *
+   * 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.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned and the entire update will be ignored.
+   * 
+ * + * .google.protobuf.FieldMask set_mask = 2; + * + * @return The setMask. + */ + com.google.protobuf.FieldMask getSetMask(); + /** + * + * + *
+   * 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.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned and the entire update will be ignored.
+   * 
+ * + * .google.protobuf.FieldMask set_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getSetMaskOrBuilder(); + + /** + * + * + *
+   * The time when the request is issued, used to prevent
+   * out-of-order updates on inventory fields with the last update time
+   * recorded. If not provided, the internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp set_time = 3; + * + * @return Whether the setTime field is set. + */ + boolean hasSetTime(); + /** + * + * + *
+   * The time when the request is issued, used to prevent
+   * out-of-order updates on inventory fields with the last update time
+   * recorded. If not provided, the internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp set_time = 3; + * + * @return The setTime. + */ + com.google.protobuf.Timestamp getSetTime(); + /** + * + * + *
+   * The time when the request is issued, used to prevent
+   * out-of-order updates on inventory fields with the last update time
+   * recorded. If not provided, the internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp set_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getSetTimeOrBuilder(); + + /** + * + * + *
+   * If set to true, and the [Product][google.cloud.retail.v2.Product] with name
+   * [Product.name][google.cloud.retail.v2.Product.name] is not found, the
+   * inventory update will still be processed and retained for at most 1 day
+   * until the [Product][google.cloud.retail.v2.Product] is created. If set to
+   * false, an INVALID_ARGUMENT error is returned if the
+   * [Product][google.cloud.retail.v2.Product] is not found.
+   * 
+ * + * bool allow_missing = 4; + * + * @return The allowMissing. + */ + boolean getAllowMissing(); +} diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/SetInventoryResponse.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/SetInventoryResponse.java new file mode 100644 index 00000000..cee6522c --- /dev/null +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/SetInventoryResponse.java @@ -0,0 +1,459 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2/product_service.proto + +package com.google.cloud.retail.v2; + +/** + * + * + *
+ * Response of the SetInventoryRequest.  Currently empty because
+ * there is no meaningful response populated from the [SetInventory][]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2.SetInventoryResponse} + */ +public final class SetInventoryResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.SetInventoryResponse) + SetInventoryResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use SetInventoryResponse.newBuilder() to construct. + private SetInventoryResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SetInventoryResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SetInventoryResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SetInventoryResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.ProductServiceProto + .internal_static_google_cloud_retail_v2_SetInventoryResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.ProductServiceProto + .internal_static_google_cloud_retail_v2_SetInventoryResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.SetInventoryResponse.class, + com.google.cloud.retail.v2.SetInventoryResponse.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.retail.v2.SetInventoryResponse)) { + return super.equals(obj); + } + com.google.cloud.retail.v2.SetInventoryResponse other = + (com.google.cloud.retail.v2.SetInventoryResponse) obj; + + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2.SetInventoryResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.SetInventoryResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SetInventoryResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.SetInventoryResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SetInventoryResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2.SetInventoryResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SetInventoryResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.SetInventoryResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SetInventoryResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.SetInventoryResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2.SetInventoryResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2.SetInventoryResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2.SetInventoryResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response of the SetInventoryRequest.  Currently empty because
+   * there is no meaningful response populated from the [SetInventory][]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2.SetInventoryResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.SetInventoryResponse) + com.google.cloud.retail.v2.SetInventoryResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2.ProductServiceProto + .internal_static_google_cloud_retail_v2_SetInventoryResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2.ProductServiceProto + .internal_static_google_cloud_retail_v2_SetInventoryResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2.SetInventoryResponse.class, + com.google.cloud.retail.v2.SetInventoryResponse.Builder.class); + } + + // Construct using com.google.cloud.retail.v2.SetInventoryResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2.ProductServiceProto + .internal_static_google_cloud_retail_v2_SetInventoryResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2.SetInventoryResponse getDefaultInstanceForType() { + return com.google.cloud.retail.v2.SetInventoryResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2.SetInventoryResponse build() { + com.google.cloud.retail.v2.SetInventoryResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2.SetInventoryResponse buildPartial() { + com.google.cloud.retail.v2.SetInventoryResponse result = + new com.google.cloud.retail.v2.SetInventoryResponse(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.retail.v2.SetInventoryResponse) { + return mergeFrom((com.google.cloud.retail.v2.SetInventoryResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2.SetInventoryResponse other) { + if (other == com.google.cloud.retail.v2.SetInventoryResponse.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.retail.v2.SetInventoryResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2.SetInventoryResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.SetInventoryResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.SetInventoryResponse) + private static final com.google.cloud.retail.v2.SetInventoryResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2.SetInventoryResponse(); + } + + public static com.google.cloud.retail.v2.SetInventoryResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SetInventoryResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SetInventoryResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.retail.v2.SetInventoryResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/SetInventoryResponseOrBuilder.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/SetInventoryResponseOrBuilder.java new file mode 100644 index 00000000..a4b37541 --- /dev/null +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/SetInventoryResponseOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2/product_service.proto + +package com.google.cloud.retail.v2; + +public interface SetInventoryResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2.SetInventoryResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/UpdateCatalogRequest.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/UpdateCatalogRequest.java index 3c0e8986..31d22126 100644 --- a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/UpdateCatalogRequest.java +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/UpdateCatalogRequest.java @@ -205,10 +205,7 @@ public com.google.cloud.retail.v2.CatalogOrBuilder getCatalogOrBuilder() { * *
    * Indicates which fields in the provided
-   * [Catalog][google.cloud.retail.v2.Catalog] to update. If not set, will only
-   * update the
-   * [Catalog.product_level_config][google.cloud.retail.v2.Catalog.product_level_config]
-   * field, which is also the only currently supported field to update.
+   * [Catalog][google.cloud.retail.v2.Catalog] to update.
    * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
    * is returned.
    * 
@@ -226,10 +223,7 @@ public boolean hasUpdateMask() { * *
    * Indicates which fields in the provided
-   * [Catalog][google.cloud.retail.v2.Catalog] to update. If not set, will only
-   * update the
-   * [Catalog.product_level_config][google.cloud.retail.v2.Catalog.product_level_config]
-   * field, which is also the only currently supported field to update.
+   * [Catalog][google.cloud.retail.v2.Catalog] to update.
    * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
    * is returned.
    * 
@@ -247,10 +241,7 @@ public com.google.protobuf.FieldMask getUpdateMask() { * *
    * Indicates which fields in the provided
-   * [Catalog][google.cloud.retail.v2.Catalog] to update. If not set, will only
-   * update the
-   * [Catalog.product_level_config][google.cloud.retail.v2.Catalog.product_level_config]
-   * field, which is also the only currently supported field to update.
+   * [Catalog][google.cloud.retail.v2.Catalog] to update.
    * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
    * is returned.
    * 
@@ -871,10 +862,7 @@ public com.google.cloud.retail.v2.CatalogOrBuilder getCatalogOrBuilder() { * *
      * Indicates which fields in the provided
-     * [Catalog][google.cloud.retail.v2.Catalog] to update. If not set, will only
-     * update the
-     * [Catalog.product_level_config][google.cloud.retail.v2.Catalog.product_level_config]
-     * field, which is also the only currently supported field to update.
+     * [Catalog][google.cloud.retail.v2.Catalog] to update.
      * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
      * is returned.
      * 
@@ -891,10 +879,7 @@ public boolean hasUpdateMask() { * *
      * Indicates which fields in the provided
-     * [Catalog][google.cloud.retail.v2.Catalog] to update. If not set, will only
-     * update the
-     * [Catalog.product_level_config][google.cloud.retail.v2.Catalog.product_level_config]
-     * field, which is also the only currently supported field to update.
+     * [Catalog][google.cloud.retail.v2.Catalog] to update.
      * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
      * is returned.
      * 
@@ -917,10 +902,7 @@ public com.google.protobuf.FieldMask getUpdateMask() { * *
      * Indicates which fields in the provided
-     * [Catalog][google.cloud.retail.v2.Catalog] to update. If not set, will only
-     * update the
-     * [Catalog.product_level_config][google.cloud.retail.v2.Catalog.product_level_config]
-     * field, which is also the only currently supported field to update.
+     * [Catalog][google.cloud.retail.v2.Catalog] to update.
      * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
      * is returned.
      * 
@@ -945,10 +927,7 @@ public Builder setUpdateMask(com.google.protobuf.FieldMask value) { * *
      * Indicates which fields in the provided
-     * [Catalog][google.cloud.retail.v2.Catalog] to update. If not set, will only
-     * update the
-     * [Catalog.product_level_config][google.cloud.retail.v2.Catalog.product_level_config]
-     * field, which is also the only currently supported field to update.
+     * [Catalog][google.cloud.retail.v2.Catalog] to update.
      * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
      * is returned.
      * 
@@ -970,10 +949,7 @@ public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForVal * *
      * Indicates which fields in the provided
-     * [Catalog][google.cloud.retail.v2.Catalog] to update. If not set, will only
-     * update the
-     * [Catalog.product_level_config][google.cloud.retail.v2.Catalog.product_level_config]
-     * field, which is also the only currently supported field to update.
+     * [Catalog][google.cloud.retail.v2.Catalog] to update.
      * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
      * is returned.
      * 
@@ -1000,10 +976,7 @@ public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { * *
      * Indicates which fields in the provided
-     * [Catalog][google.cloud.retail.v2.Catalog] to update. If not set, will only
-     * update the
-     * [Catalog.product_level_config][google.cloud.retail.v2.Catalog.product_level_config]
-     * field, which is also the only currently supported field to update.
+     * [Catalog][google.cloud.retail.v2.Catalog] to update.
      * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
      * is returned.
      * 
@@ -1026,10 +999,7 @@ public Builder clearUpdateMask() { * *
      * Indicates which fields in the provided
-     * [Catalog][google.cloud.retail.v2.Catalog] to update. If not set, will only
-     * update the
-     * [Catalog.product_level_config][google.cloud.retail.v2.Catalog.product_level_config]
-     * field, which is also the only currently supported field to update.
+     * [Catalog][google.cloud.retail.v2.Catalog] to update.
      * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
      * is returned.
      * 
@@ -1046,10 +1016,7 @@ public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { * *
      * Indicates which fields in the provided
-     * [Catalog][google.cloud.retail.v2.Catalog] to update. If not set, will only
-     * update the
-     * [Catalog.product_level_config][google.cloud.retail.v2.Catalog.product_level_config]
-     * field, which is also the only currently supported field to update.
+     * [Catalog][google.cloud.retail.v2.Catalog] to update.
      * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
      * is returned.
      * 
@@ -1070,10 +1037,7 @@ public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { * *
      * Indicates which fields in the provided
-     * [Catalog][google.cloud.retail.v2.Catalog] to update. If not set, will only
-     * update the
-     * [Catalog.product_level_config][google.cloud.retail.v2.Catalog.product_level_config]
-     * field, which is also the only currently supported field to update.
+     * [Catalog][google.cloud.retail.v2.Catalog] to update.
      * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
      * is returned.
      * 
diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/UpdateCatalogRequestOrBuilder.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/UpdateCatalogRequestOrBuilder.java index 77224b10..e71d27fb 100644 --- a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/UpdateCatalogRequestOrBuilder.java +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/UpdateCatalogRequestOrBuilder.java @@ -81,10 +81,7 @@ public interface UpdateCatalogRequestOrBuilder * *
    * Indicates which fields in the provided
-   * [Catalog][google.cloud.retail.v2.Catalog] to update. If not set, will only
-   * update the
-   * [Catalog.product_level_config][google.cloud.retail.v2.Catalog.product_level_config]
-   * field, which is also the only currently supported field to update.
+   * [Catalog][google.cloud.retail.v2.Catalog] to update.
    * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
    * is returned.
    * 
@@ -99,10 +96,7 @@ public interface UpdateCatalogRequestOrBuilder * *
    * Indicates which fields in the provided
-   * [Catalog][google.cloud.retail.v2.Catalog] to update. If not set, will only
-   * update the
-   * [Catalog.product_level_config][google.cloud.retail.v2.Catalog.product_level_config]
-   * field, which is also the only currently supported field to update.
+   * [Catalog][google.cloud.retail.v2.Catalog] to update.
    * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
    * is returned.
    * 
@@ -117,10 +111,7 @@ public interface UpdateCatalogRequestOrBuilder * *
    * Indicates which fields in the provided
-   * [Catalog][google.cloud.retail.v2.Catalog] to update. If not set, will only
-   * update the
-   * [Catalog.product_level_config][google.cloud.retail.v2.Catalog.product_level_config]
-   * field, which is also the only currently supported field to update.
+   * [Catalog][google.cloud.retail.v2.Catalog] to update.
    * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
    * is returned.
    * 
diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/UpdateProductRequest.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/UpdateProductRequest.java index d40dffa6..6cff8f3d 100644 --- a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/UpdateProductRequest.java +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/UpdateProductRequest.java @@ -96,6 +96,11 @@ private UpdateProductRequest( updateMask_ = subBuilder.buildPartial(); } + break; + } + case 24: + { + allowMissing_ = input.readBool(); break; } default: @@ -142,8 +147,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * If the caller does not have permission to update the * [Product][google.cloud.retail.v2.Product], regardless of whether or not it * exists, a PERMISSION_DENIED error is returned. - * If the [Product][google.cloud.retail.v2.Product] to update does not exist, - * a NOT_FOUND error is returned. + * If the [Product][google.cloud.retail.v2.Product] to update does not exist + * and + * [allow_missing][google.cloud.retail.v2.UpdateProductRequest.allow_missing] + * is not set, a NOT_FOUND error is returned. *
* * .google.cloud.retail.v2.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -163,8 +170,10 @@ public boolean hasProduct() { * If the caller does not have permission to update the * [Product][google.cloud.retail.v2.Product], regardless of whether or not it * exists, a PERMISSION_DENIED error is returned. - * If the [Product][google.cloud.retail.v2.Product] to update does not exist, - * a NOT_FOUND error is returned. + * If the [Product][google.cloud.retail.v2.Product] to update does not exist + * and + * [allow_missing][google.cloud.retail.v2.UpdateProductRequest.allow_missing] + * is not set, a NOT_FOUND error is returned. *
* * .google.cloud.retail.v2.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -184,8 +193,10 @@ public com.google.cloud.retail.v2.Product getProduct() { * If the caller does not have permission to update the * [Product][google.cloud.retail.v2.Product], regardless of whether or not it * exists, a PERMISSION_DENIED error is returned. - * If the [Product][google.cloud.retail.v2.Product] to update does not exist, - * a NOT_FOUND error is returned. + * If the [Product][google.cloud.retail.v2.Product] to update does not exist + * and + * [allow_missing][google.cloud.retail.v2.UpdateProductRequest.allow_missing] + * is not set, a NOT_FOUND error is returned. *
* * .google.cloud.retail.v2.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -257,6 +268,26 @@ public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { return getUpdateMask(); } + public static final int ALLOW_MISSING_FIELD_NUMBER = 3; + private boolean allowMissing_; + /** + * + * + *
+   * If set to true, and the [Product][google.cloud.retail.v2.Product] is not
+   * found, a new [Product][google.cloud.retail.v2.Product] will be created. In
+   * this situation, `update_mask` is ignored.
+   * 
+ * + * bool allow_missing = 3; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -277,6 +308,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (updateMask_ != null) { output.writeMessage(2, getUpdateMask()); } + if (allowMissing_ != false) { + output.writeBool(3, allowMissing_); + } unknownFields.writeTo(output); } @@ -292,6 +326,9 @@ public int getSerializedSize() { if (updateMask_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); } + if (allowMissing_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, allowMissing_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -316,6 +353,7 @@ public boolean equals(final java.lang.Object obj) { if (hasUpdateMask()) { if (!getUpdateMask().equals(other.getUpdateMask())) return false; } + if (getAllowMissing() != other.getAllowMissing()) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -335,6 +373,8 @@ public int hashCode() { hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; hash = (53 * hash) + getUpdateMask().hashCode(); } + hash = (37 * hash) + ALLOW_MISSING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowMissing()); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -492,6 +532,8 @@ public Builder clear() { updateMask_ = null; updateMaskBuilder_ = null; } + allowMissing_ = false; + return this; } @@ -529,6 +571,7 @@ public com.google.cloud.retail.v2.UpdateProductRequest buildPartial() { } else { result.updateMask_ = updateMaskBuilder_.build(); } + result.allowMissing_ = allowMissing_; onBuilt(); return result; } @@ -585,6 +628,9 @@ public Builder mergeFrom(com.google.cloud.retail.v2.UpdateProductRequest other) if (other.hasUpdateMask()) { mergeUpdateMask(other.getUpdateMask()); } + if (other.getAllowMissing() != false) { + setAllowMissing(other.getAllowMissing()); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -628,8 +674,10 @@ public Builder mergeFrom( * If the caller does not have permission to update the * [Product][google.cloud.retail.v2.Product], regardless of whether or not it * exists, a PERMISSION_DENIED error is returned. - * If the [Product][google.cloud.retail.v2.Product] to update does not exist, - * a NOT_FOUND error is returned. + * If the [Product][google.cloud.retail.v2.Product] to update does not exist + * and + * [allow_missing][google.cloud.retail.v2.UpdateProductRequest.allow_missing] + * is not set, a NOT_FOUND error is returned. *
* * .google.cloud.retail.v2.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -648,8 +696,10 @@ public boolean hasProduct() { * If the caller does not have permission to update the * [Product][google.cloud.retail.v2.Product], regardless of whether or not it * exists, a PERMISSION_DENIED error is returned. - * If the [Product][google.cloud.retail.v2.Product] to update does not exist, - * a NOT_FOUND error is returned. + * If the [Product][google.cloud.retail.v2.Product] to update does not exist + * and + * [allow_missing][google.cloud.retail.v2.UpdateProductRequest.allow_missing] + * is not set, a NOT_FOUND error is returned. *
* * .google.cloud.retail.v2.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -674,8 +724,10 @@ public com.google.cloud.retail.v2.Product getProduct() { * If the caller does not have permission to update the * [Product][google.cloud.retail.v2.Product], regardless of whether or not it * exists, a PERMISSION_DENIED error is returned. - * If the [Product][google.cloud.retail.v2.Product] to update does not exist, - * a NOT_FOUND error is returned. + * If the [Product][google.cloud.retail.v2.Product] to update does not exist + * and + * [allow_missing][google.cloud.retail.v2.UpdateProductRequest.allow_missing] + * is not set, a NOT_FOUND error is returned. * * * .google.cloud.retail.v2.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -702,8 +754,10 @@ public Builder setProduct(com.google.cloud.retail.v2.Product value) { * If the caller does not have permission to update the * [Product][google.cloud.retail.v2.Product], regardless of whether or not it * exists, a PERMISSION_DENIED error is returned. - * If the [Product][google.cloud.retail.v2.Product] to update does not exist, - * a NOT_FOUND error is returned. + * If the [Product][google.cloud.retail.v2.Product] to update does not exist + * and + * [allow_missing][google.cloud.retail.v2.UpdateProductRequest.allow_missing] + * is not set, a NOT_FOUND error is returned. * * * .google.cloud.retail.v2.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -727,8 +781,10 @@ public Builder setProduct(com.google.cloud.retail.v2.Product.Builder builderForV * If the caller does not have permission to update the * [Product][google.cloud.retail.v2.Product], regardless of whether or not it * exists, a PERMISSION_DENIED error is returned. - * If the [Product][google.cloud.retail.v2.Product] to update does not exist, - * a NOT_FOUND error is returned. + * If the [Product][google.cloud.retail.v2.Product] to update does not exist + * and + * [allow_missing][google.cloud.retail.v2.UpdateProductRequest.allow_missing] + * is not set, a NOT_FOUND error is returned. * * * .google.cloud.retail.v2.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -759,8 +815,10 @@ public Builder mergeProduct(com.google.cloud.retail.v2.Product value) { * If the caller does not have permission to update the * [Product][google.cloud.retail.v2.Product], regardless of whether or not it * exists, a PERMISSION_DENIED error is returned. - * If the [Product][google.cloud.retail.v2.Product] to update does not exist, - * a NOT_FOUND error is returned. + * If the [Product][google.cloud.retail.v2.Product] to update does not exist + * and + * [allow_missing][google.cloud.retail.v2.UpdateProductRequest.allow_missing] + * is not set, a NOT_FOUND error is returned. * * * .google.cloud.retail.v2.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -785,8 +843,10 @@ public Builder clearProduct() { * If the caller does not have permission to update the * [Product][google.cloud.retail.v2.Product], regardless of whether or not it * exists, a PERMISSION_DENIED error is returned. - * If the [Product][google.cloud.retail.v2.Product] to update does not exist, - * a NOT_FOUND error is returned. + * If the [Product][google.cloud.retail.v2.Product] to update does not exist + * and + * [allow_missing][google.cloud.retail.v2.UpdateProductRequest.allow_missing] + * is not set, a NOT_FOUND error is returned. * * * .google.cloud.retail.v2.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -805,8 +865,10 @@ public com.google.cloud.retail.v2.Product.Builder getProductBuilder() { * If the caller does not have permission to update the * [Product][google.cloud.retail.v2.Product], regardless of whether or not it * exists, a PERMISSION_DENIED error is returned. - * If the [Product][google.cloud.retail.v2.Product] to update does not exist, - * a NOT_FOUND error is returned. + * If the [Product][google.cloud.retail.v2.Product] to update does not exist + * and + * [allow_missing][google.cloud.retail.v2.UpdateProductRequest.allow_missing] + * is not set, a NOT_FOUND error is returned. * * * .google.cloud.retail.v2.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -829,8 +891,10 @@ public com.google.cloud.retail.v2.ProductOrBuilder getProductOrBuilder() { * If the caller does not have permission to update the * [Product][google.cloud.retail.v2.Product], regardless of whether or not it * exists, a PERMISSION_DENIED error is returned. - * If the [Product][google.cloud.retail.v2.Product] to update does not exist, - * a NOT_FOUND error is returned. + * If the [Product][google.cloud.retail.v2.Product] to update does not exist + * and + * [allow_missing][google.cloud.retail.v2.UpdateProductRequest.allow_missing] + * is not set, a NOT_FOUND error is returned. * * * .google.cloud.retail.v2.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -1081,6 +1145,64 @@ public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { return updateMaskBuilder_; } + private boolean allowMissing_; + /** + * + * + *
+     * If set to true, and the [Product][google.cloud.retail.v2.Product] is not
+     * found, a new [Product][google.cloud.retail.v2.Product] will be created. In
+     * this situation, `update_mask` is ignored.
+     * 
+ * + * bool allow_missing = 3; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + /** + * + * + *
+     * If set to true, and the [Product][google.cloud.retail.v2.Product] is not
+     * found, a new [Product][google.cloud.retail.v2.Product] will be created. In
+     * this situation, `update_mask` is ignored.
+     * 
+ * + * bool allow_missing = 3; + * + * @param value The allowMissing to set. + * @return This builder for chaining. + */ + public Builder setAllowMissing(boolean value) { + + allowMissing_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If set to true, and the [Product][google.cloud.retail.v2.Product] is not
+     * found, a new [Product][google.cloud.retail.v2.Product] will be created. In
+     * this situation, `update_mask` is ignored.
+     * 
+ * + * bool allow_missing = 3; + * + * @return This builder for chaining. + */ + public Builder clearAllowMissing() { + + allowMissing_ = false; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/UpdateProductRequestOrBuilder.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/UpdateProductRequestOrBuilder.java index 9038e133..b79bb021 100644 --- a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/UpdateProductRequestOrBuilder.java +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/UpdateProductRequestOrBuilder.java @@ -31,8 +31,10 @@ public interface UpdateProductRequestOrBuilder * If the caller does not have permission to update the * [Product][google.cloud.retail.v2.Product], regardless of whether or not it * exists, a PERMISSION_DENIED error is returned. - * If the [Product][google.cloud.retail.v2.Product] to update does not exist, - * a NOT_FOUND error is returned. + * If the [Product][google.cloud.retail.v2.Product] to update does not exist + * and + * [allow_missing][google.cloud.retail.v2.UpdateProductRequest.allow_missing] + * is not set, a NOT_FOUND error is returned. * * * .google.cloud.retail.v2.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -49,8 +51,10 @@ public interface UpdateProductRequestOrBuilder * If the caller does not have permission to update the * [Product][google.cloud.retail.v2.Product], regardless of whether or not it * exists, a PERMISSION_DENIED error is returned. - * If the [Product][google.cloud.retail.v2.Product] to update does not exist, - * a NOT_FOUND error is returned. + * If the [Product][google.cloud.retail.v2.Product] to update does not exist + * and + * [allow_missing][google.cloud.retail.v2.UpdateProductRequest.allow_missing] + * is not set, a NOT_FOUND error is returned. * * * .google.cloud.retail.v2.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -67,8 +71,10 @@ public interface UpdateProductRequestOrBuilder * If the caller does not have permission to update the * [Product][google.cloud.retail.v2.Product], regardless of whether or not it * exists, a PERMISSION_DENIED error is returned. - * If the [Product][google.cloud.retail.v2.Product] to update does not exist, - * a NOT_FOUND error is returned. + * If the [Product][google.cloud.retail.v2.Product] to update does not exist + * and + * [allow_missing][google.cloud.retail.v2.UpdateProductRequest.allow_missing] + * is not set, a NOT_FOUND error is returned. * * * .google.cloud.retail.v2.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -125,4 +131,19 @@ public interface UpdateProductRequestOrBuilder * .google.protobuf.FieldMask update_mask = 2; */ com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * If set to true, and the [Product][google.cloud.retail.v2.Product] is not
+   * found, a new [Product][google.cloud.retail.v2.Product] will be created. In
+   * this situation, `update_mask` is ignored.
+   * 
+ * + * bool allow_missing = 3; + * + * @return The allowMissing. + */ + boolean getAllowMissing(); } diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/UserEvent.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/UserEvent.java index d2f4dcbe..91f05110 100644 --- a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/UserEvent.java +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/UserEvent.java @@ -41,11 +41,14 @@ private UserEvent(com.google.protobuf.GeneratedMessageV3.Builder builder) { private UserEvent() { eventType_ = ""; visitorId_ = ""; + sessionId_ = ""; experimentIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; attributionToken_ = ""; productDetails_ = java.util.Collections.emptyList(); cartId_ = ""; searchQuery_ = ""; + filter_ = ""; + orderBy_ = ""; pageCategories_ = com.google.protobuf.LazyStringArrayList.EMPTY; uri_ = ""; referrerUri_ = ""; @@ -232,6 +235,48 @@ private UserEvent( java.lang.String s = input.readStringRequireUtf8(); pageViewId_ = s; + break; + } + case 130: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 138: + { + java.lang.String s = input.readStringRequireUtf8(); + + orderBy_ = s; + break; + } + case 144: + { + offset_ = input.readInt32(); + break; + } + case 170: + { + java.lang.String s = input.readStringRequireUtf8(); + + sessionId_ = s; + break; + } + case 178: + { + com.google.cloud.retail.v2.CompletionDetail.Builder subBuilder = null; + if (completionDetail_ != null) { + subBuilder = completionDetail_.toBuilder(); + } + completionDetail_ = + input.readMessage( + com.google.cloud.retail.v2.CompletionDetail.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(completionDetail_); + completionDetail_ = subBuilder.buildPartial(); + } + break; } default: @@ -298,8 +343,11 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { * * `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. + * * `promotion-not-offered`: Promotion is not offered to a user. * * `purchase-complete`: User finishing a purchase. * * `search`: Product search. * * `shopping-cart-page-view`: User viewing a shopping cart. @@ -329,8 +377,11 @@ public java.lang.String getEventType() { * * `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. + * * `promotion-not-offered`: Promotion is not offered to a user. * * `purchase-complete`: User finishing a purchase. * * `search`: Product search. * * `shopping-cart-page-view`: User viewing a shopping cart. @@ -365,6 +416,10 @@ public com.google.protobuf.ByteString getEventTypeBytes() { * identifier should not change if the visitor log in/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. + * The field should not contain PII or user-data. We recommend to use Google + * Analystics [Client + * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId) + * for this field. * * * string visitor_id = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -393,6 +448,10 @@ public java.lang.String getVisitorId() { * identifier should not change if the visitor log in/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. + * The field should not contain PII or user-data. We recommend to use Google + * Analystics [Client + * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId) + * for this field. * * * string visitor_id = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -412,6 +471,67 @@ public com.google.protobuf.ByteString getVisitorIdBytes() { } } + public static final int SESSION_ID_FIELD_NUMBER = 21; + private volatile java.lang.Object sessionId_; + /** + * + * + *
+   * A unique identifier for tracking a visitor session with a length limit of
+   * 128 bytes. A session is an aggregation of an end user behavior in a time
+   * span.
+   * A general guideline to populate the sesion_id:
+   * 1. If user has no activity for 30 min, a new session_id should be assigned.
+   * 2. The session_id should be unique across users, suggest use uuid or add
+   * visitor_id as prefix.
+   * 
+ * + * string session_id = 21; + * + * @return The sessionId. + */ + @java.lang.Override + public java.lang.String getSessionId() { + java.lang.Object ref = sessionId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sessionId_ = s; + return s; + } + } + /** + * + * + *
+   * A unique identifier for tracking a visitor session with a length limit of
+   * 128 bytes. A session is an aggregation of an end user behavior in a time
+   * span.
+   * A general guideline to populate the sesion_id:
+   * 1. If user has no activity for 30 min, a new session_id should be assigned.
+   * 2. The session_id should be unique across users, suggest use uuid or add
+   * visitor_id as prefix.
+   * 
+ * + * string session_id = 21; + * + * @return The bytes for sessionId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSessionIdBytes() { + java.lang.Object ref = sessionId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sessionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + public static final int EVENT_TIME_FIELD_NUMBER = 3; private com.google.protobuf.Timestamp eventTime_; /** @@ -551,6 +671,10 @@ public com.google.protobuf.ByteString getExperimentIdsBytes(int index) { * [PredictResponse.attribution_token][google.cloud.retail.v2.PredictResponse.attribution_token] * for user events that are the result of * [PredictionService.Predict][google.cloud.retail.v2.PredictionService.Predict]. + * The value must be a valid + * [SearchResponse.attribution_token][google.cloud.retail.v2.SearchResponse.attribution_token] + * for user events that are the result of + * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. * This token enables us to accurately attribute page view or purchase back to * the event and the particular predict response containing this * clicked/purchased product. If user clicks on product K in the @@ -590,6 +714,10 @@ public java.lang.String getAttributionToken() { * [PredictResponse.attribution_token][google.cloud.retail.v2.PredictResponse.attribution_token] * for user events that are the result of * [PredictionService.Predict][google.cloud.retail.v2.PredictionService.Predict]. + * The value must be a valid + * [SearchResponse.attribution_token][google.cloud.retail.v2.SearchResponse.attribution_token] + * for user events that are the result of + * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. * This token enables us to accurately attribute page view or purchase back to * the event and the particular predict response containing this * clicked/purchased product. If user clicks on product K in the @@ -742,6 +870,63 @@ public com.google.cloud.retail.v2.ProductDetailOrBuilder getProductDetailsOrBuil return productDetails_.get(index); } + public static final int COMPLETION_DETAIL_FIELD_NUMBER = 22; + private com.google.cloud.retail.v2.CompletionDetail completionDetail_; + /** + * + * + *
+   * The main 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.
+   * 
+ * + * .google.cloud.retail.v2.CompletionDetail completion_detail = 22; + * + * @return Whether the completionDetail field is set. + */ + @java.lang.Override + public boolean hasCompletionDetail() { + return completionDetail_ != null; + } + /** + * + * + *
+   * The main 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.
+   * 
+ * + * .google.cloud.retail.v2.CompletionDetail completion_detail = 22; + * + * @return The completionDetail. + */ + @java.lang.Override + public com.google.cloud.retail.v2.CompletionDetail getCompletionDetail() { + return completionDetail_ == null + ? com.google.cloud.retail.v2.CompletionDetail.getDefaultInstance() + : completionDetail_; + } + /** + * + * + *
+   * The main 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.
+   * 
+ * + * .google.cloud.retail.v2.CompletionDetail completion_detail = 22; + */ + @java.lang.Override + public com.google.cloud.retail.v2.CompletionDetailOrBuilder getCompletionDetailOrBuilder() { + return getCompletionDetail(); + } + public static final int ATTRIBUTES_FIELD_NUMBER = 7; private static final class AttributesDefaultEntryHolder { @@ -990,9 +1175,14 @@ public com.google.cloud.retail.v2.PurchaseTransactionOrBuilder getPurchaseTransa * *
    * The user's search query.
+   * See [SearchRequest.query][google.cloud.retail.v2.SearchRequest.query] for
+   * definition.
    * The value must be a UTF-8 encoded string with a length limit of 5,000
    * characters. Otherwise, an INVALID_ARGUMENT error is returned.
-   * Required for `search` events. Other event types should not set this field.
+   * At least one of
+   * [search_query][google.cloud.retail.v2.UserEvent.search_query] or
+   * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is
+   * required for `search` events. Other event types should not set this field.
    * Otherwise, an INVALID_ARGUMENT error is returned.
    * 
* @@ -1017,9 +1207,14 @@ public java.lang.String getSearchQuery() { * *
    * The user's search query.
+   * See [SearchRequest.query][google.cloud.retail.v2.SearchRequest.query] for
+   * definition.
    * The value must be a UTF-8 encoded string with a length limit of 5,000
    * characters. Otherwise, an INVALID_ARGUMENT error is returned.
-   * Required for `search` events. Other event types should not set this field.
+   * At least one of
+   * [search_query][google.cloud.retail.v2.UserEvent.search_query] or
+   * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is
+   * required for `search` events. Other event types should not set this field.
    * Otherwise, an INVALID_ARGUMENT error is returned.
    * 
* @@ -1040,6 +1235,150 @@ public com.google.protobuf.ByteString getSearchQueryBytes() { } } + public static final int FILTER_FIELD_NUMBER = 16; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * The filter syntax consists of an expression language for constructing a
+   * predicate from one or more fields of the products being filtered.
+   * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
+   * definition and syntax.
+   * The value must be a UTF-8 encoded string with a length limit of 1,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string filter = 16; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * The filter syntax consists of an expression language for constructing a
+   * predicate from one or more fields of the products being filtered.
+   * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
+   * definition and syntax.
+   * The value must be a UTF-8 encoded string with a length limit of 1,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string filter = 16; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 17; + private volatile java.lang.Object orderBy_; + /** + * + * + *
+   * The order in which products are returned.
+   * See [SearchRequest.order_by][google.cloud.retail.v2.SearchRequest.order_by]
+   * for definition and syntax.
+   * The value must be a UTF-8 encoded string with a length limit of 1,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * This can only be set for `search` events. Other event types should not set
+   * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string order_by = 17; + * + * @return The orderBy. + */ + @java.lang.Override + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } + } + /** + * + * + *
+   * The order in which products are returned.
+   * See [SearchRequest.order_by][google.cloud.retail.v2.SearchRequest.order_by]
+   * for definition and syntax.
+   * The value must be a UTF-8 encoded string with a length limit of 1,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * This can only be set for `search` events. Other event types should not set
+   * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string order_by = 17; + * + * @return The bytes for orderBy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OFFSET_FIELD_NUMBER = 18; + private int offset_; + /** + * + * + *
+   * An integer that specifies the current offset for pagination (the 0-indexed
+   * starting location, amongst the products deemed by the API as relevant).
+   * See [SearchRequest.offset][google.cloud.retail.v2.SearchRequest.offset] for
+   * definition.
+   * If this field is negative, an INVALID_ARGUMENT is returned.
+   * This can only be set for `search` events. Other event types should not set
+   * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * int32 offset = 18; + * + * @return The offset. + */ + @java.lang.Override + public int getOffset() { + return offset_; + } + public static final int PAGE_CATEGORIES_FIELD_NUMBER = 11; private com.google.protobuf.LazyStringList pageCategories_; /** @@ -1053,8 +1392,11 @@ public com.google.protobuf.ByteString getSearchQueryBytes() { * Category pages include special pages such as sales or promotions. For * instance, a special sale page may have the category hierarchy: * "pageCategories" : ["Sales > 2017 Black Friday Deals"]. - * Required for `category-page-view` events. Other event types should not set - * this field. Otherwise, an INVALID_ARGUMENT error is returned. + * Required for `category-page-view` events. At least one of + * [search_query][google.cloud.retail.v2.UserEvent.search_query] or + * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is + * required for `search` events. Other event types should not set this field. + * Otherwise, an INVALID_ARGUMENT error is returned. * * * repeated string page_categories = 11; @@ -1075,8 +1417,11 @@ public com.google.protobuf.ProtocolStringList getPageCategoriesList() { * Category pages include special pages such as sales or promotions. For * instance, a special sale page may have the category hierarchy: * "pageCategories" : ["Sales > 2017 Black Friday Deals"]. - * Required for `category-page-view` events. Other event types should not set - * this field. Otherwise, an INVALID_ARGUMENT error is returned. + * Required for `category-page-view` events. At least one of + * [search_query][google.cloud.retail.v2.UserEvent.search_query] or + * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is + * required for `search` events. Other event types should not set this field. + * Otherwise, an INVALID_ARGUMENT error is returned. * * * repeated string page_categories = 11; @@ -1097,8 +1442,11 @@ public int getPageCategoriesCount() { * Category pages include special pages such as sales or promotions. For * instance, a special sale page may have the category hierarchy: * "pageCategories" : ["Sales > 2017 Black Friday Deals"]. - * Required for `category-page-view` events. Other event types should not set - * this field. Otherwise, an INVALID_ARGUMENT error is returned. + * Required for `category-page-view` events. At least one of + * [search_query][google.cloud.retail.v2.UserEvent.search_query] or + * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is + * required for `search` events. Other event types should not set this field. + * Otherwise, an INVALID_ARGUMENT error is returned. * * * repeated string page_categories = 11; @@ -1120,8 +1468,11 @@ public java.lang.String getPageCategories(int index) { * Category pages include special pages such as sales or promotions. For * instance, a special sale page may have the category hierarchy: * "pageCategories" : ["Sales > 2017 Black Friday Deals"]. - * Required for `category-page-view` events. Other event types should not set - * this field. Otherwise, an INVALID_ARGUMENT error is returned. + * Required for `category-page-view` events. At least one of + * [search_query][google.cloud.retail.v2.UserEvent.search_query] or + * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is + * required for `search` events. Other event types should not set this field. + * Otherwise, an INVALID_ARGUMENT error is returned. * * * repeated string page_categories = 11; @@ -1408,6 +1759,21 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!getPageViewIdBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 15, pageViewId_); } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 16, filter_); + } + if (!getOrderByBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 17, orderBy_); + } + if (offset_ != 0) { + output.writeInt32(18, offset_); + } + if (!getSessionIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 21, sessionId_); + } + if (completionDetail_ != null) { + output.writeMessage(22, getCompletionDetail()); + } unknownFields.writeTo(output); } @@ -1480,6 +1846,21 @@ public int getSerializedSize() { if (!getPageViewIdBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(15, pageViewId_); } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(16, filter_); + } + if (!getOrderByBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(17, orderBy_); + } + if (offset_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(18, offset_); + } + if (!getSessionIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(21, sessionId_); + } + if (completionDetail_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(22, getCompletionDetail()); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -1497,6 +1878,7 @@ public boolean equals(final java.lang.Object obj) { if (!getEventType().equals(other.getEventType())) return false; if (!getVisitorId().equals(other.getVisitorId())) return false; + if (!getSessionId().equals(other.getSessionId())) return false; if (hasEventTime() != other.hasEventTime()) return false; if (hasEventTime()) { if (!getEventTime().equals(other.getEventTime())) return false; @@ -1504,6 +1886,10 @@ public boolean equals(final java.lang.Object obj) { if (!getExperimentIdsList().equals(other.getExperimentIdsList())) return false; if (!getAttributionToken().equals(other.getAttributionToken())) return false; if (!getProductDetailsList().equals(other.getProductDetailsList())) return false; + if (hasCompletionDetail() != other.hasCompletionDetail()) return false; + if (hasCompletionDetail()) { + if (!getCompletionDetail().equals(other.getCompletionDetail())) return false; + } if (!internalGetAttributes().equals(other.internalGetAttributes())) return false; if (!getCartId().equals(other.getCartId())) return false; if (hasPurchaseTransaction() != other.hasPurchaseTransaction()) return false; @@ -1511,6 +1897,9 @@ public boolean equals(final java.lang.Object obj) { if (!getPurchaseTransaction().equals(other.getPurchaseTransaction())) return false; } if (!getSearchQuery().equals(other.getSearchQuery())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getOrderBy().equals(other.getOrderBy())) return false; + if (getOffset() != other.getOffset()) return false; if (!getPageCategoriesList().equals(other.getPageCategoriesList())) return false; if (hasUserInfo() != other.hasUserInfo()) return false; if (hasUserInfo()) { @@ -1534,6 +1923,8 @@ public int hashCode() { hash = (53 * hash) + getEventType().hashCode(); hash = (37 * hash) + VISITOR_ID_FIELD_NUMBER; hash = (53 * hash) + getVisitorId().hashCode(); + hash = (37 * hash) + SESSION_ID_FIELD_NUMBER; + hash = (53 * hash) + getSessionId().hashCode(); if (hasEventTime()) { hash = (37 * hash) + EVENT_TIME_FIELD_NUMBER; hash = (53 * hash) + getEventTime().hashCode(); @@ -1548,6 +1939,10 @@ public int hashCode() { hash = (37 * hash) + PRODUCT_DETAILS_FIELD_NUMBER; hash = (53 * hash) + getProductDetailsList().hashCode(); } + if (hasCompletionDetail()) { + hash = (37 * hash) + COMPLETION_DETAIL_FIELD_NUMBER; + hash = (53 * hash) + getCompletionDetail().hashCode(); + } if (!internalGetAttributes().getMap().isEmpty()) { hash = (37 * hash) + ATTRIBUTES_FIELD_NUMBER; hash = (53 * hash) + internalGetAttributes().hashCode(); @@ -1560,6 +1955,12 @@ public int hashCode() { } hash = (37 * hash) + SEARCH_QUERY_FIELD_NUMBER; hash = (53 * hash) + getSearchQuery().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (37 * hash) + OFFSET_FIELD_NUMBER; + hash = (53 * hash) + getOffset(); if (getPageCategoriesCount() > 0) { hash = (37 * hash) + PAGE_CATEGORIES_FIELD_NUMBER; hash = (53 * hash) + getPageCategoriesList().hashCode(); @@ -1745,6 +2146,8 @@ public Builder clear() { visitorId_ = ""; + sessionId_ = ""; + if (eventTimeBuilder_ == null) { eventTime_ = null; } else { @@ -1761,6 +2164,12 @@ public Builder clear() { } else { productDetailsBuilder_.clear(); } + if (completionDetailBuilder_ == null) { + completionDetail_ = null; + } else { + completionDetail_ = null; + completionDetailBuilder_ = null; + } internalGetMutableAttributes().clear(); cartId_ = ""; @@ -1772,6 +2181,12 @@ public Builder clear() { } searchQuery_ = ""; + filter_ = ""; + + orderBy_ = ""; + + offset_ = 0; + pageCategories_ = com.google.protobuf.LazyStringArrayList.EMPTY; bitField0_ = (bitField0_ & ~0x00000008); if (userInfoBuilder_ == null) { @@ -1815,6 +2230,7 @@ public com.google.cloud.retail.v2.UserEvent buildPartial() { int from_bitField0_ = bitField0_; result.eventType_ = eventType_; result.visitorId_ = visitorId_; + result.sessionId_ = sessionId_; if (eventTimeBuilder_ == null) { result.eventTime_ = eventTime_; } else { @@ -1835,6 +2251,11 @@ public com.google.cloud.retail.v2.UserEvent buildPartial() { } else { result.productDetails_ = productDetailsBuilder_.build(); } + if (completionDetailBuilder_ == null) { + result.completionDetail_ = completionDetail_; + } else { + result.completionDetail_ = completionDetailBuilder_.build(); + } result.attributes_ = internalGetAttributes(); result.attributes_.makeImmutable(); result.cartId_ = cartId_; @@ -1844,6 +2265,9 @@ public com.google.cloud.retail.v2.UserEvent buildPartial() { result.purchaseTransaction_ = purchaseTransactionBuilder_.build(); } result.searchQuery_ = searchQuery_; + result.filter_ = filter_; + result.orderBy_ = orderBy_; + result.offset_ = offset_; if (((bitField0_ & 0x00000008) != 0)) { pageCategories_ = pageCategories_.getUnmodifiableView(); bitField0_ = (bitField0_ & ~0x00000008); @@ -1914,6 +2338,10 @@ public Builder mergeFrom(com.google.cloud.retail.v2.UserEvent other) { visitorId_ = other.visitorId_; onChanged(); } + if (!other.getSessionId().isEmpty()) { + sessionId_ = other.sessionId_; + onChanged(); + } if (other.hasEventTime()) { mergeEventTime(other.getEventTime()); } @@ -1958,6 +2386,9 @@ public Builder mergeFrom(com.google.cloud.retail.v2.UserEvent other) { } } } + if (other.hasCompletionDetail()) { + mergeCompletionDetail(other.getCompletionDetail()); + } internalGetMutableAttributes().mergeFrom(other.internalGetAttributes()); if (!other.getCartId().isEmpty()) { cartId_ = other.cartId_; @@ -1970,6 +2401,17 @@ public Builder mergeFrom(com.google.cloud.retail.v2.UserEvent other) { searchQuery_ = other.searchQuery_; onChanged(); } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + onChanged(); + } + if (other.getOffset() != 0) { + setOffset(other.getOffset()); + } if (!other.pageCategories_.isEmpty()) { if (pageCategories_.isEmpty()) { pageCategories_ = other.pageCategories_; @@ -2035,8 +2477,11 @@ public Builder mergeFrom( * * `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. + * * `promotion-not-offered`: Promotion is not offered to a user. * * `purchase-complete`: User finishing a purchase. * * `search`: Product search. * * `shopping-cart-page-view`: User viewing a shopping cart. @@ -2065,8 +2510,11 @@ public java.lang.String getEventType() { * * `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. + * * `promotion-not-offered`: Promotion is not offered to a user. * * `purchase-complete`: User finishing a purchase. * * `search`: Product search. * * `shopping-cart-page-view`: User viewing a shopping cart. @@ -2095,8 +2543,11 @@ public com.google.protobuf.ByteString getEventTypeBytes() { * * `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. + * * `promotion-not-offered`: Promotion is not offered to a user. * * `purchase-complete`: User finishing a purchase. * * `search`: Product search. * * `shopping-cart-page-view`: User viewing a shopping cart. @@ -2124,8 +2575,11 @@ public Builder setEventType(java.lang.String value) { * * `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. + * * `promotion-not-offered`: Promotion is not offered to a user. * * `purchase-complete`: User finishing a purchase. * * `search`: Product search. * * `shopping-cart-page-view`: User viewing a shopping cart. @@ -2149,8 +2603,11 @@ public Builder clearEventType() { * * `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. + * * `promotion-not-offered`: Promotion is not offered to a user. * * `purchase-complete`: User finishing a purchase. * * `search`: Product search. * * `shopping-cart-page-view`: User viewing a shopping cart. @@ -2183,6 +2640,10 @@ public Builder setEventTypeBytes(com.google.protobuf.ByteString value) { * identifier should not change if the visitor log in/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. + * The field should not contain PII or user-data. We recommend to use Google + * Analystics [Client + * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId) + * for this field. * * * string visitor_id = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -2210,6 +2671,10 @@ public java.lang.String getVisitorId() { * identifier should not change if the visitor log in/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. + * The field should not contain PII or user-data. We recommend to use Google + * Analystics [Client + * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId) + * for this field. * * * string visitor_id = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -2237,6 +2702,10 @@ public com.google.protobuf.ByteString getVisitorIdBytes() { * identifier should not change if the visitor log in/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. + * The field should not contain PII or user-data. We recommend to use Google + * Analystics [Client + * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId) + * for this field. * * * string visitor_id = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -2263,6 +2732,10 @@ public Builder setVisitorId(java.lang.String value) { * identifier should not change if the visitor log in/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. + * The field should not contain PII or user-data. We recommend to use Google + * Analystics [Client + * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId) + * for this field. * * * string visitor_id = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -2285,6 +2758,10 @@ public Builder clearVisitorId() { * identifier should not change if the visitor log in/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. + * The field should not contain PII or user-data. We recommend to use Google + * Analystics [Client + * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId) + * for this field. * * * string visitor_id = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -2303,55 +2780,191 @@ public Builder setVisitorIdBytes(com.google.protobuf.ByteString value) { return this; } - private com.google.protobuf.Timestamp eventTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - eventTimeBuilder_; + private java.lang.Object sessionId_ = ""; /** * * *
-     * Only required for
-     * [UserEventService.ImportUserEvents][google.cloud.retail.v2.UserEventService.ImportUserEvents]
-     * method. Timestamp of when the user event happened.
+     * A unique identifier for tracking a visitor session with a length limit of
+     * 128 bytes. A session is an aggregation of an end user behavior in a time
+     * span.
+     * A general guideline to populate the sesion_id:
+     * 1. If user has no activity for 30 min, a new session_id should be assigned.
+     * 2. The session_id should be unique across users, suggest use uuid or add
+     * visitor_id as prefix.
      * 
* - * .google.protobuf.Timestamp event_time = 3; + * string session_id = 21; * - * @return Whether the eventTime field is set. + * @return The sessionId. */ - public boolean hasEventTime() { - return eventTimeBuilder_ != null || eventTime_ != null; + public java.lang.String getSessionId() { + java.lang.Object ref = sessionId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sessionId_ = s; + return s; + } else { + return (java.lang.String) ref; + } } /** * * *
-     * Only required for
-     * [UserEventService.ImportUserEvents][google.cloud.retail.v2.UserEventService.ImportUserEvents]
-     * method. Timestamp of when the user event happened.
+     * A unique identifier for tracking a visitor session with a length limit of
+     * 128 bytes. A session is an aggregation of an end user behavior in a time
+     * span.
+     * A general guideline to populate the sesion_id:
+     * 1. If user has no activity for 30 min, a new session_id should be assigned.
+     * 2. The session_id should be unique across users, suggest use uuid or add
+     * visitor_id as prefix.
      * 
* - * .google.protobuf.Timestamp event_time = 3; + * string session_id = 21; * - * @return The eventTime. + * @return The bytes for sessionId. */ - public com.google.protobuf.Timestamp getEventTime() { - if (eventTimeBuilder_ == null) { - return eventTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : eventTime_; + public com.google.protobuf.ByteString getSessionIdBytes() { + java.lang.Object ref = sessionId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sessionId_ = b; + return b; } else { - return eventTimeBuilder_.getMessage(); + return (com.google.protobuf.ByteString) ref; } } /** * * *
-     * Only required for
-     * [UserEventService.ImportUserEvents][google.cloud.retail.v2.UserEventService.ImportUserEvents]
-     * method. Timestamp of when the user event happened.
+     * A unique identifier for tracking a visitor session with a length limit of
+     * 128 bytes. A session is an aggregation of an end user behavior in a time
+     * span.
+     * A general guideline to populate the sesion_id:
+     * 1. If user has no activity for 30 min, a new session_id should be assigned.
+     * 2. The session_id should be unique across users, suggest use uuid or add
+     * visitor_id as prefix.
+     * 
+ * + * string session_id = 21; + * + * @param value The sessionId to set. + * @return This builder for chaining. + */ + public Builder setSessionId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + sessionId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A unique identifier for tracking a visitor session with a length limit of
+     * 128 bytes. A session is an aggregation of an end user behavior in a time
+     * span.
+     * A general guideline to populate the sesion_id:
+     * 1. If user has no activity for 30 min, a new session_id should be assigned.
+     * 2. The session_id should be unique across users, suggest use uuid or add
+     * visitor_id as prefix.
+     * 
+ * + * string session_id = 21; + * + * @return This builder for chaining. + */ + public Builder clearSessionId() { + + sessionId_ = getDefaultInstance().getSessionId(); + onChanged(); + return this; + } + /** + * + * + *
+     * A unique identifier for tracking a visitor session with a length limit of
+     * 128 bytes. A session is an aggregation of an end user behavior in a time
+     * span.
+     * A general guideline to populate the sesion_id:
+     * 1. If user has no activity for 30 min, a new session_id should be assigned.
+     * 2. The session_id should be unique across users, suggest use uuid or add
+     * visitor_id as prefix.
+     * 
+ * + * string session_id = 21; + * + * @param value The bytes for sessionId to set. + * @return This builder for chaining. + */ + public Builder setSessionIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + sessionId_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp eventTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + eventTimeBuilder_; + /** + * + * + *
+     * Only required for
+     * [UserEventService.ImportUserEvents][google.cloud.retail.v2.UserEventService.ImportUserEvents]
+     * method. Timestamp of when the user event happened.
+     * 
+ * + * .google.protobuf.Timestamp event_time = 3; + * + * @return Whether the eventTime field is set. + */ + public boolean hasEventTime() { + return eventTimeBuilder_ != null || eventTime_ != null; + } + /** + * + * + *
+     * Only required for
+     * [UserEventService.ImportUserEvents][google.cloud.retail.v2.UserEventService.ImportUserEvents]
+     * method. Timestamp of when the user event happened.
+     * 
+ * + * .google.protobuf.Timestamp event_time = 3; + * + * @return The eventTime. + */ + public com.google.protobuf.Timestamp getEventTime() { + if (eventTimeBuilder_ == null) { + return eventTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : eventTime_; + } else { + return eventTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Only required for
+     * [UserEventService.ImportUserEvents][google.cloud.retail.v2.UserEventService.ImportUserEvents]
+     * method. Timestamp of when the user event happened.
      * 
* * .google.protobuf.Timestamp event_time = 3; @@ -2708,6 +3321,10 @@ public Builder addExperimentIdsBytes(com.google.protobuf.ByteString value) { * [PredictResponse.attribution_token][google.cloud.retail.v2.PredictResponse.attribution_token] * for user events that are the result of * [PredictionService.Predict][google.cloud.retail.v2.PredictionService.Predict]. + * The value must be a valid + * [SearchResponse.attribution_token][google.cloud.retail.v2.SearchResponse.attribution_token] + * for user events that are the result of + * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. * This token enables us to accurately attribute page view or purchase back to * the event and the particular predict response containing this * clicked/purchased product. If user clicks on product K in the @@ -2746,6 +3363,10 @@ public java.lang.String getAttributionToken() { * [PredictResponse.attribution_token][google.cloud.retail.v2.PredictResponse.attribution_token] * for user events that are the result of * [PredictionService.Predict][google.cloud.retail.v2.PredictionService.Predict]. + * The value must be a valid + * [SearchResponse.attribution_token][google.cloud.retail.v2.SearchResponse.attribution_token] + * for user events that are the result of + * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. * This token enables us to accurately attribute page view or purchase back to * the event and the particular predict response containing this * clicked/purchased product. If user clicks on product K in the @@ -2784,6 +3405,10 @@ public com.google.protobuf.ByteString getAttributionTokenBytes() { * [PredictResponse.attribution_token][google.cloud.retail.v2.PredictResponse.attribution_token] * for user events that are the result of * [PredictionService.Predict][google.cloud.retail.v2.PredictionService.Predict]. + * The value must be a valid + * [SearchResponse.attribution_token][google.cloud.retail.v2.SearchResponse.attribution_token] + * for user events that are the result of + * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. * This token enables us to accurately attribute page view or purchase back to * the event and the particular predict response containing this * clicked/purchased product. If user clicks on product K in the @@ -2821,6 +3446,10 @@ public Builder setAttributionToken(java.lang.String value) { * [PredictResponse.attribution_token][google.cloud.retail.v2.PredictResponse.attribution_token] * for user events that are the result of * [PredictionService.Predict][google.cloud.retail.v2.PredictionService.Predict]. + * The value must be a valid + * [SearchResponse.attribution_token][google.cloud.retail.v2.SearchResponse.attribution_token] + * for user events that are the result of + * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. * This token enables us to accurately attribute page view or purchase back to * the event and the particular predict response containing this * clicked/purchased product. If user clicks on product K in the @@ -2854,6 +3483,10 @@ public Builder clearAttributionToken() { * [PredictResponse.attribution_token][google.cloud.retail.v2.PredictResponse.attribution_token] * for user events that are the result of * [PredictionService.Predict][google.cloud.retail.v2.PredictionService.Predict]. + * The value must be a valid + * [SearchResponse.attribution_token][google.cloud.retail.v2.SearchResponse.attribution_token] + * for user events that are the result of + * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. * This token enables us to accurately attribute page view or purchase back to * the event and the particular predict response containing this * clicked/purchased product. If user clicks on product K in the @@ -3433,6 +4066,219 @@ public com.google.cloud.retail.v2.ProductDetail.Builder addProductDetailsBuilder return productDetailsBuilder_; } + private com.google.cloud.retail.v2.CompletionDetail completionDetail_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2.CompletionDetail, + com.google.cloud.retail.v2.CompletionDetail.Builder, + com.google.cloud.retail.v2.CompletionDetailOrBuilder> + completionDetailBuilder_; + /** + * + * + *
+     * The main 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.
+     * 
+ * + * .google.cloud.retail.v2.CompletionDetail completion_detail = 22; + * + * @return Whether the completionDetail field is set. + */ + public boolean hasCompletionDetail() { + return completionDetailBuilder_ != null || completionDetail_ != null; + } + /** + * + * + *
+     * The main 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.
+     * 
+ * + * .google.cloud.retail.v2.CompletionDetail completion_detail = 22; + * + * @return The completionDetail. + */ + public com.google.cloud.retail.v2.CompletionDetail getCompletionDetail() { + if (completionDetailBuilder_ == null) { + return completionDetail_ == null + ? com.google.cloud.retail.v2.CompletionDetail.getDefaultInstance() + : completionDetail_; + } else { + return completionDetailBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The main 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.
+     * 
+ * + * .google.cloud.retail.v2.CompletionDetail completion_detail = 22; + */ + public Builder setCompletionDetail(com.google.cloud.retail.v2.CompletionDetail value) { + if (completionDetailBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + completionDetail_ = value; + onChanged(); + } else { + completionDetailBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The main 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.
+     * 
+ * + * .google.cloud.retail.v2.CompletionDetail completion_detail = 22; + */ + public Builder setCompletionDetail( + com.google.cloud.retail.v2.CompletionDetail.Builder builderForValue) { + if (completionDetailBuilder_ == null) { + completionDetail_ = builderForValue.build(); + onChanged(); + } else { + completionDetailBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The main 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.
+     * 
+ * + * .google.cloud.retail.v2.CompletionDetail completion_detail = 22; + */ + public Builder mergeCompletionDetail(com.google.cloud.retail.v2.CompletionDetail value) { + if (completionDetailBuilder_ == null) { + if (completionDetail_ != null) { + completionDetail_ = + com.google.cloud.retail.v2.CompletionDetail.newBuilder(completionDetail_) + .mergeFrom(value) + .buildPartial(); + } else { + completionDetail_ = value; + } + onChanged(); + } else { + completionDetailBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The main 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.
+     * 
+ * + * .google.cloud.retail.v2.CompletionDetail completion_detail = 22; + */ + public Builder clearCompletionDetail() { + if (completionDetailBuilder_ == null) { + completionDetail_ = null; + onChanged(); + } else { + completionDetail_ = null; + completionDetailBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The main 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.
+     * 
+ * + * .google.cloud.retail.v2.CompletionDetail completion_detail = 22; + */ + public com.google.cloud.retail.v2.CompletionDetail.Builder getCompletionDetailBuilder() { + + onChanged(); + return getCompletionDetailFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The main 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.
+     * 
+ * + * .google.cloud.retail.v2.CompletionDetail completion_detail = 22; + */ + public com.google.cloud.retail.v2.CompletionDetailOrBuilder getCompletionDetailOrBuilder() { + if (completionDetailBuilder_ != null) { + return completionDetailBuilder_.getMessageOrBuilder(); + } else { + return completionDetail_ == null + ? com.google.cloud.retail.v2.CompletionDetail.getDefaultInstance() + : completionDetail_; + } + } + /** + * + * + *
+     * The main 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.
+     * 
+ * + * .google.cloud.retail.v2.CompletionDetail completion_detail = 22; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2.CompletionDetail, + com.google.cloud.retail.v2.CompletionDetail.Builder, + com.google.cloud.retail.v2.CompletionDetailOrBuilder> + getCompletionDetailFieldBuilder() { + if (completionDetailBuilder_ == null) { + completionDetailBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2.CompletionDetail, + com.google.cloud.retail.v2.CompletionDetail.Builder, + com.google.cloud.retail.v2.CompletionDetailOrBuilder>( + getCompletionDetail(), getParentForChildren(), isClean()); + completionDetail_ = null; + } + return completionDetailBuilder_; + } + private com.google.protobuf.MapField< java.lang.String, com.google.cloud.retail.v2.CustomAttribute> attributes_; @@ -3978,9 +4824,14 @@ public com.google.cloud.retail.v2.PurchaseTransaction.Builder getPurchaseTransac * *
      * The user's search query.
+     * See [SearchRequest.query][google.cloud.retail.v2.SearchRequest.query] for
+     * definition.
      * The value must be a UTF-8 encoded string with a length limit of 5,000
      * characters. Otherwise, an INVALID_ARGUMENT error is returned.
-     * Required for `search` events. Other event types should not set this field.
+     * At least one of
+     * [search_query][google.cloud.retail.v2.UserEvent.search_query] or
+     * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is
+     * required for `search` events. Other event types should not set this field.
      * Otherwise, an INVALID_ARGUMENT error is returned.
      * 
* @@ -4004,9 +4855,14 @@ public java.lang.String getSearchQuery() { * *
      * The user's search query.
+     * See [SearchRequest.query][google.cloud.retail.v2.SearchRequest.query] for
+     * definition.
      * The value must be a UTF-8 encoded string with a length limit of 5,000
      * characters. Otherwise, an INVALID_ARGUMENT error is returned.
-     * Required for `search` events. Other event types should not set this field.
+     * At least one of
+     * [search_query][google.cloud.retail.v2.UserEvent.search_query] or
+     * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is
+     * required for `search` events. Other event types should not set this field.
      * Otherwise, an INVALID_ARGUMENT error is returned.
      * 
* @@ -4030,9 +4886,14 @@ public com.google.protobuf.ByteString getSearchQueryBytes() { * *
      * The user's search query.
+     * See [SearchRequest.query][google.cloud.retail.v2.SearchRequest.query] for
+     * definition.
      * The value must be a UTF-8 encoded string with a length limit of 5,000
      * characters. Otherwise, an INVALID_ARGUMENT error is returned.
-     * Required for `search` events. Other event types should not set this field.
+     * At least one of
+     * [search_query][google.cloud.retail.v2.UserEvent.search_query] or
+     * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is
+     * required for `search` events. Other event types should not set this field.
      * Otherwise, an INVALID_ARGUMENT error is returned.
      * 
* @@ -4055,9 +4916,14 @@ public Builder setSearchQuery(java.lang.String value) { * *
      * The user's search query.
+     * See [SearchRequest.query][google.cloud.retail.v2.SearchRequest.query] for
+     * definition.
      * The value must be a UTF-8 encoded string with a length limit of 5,000
      * characters. Otherwise, an INVALID_ARGUMENT error is returned.
-     * Required for `search` events. Other event types should not set this field.
+     * At least one of
+     * [search_query][google.cloud.retail.v2.UserEvent.search_query] or
+     * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is
+     * required for `search` events. Other event types should not set this field.
      * Otherwise, an INVALID_ARGUMENT error is returned.
      * 
* @@ -4076,9 +4942,14 @@ public Builder clearSearchQuery() { * *
      * The user's search query.
+     * See [SearchRequest.query][google.cloud.retail.v2.SearchRequest.query] for
+     * definition.
      * The value must be a UTF-8 encoded string with a length limit of 5,000
      * characters. Otherwise, an INVALID_ARGUMENT error is returned.
-     * Required for `search` events. Other event types should not set this field.
+     * At least one of
+     * [search_query][google.cloud.retail.v2.UserEvent.search_query] or
+     * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is
+     * required for `search` events. Other event types should not set this field.
      * Otherwise, an INVALID_ARGUMENT error is returned.
      * 
* @@ -4098,6 +4969,343 @@ public Builder setSearchQueryBytes(com.google.protobuf.ByteString value) { return this; } + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * The filter syntax consists of an expression language for constructing a
+     * predicate from one or more fields of the products being filtered.
+     * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
+     * definition and syntax.
+     * The value must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string filter = 16; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The filter syntax consists of an expression language for constructing a
+     * predicate from one or more fields of the products being filtered.
+     * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
+     * definition and syntax.
+     * The value must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string filter = 16; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The filter syntax consists of an expression language for constructing a
+     * predicate from one or more fields of the products being filtered.
+     * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
+     * definition and syntax.
+     * The value must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string filter = 16; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The filter syntax consists of an expression language for constructing a
+     * predicate from one or more fields of the products being filtered.
+     * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
+     * definition and syntax.
+     * The value must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string filter = 16; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * The filter syntax consists of an expression language for constructing a
+     * predicate from one or more fields of the products being filtered.
+     * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
+     * definition and syntax.
+     * The value must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string filter = 16; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * The order in which products are returned.
+     * See [SearchRequest.order_by][google.cloud.retail.v2.SearchRequest.order_by]
+     * for definition and syntax.
+     * The value must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * This can only be set for `search` events. Other event types should not set
+     * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string order_by = 17; + * + * @return The orderBy. + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The order in which products are returned.
+     * See [SearchRequest.order_by][google.cloud.retail.v2.SearchRequest.order_by]
+     * for definition and syntax.
+     * The value must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * This can only be set for `search` events. Other event types should not set
+     * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string order_by = 17; + * + * @return The bytes for orderBy. + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The order in which products are returned.
+     * See [SearchRequest.order_by][google.cloud.retail.v2.SearchRequest.order_by]
+     * for definition and syntax.
+     * The value must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * This can only be set for `search` events. Other event types should not set
+     * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string order_by = 17; + * + * @param value The orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + orderBy_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The order in which products are returned.
+     * See [SearchRequest.order_by][google.cloud.retail.v2.SearchRequest.order_by]
+     * for definition and syntax.
+     * The value must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * This can only be set for `search` events. Other event types should not set
+     * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string order_by = 17; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + + orderBy_ = getDefaultInstance().getOrderBy(); + onChanged(); + return this; + } + /** + * + * + *
+     * The order in which products are returned.
+     * See [SearchRequest.order_by][google.cloud.retail.v2.SearchRequest.order_by]
+     * for definition and syntax.
+     * The value must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * This can only be set for `search` events. Other event types should not set
+     * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string order_by = 17; + * + * @param value The bytes for orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + orderBy_ = value; + onChanged(); + return this; + } + + private int offset_; + /** + * + * + *
+     * An integer that specifies the current offset for pagination (the 0-indexed
+     * starting location, amongst the products deemed by the API as relevant).
+     * See [SearchRequest.offset][google.cloud.retail.v2.SearchRequest.offset] for
+     * definition.
+     * If this field is negative, an INVALID_ARGUMENT is returned.
+     * This can only be set for `search` events. Other event types should not set
+     * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * int32 offset = 18; + * + * @return The offset. + */ + @java.lang.Override + public int getOffset() { + return offset_; + } + /** + * + * + *
+     * An integer that specifies the current offset for pagination (the 0-indexed
+     * starting location, amongst the products deemed by the API as relevant).
+     * See [SearchRequest.offset][google.cloud.retail.v2.SearchRequest.offset] for
+     * definition.
+     * If this field is negative, an INVALID_ARGUMENT is returned.
+     * This can only be set for `search` events. Other event types should not set
+     * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * int32 offset = 18; + * + * @param value The offset to set. + * @return This builder for chaining. + */ + public Builder setOffset(int value) { + + offset_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * An integer that specifies the current offset for pagination (the 0-indexed
+     * starting location, amongst the products deemed by the API as relevant).
+     * See [SearchRequest.offset][google.cloud.retail.v2.SearchRequest.offset] for
+     * definition.
+     * If this field is negative, an INVALID_ARGUMENT is returned.
+     * This can only be set for `search` events. Other event types should not set
+     * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * int32 offset = 18; + * + * @return This builder for chaining. + */ + public Builder clearOffset() { + + offset_ = 0; + onChanged(); + return this; + } + private com.google.protobuf.LazyStringList pageCategories_ = com.google.protobuf.LazyStringArrayList.EMPTY; @@ -4118,8 +5326,11 @@ private void ensurePageCategoriesIsMutable() { * Category pages include special pages such as sales or promotions. For * instance, a special sale page may have the category hierarchy: * "pageCategories" : ["Sales > 2017 Black Friday Deals"]. - * Required for `category-page-view` events. Other event types should not set - * this field. Otherwise, an INVALID_ARGUMENT error is returned. + * Required for `category-page-view` events. At least one of + * [search_query][google.cloud.retail.v2.UserEvent.search_query] or + * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is + * required for `search` events. Other event types should not set this field. + * Otherwise, an INVALID_ARGUMENT error is returned. * * * repeated string page_categories = 11; @@ -4140,8 +5351,11 @@ public com.google.protobuf.ProtocolStringList getPageCategoriesList() { * Category pages include special pages such as sales or promotions. For * instance, a special sale page may have the category hierarchy: * "pageCategories" : ["Sales > 2017 Black Friday Deals"]. - * Required for `category-page-view` events. Other event types should not set - * this field. Otherwise, an INVALID_ARGUMENT error is returned. + * Required for `category-page-view` events. At least one of + * [search_query][google.cloud.retail.v2.UserEvent.search_query] or + * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is + * required for `search` events. Other event types should not set this field. + * Otherwise, an INVALID_ARGUMENT error is returned. * * * repeated string page_categories = 11; @@ -4162,8 +5376,11 @@ public int getPageCategoriesCount() { * Category pages include special pages such as sales or promotions. For * instance, a special sale page may have the category hierarchy: * "pageCategories" : ["Sales > 2017 Black Friday Deals"]. - * Required for `category-page-view` events. Other event types should not set - * this field. Otherwise, an INVALID_ARGUMENT error is returned. + * Required for `category-page-view` events. At least one of + * [search_query][google.cloud.retail.v2.UserEvent.search_query] or + * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is + * required for `search` events. Other event types should not set this field. + * Otherwise, an INVALID_ARGUMENT error is returned. * * * repeated string page_categories = 11; @@ -4185,8 +5402,11 @@ public java.lang.String getPageCategories(int index) { * Category pages include special pages such as sales or promotions. For * instance, a special sale page may have the category hierarchy: * "pageCategories" : ["Sales > 2017 Black Friday Deals"]. - * Required for `category-page-view` events. Other event types should not set - * this field. Otherwise, an INVALID_ARGUMENT error is returned. + * Required for `category-page-view` events. At least one of + * [search_query][google.cloud.retail.v2.UserEvent.search_query] or + * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is + * required for `search` events. Other event types should not set this field. + * Otherwise, an INVALID_ARGUMENT error is returned. * * * repeated string page_categories = 11; @@ -4208,8 +5428,11 @@ public com.google.protobuf.ByteString getPageCategoriesBytes(int index) { * Category pages include special pages such as sales or promotions. For * instance, a special sale page may have the category hierarchy: * "pageCategories" : ["Sales > 2017 Black Friday Deals"]. - * Required for `category-page-view` events. Other event types should not set - * this field. Otherwise, an INVALID_ARGUMENT error is returned. + * Required for `category-page-view` events. At least one of + * [search_query][google.cloud.retail.v2.UserEvent.search_query] or + * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is + * required for `search` events. Other event types should not set this field. + * Otherwise, an INVALID_ARGUMENT error is returned. * * * repeated string page_categories = 11; @@ -4238,8 +5461,11 @@ public Builder setPageCategories(int index, java.lang.String value) { * Category pages include special pages such as sales or promotions. For * instance, a special sale page may have the category hierarchy: * "pageCategories" : ["Sales > 2017 Black Friday Deals"]. - * Required for `category-page-view` events. Other event types should not set - * this field. Otherwise, an INVALID_ARGUMENT error is returned. + * Required for `category-page-view` events. At least one of + * [search_query][google.cloud.retail.v2.UserEvent.search_query] or + * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is + * required for `search` events. Other event types should not set this field. + * Otherwise, an INVALID_ARGUMENT error is returned. * * * repeated string page_categories = 11; @@ -4267,8 +5493,11 @@ public Builder addPageCategories(java.lang.String value) { * Category pages include special pages such as sales or promotions. For * instance, a special sale page may have the category hierarchy: * "pageCategories" : ["Sales > 2017 Black Friday Deals"]. - * Required for `category-page-view` events. Other event types should not set - * this field. Otherwise, an INVALID_ARGUMENT error is returned. + * Required for `category-page-view` events. At least one of + * [search_query][google.cloud.retail.v2.UserEvent.search_query] or + * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is + * required for `search` events. Other event types should not set this field. + * Otherwise, an INVALID_ARGUMENT error is returned. * * * repeated string page_categories = 11; @@ -4293,8 +5522,11 @@ public Builder addAllPageCategories(java.lang.Iterable values) * Category pages include special pages such as sales or promotions. For * instance, a special sale page may have the category hierarchy: * "pageCategories" : ["Sales > 2017 Black Friday Deals"]. - * Required for `category-page-view` events. Other event types should not set - * this field. Otherwise, an INVALID_ARGUMENT error is returned. + * Required for `category-page-view` events. At least one of + * [search_query][google.cloud.retail.v2.UserEvent.search_query] or + * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is + * required for `search` events. Other event types should not set this field. + * Otherwise, an INVALID_ARGUMENT error is returned. * * * repeated string page_categories = 11; @@ -4318,8 +5550,11 @@ public Builder clearPageCategories() { * Category pages include special pages such as sales or promotions. For * instance, a special sale page may have the category hierarchy: * "pageCategories" : ["Sales > 2017 Black Friday Deals"]. - * Required for `category-page-view` events. Other event types should not set - * this field. Otherwise, an INVALID_ARGUMENT error is returned. + * Required for `category-page-view` events. At least one of + * [search_query][google.cloud.retail.v2.UserEvent.search_query] or + * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is + * required for `search` events. Other event types should not set this field. + * Otherwise, an INVALID_ARGUMENT error is returned. * * * repeated string page_categories = 11; diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/UserEventOrBuilder.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/UserEventOrBuilder.java index ccc43da7..5d267d26 100644 --- a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/UserEventOrBuilder.java +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/UserEventOrBuilder.java @@ -31,8 +31,11 @@ public interface UserEventOrBuilder * * `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. + * * `promotion-not-offered`: Promotion is not offered to a user. * * `purchase-complete`: User finishing a purchase. * * `search`: Product search. * * `shopping-cart-page-view`: User viewing a shopping cart. @@ -51,8 +54,11 @@ public interface UserEventOrBuilder * * `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. + * * `promotion-not-offered`: Promotion is not offered to a user. * * `purchase-complete`: User finishing a purchase. * * `search`: Product search. * * `shopping-cart-page-view`: User viewing a shopping cart. @@ -74,6 +80,10 @@ public interface UserEventOrBuilder * identifier should not change if the visitor log in/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. + * The field should not contain PII or user-data. We recommend to use Google + * Analystics [Client + * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId) + * for this field. * * * string visitor_id = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -91,6 +101,10 @@ public interface UserEventOrBuilder * identifier should not change if the visitor log in/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. + * The field should not contain PII or user-data. We recommend to use Google + * Analystics [Client + * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId) + * for this field. * * * string visitor_id = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -99,6 +113,43 @@ public interface UserEventOrBuilder */ com.google.protobuf.ByteString getVisitorIdBytes(); + /** + * + * + *
+   * A unique identifier for tracking a visitor session with a length limit of
+   * 128 bytes. A session is an aggregation of an end user behavior in a time
+   * span.
+   * A general guideline to populate the sesion_id:
+   * 1. If user has no activity for 30 min, a new session_id should be assigned.
+   * 2. The session_id should be unique across users, suggest use uuid or add
+   * visitor_id as prefix.
+   * 
+ * + * string session_id = 21; + * + * @return The sessionId. + */ + java.lang.String getSessionId(); + /** + * + * + *
+   * A unique identifier for tracking a visitor session with a length limit of
+   * 128 bytes. A session is an aggregation of an end user behavior in a time
+   * span.
+   * A general guideline to populate the sesion_id:
+   * 1. If user has no activity for 30 min, a new session_id should be assigned.
+   * 2. The session_id should be unique across users, suggest use uuid or add
+   * visitor_id as prefix.
+   * 
+ * + * string session_id = 21; + * + * @return The bytes for sessionId. + */ + com.google.protobuf.ByteString getSessionIdBytes(); + /** * * @@ -215,6 +266,10 @@ public interface UserEventOrBuilder * [PredictResponse.attribution_token][google.cloud.retail.v2.PredictResponse.attribution_token] * for user events that are the result of * [PredictionService.Predict][google.cloud.retail.v2.PredictionService.Predict]. + * The value must be a valid + * [SearchResponse.attribution_token][google.cloud.retail.v2.SearchResponse.attribution_token] + * for user events that are the result of + * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. * This token enables us to accurately attribute page view or purchase back to * the event and the particular predict response containing this * clicked/purchased product. If user clicks on product K in the @@ -243,6 +298,10 @@ public interface UserEventOrBuilder * [PredictResponse.attribution_token][google.cloud.retail.v2.PredictResponse.attribution_token] * for user events that are the result of * [PredictionService.Predict][google.cloud.retail.v2.PredictionService.Predict]. + * The value must be a valid + * [SearchResponse.attribution_token][google.cloud.retail.v2.SearchResponse.attribution_token] + * for user events that are the result of + * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. * This token enables us to accurately attribute page view or purchase back to * the event and the particular predict response containing this * clicked/purchased product. If user clicks on product K in the @@ -367,6 +426,50 @@ public interface UserEventOrBuilder */ com.google.cloud.retail.v2.ProductDetailOrBuilder getProductDetailsOrBuilder(int index); + /** + * + * + *
+   * The main 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.
+   * 
+ * + * .google.cloud.retail.v2.CompletionDetail completion_detail = 22; + * + * @return Whether the completionDetail field is set. + */ + boolean hasCompletionDetail(); + /** + * + * + *
+   * The main 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.
+   * 
+ * + * .google.cloud.retail.v2.CompletionDetail completion_detail = 22; + * + * @return The completionDetail. + */ + com.google.cloud.retail.v2.CompletionDetail getCompletionDetail(); + /** + * + * + *
+   * The main 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.
+   * 
+ * + * .google.cloud.retail.v2.CompletionDetail completion_detail = 22; + */ + com.google.cloud.retail.v2.CompletionDetailOrBuilder getCompletionDetailOrBuilder(); + /** * * @@ -529,9 +632,14 @@ com.google.cloud.retail.v2.CustomAttribute getAttributesOrDefault( * *
    * The user's search query.
+   * See [SearchRequest.query][google.cloud.retail.v2.SearchRequest.query] for
+   * definition.
    * The value must be a UTF-8 encoded string with a length limit of 5,000
    * characters. Otherwise, an INVALID_ARGUMENT error is returned.
-   * Required for `search` events. Other event types should not set this field.
+   * At least one of
+   * [search_query][google.cloud.retail.v2.UserEvent.search_query] or
+   * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is
+   * required for `search` events. Other event types should not set this field.
    * Otherwise, an INVALID_ARGUMENT error is returned.
    * 
* @@ -545,9 +653,14 @@ com.google.cloud.retail.v2.CustomAttribute getAttributesOrDefault( * *
    * The user's search query.
+   * See [SearchRequest.query][google.cloud.retail.v2.SearchRequest.query] for
+   * definition.
    * The value must be a UTF-8 encoded string with a length limit of 5,000
    * characters. Otherwise, an INVALID_ARGUMENT error is returned.
-   * Required for `search` events. Other event types should not set this field.
+   * At least one of
+   * [search_query][google.cloud.retail.v2.UserEvent.search_query] or
+   * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is
+   * required for `search` events. Other event types should not set this field.
    * Otherwise, an INVALID_ARGUMENT error is returned.
    * 
* @@ -557,6 +670,97 @@ com.google.cloud.retail.v2.CustomAttribute getAttributesOrDefault( */ com.google.protobuf.ByteString getSearchQueryBytes(); + /** + * + * + *
+   * The filter syntax consists of an expression language for constructing a
+   * predicate from one or more fields of the products being filtered.
+   * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
+   * definition and syntax.
+   * The value must be a UTF-8 encoded string with a length limit of 1,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string filter = 16; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * The filter syntax consists of an expression language for constructing a
+   * predicate from one or more fields of the products being filtered.
+   * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
+   * definition and syntax.
+   * The value must be a UTF-8 encoded string with a length limit of 1,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string filter = 16; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * The order in which products are returned.
+   * See [SearchRequest.order_by][google.cloud.retail.v2.SearchRequest.order_by]
+   * for definition and syntax.
+   * The value must be a UTF-8 encoded string with a length limit of 1,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * This can only be set for `search` events. Other event types should not set
+   * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string order_by = 17; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * The order in which products are returned.
+   * See [SearchRequest.order_by][google.cloud.retail.v2.SearchRequest.order_by]
+   * for definition and syntax.
+   * The value must be a UTF-8 encoded string with a length limit of 1,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * This can only be set for `search` events. Other event types should not set
+   * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string order_by = 17; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); + + /** + * + * + *
+   * An integer that specifies the current offset for pagination (the 0-indexed
+   * starting location, amongst the products deemed by the API as relevant).
+   * See [SearchRequest.offset][google.cloud.retail.v2.SearchRequest.offset] for
+   * definition.
+   * If this field is negative, an INVALID_ARGUMENT is returned.
+   * This can only be set for `search` events. Other event types should not set
+   * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * int32 offset = 18; + * + * @return The offset. + */ + int getOffset(); + /** * * @@ -568,8 +772,11 @@ com.google.cloud.retail.v2.CustomAttribute getAttributesOrDefault( * Category pages include special pages such as sales or promotions. For * instance, a special sale page may have the category hierarchy: * "pageCategories" : ["Sales > 2017 Black Friday Deals"]. - * Required for `category-page-view` events. Other event types should not set - * this field. Otherwise, an INVALID_ARGUMENT error is returned. + * Required for `category-page-view` events. At least one of + * [search_query][google.cloud.retail.v2.UserEvent.search_query] or + * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is + * required for `search` events. Other event types should not set this field. + * Otherwise, an INVALID_ARGUMENT error is returned. * * * repeated string page_categories = 11; @@ -588,8 +795,11 @@ com.google.cloud.retail.v2.CustomAttribute getAttributesOrDefault( * Category pages include special pages such as sales or promotions. For * instance, a special sale page may have the category hierarchy: * "pageCategories" : ["Sales > 2017 Black Friday Deals"]. - * Required for `category-page-view` events. Other event types should not set - * this field. Otherwise, an INVALID_ARGUMENT error is returned. + * Required for `category-page-view` events. At least one of + * [search_query][google.cloud.retail.v2.UserEvent.search_query] or + * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is + * required for `search` events. Other event types should not set this field. + * Otherwise, an INVALID_ARGUMENT error is returned. * * * repeated string page_categories = 11; @@ -608,8 +818,11 @@ com.google.cloud.retail.v2.CustomAttribute getAttributesOrDefault( * Category pages include special pages such as sales or promotions. For * instance, a special sale page may have the category hierarchy: * "pageCategories" : ["Sales > 2017 Black Friday Deals"]. - * Required for `category-page-view` events. Other event types should not set - * this field. Otherwise, an INVALID_ARGUMENT error is returned. + * Required for `category-page-view` events. At least one of + * [search_query][google.cloud.retail.v2.UserEvent.search_query] or + * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is + * required for `search` events. Other event types should not set this field. + * Otherwise, an INVALID_ARGUMENT error is returned. * * * repeated string page_categories = 11; @@ -629,8 +842,11 @@ com.google.cloud.retail.v2.CustomAttribute getAttributesOrDefault( * Category pages include special pages such as sales or promotions. For * instance, a special sale page may have the category hierarchy: * "pageCategories" : ["Sales > 2017 Black Friday Deals"]. - * Required for `category-page-view` events. Other event types should not set - * this field. Otherwise, an INVALID_ARGUMENT error is returned. + * Required for `category-page-view` events. At least one of + * [search_query][google.cloud.retail.v2.UserEvent.search_query] or + * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is + * required for `search` events. Other event types should not set this field. + * Otherwise, an INVALID_ARGUMENT error is returned. * * * repeated string page_categories = 11; diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/UserEventProto.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/UserEventProto.java index d7ff4ff4..0d2fc9aa 100644 --- a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/UserEventProto.java +++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/UserEventProto.java @@ -39,6 +39,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_retail_v2_ProductDetail_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_retail_v2_ProductDetail_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2_CompletionDetail_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2_CompletionDetail_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_retail_v2_PurchaseTransaction_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -58,34 +62,40 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "or.proto\032#google/cloud/retail/v2/common." + "proto\032$google/cloud/retail/v2/product.pr" + "oto\032\037google/protobuf/timestamp.proto\032\036go" - + "ogle/protobuf/wrappers.proto\"\374\004\n\tUserEve" + + "ogle/protobuf/wrappers.proto\"\207\006\n\tUserEve" + "nt\022\027\n\nevent_type\030\001 \001(\tB\003\340A\002\022\027\n\nvisitor_i" - + "d\030\002 \001(\tB\003\340A\002\022.\n\nevent_time\030\003 \001(\0132\032.googl" - + "e.protobuf.Timestamp\022\026\n\016experiment_ids\030\004" - + " \003(\t\022\031\n\021attribution_token\030\005 \001(\t\022>\n\017produ" - + "ct_details\030\006 \003(\0132%.google.cloud.retail.v" - + "2.ProductDetail\022E\n\nattributes\030\007 \003(\01321.go" - + "ogle.cloud.retail.v2.UserEvent.Attribute" - + "sEntry\022\017\n\007cart_id\030\010 \001(\t\022I\n\024purchase_tran" - + "saction\030\t \001(\0132+.google.cloud.retail.v2.P" - + "urchaseTransaction\022\024\n\014search_query\030\n \001(\t" - + "\022\027\n\017page_categories\030\013 \003(\t\0223\n\tuser_info\030\014" - + " \001(\0132 .google.cloud.retail.v2.UserInfo\022\013" - + "\n\003uri\030\r \001(\t\022\024\n\014referrer_uri\030\016 \001(\t\022\024\n\014pag" - + "e_view_id\030\017 \001(\t\032Z\n\017AttributesEntry\022\013\n\003ke" - + "y\030\001 \001(\t\0226\n\005value\030\002 \001(\0132\'.google.cloud.re" - + "tail.v2.CustomAttribute:\0028\001\"u\n\rProductDe" - + "tail\0225\n\007product\030\001 \001(\0132\037.google.cloud.ret" - + "ail.v2.ProductB\003\340A\002\022-\n\010quantity\030\002 \001(\0132\033." - + "google.protobuf.Int32Value\"n\n\023PurchaseTr" - + "ansaction\022\n\n\002id\030\001 \001(\t\022\024\n\007revenue\030\002 \001(\002B\003" - + "\340A\002\022\013\n\003tax\030\003 \001(\002\022\014\n\004cost\030\004 \001(\002\022\032\n\rcurren" - + "cy_code\030\005 \001(\tB\003\340A\002B\303\001\n\032com.google.cloud." - + "retail.v2B\016UserEventProtoP\001Z\n\017product_details\030\006 \003(\0132%.g" + + "oogle.cloud.retail.v2.ProductDetail\022C\n\021c" + + "ompletion_detail\030\026 \001(\0132(.google.cloud.re" + + "tail.v2.CompletionDetail\022E\n\nattributes\030\007" + + " \003(\01321.google.cloud.retail.v2.UserEvent." + + "AttributesEntry\022\017\n\007cart_id\030\010 \001(\t\022I\n\024purc" + + "hase_transaction\030\t \001(\0132+.google.cloud.re" + + "tail.v2.PurchaseTransaction\022\024\n\014search_qu" + + "ery\030\n \001(\t\022\016\n\006filter\030\020 \001(\t\022\020\n\010order_by\030\021 " + + "\001(\t\022\016\n\006offset\030\022 \001(\005\022\027\n\017page_categories\030\013" + + " \003(\t\0223\n\tuser_info\030\014 \001(\0132 .google.cloud.r" + + "etail.v2.UserInfo\022\013\n\003uri\030\r \001(\t\022\024\n\014referr" + + "er_uri\030\016 \001(\t\022\024\n\014page_view_id\030\017 \001(\t\032Z\n\017At" + + "tributesEntry\022\013\n\003key\030\001 \001(\t\0226\n\005value\030\002 \001(" + + "\0132\'.google.cloud.retail.v2.CustomAttribu" + + "te:\0028\001\"u\n\rProductDetail\0225\n\007product\030\001 \001(\013" + + "2\037.google.cloud.retail.v2.ProductB\003\340A\002\022-" + + "\n\010quantity\030\002 \001(\0132\033.google.protobuf.Int32" + + "Value\"p\n\020CompletionDetail\022$\n\034completion_" + + "attribution_token\030\001 \001(\t\022\033\n\023selected_sugg" + + "estion\030\002 \001(\t\022\031\n\021selected_position\030\003 \001(\005\"" + + "n\n\023PurchaseTransaction\022\n\n\002id\030\001 \001(\t\022\024\n\007re" + + "venue\030\002 \001(\002B\003\340A\002\022\013\n\003tax\030\003 \001(\002\022\014\n\004cost\030\004 " + + "\001(\002\022\032\n\rcurrency_code\030\005 \001(\tB\003\340A\002B\303\001\n\032com." + + "google.cloud.retail.v2B\016UserEventProtoP\001" + + "Z - * The end user's IP address. This field is used to extract location - * information for personalization. + * 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. * 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. @@ -225,8 +226,9 @@ public java.lang.String getIpAddress() { * * *
-   * The end user's IP address. This field is used to extract location
-   * information for personalization.
+   * 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.
    * 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.
@@ -260,7 +262,8 @@ public com.google.protobuf.ByteString getIpAddressBytes() {
    *
    *
    * 
-   * User agent as included in the HTTP header.
+   * User agent as included in the HTTP header. Required for getting
+   * [SearchResponse.sponsored_results][google.cloud.retail.v2.SearchResponse.sponsored_results].
    * The field must be a UTF-8 encoded string with a length limit of 1,000
    * characters. Otherwise, an INVALID_ARGUMENT error is returned.
    * This should not be set when using the client side event reporting with
@@ -291,7 +294,8 @@ public java.lang.String getUserAgent() {
    *
    *
    * 
-   * User agent as included in the HTTP header.
+   * User agent as included in the HTTP header. Required for getting
+   * [SearchResponse.sponsored_results][google.cloud.retail.v2.SearchResponse.sponsored_results].
    * The field must be a UTF-8 encoded string with a length limit of 1,000
    * characters. Otherwise, an INVALID_ARGUMENT error is returned.
    * This should not be set when using the client side event reporting with
@@ -830,8 +834,9 @@ public Builder setUserIdBytes(com.google.protobuf.ByteString value) {
      *
      *
      * 
-     * The end user's IP address. This field is used to extract location
-     * information for personalization.
+     * 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.
      * 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.
@@ -861,8 +866,9 @@ public java.lang.String getIpAddress() {
      *
      *
      * 
-     * The end user's IP address. This field is used to extract location
-     * information for personalization.
+     * 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.
      * 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.
@@ -892,8 +898,9 @@ public com.google.protobuf.ByteString getIpAddressBytes() {
      *
      *
      * 
-     * The end user's IP address. This field is used to extract location
-     * information for personalization.
+     * 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.
      * 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.
@@ -922,8 +929,9 @@ public Builder setIpAddress(java.lang.String value) {
      *
      *
      * 
-     * The end user's IP address. This field is used to extract location
-     * information for personalization.
+     * 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.
      * 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.
@@ -948,8 +956,9 @@ public Builder clearIpAddress() {
      *
      *
      * 
-     * The end user's IP address. This field is used to extract location
-     * information for personalization.
+     * 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.
      * 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.
@@ -981,7 +990,8 @@ public Builder setIpAddressBytes(com.google.protobuf.ByteString value) {
      *
      *
      * 
-     * User agent as included in the HTTP header.
+     * User agent as included in the HTTP header. Required for getting
+     * [SearchResponse.sponsored_results][google.cloud.retail.v2.SearchResponse.sponsored_results].
      * The field must be a UTF-8 encoded string with a length limit of 1,000
      * characters. Otherwise, an INVALID_ARGUMENT error is returned.
      * This should not be set when using the client side event reporting with
@@ -1011,7 +1021,8 @@ public java.lang.String getUserAgent() {
      *
      *
      * 
-     * User agent as included in the HTTP header.
+     * User agent as included in the HTTP header. Required for getting
+     * [SearchResponse.sponsored_results][google.cloud.retail.v2.SearchResponse.sponsored_results].
      * The field must be a UTF-8 encoded string with a length limit of 1,000
      * characters. Otherwise, an INVALID_ARGUMENT error is returned.
      * This should not be set when using the client side event reporting with
@@ -1041,7 +1052,8 @@ public com.google.protobuf.ByteString getUserAgentBytes() {
      *
      *
      * 
-     * User agent as included in the HTTP header.
+     * User agent as included in the HTTP header. Required for getting
+     * [SearchResponse.sponsored_results][google.cloud.retail.v2.SearchResponse.sponsored_results].
      * The field must be a UTF-8 encoded string with a length limit of 1,000
      * characters. Otherwise, an INVALID_ARGUMENT error is returned.
      * This should not be set when using the client side event reporting with
@@ -1070,7 +1082,8 @@ public Builder setUserAgent(java.lang.String value) {
      *
      *
      * 
-     * User agent as included in the HTTP header.
+     * User agent as included in the HTTP header. Required for getting
+     * [SearchResponse.sponsored_results][google.cloud.retail.v2.SearchResponse.sponsored_results].
      * The field must be a UTF-8 encoded string with a length limit of 1,000
      * characters. Otherwise, an INVALID_ARGUMENT error is returned.
      * This should not be set when using the client side event reporting with
@@ -1095,7 +1108,8 @@ public Builder clearUserAgent() {
      *
      *
      * 
-     * User agent as included in the HTTP header.
+     * User agent as included in the HTTP header. Required for getting
+     * [SearchResponse.sponsored_results][google.cloud.retail.v2.SearchResponse.sponsored_results].
      * The field must be a UTF-8 encoded string with a length limit of 1,000
      * characters. Otherwise, an INVALID_ARGUMENT error is returned.
      * This should not be set when using the client side event reporting with
diff --git a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/UserInfoOrBuilder.java b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/UserInfoOrBuilder.java
index 7d78a82f..440e013c 100644
--- a/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/UserInfoOrBuilder.java
+++ b/proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/UserInfoOrBuilder.java
@@ -58,8 +58,9 @@ public interface UserInfoOrBuilder
    *
    *
    * 
-   * The end user's IP address. This field is used to extract location
-   * information for personalization.
+   * 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.
    * 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.
@@ -79,8 +80,9 @@ public interface UserInfoOrBuilder
    *
    *
    * 
-   * The end user's IP address. This field is used to extract location
-   * information for personalization.
+   * 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.
    * 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.
@@ -101,7 +103,8 @@ public interface UserInfoOrBuilder
    *
    *
    * 
-   * User agent as included in the HTTP header.
+   * User agent as included in the HTTP header. Required for getting
+   * [SearchResponse.sponsored_results][google.cloud.retail.v2.SearchResponse.sponsored_results].
    * The field must be a UTF-8 encoded string with a length limit of 1,000
    * characters. Otherwise, an INVALID_ARGUMENT error is returned.
    * This should not be set when using the client side event reporting with
@@ -121,7 +124,8 @@ public interface UserInfoOrBuilder
    *
    *
    * 
-   * User agent as included in the HTTP header.
+   * User agent as included in the HTTP header. Required for getting
+   * [SearchResponse.sponsored_results][google.cloud.retail.v2.SearchResponse.sponsored_results].
    * The field must be a UTF-8 encoded string with a length limit of 1,000
    * characters. Otherwise, an INVALID_ARGUMENT error is returned.
    * This should not be set when using the client side event reporting with
diff --git a/proto-google-cloud-retail-v2/src/main/proto/google/cloud/retail/v2/catalog.proto b/proto-google-cloud-retail-v2/src/main/proto/google/cloud/retail/v2/catalog.proto
index ded4ebd0..20cd402c 100644
--- a/proto-google-cloud-retail-v2/src/main/proto/google/cloud/retail/v2/catalog.proto
+++ b/proto-google-cloud-retail-v2/src/main/proto/google/cloud/retail/v2/catalog.proto
@@ -19,6 +19,8 @@ package google.cloud.retail.v2;
 import "google/api/annotations.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";
 
 option csharp_namespace = "Google.Cloud.Retail.V2";
 option go_package = "google.golang.org/genproto/googleapis/cloud/retail/v2;retail";
@@ -55,9 +57,9 @@ message ProductLevelConfig {
   // [merchant_center_product_id_field][google.cloud.retail.v2.ProductLevelConfig.merchant_center_product_id_field]
   // is `itemGroupId`, an INVALID_ARGUMENT error is returned.
   //
-  // See [Using catalog
-  // levels](/retail/recommendations-ai/docs/catalog#catalog-levels) for more
-  // details.
+  // See [Using product
+  // levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels)
+  // for more details.
   string ingestion_product_type = 1;
 
   // Which field of [Merchant Center
@@ -77,9 +79,9 @@ message ProductLevelConfig {
   // [ingestion_product_type][google.cloud.retail.v2.ProductLevelConfig.ingestion_product_type]
   // is `variant`, an INVALID_ARGUMENT error is returned.
   //
-  // See [Using catalog
-  // levels](/retail/recommendations-ai/docs/catalog#catalog-levels) for more
-  // details.
+  // See [Using product
+  // levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels)
+  // for more details.
   string merchant_center_product_id_field = 2;
 }
 
diff --git a/proto-google-cloud-retail-v2/src/main/proto/google/cloud/retail/v2/catalog_service.proto b/proto-google-cloud-retail-v2/src/main/proto/google/cloud/retail/v2/catalog_service.proto
index 4adda8df..30858061 100644
--- a/proto-google-cloud-retail-v2/src/main/proto/google/cloud/retail/v2/catalog_service.proto
+++ b/proto-google-cloud-retail-v2/src/main/proto/google/cloud/retail/v2/catalog_service.proto
@@ -57,6 +57,67 @@ service CatalogService {
     };
     option (google.api.method_signature) = "catalog,update_mask";
   }
+
+  // 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.
+  // Contact Retail Support (retail-search-support@google.com) if you are
+  // interested in using Retail Search.
+  rpc SetDefaultBranch(SetDefaultBranchRequest)
+      returns (google.protobuf.Empty) {
+    option (google.api.http) = {
+      post: "/v2/{catalog=projects/*/locations/*/catalogs/*}:setDefaultBranch"
+      body: "*"
+    };
+    option (google.api.method_signature) = "catalog";
+  }
+
+  // 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.
+  // Contact Retail Support (retail-search-support@google.com) if you are
+  // interested in using Retail Search.
+  rpc GetDefaultBranch(GetDefaultBranchRequest)
+      returns (GetDefaultBranchResponse) {
+    option (google.api.http) = {
+      get: "/v2/{catalog=projects/*/locations/*/catalogs/*}:getDefaultBranch"
+    };
+    option (google.api.method_signature) = "catalog";
+  }
 }
 
 // Request for
@@ -125,12 +186,60 @@ message UpdateCatalogRequest {
   Catalog catalog = 1 [(google.api.field_behavior) = REQUIRED];
 
   // Indicates which fields in the provided
-  // [Catalog][google.cloud.retail.v2.Catalog] to update. If not set, will only
-  // update the
-  // [Catalog.product_level_config][google.cloud.retail.v2.Catalog.product_level_config]
-  // field, which is also the only currently supported field to update.
+  // [Catalog][google.cloud.retail.v2.Catalog] to update.
   //
   // If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
   // is returned.
   google.protobuf.FieldMask update_mask = 2;
 }
+
+// Request message to set a specified branch as new default_branch.
+message SetDefaultBranchRequest {
+  // Full resource name of the catalog, such as
+  // `projects/*/locations/global/catalogs/default_catalog`.
+  string catalog = 1 [
+    (google.api.resource_reference) = { type: "retail.googleapis.com/Catalog" }
+  ];
+
+  // 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.
+  string branch_id = 2 [
+    (google.api.resource_reference) = { type: "retail.googleapis.com/Branch" }
+  ];
+
+  // Some note on this request, this can be retrieved by
+  // [CatalogService.GetDefaultBranch][google.cloud.retail.v2.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.
+  string note = 3;
+}
+
+// Request message to show which branch is currently the default branch.
+message GetDefaultBranchRequest {
+  // The parent catalog resource name, such as
+  // `projects/*/locations/global/catalogs/default_catalog`.
+  string catalog = 1 [
+    (google.api.resource_reference) = { type: "retail.googleapis.com/Catalog" }
+  ];
+}
+
+// Response message of
+// [CatalogService.GetDefaultBranch][google.cloud.retail.v2.CatalogService.GetDefaultBranch].
+message GetDefaultBranchResponse {
+  // Full resource name of the branch id currently set as default branch.
+  string branch = 1 [
+    (google.api.resource_reference) = { type: "retail.googleapis.com/Branch" }
+  ];
+
+  // The time when this branch is set to default.
+  google.protobuf.Timestamp set_time = 2;
+
+  // This corresponds to
+  // [SetDefaultBranchRequest.note][google.cloud.retail.v2.SetDefaultBranchRequest.note]
+  // field, when this branch was set as default.
+  string note = 3;
+}
diff --git a/proto-google-cloud-retail-v2/src/main/proto/google/cloud/retail/v2/common.proto b/proto-google-cloud-retail-v2/src/main/proto/google/cloud/retail/v2/common.proto
index 341126af..e1e06f87 100644
--- a/proto-google-cloud-retail-v2/src/main/proto/google/cloud/retail/v2/common.proto
+++ b/proto-google-cloud-retail-v2/src/main/proto/google/cloud/retail/v2/common.proto
@@ -29,8 +29,73 @@ option objc_class_prefix = "RETAIL";
 option php_namespace = "Google\\Cloud\\Retail\\V2";
 option ruby_package = "Google::Cloud::Retail::V2";
 
+// An intended audience of the [Product][google.cloud.retail.v2.Product] for
+// whom it's sold.
+message Audience {
+  // The genders of the audience. Strongly encouraged to use the standard
+  // values: "male", "female", "unisex".
+  //
+  // At most 5 values are allowed. 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
+  // [gender](https://support.google.com/merchants/answer/6324479). Schema.org
+  // property
+  // [Product.audience.suggestedGender](https://schema.org/suggestedGender).
+  repeated string genders = 1;
+
+  // The age groups of the audience. Strongly encouraged to use the standard
+  // values: "newborn" (up to 3 months old), "infant" (3–12 months old),
+  // "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
+  // teens or older).
+  //
+  // At most 5 values are allowed. 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
+  // [age_group](https://support.google.com/merchants/answer/6324463).
+  // Schema.org property
+  // [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
+  // [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
+  repeated string age_groups = 2;
+}
+
+// The color information of a [Product][google.cloud.retail.v2.Product].
+message ColorInfo {
+  // The standard color families. Strongly recommended to use the following
+  // standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple",
+  // "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and
+  // "Mixed". Normally it is expected to have only 1 color family. May consider
+  // using single "Mixed" instead of multiple values.
+  //
+  // A maximum of 5 values are allowed. 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
+  // [color](https://support.google.com/merchants/answer/6324487). Schema.org
+  // property [Product.color](https://schema.org/color).
+  repeated string color_families = 1;
+
+  // The color display names, which may be different from standard color family
+  // names, such as the color aliases used in the website frontend. Normally
+  // it is expected to have only 1 color. May consider using single "Mixed"
+  // instead of multiple values.
+  //
+  // A maximum of 5 colors are allowed. 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
+  // [color](https://support.google.com/merchants/answer/6324487). Schema.org
+  // property [Product.color](https://schema.org/color).
+  repeated string colors = 2;
+}
+
 // A custom attribute that is not explicitly modeled in
-// [Product][google.cloud.retail.v2.Product]].
+// [Product][google.cloud.retail.v2.Product].
 message CustomAttribute {
   // The textual values of this custom attribute. For example, `["yellow",
   // "green"]` when the key is "color".
@@ -54,6 +119,63 @@ message CustomAttribute {
   // [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
+  // [SearchService.Search][google.cloud.retail.v2.SearchService.Search].
+  //
+  // This field is ignored in a [UserEvent][google.cloud.retail.v2.UserEvent].
+  //
+  // Only set if type [text][google.cloud.retail.v2.CustomAttribute.text] is
+  // 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
+  // [SearchService.Search][google.cloud.retail.v2.SearchService.Search].
+  //
+  // This field is ignored in a [UserEvent][google.cloud.retail.v2.UserEvent].
+  //
+  // See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter],
+  // [SearchRequest.facet_specs][google.cloud.retail.v2.SearchRequest.facet_specs]
+  // and
+  // [SearchRequest.boost_spec][google.cloud.retail.v2.SearchRequest.boost_spec]
+  // for more details.
+  optional bool indexable = 4;
+}
+
+// Fulfillment information, such as the store IDs for in-store pickup or region
+// IDs for different shipping methods.
+message FulfillmentInfo {
+  // The fulfillment type, including 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.
+  string type = 1;
+
+  // The IDs for this [type][google.cloud.retail.v2.FulfillmentInfo.type], such
+  // as the store IDs for
+  // [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2.FulfillmentInfo.type]
+  // or the region IDs for
+  // [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2.FulfillmentInfo.type].
+  //
+  // A maximum of 2000 values are allowed. Each value must be a string with a
+  // length limit of 10 characters, matching the pattern [a-zA-Z0-9_-]+, such as
+  // "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is returned.
+  repeated string place_ids = 2;
 }
 
 // [Product][google.cloud.retail.v2.Product] thumbnail/detail image.
@@ -81,13 +203,71 @@ message Image {
   int32 width = 3;
 }
 
+// A floating point interval.
+message Interval {
+  // The lower bound of the interval. If neither of the min fields are set, then
+  // the lower bound is negative infinity.
+  //
+  // This field must be not larger than
+  // [max][google.cloud.retail.v2.Interval.max]. Otherwise, an INVALID_ARGUMENT
+  // error is returned.
+  oneof min {
+    // Inclusive lower bound.
+    double minimum = 1;
+
+    // Exclusive lower bound.
+    double exclusive_minimum = 2;
+  }
+
+  // The upper bound of the interval. If neither of the max fields are set, then
+  // the upper bound is positive infinity.
+  //
+  // This field must be not smaller than
+  // [min][google.cloud.retail.v2.Interval.min]. Otherwise, an INVALID_ARGUMENT
+  // error is returned.
+  oneof max {
+    // Inclusive upper bound.
+    double maximum = 3;
+
+    // Exclusive upper bound.
+    double exclusive_maximum = 4;
+  }
+}
+
 // The price information of a [Product][google.cloud.retail.v2.Product].
 message PriceInfo {
+  // The price range of all
+  // [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+  // [Product][google.cloud.retail.v2.Product] having the same
+  // [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id].
+  message PriceRange {
+    // The inclusive
+    // [Product.pricing_info.price][google.cloud.retail.v2.PriceInfo.price]
+    // interval of all [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+    // [Product][google.cloud.retail.v2.Product] having the same
+    // [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id].
+    Interval price = 1;
+
+    // The inclusive
+    // [Product.pricing_info.original_price][google.cloud.retail.v2.PriceInfo.original_price]
+    // internal of all [variant][google.cloud.retail.v2.Product.Type.VARIANT]
+    // [Product][google.cloud.retail.v2.Product] having the same
+    // [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id].
+    Interval original_price = 2;
+  }
+
   // The 3-letter currency code defined in [ISO
   // 4217](https://www.iso.org/iso-4217-currency-codes.html).
   //
   // If this field is an unrecognizable currency code, an INVALID_ARGUMENT
   // error is returned.
+  //
+  // The [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]
+  // [Product][google.cloud.retail.v2.Product]s with the same
+  // [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id]
+  // must share the same
+  // [currency_code][google.cloud.retail.v2.PriceInfo.currency_code]. Otherwise,
+  // a FAILED_PRECONDITION error is returned.
   string currency_code = 1;
 
   // Price of the product.
@@ -110,6 +290,73 @@ message PriceInfo {
   // Google Merchant Center property
   // [cost_of_goods_sold](https://support.google.com/merchants/answer/9017895).
   float cost = 4;
+
+  // The timestamp when the [price][google.cloud.retail.v2.PriceInfo.price]
+  // starts to be effective. This can be set as a future timestamp, and the
+  // [price][google.cloud.retail.v2.PriceInfo.price] is only used for search
+  // after
+  // [price_effective_time][google.cloud.retail.v2.PriceInfo.price_effective_time].
+  // If so, the
+  // [original_price][google.cloud.retail.v2.PriceInfo.original_price] must be
+  // set and [original_price][google.cloud.retail.v2.PriceInfo.original_price]
+  // is used before
+  // [price_effective_time][google.cloud.retail.v2.PriceInfo.price_effective_time].
+  //
+  // Do not set if [price][google.cloud.retail.v2.PriceInfo.price] is always
+  // effective because it will cause additional latency during search.
+  google.protobuf.Timestamp price_effective_time = 5;
+
+  // The timestamp when the [price][google.cloud.retail.v2.PriceInfo.price]
+  // stops to be effective. The [price][google.cloud.retail.v2.PriceInfo.price]
+  // is used for search before
+  // [price_expire_time][google.cloud.retail.v2.PriceInfo.price_expire_time]. If
+  // this field is set, the
+  // [original_price][google.cloud.retail.v2.PriceInfo.original_price] must be
+  // set and [original_price][google.cloud.retail.v2.PriceInfo.original_price]
+  // is used after
+  // [price_expire_time][google.cloud.retail.v2.PriceInfo.price_expire_time].
+  //
+  // Do not set if [price][google.cloud.retail.v2.PriceInfo.price] is always
+  // effective because it will cause additional latency during search.
+  google.protobuf.Timestamp price_expire_time = 6;
+
+  // Output only. The price range of all the child
+  // [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]
+  // [Product][google.cloud.retail.v2.Product]s grouped together on the
+  // [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+  // [Product][google.cloud.retail.v2.Product]. Only populated for
+  // [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+  // [Product][google.cloud.retail.v2.Product]s.
+  //
+  // Note: This field is OUTPUT_ONLY for
+  // [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct].
+  // Do not set this field in API requests.
+  PriceRange price_range = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
+}
+
+// The rating of a [Product][google.cloud.retail.v2.Product].
+message Rating {
+  // The total number of ratings. This value is independent of the value of
+  // [rating_histogram][google.cloud.retail.v2.Rating.rating_histogram].
+  //
+  // This value must be nonnegative. Otherwise, an INVALID_ARGUMENT error is
+  // returned.
+  int32 rating_count = 1;
+
+  // The average rating of the [Product][google.cloud.retail.v2.Product].
+  //
+  // The rating is scaled at 1-5. Otherwise, an INVALID_ARGUMENT error is
+  // returned.
+  float average_rating = 2;
+
+  // List of rating counts per rating value (index = rating - 1). The list is
+  // empty if there is no rating. If the list is non-empty, its size is
+  // always 5. Otherwise, an INVALID_ARGUMENT error is returned.
+  //
+  // For example, [41, 14, 13, 47, 303]. It means that the
+  // [Product][google.cloud.retail.v2.Product] got 41 ratings with 1 star, 14
+  // ratings with 2 star, and so on.
+  repeated int32 rating_histogram = 3;
 }
 
 // Information of an end user.
@@ -121,8 +368,9 @@ message UserInfo {
   // characters. Otherwise, an INVALID_ARGUMENT error is returned.
   string user_id = 1;
 
-  // The end user's IP address. This field is used to extract location
-  // information for personalization.
+  // 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.
   //
   // 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
@@ -135,7 +383,8 @@ message UserInfo {
   // is set.
   string ip_address = 2;
 
-  // User agent as included in the HTTP header.
+  // User agent as included in the HTTP header. Required for getting
+  // [SearchResponse.sponsored_results][google.cloud.retail.v2.SearchResponse.sponsored_results].
   //
   // The field must be a UTF-8 encoded string with a length limit of 1,000
   // characters. Otherwise, an INVALID_ARGUMENT error is returned.
@@ -159,3 +408,17 @@ message UserInfo {
   // [UserEventService.CollectUserEvent][google.cloud.retail.v2.UserEventService.CollectUserEvent].
   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.
+  //
+  // Google Merchant Center property
+  // [promotion](https://support.google.com/merchants/answer/7050148).
+  string promotion_id = 1;
+}
diff --git a/proto-google-cloud-retail-v2/src/main/proto/google/cloud/retail/v2/completion_service.proto b/proto-google-cloud-retail-v2/src/main/proto/google/cloud/retail/v2/completion_service.proto
new file mode 100644
index 00000000..478dac63
--- /dev/null
+++ b/proto-google-cloud-retail-v2/src/main/proto/google/cloud/retail/v2/completion_service.proto
@@ -0,0 +1,193 @@
+// Copyright 2020 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;
+
+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/longrunning/operations.proto";
+
+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 = "CompletionServiceProto";
+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";
+
+// Auto-completion service for retail.
+//
+// This feature is only available for users who have Retail Search enabled.
+// Contact Retail Support (retail-search-support@google.com) if you are
+// interested in using Retail Search.
+service CompletionService {
+  option (google.api.default_host) = "retail.googleapis.com";
+  option (google.api.oauth_scopes) =
+      "https://www.googleapis.com/auth/cloud-platform";
+
+  // Completes the specified prefix with keyword suggestions.
+  //
+  // This feature is only available for users who have Retail Search enabled.
+  // Contact Retail Support (retail-search-support@google.com) if you are
+  // interested in using Retail Search.
+  rpc CompleteQuery(CompleteQueryRequest) returns (CompleteQueryResponse) {
+    option (google.api.http) = {
+      get: "/v2/{catalog=projects/*/locations/*/catalogs/*}:completeQuery"
+    };
+  }
+
+  // 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.
+  // Contact Retail Support (retail-search-support@google.com) if you are
+  // interested in using Retail Search.
+  rpc ImportCompletionData(ImportCompletionDataRequest)
+      returns (google.longrunning.Operation) {
+    option (google.api.http) = {
+      post: "/v2/{parent=projects/*/locations/*/catalogs/*}/completionData:import"
+      body: "*"
+    };
+    option (google.longrunning.operation_info) = {
+      response_type: "google.cloud.retail.v2.ImportCompletionDataResponse"
+      metadata_type: "google.cloud.retail.v2.ImportMetadata"
+    };
+  }
+}
+
+// Auto-complete parameters.
+message CompleteQueryRequest {
+  // Required. Catalog for which the completion is performed.
+  //
+  // Full resource name of catalog, such as
+  // `projects/*/locations/global/catalogs/default_catalog`.
+  string catalog = 1 [
+    (google.api.field_behavior) = REQUIRED,
+    (google.api.resource_reference) = { type: "retail.googleapis.com/Catalog" }
+  ];
+
+  // Required. The query used to generate suggestions.
+  //
+  // 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.
+  //
+  // 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.
+  repeated string language_codes = 3;
+
+  // The device type context for completion suggestions.
+  // It is useful to apply different suggestions on different device types, e.g.
+  // DESKTOP, MOBILE. If it is empty, the suggestions are across all device
+  // types.
+  //
+  // Supported formats:
+  //
+  // * UNKNOWN_DEVICE_TYPE
+  //
+  // * DESKTOP
+  //
+  // * MOBILE
+  //
+  // * A customized string starts with OTHER_, e.g. OTHER_IPHONE.
+  string device_type = 4;
+
+  // Determines which dataset to use for fetching completion. "user-data" will
+  // use the imported dataset through
+  // [CompletionService.ImportCompletionData][google.cloud.retail.v2.CompletionService.ImportCompletionData].
+  // "cloud-retail" will use the dataset generated by cloud retail based on user
+  // events. If leave empty, it will use the "user-data".
+  //
+  // Current supported values:
+  //
+  // * user-data
+  //
+  // * cloud-retail
+  //   This option is not automatically enabled. Before using cloud-retail,
+  //   contact retail-search-support@google.com first.
+  string dataset = 6;
+
+  // Completion max suggestions.
+  //
+  // The maximum allowed max suggestions is 20. The default value is 20.
+  int32 max_suggestions = 5;
+}
+
+// Response of the auto-complete query.
+message CompleteQueryResponse {
+  // Resource that represents completion results.
+  message CompletionResult {
+    // The suggestion for the query.
+    string suggestion = 1;
+
+    // Additional custom attributes ingested through BigQuery.
+    map attributes = 2;
+  }
+
+  // Recent search of this user.
+  message RecentSearchResult {
+    // The recent search query.
+    string recent_search = 1;
+  }
+
+  // Results of the matching suggestions. The result list is ordered and the
+  // first result is top suggestion.
+  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.
+  string attribution_token = 2;
+
+  // Matched recent searches of this user. This field is a restricted feature.
+  // Contact Retail Support (retail-search-support@google.com) if you are
+  // interested in enabling it.
+  //
+  // This feature is only available when
+  // [CompleteQueryRequest.visitor_id][google.cloud.retail.v2.CompleteQueryRequest.visitor_id]
+  // field is set and [UserEvent][google.cloud.retail.v2.UserEvent] is imported.
+  // The recent searches satisfy the follow rules:
+  //  * They are ordered from latest to oldest.
+  //  * They are matched with
+  //  [CompleteQueryRequest.query][google.cloud.retail.v2.CompleteQueryRequest.query]
+  //  case insensitively.
+  //  * They are transformed to lower cases.
+  //  * They are UTF-8 safe.
+  //
+  // Recent searches are deduplicated. More recent searches will be reserved
+  // when duplication happens.
+  repeated RecentSearchResult recent_search_results = 3;
+}
diff --git a/proto-google-cloud-retail-v2/src/main/proto/google/cloud/retail/v2/import_config.proto b/proto-google-cloud-retail-v2/src/main/proto/google/cloud/retail/v2/import_config.proto
index 3d4c2686..1fb849da 100644
--- a/proto-google-cloud-retail-v2/src/main/proto/google/cloud/retail/v2/import_config.proto
+++ b/proto-google-cloud-retail-v2/src/main/proto/google/cloud/retail/v2/import_config.proto
@@ -18,11 +18,13 @@ package google.cloud.retail.v2;
 
 import "google/api/annotations.proto";
 import "google/api/field_behavior.proto";
+import "google/api/resource.proto";
 import "google/cloud/retail/v2/product.proto";
 import "google/cloud/retail/v2/user_event.proto";
 import "google/protobuf/field_mask.proto";
 import "google/protobuf/timestamp.proto";
 import "google/rpc/status.proto";
+import "google/type/date.proto";
 
 option csharp_namespace = "Google.Cloud.Retail.V2";
 option go_package = "google.golang.org/genproto/googleapis/cloud/retail/v2;retail";
@@ -42,7 +44,7 @@ message GcsSource {
   // files, such as `gs://bucket/directory/*.json`. A request can
   // contain at most 100 files, and each file can be up to 2 GB. See
   // [Importing product
-  // information](https://cloud.google.com/recommendations-ai/docs/upload-catalog)
+  // information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog)
   // for the expected file format and setup instructions.
   repeated string input_uris = 1 [(google.api.field_behavior) = REQUIRED];
 
@@ -61,15 +63,26 @@ message GcsSource {
   // * `user_event` (default): One JSON
   // [UserEvent][google.cloud.retail.v2.UserEvent] per line.
   // * `user_event_ga360`: Using
-  //   https://support.google.com/analytics/answer/3437719?hl=en.
+  //   https://support.google.com/analytics/answer/3437719.
   string data_schema = 2;
 }
 
 // BigQuery source import data from.
 message BigQuerySource {
-  // The project id (can be project # or id) that the BigQuery source is in with
+  // BigQuery table partition info. Leave this empty if the BigQuery table
+  // is not partitioned.
+  oneof partition {
+    // BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
+    //
+    // Only supported when
+    // [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2.ImportProductsRequest.reconciliation_mode]
+    // is set to `FULL`.
+    google.type.Date partition_date = 6;
+  }
+
+  // The project ID (can be project # or ID) that the BigQuery source is in with
   // a length limit of 128 characters. If not specified, inherits the project
-  // id from the parent request.
+  // ID from the parent request.
   string project_id = 5;
 
   // Required. The BigQuery data set to copy the data from with a length limit
@@ -100,7 +113,7 @@ message BigQuerySource {
   // * `user_event` (default): One JSON
   // [UserEvent][google.cloud.retail.v2.UserEvent] per line.
   // * `user_event_ga360`: Using
-  //   https://support.google.com/analytics/answer/3437719?hl=en.
+  //   https://support.google.com/analytics/answer/3437719.
   string data_schema = 4;
 }
 
@@ -108,7 +121,7 @@ message BigQuerySource {
 message ProductInlineSource {
   // Required. A list of products to update/create. Each product must have a
   // valid [Product.id][google.cloud.retail.v2.Product.id]. Recommended max of
-  // 10k items.
+  // 100 items.
   repeated Product products = 1 [(google.api.field_behavior) = REQUIRED];
 }
 
@@ -132,12 +145,51 @@ message ImportErrorsConfig {
 
 // Request message for Import methods.
 message ImportProductsRequest {
+  // Indicates how imported products are reconciled with the existing products
+  // created or imported before.
+  enum ReconciliationMode {
+    // Defaults to INCREMENTAL.
+    RECONCILIATION_MODE_UNSPECIFIED = 0;
+
+    // Inserts new products or updates existing products.
+    INCREMENTAL = 1;
+
+    // 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].
+    //
+    // 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.
+    // Contact Retail Support (retail-search-support@google.com) if you are
+    // interested in using Retail Search.
+    FULL = 2;
+  }
+
   // Required.
   // `projects/1234/locations/global/catalogs/default_catalog/branches/default_branch`
   //
   // If no updateMask is specified, requires products.create permission.
   // If updateMask is specified, requires products.update permission.
-  string parent = 1 [(google.api.field_behavior) = REQUIRED];
+  string parent = 1 [
+    (google.api.field_behavior) = REQUIRED,
+    (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;
 
   // Required. The desired input location of the data.
   ProductInputConfig input_config = 2 [(google.api.field_behavior) = REQUIRED];
@@ -148,12 +200,31 @@ message ImportProductsRequest {
   // Indicates which fields in the provided imported 'products' to update. If
   // not set, will by default update all fields.
   google.protobuf.FieldMask update_mask = 4;
+
+  // The mode of reconciliation between existing products and the products to be
+  // imported. Defaults to
+  // [ReconciliationMode.INCREMENTAL][google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode.INCREMENTAL].
+  ReconciliationMode reconciliation_mode = 5;
+
+  // Pub/Sub topic for receiving notification. If this field is set,
+  // when the import is finished, a notification will be sent to
+  // specified Pub/Sub topic. The message data will be JSON string of a
+  // [Operation][google.longrunning.Operation].
+  // Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+  //
+  // Only supported when
+  // [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2.ImportProductsRequest.reconciliation_mode]
+  // is set to `FULL`.
+  string notification_pubsub_topic = 7;
 }
 
 // Request message for the ImportUserEvents request.
 message ImportUserEventsRequest {
   // Required. `projects/1234/locations/global/catalogs/default_catalog`
-  string parent = 1 [(google.api.field_behavior) = REQUIRED];
+  string parent = 1 [
+    (google.api.field_behavior) = REQUIRED,
+    (google.api.resource_reference) = { type: "retail.googleapis.com/Catalog" }
+  ];
 
   // Required. The desired input location of the data.
   UserEventInputConfig input_config = 2
@@ -164,6 +235,28 @@ message ImportUserEventsRequest {
   ImportErrorsConfig errors_config = 3;
 }
 
+// Request message for ImportCompletionData methods.
+message ImportCompletionDataRequest {
+  // Required. The catalog which the suggestions dataset belongs to.
+  //
+  // Format: `projects/1234/locations/global/catalogs/default_catalog`.
+  string parent = 1 [
+    (google.api.field_behavior) = REQUIRED,
+    (google.api.resource_reference) = { type: "retail.googleapis.com/Catalog" }
+  ];
+
+  // Required. The desired input location of the data.
+  CompletionDataInputConfig input_config = 2
+      [(google.api.field_behavior) = REQUIRED];
+
+  // Pub/Sub topic for receiving notification. If this field is set,
+  // when the import is finished, a notification will be sent to
+  // specified Pub/Sub topic. The message data will be JSON string of a
+  // [Operation][google.longrunning.Operation].
+  // Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+  string notification_pubsub_topic = 3;
+}
+
 // The input config source for products.
 message ProductInputConfig {
   // Required. The source of the input.
@@ -196,6 +289,28 @@ message UserEventInputConfig {
   }
 }
 
+// The input config source for completion data.
+message CompletionDataInputConfig {
+  // The source of the input.
+  //
+  // Supported
+  // [BigQuerySource.data_schema][google.cloud.retail.v2.BigQuerySource.data_schema]
+  // values for suggestions imports:
+  //
+  // * `suggestions` (default): One JSON completion suggestion per line.
+  // * `denylist`:  One JSON deny suggestion per line.
+  // * `allowlist`:  One JSON allow suggestion per line.
+  oneof source {
+    // Required. BigQuery input source.
+    //
+    // 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.
+    BigQuerySource big_query_source = 1
+        [(google.api.field_behavior) = REQUIRED];
+  }
+}
+
 // Metadata related to the progress of the Import operation. This will be
 // returned by the google.longrunning.Operation.metadata field.
 message ImportMetadata {
@@ -211,6 +326,17 @@ 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;
+
+  // Pub/Sub topic for receiving notification. If this field is set,
+  // when the import is finished, a notification will be sent to
+  // specified Pub/Sub topic. The message data will be JSON string of a
+  // [Operation][google.longrunning.Operation].
+  // Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+  string notification_pubsub_topic = 6;
 }
 
 // Response of the
@@ -250,3 +376,12 @@ message UserEventImportSummary {
   // in the imported catalog.
   int64 unjoined_events_count = 2;
 }
+
+// Response of the
+// [ImportCompletionDataRequest][google.cloud.retail.v2.ImportCompletionDataRequest].
+// If the long running operation is done, this message is returned by the
+// google.longrunning.Operations.response field if the operation is successful.
+message ImportCompletionDataResponse {
+  // A sample of errors encountered while processing the request.
+  repeated google.rpc.Status error_samples = 1;
+}
diff --git a/proto-google-cloud-retail-v2/src/main/proto/google/cloud/retail/v2/prediction_service.proto b/proto-google-cloud-retail-v2/src/main/proto/google/cloud/retail/v2/prediction_service.proto
index d5f68ebd..067f872b 100644
--- a/proto-google-cloud-retail-v2/src/main/proto/google/cloud/retail/v2/prediction_service.proto
+++ b/proto-google-cloud-retail-v2/src/main/proto/google/cloud/retail/v2/prediction_service.proto
@@ -50,30 +50,10 @@ service PredictionService {
 message PredictRequest {
   // Required. Full resource name of the format:
   // {name=projects/*/locations/global/catalogs/default_catalog/placements/*}
-  // The id of the recommendation engine placement. This id is used to identify
-  // the set of models that will be used to make the prediction.
-  //
-  // We currently support three placements with the following IDs by default:
-  //
-  // * `shopping_cart`: Predicts products frequently bought together with one or
-  //   more  products in the same shopping session. Commonly displayed after
-  //   `add-to-cart` events, on product detail pages, or on the shopping cart
-  //   page.
-  //
-  // * `home_page`: Predicts the next product that a user will most likely
-  //   engage with or purchase based on the shopping or viewing history of the
-  //   specified `userId` or `visitorId`. For example - Recommendations for you.
-  //
-  // * `product_detail`: Predicts the next product that a user will most likely
-  //   engage with or purchase. The prediction is based on the shopping or
-  //   viewing history of the specified `userId` or `visitorId` and its
-  //   relevance to a specified `CatalogItem`. Typically used on product detail
-  //   pages. For example - More products like this.
-  //
-  // * `recently_viewed_default`: Returns up to 75 products recently viewed by
-  //   the specified `userId` or `visitorId`, most recent ones first. Returns
-  //   nothing if neither of them has viewed any products yet. For example -
-  //   Recently viewed.
+  // The ID of the Recommendations AI placement. Before you can request
+  // predictions from your model, you must create at least one placement for it.
+  // For more information, see [Managing
+  // placements](https://cloud.google.com/retail/recommendations-ai/docs/manage-placements).
   //
   // The full list of available placements can be seen at
   // https://console.cloud.google.com/recommendation/catalogs/default_catalog/placements
@@ -104,6 +84,9 @@ message PredictRequest {
   //    `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings
   //    with a size limit of 1,000 characters.
   //
+  //    Note: "Recently viewed" models don't support tag filtering at the
+  //    moment.
+  //
   //  * filterOutOfStockItems. Restricts predictions to products that do not
   //  have a
   //    stockState value of OUT_OF_STOCK.
@@ -140,17 +123,35 @@ message PredictRequest {
   // * `strictFiltering`: Boolean. True by default. If set to false, the service
   //    will return generic (unfiltered) popular products instead of empty if
   //    your filter blocks all prediction results.
+  // * `priceRerankLevel`: String. Default empty. If set to be non-empty, then
+  //    it needs to be one of {'no-price-reranking', 'low-price-reranking',
+  //    'medium-price-reranking', 'high-price-reranking'}. This gives
+  //    request-level control and adjusts prediction results based on product
+  //    price.
+  // * `diversityLevel`: String. Default empty. If set to be non-empty, then
+  //    it needs to be one of {'no-diversity', 'low-diversity',
+  //    'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives
+  //    request-level control and adjusts prediction results based on product
+  //    category.
   map params = 7;
 
-  // The labels for the predict request.
+  // The labels applied to a resource must meet the following requirements:
   //
-  //  * Label keys can contain lowercase letters, digits and hyphens, must start
-  //    with a letter, and must end with a letter or digit.
-  //  * Non-zero label values can contain lowercase letters, digits and hyphens,
-  //    must start with a letter, and must end with a letter or digit.
-  //  * No more than 64 labels can be associated with a given request.
+  // * Each resource can have multiple labels, up to a maximum of 64.
+  // * Each label must be a key-value pair.
+  // * Keys have a minimum length of 1 character and a maximum length of 63
+  //   characters, and cannot be empty. Values can be empty, and have a maximum
+  //   length of 63 characters.
+  // * Keys and values can contain only lowercase letters, numeric characters,
+  //   underscores, and dashes. All characters must use UTF-8 encoding, and
+  //   international characters are allowed.
+  // * The key portion of a label must be unique. However, you can use the same
+  //   key with multiple resources.
+  // * Keys must start with a lowercase letter or international character.
   //
-  // See https://goo.gl/xmQnxf for more information on and examples of labels.
+  // See [Google Cloud
+  // Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+  // for more details.
   map labels = 8;
 }
 
diff --git a/proto-google-cloud-retail-v2/src/main/proto/google/cloud/retail/v2/product.proto b/proto-google-cloud-retail-v2/src/main/proto/google/cloud/retail/v2/product.proto
index d93b0717..746dc625 100644
--- a/proto-google-cloud-retail-v2/src/main/proto/google/cloud/retail/v2/product.proto
+++ b/proto-google-cloud-retail-v2/src/main/proto/google/cloud/retail/v2/product.proto
@@ -20,6 +20,7 @@ import "google/api/annotations.proto";
 import "google/api/field_behavior.proto";
 import "google/api/resource.proto";
 import "google/cloud/retail/v2/common.proto";
+import "google/protobuf/duration.proto";
 import "google/protobuf/field_mask.proto";
 import "google/protobuf/timestamp.proto";
 import "google/protobuf/wrappers.proto";
@@ -48,7 +49,8 @@ message Product {
   // The type of this product.
   enum Type {
     // Default value. Default to
-    // [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] if unset.
+    // [Catalog.product_level_config.ingestion_product_type][google.cloud.retail.v2.ProductLevelConfig.ingestion_product_type]
+    // if unset.
     TYPE_UNSPECIFIED = 0;
 
     // The primary type.
@@ -100,6 +102,43 @@ message Product {
     BACKORDER = 4;
   }
 
+  oneof expiration {
+    // The timestamp when this product becomes unavailable for
+    // [SearchService.Search][google.cloud.retail.v2.SearchService.Search].
+    //
+    // If it is set, the [Product][google.cloud.retail.v2.Product] is not
+    // available for
+    // [SearchService.Search][google.cloud.retail.v2.SearchService.Search] after
+    // [expire_time][google.cloud.retail.v2.Product.expire_time]. However, the
+    // product can still be retrieved by
+    // [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]
+    // and
+    // [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].
+    //
+    // Google Merchant Center property
+    // [expiration_date](https://support.google.com/merchants/answer/6324499).
+    google.protobuf.Timestamp expire_time = 16;
+
+    // Input only. The TTL (time to live) of the product.
+    //
+    // If it is set, [expire_time][google.cloud.retail.v2.Product.expire_time]
+    // is set as current timestamp plus
+    // [ttl][google.cloud.retail.v2.Product.ttl]. The derived
+    // [expire_time][google.cloud.retail.v2.Product.expire_time] is returned in
+    // the output and [ttl][google.cloud.retail.v2.Product.ttl] is left blank
+    // when retrieving the [Product][google.cloud.retail.v2.Product].
+    //
+    // If it is set, the product is not available for
+    // [SearchService.Search][google.cloud.retail.v2.SearchService.Search] after
+    // current timestamp plus [ttl][google.cloud.retail.v2.Product.ttl].
+    // However, the product can still be retrieved by
+    // [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]
+    // and
+    // [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].
+    google.protobuf.Duration ttl = 17
+        [(google.api.field_behavior) = INPUT_ONLY];
+  }
+
   // Immutable. Full resource name of the product, such as
   // `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/product_id`.
   //
@@ -120,7 +159,9 @@ message Product {
   // Property [Product.sku](https://schema.org/sku).
   string id = 2 [(google.api.field_behavior) = IMMUTABLE];
 
-  // Immutable. The type of the product. This field is output-only.
+  // Immutable. The type of the product. Default to
+  // [Catalog.product_level_config.ingestion_product_type][google.cloud.retail.v2.ProductLevelConfig.ingestion_product_type]
+  // if unset.
   Type type = 3 [(google.api.field_behavior) = IMMUTABLE];
 
   // Variant group identifier. Must be an
@@ -146,6 +187,31 @@ message Product {
   // 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.
+  repeated string collection_member_ids = 5;
+
+  // The Global Trade Item Number (GTIN) of the 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
+  // [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.gtin14](https://schema.org/gtin14).
+  //
+  // If the value is not a valid GTIN, an INVALID_ARGUMENT error is returned.
+  string gtin = 6;
+
   // Product categories. This field is repeated for supporting one product
   // belonging to several parallel categories. Strongly recommended using the
   // full path for better search / recommendation quality.
@@ -184,7 +250,7 @@ message Product {
 
   // Required. Product title.
   //
-  // This field must be a UTF-8 encoded string with a length limit of 128
+  // 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
@@ -192,6 +258,17 @@ message Product {
   // property [Product.name](https://schema.org/name).
   string title = 8 [(google.api.field_behavior) = REQUIRED];
 
+  // The brands of the product.
+  //
+  // A maximum of 30 brands are allowed. Each brand 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
+  // [brand](https://support.google.com/merchants/answer/6324351). Schema.org
+  // property [Product.brand](https://schema.org/brand).
+  repeated string brands = 9;
+
   // Product description.
   //
   // This field must be a UTF-8 encoded string with a length limit of 5,000
@@ -202,6 +279,18 @@ message Product {
   // 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].
+  //
+  // For product prediction, this field is ignored and the model automatically
+  // detects the text language. The [Product][google.cloud.retail.v2.Product]
+  // can include text in different languages, but duplicating
+  // [Product][google.cloud.retail.v2.Product]s to provide text in multiple
+  // languages can result in degraded model performance.
+  //
+  // For product search this field is in use. It defaults to "en-US" if unset.
+  string language_code = 11;
+
   // Highly encouraged. Extra product attributes to be included. For example,
   // for products, this could include the store name, vendor, style, color, etc.
   // These are very strong signals for recommendation model, thus we highly
@@ -218,11 +307,18 @@ message Product {
   // "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]}
   // }`.
   //
-  // A maximum of 150 attributes are allowed. Otherwise, an INVALID_ARGUMENT
-  // error is returned.
-  //
-  // The key must be a UTF-8 encoded string with a length limit of 5,000
-  // characters. Otherwise, an INVALID_ARGUMENT error is returned.
+  // This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+  // error is returned:
+  //
+  // * Max entries count: 200 by default; 100 for
+  // [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT].
+  // * The key must be a UTF-8 encoded string with a length limit of 128
+  //   characters.
+  // * Max indexable entries count: 200 by default; 40 for
+  // [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT].
+  // * Max searchable entries count: 30.
+  // * 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.
   map attributes = 12;
 
   // Custom tags associated with the product.
@@ -246,8 +342,12 @@ message Product {
   // [price](https://support.google.com/merchants/answer/6324371).
   PriceInfo price_info = 14;
 
+  // The rating of this product.
+  Rating rating = 15;
+
   // The timestamp when this [Product][google.cloud.retail.v2.Product] becomes
-  // available recommendation and search.
+  // available for
+  // [SearchService.Search][google.cloud.retail.v2.SearchService.Search].
   google.protobuf.Timestamp available_time = 18;
 
   // The online availability of the [Product][google.cloud.retail.v2.Product].
@@ -262,8 +362,19 @@ message Product {
   // The available quantity of the item.
   google.protobuf.Int32Value available_quantity = 20;
 
+  // Fulfillment information, such as the store IDs for in-store pickup or
+  // region IDs for different shipping methods.
+  //
+  // All the elements must have distinct
+  // [FulfillmentInfo.type][google.cloud.retail.v2.FulfillmentInfo.type].
+  // Otherwise, an INVALID_ARGUMENT error is returned.
+  repeated FulfillmentInfo fulfillment_info = 21;
+
   // Canonical URL directly linking to the product detail page.
   //
+  // It is strongly recommended to provide a valid uri for the product,
+  // otherwise the service performance could be significantly degraded.
+  //
   // This field must be a UTF-8 encoded string with a length limit of 5,000
   // characters. Otherwise, an INVALID_ARGUMENT error is returned.
   //
@@ -272,7 +383,8 @@ message Product {
   // property [Offer.url](https://schema.org/url).
   string uri = 22;
 
-  // Product images for the product.
+  // Product images for the product.Highly recommended to put the main image
+  // to the first.
   //
   // A maximum of 300 images are allowed.
   //
@@ -280,4 +392,152 @@ message Product {
   // [image_link](https://support.google.com/merchants/answer/6324350).
   // Schema.org property [Product.image](https://schema.org/image).
   repeated Image images = 23;
+
+  // The target group associated with a given audience (e.g. male, veterans,
+  // car owners, musicians, etc.) of the product.
+  Audience audience = 24;
+
+  // The color of the product.
+  //
+  // 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;
+
+  // The size of the product. To represent different size systems or size types,
+  // consider using this format: [[[size_system:]size_type:]size_value].
+  //
+  // For example, in "US:MENS:M", "US" represents size system; "MENS" represents
+  // size type; "M" represents size value. In "GIRLS:27", size system is empty;
+  // "GIRLS" represents size type; "27" represents size value. In "32 inches",
+  // both size system and size type are empty, while size value is "32 inches".
+  //
+  // A maximum of 20 values are 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
+  // [size](https://support.google.com/merchants/answer/6324492),
+  // [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;
+
+  // The material of the product. For example, "leather", "wooden".
+  //
+  // A maximum of 5 values are allowed. 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
+  // [material](https://support.google.com/merchants/answer/6324410). Schema.org
+  // property [Product.material](https://schema.org/material).
+  repeated string materials = 27;
+
+  // The pattern or graphic print of the product. For example, "striped", "polka
+  // dot", "paisley".
+  //
+  // A maximum of 5 values are 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
+  // [pattern](https://support.google.com/merchants/answer/6324483). Schema.org
+  // property [Product.pattern](https://schema.org/pattern).
+  repeated string patterns = 28;
+
+  // The condition of the product. Strongly encouraged to use the standard
+  // values: "new", "refurbished", "used".
+  //
+  // A maximum of 5 values are 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
+  // [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].
+  repeated Promotion promotions = 34;
+
+  // The timestamp when the product is published by the retailer for the first
+  // time, which indicates the freshness of the products. Note that this field
+  // is different from
+  // [available_time][google.cloud.retail.v2.Product.available_time], given it
+  // purely describes product freshness regardless of when it is available on
+  // search and recommendation.
+  google.protobuf.Timestamp publish_time = 33;
+
+  // Indicates which fields in the [Product][google.cloud.retail.v2.Product]s
+  // are returned in [SearchResponse][google.cloud.retail.v2.SearchResponse].
+  //
+  // Supported fields for all [type][google.cloud.retail.v2.Product.type]s:
+  //
+  // * [audience][google.cloud.retail.v2.Product.audience]
+  // * [availability][google.cloud.retail.v2.Product.availability]
+  // * [brands][google.cloud.retail.v2.Product.brands]
+  // * [color_info][google.cloud.retail.v2.Product.color_info]
+  // * [conditions][google.cloud.retail.v2.Product.conditions]
+  // * [gtin][google.cloud.retail.v2.Product.gtin]
+  // * [materials][google.cloud.retail.v2.Product.materials]
+  // * [name][google.cloud.retail.v2.Product.name]
+  // * [patterns][google.cloud.retail.v2.Product.patterns]
+  // * [price_info][google.cloud.retail.v2.Product.price_info]
+  // * [rating][google.cloud.retail.v2.Product.rating]
+  // * [sizes][google.cloud.retail.v2.Product.sizes]
+  // * [title][google.cloud.retail.v2.Product.title]
+  // * [uri][google.cloud.retail.v2.Product.uri]
+  //
+  // Supported fields only for
+  // [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and
+  // [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]:
+  //
+  // * [categories][google.cloud.retail.v2.Product.categories]
+  // * [description][google.cloud.retail.v2.Product.description]
+  // * [images][google.cloud.retail.v2.Product.images]
+  //
+  // Supported fields only for
+  // [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]:
+  //
+  // * Only the first image in [images][google.cloud.retail.v2.Product.images]
+  //
+  // To mark [attributes][google.cloud.retail.v2.Product.attributes] as
+  // retrievable, include paths of the form "attributes.key" where "key" is the
+  // key of a custom attribute, as specified in
+  // [attributes][google.cloud.retail.v2.Product.attributes].
+  //
+  // For [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and
+  // [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION], the
+  // following fields are always returned in
+  // [SearchResponse][google.cloud.retail.v2.SearchResponse] by default:
+  //
+  // * [name][google.cloud.retail.v2.Product.name]
+  //
+  // For [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT], the
+  // following fields are always returned in by default:
+  //
+  // * [name][google.cloud.retail.v2.Product.name]
+  // * [color_info][google.cloud.retail.v2.Product.color_info]
+  //
+  // Maximum number of paths is 20. Otherwise, an INVALID_ARGUMENT error is
+  // returned.
+  google.protobuf.FieldMask retrievable_fields = 30;
+
+  // Output only. Product variants grouped together on primary product which
+  // share similar product attributes. It's automatically grouped by
+  // [primary_product_id][google.cloud.retail.v2.Product.primary_product_id] for
+  // all the product variants. Only populated for
+  // [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+  // [Product][google.cloud.retail.v2.Product]s.
+  //
+  // Note: This field is OUTPUT_ONLY for
+  // [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct].
+  // Do not set this field in API requests.
+  repeated Product variants = 31 [(google.api.field_behavior) = OUTPUT_ONLY];
 }
diff --git a/proto-google-cloud-retail-v2/src/main/proto/google/cloud/retail/v2/product_service.proto b/proto-google-cloud-retail-v2/src/main/proto/google/cloud/retail/v2/product_service.proto
index b4130502..dac78fbc 100644
--- a/proto-google-cloud-retail-v2/src/main/proto/google/cloud/retail/v2/product_service.proto
+++ b/proto-google-cloud-retail-v2/src/main/proto/google/cloud/retail/v2/product_service.proto
@@ -26,6 +26,7 @@ import "google/cloud/retail/v2/purge_config.proto";
 import "google/longrunning/operations.proto";
 import "google/protobuf/empty.proto";
 import "google/protobuf/field_mask.proto";
+import "google/protobuf/timestamp.proto";
 
 option csharp_namespace = "Google.Cloud.Retail.V2";
 option go_package = "google.golang.org/genproto/googleapis/cloud/retail/v2;retail";
@@ -60,6 +61,14 @@ service ProductService {
     option (google.api.method_signature) = "name";
   }
 
+  // Gets a list of [Product][google.cloud.retail.v2.Product]s.
+  rpc ListProducts(ListProductsRequest) returns (ListProductsResponse) {
+    option (google.api.http) = {
+      get: "/v2/{parent=projects/*/locations/*/catalogs/*/branches/*}/products"
+    };
+    option (google.api.method_signature) = "parent";
+  }
+
   // Updates a [Product][google.cloud.retail.v2.Product].
   rpc UpdateProduct(UpdateProductRequest) returns (Product) {
     option (google.api.http) = {
@@ -95,6 +104,114 @@ service ProductService {
       metadata_type: "google.cloud.retail.v2.ImportMetadata"
     };
   }
+
+  // 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.
+  // Contact Retail Support (retail-search-support@google.com) if you are
+  // interested in using Retail Search.
+  rpc SetInventory(SetInventoryRequest) returns (google.longrunning.Operation) {
+    option (google.api.http) = {
+      post: "/v2/{inventory.name=projects/*/locations/*/catalogs/*/branches/*/products/**}:setInventory"
+      body: "*"
+    };
+    option (google.api.method_signature) = "inventory,set_mask";
+    option (google.longrunning.operation_info) = {
+      response_type: "google.cloud.retail.v2.SetInventoryResponse"
+      metadata_type: "google.cloud.retail.v2.SetInventoryMetadata"
+    };
+  }
+
+  // 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.
+  // Contact Retail Support (retail-search-support@google.com) if you are
+  // interested in using Retail Search.
+  rpc AddFulfillmentPlaces(AddFulfillmentPlacesRequest)
+      returns (google.longrunning.Operation) {
+    option (google.api.http) = {
+      post: "/v2/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:addFulfillmentPlaces"
+      body: "*"
+    };
+    option (google.api.method_signature) = "product";
+    option (google.longrunning.operation_info) = {
+      response_type: "google.cloud.retail.v2.AddFulfillmentPlacesResponse"
+      metadata_type: "google.cloud.retail.v2.AddFulfillmentPlacesMetadata"
+    };
+  }
+
+  // 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.
+  // Contact Retail Support (retail-search-support@google.com) if you are
+  // interested in using Retail Search.
+  rpc RemoveFulfillmentPlaces(RemoveFulfillmentPlacesRequest)
+      returns (google.longrunning.Operation) {
+    option (google.api.http) = {
+      post: "/v2/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:removeFulfillmentPlaces"
+      body: "*"
+    };
+    option (google.api.method_signature) = "product";
+    option (google.longrunning.operation_info) = {
+      response_type: "google.cloud.retail.v2.RemoveFulfillmentPlacesResponse"
+      metadata_type: "google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata"
+    };
+  }
 }
 
 // Request message for [CreateProduct][] method.
@@ -153,8 +270,10 @@ message UpdateProductRequest {
   // [Product][google.cloud.retail.v2.Product], regardless of whether or not it
   // exists, a PERMISSION_DENIED error is returned.
   //
-  // If the [Product][google.cloud.retail.v2.Product] to update does not exist,
-  // a NOT_FOUND error is returned.
+  // If the [Product][google.cloud.retail.v2.Product] to update does not exist
+  // and
+  // [allow_missing][google.cloud.retail.v2.UpdateProductRequest.allow_missing]
+  // is not set, a NOT_FOUND error is returned.
   Product product = 1 [(google.api.field_behavior) = REQUIRED];
 
   // Indicates which fields in the provided
@@ -165,6 +284,11 @@ message UpdateProductRequest {
   // If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
   // is returned.
   google.protobuf.FieldMask update_mask = 2;
+
+  // If set to true, and the [Product][google.cloud.retail.v2.Product] is not
+  // found, a new [Product][google.cloud.retail.v2.Product] will be created. In
+  // this situation, `update_mask` is ignored.
+  bool allow_missing = 3;
 }
 
 // Request message for [DeleteProduct][] method.
@@ -179,8 +303,337 @@ message DeleteProductRequest {
   //
   // If the [Product][google.cloud.retail.v2.Product] to delete does not exist,
   // a NOT_FOUND error is returned.
+  //
+  // The [Product][google.cloud.retail.v2.Product] to delete can neither be a
+  // [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]
+  // [Product][google.cloud.retail.v2.Product] member nor a
+  // [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+  // [Product][google.cloud.retail.v2.Product] with more than one
+  // [variants][google.cloud.retail.v2.Product.Type.VARIANT]. Otherwise, an
+  // INVALID_ARGUMENT error is returned.
+  //
+  // All inventory information for the named
+  // [Product][google.cloud.retail.v2.Product] will be deleted.
   string name = 1 [
     (google.api.field_behavior) = REQUIRED,
     (google.api.resource_reference) = { type: "retail.googleapis.com/Product" }
   ];
 }
+
+// Request message for
+// [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]
+// method.
+message ListProductsRequest {
+  // Required. The parent branch resource name, such as
+  // `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use
+  // `default_branch` as the branch ID, to list products under the default
+  // branch.
+  //
+  // If the caller does not have permission to list
+  // [Product][google.cloud.retail.v2.Product]s under this branch, regardless of
+  // whether or not this branch exists, a PERMISSION_DENIED error is returned.
+  string parent = 1 [
+    (google.api.field_behavior) = REQUIRED,
+    (google.api.resource_reference) = { type: "retail.googleapis.com/Branch" }
+  ];
+
+  // Maximum number of [Product][google.cloud.retail.v2.Product]s to return. If
+  // unspecified, defaults to 100. The maximum allowed value is 1000. Values
+  // above 1000 will be coerced to 1000.
+  //
+  // If this field is negative, an INVALID_ARGUMENT error is returned.
+  int32 page_size = 2;
+
+  // A page token
+  // [ListProductsResponse.next_page_token][google.cloud.retail.v2.ListProductsResponse.next_page_token],
+  // received from a previous
+  // [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]
+  // call. Provide this to retrieve the subsequent page.
+  //
+  // When paginating, all other parameters provided to
+  // [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]
+  // must match the call that provided the page token. Otherwise, an
+  // INVALID_ARGUMENT error is returned.
+  string page_token = 3;
+
+  // A filter to apply on the list results. Supported features:
+  //
+  // * List all the products under the parent branch if
+  // [filter][google.cloud.retail.v2.ListProductsRequest.filter] is unset.
+  // * List [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]
+  // [Product][google.cloud.retail.v2.Product]s sharing the same
+  //   [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+  //   [Product][google.cloud.retail.v2.Product]. For example:
+  //     `primary_product_id = "some_product_id"`
+  // * List [Product][google.cloud.retail.v2.Product]s bundled in a
+  // [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]
+  // [Product][google.cloud.retail.v2.Product].
+  //   For example:
+  //     `collection_product_id = "some_product_id"`
+  // * List [Product][google.cloud.retail.v2.Product]s with a partibular type.
+  // For example:
+  //     `type = "PRIMARY"`
+  //     `type = "VARIANT"`
+  //     `type = "COLLECTION"`
+  //
+  // If the field is unrecognizable, an INVALID_ARGUMENT error is returned.
+  //
+  // If the specified
+  // [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
+  // [Product][google.cloud.retail.v2.Product] or
+  // [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]
+  // [Product][google.cloud.retail.v2.Product] does not exist, a NOT_FOUND error
+  // is returned.
+  string filter = 4;
+
+  // The fields of [Product][google.cloud.retail.v2.Product] to return in the
+  // responses. If not set or empty, the following fields are returned:
+  //
+  // * [Product.name][google.cloud.retail.v2.Product.name]
+  // * [Product.id][google.cloud.retail.v2.Product.id]
+  // * [Product.title][google.cloud.retail.v2.Product.title]
+  // * [Product.uri][google.cloud.retail.v2.Product.uri]
+  // * [Product.images][google.cloud.retail.v2.Product.images]
+  // * [Product.price_info][google.cloud.retail.v2.Product.price_info]
+  // * [Product.brands][google.cloud.retail.v2.Product.brands]
+  //
+  // If "*" is provided, all fields are returned.
+  // [Product.name][google.cloud.retail.v2.Product.name] is always returned no
+  // matter what mask is set.
+  //
+  // If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+  // is returned.
+  google.protobuf.FieldMask read_mask = 5;
+}
+
+// Response message for
+// [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]
+// method.
+message ListProductsResponse {
+  // The [Product][google.cloud.retail.v2.Product]s.
+  repeated Product products = 1;
+
+  // A token that can be sent as
+  // [ListProductsRequest.page_token][google.cloud.retail.v2.ListProductsRequest.page_token]
+  // to retrieve the next page. If this field is omitted, there are no
+  // subsequent pages.
+  string next_page_token = 2;
+}
+
+// Request message for [SetInventory][] method.
+message SetInventoryRequest {
+  // Required. The inventory information to update. The allowable fields to
+  // update are:
+  // * [Product.price_info][google.cloud.retail.v2.Product.price_info]
+  // * [Product.availability][google.cloud.retail.v2.Product.availability]
+  // * [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity]
+  // * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info]
+  // The updated inventory fields must be specified in
+  // [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask].
+  //
+  // If [SetInventoryRequest.inventory.name][] is empty or invalid, an
+  // INVALID_ARGUMENT error is returned.
+  //
+  // If the caller does not have permission to update the
+  // [Product][google.cloud.retail.v2.Product] named in
+  // [Product.name][google.cloud.retail.v2.Product.name], regardless of whether
+  // or not it exists, a PERMISSION_DENIED error is returned.
+  //
+  // If the [Product][google.cloud.retail.v2.Product] to update does not have
+  // existing inventory information, the provided inventory information will be
+  // inserted.
+  //
+  // If the [Product][google.cloud.retail.v2.Product] to update has existing
+  // inventory information, the provided inventory information will be merged
+  // 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 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]
+  // * [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity]
+  // * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info]
+  //
+  // If a full overwrite of inventory information while ignoring timestamps is
+  // needed, [UpdateProduct][] should be invoked instead.
+  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.
+  //
+  // If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+  // is returned and the entire update will be ignored.
+  google.protobuf.FieldMask set_mask = 2;
+
+  // The time when the request is issued, used to prevent
+  // out-of-order updates on inventory fields with the last update time
+  // recorded. If not provided, the internal system time will be used.
+  google.protobuf.Timestamp set_time = 3;
+
+  // If set to true, and the [Product][google.cloud.retail.v2.Product] with name
+  // [Product.name][google.cloud.retail.v2.Product.name] is not found, the
+  // inventory update will still be processed and retained for at most 1 day
+  // until the [Product][google.cloud.retail.v2.Product] is created. If set to
+  // false, an INVALID_ARGUMENT error is returned if the
+  // [Product][google.cloud.retail.v2.Product] is not found.
+  bool allow_missing = 4;
+}
+
+// Metadata related to the progress of the SetInventory operation.
+// Currently empty because there is no meaningful metadata populated from the
+// [SetInventory][] method.
+message SetInventoryMetadata {}
+
+// Response of the SetInventoryRequest.  Currently empty because
+// there is no meaningful response populated from the [SetInventory][]
+// method.
+message SetInventoryResponse {}
+
+// Request message for [AddFulfillmentPlaces][] method.
+message AddFulfillmentPlacesRequest {
+  // 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. The fulfillment type, including commonly used types (such as
+  // pickup in store and same day delivery), and custom types.
+  //
+  // 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.
+  //
+  // This field directly corresponds to [Product.fulfillment_info.type][].
+  string type = 2 [(google.api.field_behavior) = REQUIRED];
+
+  // Required. The IDs for this
+  // [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type], such as
+  // the store IDs for "pickup-in-store" or the region IDs for
+  // "same-day-delivery" to be added for this
+  // [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type]. Duplicate
+  // IDs will be automatically ignored.
+  //
+  // At least 1 value is required, and a maximum of 2000 values are allowed.
+  // Each value must be a string with a length limit of 10 characters, matching
+  // the pattern [a-zA-Z0-9_-]+, such as "store1" or "REGION-2". Otherwise, an
+  // INVALID_ARGUMENT error is returned.
+  //
+  // If the total number of place IDs exceeds 2000 for this
+  // [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type] after
+  // adding, then the update will be rejected.
+  repeated string place_ids = 3 [(google.api.field_behavior) = REQUIRED];
+
+  // The time when the fulfillment updates are issued, used to prevent
+  // out-of-order updates on fulfillment information. If not provided, the
+  // internal system time will be used.
+  google.protobuf.Timestamp add_time = 4;
+
+  // If set to true, and the [Product][google.cloud.retail.v2.Product] is not
+  // found, the fulfillment information 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, an
+  // INVALID_ARGUMENT error is returned if the
+  // [Product][google.cloud.retail.v2.Product] is not found.
+  bool allow_missing = 5;
+}
+
+// Metadata related to the progress of the AddFulfillmentPlaces operation.
+// Currently empty because there is no meaningful metadata populated from the
+// [AddFulfillmentPlaces][] method.
+message AddFulfillmentPlacesMetadata {}
+
+// Response of the RemoveFulfillmentPlacesRequest.  Currently empty because
+// there is no meaningful response populated from the [AddFulfillmentPlaces][]
+// method.
+message AddFulfillmentPlacesResponse {}
+
+// Request message for [RemoveFulfillmentPlaces][] method.
+message RemoveFulfillmentPlacesRequest {
+  // 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. The fulfillment type, including commonly used types (such as
+  // pickup in store and same day delivery), and custom types.
+  //
+  // 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.
+  //
+  // This field directly corresponds to [Product.fulfillment_info.type][].
+  string type = 2 [(google.api.field_behavior) = REQUIRED];
+
+  // Required. The IDs for this
+  // [type][google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.type], such as
+  // the store IDs for "pickup-in-store" or the region IDs for
+  // "same-day-delivery", to be removed for this
+  // [type][google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.type].
+  //
+  // At least 1 value is required, and a maximum of 2000 values are allowed.
+  // Each value must be a string with a length limit of 10 characters, matching
+  // the pattern [a-zA-Z0-9_-]+, such as "store1" or "REGION-2". Otherwise, an
+  // INVALID_ARGUMENT error is returned.
+  repeated string place_ids = 3 [(google.api.field_behavior) = REQUIRED];
+
+  // The time when the fulfillment updates are issued, used to prevent
+  // out-of-order updates on fulfillment information. If not provided, the
+  // internal system time will be used.
+  google.protobuf.Timestamp remove_time = 4;
+
+  // If set to true, and the [Product][google.cloud.retail.v2.Product] is not
+  // found, the fulfillment information 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, an
+  // INVALID_ARGUMENT error is returned if the
+  // [Product][google.cloud.retail.v2.Product] is not found.
+  bool allow_missing = 5;
+}
+
+// Metadata related to the progress of the RemoveFulfillmentPlaces operation.
+// Currently empty because there is no meaningful metadata populated from the
+// [RemoveFulfillmentPlaces][] method.
+message RemoveFulfillmentPlacesMetadata {}
+
+// Response of the RemoveFulfillmentPlacesRequest. Currently empty because there
+// is no meaningful response populated from the [RemoveFulfillmentPlaces][]
+// method.
+message RemoveFulfillmentPlacesResponse {}
diff --git a/proto-google-cloud-retail-v2/src/main/proto/google/cloud/retail/v2/purge_config.proto b/proto-google-cloud-retail-v2/src/main/proto/google/cloud/retail/v2/purge_config.proto
index d9cf6b82..588bb39b 100644
--- a/proto-google-cloud-retail-v2/src/main/proto/google/cloud/retail/v2/purge_config.proto
+++ b/proto-google-cloud-retail-v2/src/main/proto/google/cloud/retail/v2/purge_config.proto
@@ -36,7 +36,7 @@ message PurgeMetadata {}
 message PurgeUserEventsRequest {
   // Required. The resource name of the catalog under which the events are
   // created. The format is
-  // "projects/${projectId}/locations/global/catalogs/${catalogId}"
+  // `projects/${projectId}/locations/global/catalogs/${catalogId}`
   string parent = 1 [(google.api.field_behavior) = REQUIRED];
 
   // Required. The filter string to specify the events to be deleted with a
diff --git a/proto-google-cloud-retail-v2/src/main/proto/google/cloud/retail/v2/search_service.proto b/proto-google-cloud-retail-v2/src/main/proto/google/cloud/retail/v2/search_service.proto
new file mode 100644
index 00000000..36b46041
--- /dev/null
+++ b/proto-google-cloud-retail-v2/src/main/proto/google/cloud/retail/v2/search_service.proto
@@ -0,0 +1,805 @@
+// Copyright 2020 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;
+
+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/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.V2";
+option go_package = "google.golang.org/genproto/googleapis/cloud/retail/v2;retail";
+option java_multiple_files = true;
+option java_outer_classname = "SearchServiceProto";
+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";
+
+// Service for search.
+//
+// This feature is only available for users who have Retail Search enabled.
+// Contact Retail Support (retail-search-support@google.com) if you are
+// interested in using Retail Search.
+service SearchService {
+  option (google.api.default_host) = "retail.googleapis.com";
+  option (google.api.oauth_scopes) =
+      "https://www.googleapis.com/auth/cloud-platform";
+
+  // Performs a search.
+  //
+  // This feature is only available for users who have Retail Search enabled.
+  // Contact Retail Support (retail-search-support@google.com) if you are
+  // interested in using Retail Search.
+  rpc Search(SearchRequest) returns (SearchResponse) {
+    option (google.api.http) = {
+      post: "/v2/{placement=projects/*/locations/*/catalogs/*/placements/*}:search"
+      body: "*"
+    };
+  }
+}
+
+// Request message for
+// [SearchService.Search][google.cloud.retail.v2.SearchService.Search] method.
+message SearchRequest {
+  // A facet specification to perform faceted search.
+  message FacetSpec {
+    // Specifies how a facet is computed.
+    message FacetKey {
+      // Required. Supported textual and numerical facet keys in
+      // [Product][google.cloud.retail.v2.Product] object, over which the facet
+      // values are computed. Facet key is case-sensitive.
+      //
+      // Allowed facet keys when
+      // [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query]
+      // is not specified:
+      //
+      // * textual_field =
+ // + // *# The + // [Product.brands][google.cloud.retail.v2.Product.brands].
* + //
+ // "brands"; + //
+ // + // *# The + // [Product.categories][google.cloud.retail.v2.Product.categories].
* + //
+ // "categories"; + //
+ // + // *# The + // [Audience.genders][google.cloud.retail.v2.Audience.genders].
* + //
+ // | "genders"; + //
+ // + // *# The + // [Audience.age_groups][google.cloud.retail.v2.Audience.age_groups].
* + //
+ // | "ageGroups"; + //
+ // + // *# The + // [Product.availability][google.cloud.retail.v2.Product.availability]. + // Value is one of
* + // *# "IN_STOCK", "OUT_OF_STOCK", PREORDER", "BACKORDER".
* + //
+ // | "availability"; + //
+ // + // *# The + // [ColorInfo.color_families][google.cloud.retail.v2.ColorInfo.color_families].
* + //
+ // | "colorFamilies"; + //
+ // + // *# The + // [ColorInfo.colors][google.cloud.retail.v2.ColorInfo.colors].
* + //
+ // | "colors"; + //
+ // + // *# The [Product.sizes][google.cloud.retail.v2.Product.sizes].
* + //
+ // | "sizes"; + //
+ // + // *# The + // [Product.materials][google.cloud.retail.v2.Product.materials].
* + //
+ // | "materials"; + //
+ // + // *# The + // [Product.patterns][google.cloud.retail.v2.Product.patterns].
* + //
+ // | "patterns"; + //
+ // + // *# The + // [Product.conditions][google.cloud.retail.v2.Product.conditions].
* + //
+ // | "conditions"; + //
+ // + // *# The textual custom attribute in + // [Product][google.cloud.retail.v2.Product] object. Key can
* + // *# be any key in the + // [Product.attributes][google.cloud.retail.v2.Product.attributes] + // map
* + // *# if the attribute values are textual.
* + // *# map.
* + //
+ // | "attributes.key"; + //
+ // + // *# The [FulfillmentInfo.ids][] for type + // *# [FulfillmentInfo.Type.PICKUP_IN_STORE][].
* + //
+ // | "pickupInStore"; + //
+ // + // *# The [FulfillmentInfo.ids][] for type + // *# [FulfillmentInfo.Type.SHIP_TO_STORE][].
* + //
+ // | "shipToStore"; + //
+ // + // *# The [FulfillmentInfo.ids][] for type + // *# [FulfillmentInfo.Type.SAME_DAY_DELIVERY][].
* + //
+ // | "sameDayDelivery"; + //
+ // + // *# The [FulfillmentInfo.ids][] for type + // *# [FulfillmentInfo.Type.NEXT_DAY_DELIVERY][].
* + //
+ // | "nextDayDelivery"; + //
+ // + // *# The [FulfillmentInfo.ids][] for type + // *# [FulfillmentInfo.Type.CUSTOM_TYPE_1][].
* + //
+ // | "customFulfillment1"; + //
+ // + // *# The [FulfillmentInfo.ids][] for type + // *# [FulfillmentInfo.Type.CUSTOM_TYPE_2][].
* + //
+ // | "customFulfillment2"; + //
+ // + // *# The [FulfillmentInfo.ids][] for type + // *# [FulfillmentInfo.Type.CUSTOM_TYPE_3][].
* + //
+ // | "customFulfillment3"; + //
+ // + // *# The [FulfillmentInfo.ids][] for type + // *# [FulfillmentInfo.Type.CUSTOM_TYPE_4][].
* + //
+ // | "customFulfillment4"; + //
+ // + // *# The [FulfillmentInfo.ids][] for type + // *# [FulfillmentInfo.Type.CUSTOM_TYPE_5][].
* + //
+ // | "customFulfillment5"; + // + // * numerical_field =
+ // + // *# The + // [PriceInfo.price][google.cloud.retail.v2.PriceInfo.price].
* + //
+ // "price"; + //
+ // + // *# The discount. Computed by (original_price-price)/price
* + //
+ // "discount"; + //
+ // + // *# The + // [Rating.average_rating][google.cloud.retail.v2.Rating.average_rating].
* + //
+ // "rating"; + //
+ // + // *# The + // [Rating.rating_count][google.cloud.retail.v2.Rating.rating_count].
* + //
+ // "ratingCount"; + //
+ // + // *# The numerical custom attribute in + // [Product][google.cloud.retail.v2.Product] object. Key can
* + // *# be any key in the + // [Product.attributes][google.cloud.retail.v2.Product.attributes] + // map
* + // *# if the attribute values are numerical.
* + //
+ // | "attributes.key"; + string key = 1 [(google.api.field_behavior) = REQUIRED]; + + // Set only if values should be bucketized into intervals. Must be set + // for facets with numerical values. Must not be set for facet with text + // values. Maximum number of intervals is 30. + repeated Interval intervals = 2; + + // Only get facet for the given restricted values. For example, when using + // "pickupInStore" as key and set restricted values to + // ["store123", "store456"], only facets for "store123" and "store456" are + // returned. Only supported on textual fields and fulfillments. + // Maximum is 20. + // + // Must be set for the fulfillment facet keys: + // + // * pickupInStore + // + // * shipToStore + // + // * sameDayDelivery + // + // * nextDayDelivery + // + // * customFulfillment1 + // + // * customFulfillment2 + // + // * customFulfillment3 + // + // * customFulfillment4 + // + // * customFulfillment5 + repeated string restricted_values = 3; + + // Only get facet values that start with the given string prefix. For + // example, suppose "categories" has three values "Women > Shoe", + // "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the + // "categories" facet will give only "Women > Shoe" and "Women > Dress". + // Only supported on textual fields. Maximum is 10. + repeated string prefixes = 8; + + // Only get facet values that contains the given strings. For example, + // suppose "categories" has three values "Women > Shoe", + // "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the + // "categories" facet will give only "Women > Shoe" and "Men > Shoe". + // Only supported on textual fields. Maximum is 10. + repeated string contains = 9; + + // The order in which [Facet.values][] are returned. + // + // Allowed values are: + // + // * "count desc", which means order by [Facet.FacetValue.count][] + // descending. + // + // * "value desc", which means order by [Facet.FacetValue.value][] + // descending. + // Only applies to textual facets. + // + // If not set, textual values are sorted in [natural + // order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical + // intervals are sorted in the order given by + // [FacetSpec.FacetKey.intervals][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.intervals]; + // [FulfillmentInfo.ids][] are sorted in the order given by + // [FacetSpec.FacetKey.restricted_values][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.restricted_values]. + string order_by = 4; + + // The query that is used to compute facet for the given facet key. + // When provided, it will override the default behavior of facet + // computation. The query syntax is the same as a filter expression. See + // [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for + // detail syntax and limitations. Notice that there is no limitation on + // [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key] + // when query is specified. + // + // In the response, [FacetValue.value][] will be always "1" and + // [FacetValue.count][] will be the number of results that matches the + // query. + // + // For example, you can set a customized facet for "shipToStore", + // where + // [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key] + // is "customizedShipToStore", and + // [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query] + // is "availability: ANY(\"IN_STOCK\") AND shipToStore: ANY(\"123\")". + // Then the facet will count the products that are both in stock and ship + // to store "123". + string query = 5; + } + + // Required. The facet key specification. + FacetKey facet_key = 1 [(google.api.field_behavior) = REQUIRED]; + + // Maximum of facet values that should be returned for this facet. If + // unspecified, defaults to 20. The maximum allowed value is 300. Values + // above 300 will be coerced to 300. + // + // If this field is negative, an INVALID_ARGUMENT is returned. + int32 limit = 2; + + // List of keys to exclude when faceting. + // + // By default, + // [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key] + // is not excluded from the filter unless it is listed in this field. + // + // For example, suppose there are 100 products with color facet "Red" and + // 200 products with color facet "Blue". A query containing the filter + // "colorFamilies:ANY("Red")" and have "colorFamilies" as + // [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key] + // will by default return the "Red" with count 100. + // + // If this field contains "colorFamilies", then the query returns both the + // "Red" with count 100 and "Blue" with count 200, because the + // "colorFamilies" key is now excluded from the filter. + // + // A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error + // is returned. + repeated string excluded_filter_keys = 3; + + // Enables dynamic position for this facet. If set to true, the position of + // this facet among all facets in the response is determined by Google + // Retail Search. It will be ordered together with dynamic facets if dynamic + // facets is enabled. If set to false, the position of this facet in the + // response will be the same as in the request, and it will be ranked before + // the facets with dynamic position enable and all dynamic facets. + // + // For example, you may always want to have rating facet returned in + // the response, but it's not necessarily to always display the rating facet + // at the top. In that case, you can set enable_dynamic_position to true so + // that the position of rating facet in response will be determined by + // Google Retail Search. + // + // Another example, assuming you have the following facets in the request: + // + // * "rating", enable_dynamic_position = true + // + // * "price", enable_dynamic_position = false + // + // * "brands", enable_dynamic_position = false + // + // And also you have a dynamic facets enable, which will generate a facet + // 'gender'. Then the final order of the facets in the response can be + // ("price", "brands", "rating", "gender") or ("price", "brands", "gender", + // "rating") depends on how Google Retail Search orders "gender" and + // "rating" facets. However, notice that "price" and "brands" will always be + // ranked at 1st and 2nd position since their enable_dynamic_position are + // false. + bool enable_dynamic_position = 4; + } + + // The specifications of dynamically generated facets. + message DynamicFacetSpec { + // Enum to control DynamicFacet mode + enum Mode { + // Default value. + MODE_UNSPECIFIED = 0; + + // Disable Dynamic Facet. + DISABLED = 1; + + // Automatic mode built by Google Retail Search. + ENABLED = 2; + } + + // Mode of the DynamicFacet feature. + // Defaults to + // [Mode.DISABLED][google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode.DISABLED] + // if it's unset. + Mode mode = 1; + } + + // Boost specification to boost certain items. + message BoostSpec { + // Boost applies to products which match a condition. + message ConditionBoostSpec { + // An expression which specifies a boost condition. The syntax and + // supported fields are the same as a filter expression. See + // [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for + // detail syntax and limitations. + // + // Examples: + // + // * To boost products with product ID "product_1" or "product_2", and + // color + // "Red" or "Blue":
+ // *(id: ANY("product_1", "product_2"))
* + // *AND
* + // *(colorFamilies: ANY("Red", "Blue"))
* + string condition = 1; + + // Strength of the condition boost, which should be in [-1, 1]. Negative + // boost means demotion. Default is 0.0. + // + // Setting to 1.0 gives the item a big promotion. However, it does not + // necessarily mean that the boosted item will be the top result at all + // times, nor that other items will be excluded. Results could still be + // shown even when none of them matches the condition. And results that + // are significantly more relevant to the search query can still trump + // your heavily favored but irrelevant items. + // + // Setting to -1.0 gives the item a big demotion. However, results that + // are deeply relevant might still be shown. The item will have an + // upstream battle to get a fairly high ranking, but it is not blocked out + // completely. + // + // Setting to 0.0 means no boost applied. The boosting condition is + // ignored. + float boost = 2; + } + + // Condition boost specifications. If a product matches multiple conditions + // in the specifictions, boost scores from these specifications are all + // applied and combined in a non-linear way. Maximum number of + // specifications is 10. + repeated ConditionBoostSpec condition_boost_specs = 1; + } + + // Specification to determine under which conditions query expansion should + // occur. + message QueryExpansionSpec { + // Enum describing under which condition query expansion should occur. + enum Condition { + // Unspecified query expansion condition. This defaults to + // [Condition.DISABLED][google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition.DISABLED]. + CONDITION_UNSPECIFIED = 0; + + // Disabled query expansion. Only the exact search query is used, even if + // [SearchResponse.total_size][google.cloud.retail.v2.SearchResponse.total_size] + // is zero. + DISABLED = 1; + + // Automatic query expansion built by Google Retail Search. + AUTO = 3; + } + + // The condition under which query expansion should occur. Default to + // [Condition.DISABLED][google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition.DISABLED]. + Condition condition = 1; + } + + // Required. The resource name of the search engine placement, such as + // `projects/*/locations/global/catalogs/default_catalog/placements/default_search`. + // This field is used to identify the set of models that will be used to make + // the search. + // + // We currently support one placement with the following ID: + // + // * `default_search`. + string placement = 1 [(google.api.field_behavior) = REQUIRED]; + + // The branch resource name, such as + // `projects/*/locations/global/catalogs/default_catalog/branches/0`. + // + // Use "default_branch" as the branch ID or leave this field empty, to search + // products under the default branch. + string branch = 2 [ + (google.api.resource_reference) = { type: "retail.googleapis.com/Branch" } + ]; + + // Raw search query. + string query = 3; + + // 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. + // + // 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]; + + // User information. + UserInfo user_info = 5; + + // Maximum number of [Product][google.cloud.retail.v2.Product]s to return. If + // unspecified, defaults to a reasonable value. The maximum allowed value is + // 120. Values above 120 will be coerced to 120. + // + // If this field is negative, an INVALID_ARGUMENT is returned. + int32 page_size = 7; + + // A page token + // [SearchResponse.next_page_token][google.cloud.retail.v2.SearchResponse.next_page_token], + // received from a previous + // [SearchService.Search][google.cloud.retail.v2.SearchService.Search] call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // [SearchService.Search][google.cloud.retail.v2.SearchService.Search] must + // match the call that provided the page token. Otherwise, an INVALID_ARGUMENT + // error is returned. + string page_token = 8; + + // A 0-indexed integer that specifies the current offset (that is, starting + // result location, amongst the [Product][google.cloud.retail.v2.Product]s + // deemed by the API as relevant) in search results. This field is only + // considered if [page_token][google.cloud.retail.v2.SearchRequest.page_token] + // is unset. + // + // If this field is negative, an INVALID_ARGUMENT is returned. + int32 offset = 9; + + // The filter syntax consists of an expression language for constructing a + // predicate from one or more fields of the products being filtered. Filter + // expression is case-sensitive. See more details at this [user + // guide](/retail/private/docs/filter-and-order#filter). + // + // If this field is unrecognizable, an INVALID_ARGUMENT is returned. + string filter = 10; + + // 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 + // [SearchRequest.canonical_filter][google.cloud.retail.v2.SearchRequest.canonical_filter] + // will be returned as a supplement of the original query. This field is + // strongly recommended to achieve high search quality. + // + // See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for + // more details about filter syntax. + string canonical_filter = 28; + + // The order in which products are returned. Products can be ordered by + // a field in an [Product][google.cloud.retail.v2.Product] object. Leave it + // unset if ordered by relevance. OrderBy expression is case-sensitive. See + // more details at this [user + // guide](/retail/private/docs/filter-and-order#order). + // + // If this field is unrecognizable, an INVALID_ARGUMENT is returned. + string order_by = 11; + + // Facet specifications for faceted search. If empty, no facets are returned. + // + // A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error + // is returned. + repeated FacetSpec facet_specs = 12; + + // The specification for dynamically generated facets. Notice that only + // textual facets can be dynamically generated. + // + // This feature requires additional allowlisting. Contact Retail Support + // (retail-search-support@google.com) if you are interested in using dynamic + // facet feature. + DynamicFacetSpec dynamic_facet_spec = 21; + + // Boost specification to boost certain products. See more details at this + // [user guide](/retail/private/docs/boosting). + BoostSpec boost_spec = 13; + + // The query expansion specification that specifies the conditions under which + // query expansion will occur. See more details at this [user + // guide](/retail/private/docs/result-size#query_expansion). + QueryExpansionSpec query_expansion_spec = 14; + + // 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. + // + // For + // [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info], + // a fulfillment type and a fulfillment ID must be provided in the format of + // "fulfillmentType.filfillmentId". E.g., in "pickupInStore.store123", + // "pickupInStore" is fulfillment type and "store123" is the store ID. + // + // Supported keys are: + // + // * colorFamilies + // * price + // * originalPrice + // * discount + // * attributes.key, where key is any key in the + // [Product.attributes][google.cloud.retail.v2.Product.attributes] map. + // * pickupInStore.id, where id is any [FulfillmentInfo.ids][] for type + // [FulfillmentInfo.Type.PICKUP_IN_STORE][]. + // * shipToStore.id, where id is any [FulfillmentInfo.ids][] for type + // [FulfillmentInfo.Type.SHIP_TO_STORE][]. + // * sameDayDelivery.id, where id is any [FulfillmentInfo.ids][] for type + // [FulfillmentInfo.Type.SAME_DAY_DELIVERY][]. + // * nextDayDelivery.id, where id is any [FulfillmentInfo.ids][] for type + // [FulfillmentInfo.Type.NEXT_DAY_DELIVERY][]. + // * customFulfillment1.id, where id is any [FulfillmentInfo.ids][] for type + // [FulfillmentInfo.Type.CUSTOM_TYPE_1][]. + // * customFulfillment2.id, where id is any [FulfillmentInfo.ids][] for type + // [FulfillmentInfo.Type.CUSTOM_TYPE_2][]. + // * customFulfillment3.id, where id is any [FulfillmentInfo.ids][] for type + // [FulfillmentInfo.Type.CUSTOM_TYPE_3][]. + // * customFulfillment4.id, where id is any [FulfillmentInfo.ids][] for type + // [FulfillmentInfo.Type.CUSTOM_TYPE_4][]. + // * customFulfillment5.id, where id is any [FulfillmentInfo.ids][] for type + // [FulfillmentInfo.Type.CUSTOM_TYPE_5][]. + // + // If this field is set to an invalid value other than these, an + // INVALID_ARGUMENT error is returned. + repeated string variant_rollup_keys = 17; + + // The categories associated with a category page. Required for category + // navigation queries to achieve good search quality. The format should be + // the same as + // [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories]; + // + // To represent full path of category, use '>' sign to separate different + // hierarchies. If '>' is part of the category name, please replace it with + // other character(s). + // + // Category pages include special pages such as sales or promotions. For + // instance, a special sale page may have the category hierarchy: + // "pageCategories" : ["Sales > 2017 Black Friday Deals"]. + repeated string page_categories = 23; +} + +// Response message for +// [SearchService.Search][google.cloud.retail.v2.SearchService.Search] method. +message SearchResponse { + // Represents the search results. + message SearchResult { + // [Product.id][google.cloud.retail.v2.Product.id] of the searched + // [Product][google.cloud.retail.v2.Product]. + string id = 1; + + // The product data snippet in the search response. Only + // [Product.name][google.cloud.retail.v2.Product.name] is guaranteed to be + // populated. + // + // [Product.variants][google.cloud.retail.v2.Product.variants] contains the + // product variants that match the search query. If there are multiple + // product variants matching the query, top 5 most relevant product variants + // are returned and ordered by relevancy. + // + // If relevancy can be deternmined, use + // [matching_variant_fields][google.cloud.retail.v2.SearchResponse.SearchResult.matching_variant_fields] + // to look up matched product variants fields. If relevancy cannot be + // determined, e.g. when searching "shoe" all products in a shoe product can + // be a match, 5 product variants are returned but order is meaningless. + Product product = 2; + + // The count of matched + // [variant][google.cloud.retail.v2.Product.Type.VARIANT] + // [Product][google.cloud.retail.v2.Product]s. + int32 matching_variant_count = 3; + + // If a [variant][google.cloud.retail.v2.Product.Type.VARIANT] + // [Product][google.cloud.retail.v2.Product] matches the search query, this + // map indicates which [Product][google.cloud.retail.v2.Product] fields are + // matched. The key is the + // [Product.name][google.cloud.retail.v2.Product.name], the value is a field + // mask of the matched [Product][google.cloud.retail.v2.Product] fields. If + // matched attributes cannot be determined, this map will be empty. + // + // For example, a key "sku1" with field mask + // "products.color_info" indicates there is a match between + // "sku1" [ColorInfo][google.cloud.retail.v2.ColorInfo] and the query. + map matching_variant_fields = 4; + + // The rollup matching + // [variant][google.cloud.retail.v2.Product.Type.VARIANT] + // [Product][google.cloud.retail.v2.Product] attributes. The key is one of + // the + // [SearchRequest.variant_rollup_keys][google.cloud.retail.v2.SearchRequest.variant_rollup_keys]. + // The values are the merged and de-duplicated + // [Product][google.cloud.retail.v2.Product] attributes. Notice that the + // rollup values are respect filter. For example, when filtering by + // "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is + // returned. + // + // For textual and numerical attributes, the rollup values is a list of + // string or double values with type + // [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if + // there are two variants with colors "red" and "blue", the rollup values + // are { key: "colorFamilies" + // value { + // list_value { + // values { string_value: "red" } + // values { string_value: "blue" } + // } + // } + // } + // + // For + // [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info], + // the rollup values is a double value with type + // [google.protobuf.Value][google.protobuf.Value]. For example, {key: + // "pickupInStore.store1" value { number_value: 10 }} means a there are 10 + // variants in this product are available in the store "store1". + map variant_rollup_values = 5; + } + + // A facet result. + message Facet { + // A facet value which contains value names and their count. + message FacetValue { + // A facet value which contains values. + oneof facet_value { + // Text value of a facet, such as "Black" for facet "colorFamilies". + string value = 1; + + // Interval value for a facet, such as [10, 20) for facet "price". + Interval interval = 2; + } + + // Number of items that have this facet value. + int64 count = 3; + } + + // The key for this facet. E.g., "colorFamilies" or "price" or + // "attributes.attr1". + string key = 1; + + // The facet values for this field. + repeated FacetValue values = 2; + + // Whether the facet is dynamically generated. + bool dynamic_facet = 3; + } + + // Information describing query expansion including whether expansion has + // occurred. + message QueryExpansionInfo { + // Bool describing whether query expansion has occurred. + bool expanded_query = 1; + } + + // A list of matched items. The order represents the ranking. + repeated SearchResult results = 1; + + // Results of facets requested by user. + repeated Facet facets = 2; + + // The estimated total count of matched items irrespective of pagination. The + // count of [results][google.cloud.retail.v2.SearchResponse.results] returned + // by pagination may be less than the + // [total_size][google.cloud.retail.v2.SearchResponse.total_size] that + // matches. + int32 total_size = 3; + + // If spell correction applies, the corrected query. Otherwise, empty. + string corrected_query = 4; + + // A unique search token. This should be included in the + // [UserEvent][google.cloud.retail.v2.UserEvent] logs resulting from this + // search, which enables accurate attribution of search model performance. + string attribution_token = 5; + + // A token that can be sent as + // [SearchRequest.page_token][google.cloud.retail.v2.SearchRequest.page_token] + // to retrieve the next page. If this field is omitted, there are no + // subsequent pages. + string next_page_token = 6; + + // Query expansion information for the returned results. + QueryExpansionInfo query_expansion_info = 7; + + // The URI of a customer-defined redirect page. If redirect action is + // triggered, no search will be performed, and only + // [redirect_uri][google.cloud.retail.v2.SearchResponse.redirect_uri] and + // [attribution_token][google.cloud.retail.v2.SearchResponse.attribution_token] + // will be set in the response. + string redirect_uri = 10; +} diff --git a/proto-google-cloud-retail-v2/src/main/proto/google/cloud/retail/v2/user_event.proto b/proto-google-cloud-retail-v2/src/main/proto/google/cloud/retail/v2/user_event.proto index ca7083e5..7534edf3 100644 --- a/proto-google-cloud-retail-v2/src/main/proto/google/cloud/retail/v2/user_event.proto +++ b/proto-google-cloud-retail-v2/src/main/proto/google/cloud/retail/v2/user_event.proto @@ -40,8 +40,11 @@ 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. + // * `promotion-not-offered`: Promotion is not offered to a user. // * `purchase-complete`: User finishing a purchase. // * `search`: Product search. // * `shopping-cart-page-view`: User viewing a shopping cart. @@ -55,8 +58,23 @@ message UserEvent { // // The field must be a UTF-8 encoded string with a length limit of 128 // characters. Otherwise, an INVALID_ARGUMENT error is returned. + // + // The field should not contain PII or user-data. We recommend to use Google + // Analystics [Client + // ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId) + // for this field. string visitor_id = 2 [(google.api.field_behavior) = REQUIRED]; + // A unique identifier for tracking a visitor session with a length limit of + // 128 bytes. A session is an aggregation of an end user behavior in a time + // span. + // + // A general guideline to populate the sesion_id: + // 1. If user has no activity for 30 min, a new session_id should be assigned. + // 2. The session_id should be unique across users, suggest use uuid or add + // visitor_id as prefix. + string session_id = 21; + // Only required for // [UserEventService.ImportUserEvents][google.cloud.retail.v2.UserEventService.ImportUserEvents] // method. Timestamp of when the user event happened. @@ -77,6 +95,10 @@ message UserEvent { // [PredictResponse.attribution_token][google.cloud.retail.v2.PredictResponse.attribution_token] // for user events that are the result of // [PredictionService.Predict][google.cloud.retail.v2.PredictionService.Predict]. + // The value must be a valid + // [SearchResponse.attribution_token][google.cloud.retail.v2.SearchResponse.attribution_token] + // for user events that are the result of + // [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. // // This token enables us to accurately attribute page view or purchase back to // the event and the particular predict response containing this @@ -106,6 +128,13 @@ message UserEvent { // desired. The end user may have not finished broswing the whole page yet. repeated ProductDetail product_details = 6; + // The main 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. + 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 @@ -132,13 +161,53 @@ message UserEvent { // The user's search query. // + // See [SearchRequest.query][google.cloud.retail.v2.SearchRequest.query] for + // definition. + // // The value must be a UTF-8 encoded string with a length limit of 5,000 // characters. Otherwise, an INVALID_ARGUMENT error is returned. // - // Required for `search` events. Other event types should not set this field. + // At least one of + // [search_query][google.cloud.retail.v2.UserEvent.search_query] or + // [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is + // required for `search` events. Other event types should not set this field. // Otherwise, an INVALID_ARGUMENT error is returned. string search_query = 10; + // The filter syntax consists of an expression language for constructing a + // predicate from one or more fields of the products being filtered. + // + // See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for + // definition and syntax. + // + // The value must be a UTF-8 encoded string with a length limit of 1,000 + // characters. Otherwise, an INVALID_ARGUMENT error is returned. + string filter = 16; + + // The order in which products are returned. + // + // See [SearchRequest.order_by][google.cloud.retail.v2.SearchRequest.order_by] + // for definition and syntax. + // + // The value must be a UTF-8 encoded string with a length limit of 1,000 + // characters. Otherwise, an INVALID_ARGUMENT error is returned. + // + // This can only be set for `search` events. Other event types should not set + // this field. Otherwise, an INVALID_ARGUMENT error is returned. + string order_by = 17; + + // An integer that specifies the current offset for pagination (the 0-indexed + // starting location, amongst the products deemed by the API as relevant). + // + // See [SearchRequest.offset][google.cloud.retail.v2.SearchRequest.offset] for + // definition. + // + // If this field is negative, an INVALID_ARGUMENT is returned. + // + // This can only be set for `search` events. Other event types should not set + // this field. Otherwise, an INVALID_ARGUMENT error is returned. + int32 offset = 18; + // The categories associated with a category page. // // To represent full path of category, use '>' sign to separate different @@ -149,8 +218,11 @@ message UserEvent { // instance, a special sale page may have the category hierarchy: // "pageCategories" : ["Sales > 2017 Black Friday Deals"]. // - // Required for `category-page-view` events. Other event types should not set - // this field. Otherwise, an INVALID_ARGUMENT error is returned. + // Required for `category-page-view` events. At least one of + // [search_query][google.cloud.retail.v2.UserEvent.search_query] or + // [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is + // required for `search` events. Other event types should not set this field. + // Otherwise, an INVALID_ARGUMENT error is returned. repeated string page_categories = 11; // User information. @@ -199,6 +271,23 @@ message ProductDetail { google.protobuf.Int32Value quantity = 2; } +// Detailed completion information including completion attribution token and +// clicked completion info. +message CompletionDetail { + // Completion attribution token in + // [CompleteQueryResponse.attribution_token][google.cloud.retail.v2.CompleteQueryResponse.attribution_token]. + string completion_attribution_token = 1; + + // End user selected + // [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2.CompleteQueryResponse.CompletionResult.suggestion]. + string selected_suggestion = 2; + + // End user selected + // [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2.CompleteQueryResponse.CompletionResult.suggestion] + // position, starting from 0. + int32 selected_position = 3; +} + // A transaction represents the entire purchase transaction. message PurchaseTransaction { // The transaction ID with a length limit of 128 characters. diff --git a/synth.metadata b/synth.metadata index f7c41d49..3b571f29 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-retail.git", - "sha": "2e7ead0e1864e05ecc08016545ccc5ed44b5a43e" + "sha": "3573ab4a3ede0f0498048921d7e5a4ca5e04506a" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "551681f25e36b11829e87e580281350461f4f3f5", - "internalRef": "379784268" + "sha": "cea896d1032b311179e5114b3e5a1b798e7040b7", + "internalRef": "387366941" } }, { @@ -105,48 +105,76 @@ "codecov.yaml", "google-cloud-retail/src/main/java/com/google/cloud/retail/v2/CatalogServiceClient.java", "google-cloud-retail/src/main/java/com/google/cloud/retail/v2/CatalogServiceSettings.java", + "google-cloud-retail/src/main/java/com/google/cloud/retail/v2/CompletionServiceClient.java", + "google-cloud-retail/src/main/java/com/google/cloud/retail/v2/CompletionServiceSettings.java", "google-cloud-retail/src/main/java/com/google/cloud/retail/v2/PredictionServiceClient.java", "google-cloud-retail/src/main/java/com/google/cloud/retail/v2/PredictionServiceSettings.java", "google-cloud-retail/src/main/java/com/google/cloud/retail/v2/ProductServiceClient.java", "google-cloud-retail/src/main/java/com/google/cloud/retail/v2/ProductServiceSettings.java", + "google-cloud-retail/src/main/java/com/google/cloud/retail/v2/SearchServiceClient.java", + "google-cloud-retail/src/main/java/com/google/cloud/retail/v2/SearchServiceSettings.java", "google-cloud-retail/src/main/java/com/google/cloud/retail/v2/UserEventServiceClient.java", "google-cloud-retail/src/main/java/com/google/cloud/retail/v2/UserEventServiceSettings.java", "google-cloud-retail/src/main/java/com/google/cloud/retail/v2/gapic_metadata.json", "google-cloud-retail/src/main/java/com/google/cloud/retail/v2/package-info.java", "google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/CatalogServiceStub.java", "google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/CatalogServiceStubSettings.java", + "google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/CompletionServiceStub.java", + "google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/CompletionServiceStubSettings.java", "google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/GrpcCatalogServiceCallableFactory.java", "google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/GrpcCatalogServiceStub.java", + "google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/GrpcCompletionServiceCallableFactory.java", + "google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/GrpcCompletionServiceStub.java", "google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/GrpcPredictionServiceCallableFactory.java", "google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/GrpcPredictionServiceStub.java", "google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/GrpcProductServiceCallableFactory.java", "google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/GrpcProductServiceStub.java", + "google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/GrpcSearchServiceCallableFactory.java", + "google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/GrpcSearchServiceStub.java", "google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/GrpcUserEventServiceCallableFactory.java", "google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/GrpcUserEventServiceStub.java", "google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/PredictionServiceStub.java", "google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/PredictionServiceStubSettings.java", "google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/ProductServiceStub.java", "google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/ProductServiceStubSettings.java", + "google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/SearchServiceStub.java", + "google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/SearchServiceStubSettings.java", "google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/UserEventServiceStub.java", "google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/UserEventServiceStubSettings.java", "google-cloud-retail/src/test/java/com/google/cloud/retail/v2/CatalogServiceClientTest.java", + "google-cloud-retail/src/test/java/com/google/cloud/retail/v2/CompletionServiceClientTest.java", "google-cloud-retail/src/test/java/com/google/cloud/retail/v2/MockCatalogService.java", "google-cloud-retail/src/test/java/com/google/cloud/retail/v2/MockCatalogServiceImpl.java", + "google-cloud-retail/src/test/java/com/google/cloud/retail/v2/MockCompletionService.java", + "google-cloud-retail/src/test/java/com/google/cloud/retail/v2/MockCompletionServiceImpl.java", "google-cloud-retail/src/test/java/com/google/cloud/retail/v2/MockPredictionService.java", "google-cloud-retail/src/test/java/com/google/cloud/retail/v2/MockPredictionServiceImpl.java", "google-cloud-retail/src/test/java/com/google/cloud/retail/v2/MockProductService.java", "google-cloud-retail/src/test/java/com/google/cloud/retail/v2/MockProductServiceImpl.java", + "google-cloud-retail/src/test/java/com/google/cloud/retail/v2/MockSearchService.java", + "google-cloud-retail/src/test/java/com/google/cloud/retail/v2/MockSearchServiceImpl.java", "google-cloud-retail/src/test/java/com/google/cloud/retail/v2/MockUserEventService.java", "google-cloud-retail/src/test/java/com/google/cloud/retail/v2/MockUserEventServiceImpl.java", "google-cloud-retail/src/test/java/com/google/cloud/retail/v2/PredictionServiceClientTest.java", "google-cloud-retail/src/test/java/com/google/cloud/retail/v2/ProductServiceClientTest.java", + "google-cloud-retail/src/test/java/com/google/cloud/retail/v2/SearchServiceClientTest.java", "google-cloud-retail/src/test/java/com/google/cloud/retail/v2/UserEventServiceClientTest.java", "grpc-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CatalogServiceGrpc.java", + "grpc-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CompletionServiceGrpc.java", "grpc-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/PredictionServiceGrpc.java", "grpc-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ProductServiceGrpc.java", + "grpc-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/SearchServiceGrpc.java", "grpc-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/UserEventServiceGrpc.java", "java.header", "license-checks.xml", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/AddFulfillmentPlacesMetadata.java", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/AddFulfillmentPlacesMetadataOrBuilder.java", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/AddFulfillmentPlacesRequest.java", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/AddFulfillmentPlacesRequestOrBuilder.java", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/AddFulfillmentPlacesResponse.java", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/AddFulfillmentPlacesResponseOrBuilder.java", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/Audience.java", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/AudienceOrBuilder.java", "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/BigQuerySource.java", "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/BigQuerySourceOrBuilder.java", "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/BranchName.java", @@ -157,19 +185,40 @@ "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CatalogServiceProto.java", "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CollectUserEventRequest.java", "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CollectUserEventRequestOrBuilder.java", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ColorInfo.java", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ColorInfoOrBuilder.java", "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CommonProto.java", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CompleteQueryRequest.java", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CompleteQueryRequestOrBuilder.java", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CompleteQueryResponse.java", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CompleteQueryResponseOrBuilder.java", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CompletionDataInputConfig.java", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CompletionDataInputConfigOrBuilder.java", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CompletionDetail.java", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CompletionDetailOrBuilder.java", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CompletionServiceProto.java", "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CreateProductRequest.java", "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CreateProductRequestOrBuilder.java", "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CustomAttribute.java", "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/CustomAttributeOrBuilder.java", "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/DeleteProductRequest.java", "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/DeleteProductRequestOrBuilder.java", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/FulfillmentInfo.java", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/FulfillmentInfoOrBuilder.java", "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/GcsSource.java", "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/GcsSourceOrBuilder.java", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/GetDefaultBranchRequest.java", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/GetDefaultBranchRequestOrBuilder.java", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/GetDefaultBranchResponse.java", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/GetDefaultBranchResponseOrBuilder.java", "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/GetProductRequest.java", "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/GetProductRequestOrBuilder.java", "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/Image.java", "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ImageOrBuilder.java", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ImportCompletionDataRequest.java", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ImportCompletionDataRequestOrBuilder.java", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ImportCompletionDataResponse.java", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ImportCompletionDataResponseOrBuilder.java", "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ImportConfigProto.java", "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ImportErrorsConfig.java", "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ImportErrorsConfigOrBuilder.java", @@ -183,10 +232,16 @@ "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ImportUserEventsRequestOrBuilder.java", "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ImportUserEventsResponse.java", "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ImportUserEventsResponseOrBuilder.java", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/Interval.java", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/IntervalOrBuilder.java", "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ListCatalogsRequest.java", "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ListCatalogsRequestOrBuilder.java", "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ListCatalogsResponse.java", "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ListCatalogsResponseOrBuilder.java", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ListProductsRequest.java", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ListProductsRequestOrBuilder.java", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ListProductsResponse.java", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ListProductsResponseOrBuilder.java", "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/LocationName.java", "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/PredictRequest.java", "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/PredictRequestOrBuilder.java", @@ -208,6 +263,8 @@ "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ProductOrBuilder.java", "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ProductProto.java", "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/ProductServiceProto.java", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/Promotion.java", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/PromotionOrBuilder.java", "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/PurchaseTransaction.java", "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/PurchaseTransactionOrBuilder.java", "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/PurgeConfigProto.java", @@ -217,12 +274,33 @@ "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/PurgeUserEventsRequestOrBuilder.java", "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/PurgeUserEventsResponse.java", "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/PurgeUserEventsResponseOrBuilder.java", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/Rating.java", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/RatingOrBuilder.java", "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/RejoinUserEventsMetadata.java", "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/RejoinUserEventsMetadataOrBuilder.java", "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/RejoinUserEventsRequest.java", "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/RejoinUserEventsRequestOrBuilder.java", "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/RejoinUserEventsResponse.java", "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/RejoinUserEventsResponseOrBuilder.java", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/RemoveFulfillmentPlacesMetadata.java", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/RemoveFulfillmentPlacesMetadataOrBuilder.java", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/RemoveFulfillmentPlacesRequest.java", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/RemoveFulfillmentPlacesRequestOrBuilder.java", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/RemoveFulfillmentPlacesResponse.java", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/RemoveFulfillmentPlacesResponseOrBuilder.java", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/SearchRequest.java", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/SearchRequestOrBuilder.java", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/SearchResponse.java", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/SearchResponseOrBuilder.java", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/SearchServiceProto.java", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/SetDefaultBranchRequest.java", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/SetDefaultBranchRequestOrBuilder.java", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/SetInventoryMetadata.java", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/SetInventoryMetadataOrBuilder.java", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/SetInventoryRequest.java", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/SetInventoryRequestOrBuilder.java", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/SetInventoryResponse.java", + "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/SetInventoryResponseOrBuilder.java", "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/UpdateCatalogRequest.java", "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/UpdateCatalogRequestOrBuilder.java", "proto-google-cloud-retail-v2/src/main/java/com/google/cloud/retail/v2/UpdateProductRequest.java", @@ -244,11 +322,13 @@ "proto-google-cloud-retail-v2/src/main/proto/google/cloud/retail/v2/catalog.proto", "proto-google-cloud-retail-v2/src/main/proto/google/cloud/retail/v2/catalog_service.proto", "proto-google-cloud-retail-v2/src/main/proto/google/cloud/retail/v2/common.proto", + "proto-google-cloud-retail-v2/src/main/proto/google/cloud/retail/v2/completion_service.proto", "proto-google-cloud-retail-v2/src/main/proto/google/cloud/retail/v2/import_config.proto", "proto-google-cloud-retail-v2/src/main/proto/google/cloud/retail/v2/prediction_service.proto", "proto-google-cloud-retail-v2/src/main/proto/google/cloud/retail/v2/product.proto", "proto-google-cloud-retail-v2/src/main/proto/google/cloud/retail/v2/product_service.proto", "proto-google-cloud-retail-v2/src/main/proto/google/cloud/retail/v2/purge_config.proto", + "proto-google-cloud-retail-v2/src/main/proto/google/cloud/retail/v2/search_service.proto", "proto-google-cloud-retail-v2/src/main/proto/google/cloud/retail/v2/user_event.proto", "proto-google-cloud-retail-v2/src/main/proto/google/cloud/retail/v2/user_event_service.proto", "renovate.json",