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 + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) { + * Catalog catalog = Catalog.newBuilder().build(); + * FieldMask updateMask = FieldMask.newBuilder().build(); + * Catalog response = catalogServiceClient.updateCatalog(catalog, updateMask); + * } + * }+ * + *
Note: close() needs to be called on the CatalogServiceClient 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: + * + *
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 CatalogServiceSettings to + * create(). For example: + * + *
To customize credentials: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * CatalogServiceSettings catalogServiceSettings = + * CatalogServiceSettings.newBuilder() + * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + * .build(); + * CatalogServiceClient catalogServiceClient = CatalogServiceClient.create(catalogServiceSettings); + * }+ * + *
To customize the endpoint: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * CatalogServiceSettings catalogServiceSettings = + * CatalogServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + * CatalogServiceClient catalogServiceClient = CatalogServiceClient.create(catalogServiceSettings); + * }+ * + *
Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class CatalogServiceClient implements BackgroundResource { + private final CatalogServiceSettings settings; + private final CatalogServiceStub stub; + + /** Constructs an instance of CatalogServiceClient with default settings. */ + public static final CatalogServiceClient create() throws IOException { + return create(CatalogServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of CatalogServiceClient, 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 CatalogServiceClient create(CatalogServiceSettings settings) + throws IOException { + return new CatalogServiceClient(settings); + } + + /** + * Constructs an instance of CatalogServiceClient, using the given stub for making calls. This is + * for advanced usage - prefer using create(CatalogServiceSettings). + */ + public static final CatalogServiceClient create(CatalogServiceStub stub) { + return new CatalogServiceClient(stub); + } + + /** + * Constructs an instance of CatalogServiceClient, 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 CatalogServiceClient(CatalogServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((CatalogServiceStubSettings) settings.getStubSettings()).createStub(); + } + + protected CatalogServiceClient(CatalogServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final CatalogServiceSettings getSettings() { + return settings; + } + + public CatalogServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all the [Catalog][google.cloud.retail.v2alpha.Catalog]s associated with the project. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * for (Catalog element : catalogServiceClient.listCatalogs(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. The account resource name with an associated location. + *
If the caller does not have permission to list + * [Catalog][google.cloud.retail.v2alpha.Catalog]s under this location, regardless of whether + * or not this location exists, a PERMISSION_DENIED error is returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListCatalogsPagedResponse listCatalogs(LocationName parent) { + ListCatalogsRequest request = + ListCatalogsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listCatalogs(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all the [Catalog][google.cloud.retail.v2alpha.Catalog]s associated with the project. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) { + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + * for (Catalog element : catalogServiceClient.listCatalogs(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. The account resource name with an associated location. + *
If the caller does not have permission to list + * [Catalog][google.cloud.retail.v2alpha.Catalog]s under this location, regardless of whether + * or not this location exists, a PERMISSION_DENIED error is returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListCatalogsPagedResponse listCatalogs(String parent) { + ListCatalogsRequest request = ListCatalogsRequest.newBuilder().setParent(parent).build(); + return listCatalogs(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all the [Catalog][google.cloud.retail.v2alpha.Catalog]s associated with the project. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) { + * ListCatalogsRequest request = + * ListCatalogsRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * for (Catalog element : catalogServiceClient.listCatalogs(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 ListCatalogsPagedResponse listCatalogs(ListCatalogsRequest request) { + return listCatalogsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all the [Catalog][google.cloud.retail.v2alpha.Catalog]s associated with the project. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) { + * ListCatalogsRequest request = + * ListCatalogsRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * catalogServiceClient.listCatalogsPagedCallable().futureCall(request); + * // Do something. + * for (Catalog element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) { + * ListCatalogsRequest request = + * ListCatalogsRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * while (true) { + * ListCatalogsResponse response = catalogServiceClient.listCatalogsCallable().call(request); + * for (Catalog element : response.getResponsesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }+ */ + public final UnaryCallable
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) { + * Catalog catalog = Catalog.newBuilder().build(); + * FieldMask updateMask = FieldMask.newBuilder().build(); + * Catalog response = catalogServiceClient.updateCatalog(catalog, updateMask); + * } + * }+ * + * @param catalog Required. The [Catalog][google.cloud.retail.v2alpha.Catalog] to update. + *
If the caller does not have permission to update the + * [Catalog][google.cloud.retail.v2alpha.Catalog], regardless of whether or not it exists, a + * PERMISSION_DENIED error is returned. + *
If the [Catalog][google.cloud.retail.v2alpha.Catalog] to update does not exist, a + * NOT_FOUND error is returned. + * @param updateMask Indicates which fields in the provided + * [Catalog][google.cloud.retail.v2alpha.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 + */ + public final Catalog updateCatalog(Catalog catalog, FieldMask updateMask) { + UpdateCatalogRequest request = + UpdateCatalogRequest.newBuilder().setCatalog(catalog).setUpdateMask(updateMask).build(); + return updateCatalog(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the [Catalog][google.cloud.retail.v2alpha.Catalog]s. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) { + * UpdateCatalogRequest request = + * UpdateCatalogRequest.newBuilder() + * .setCatalog(Catalog.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * Catalog response = catalogServiceClient.updateCatalog(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 Catalog updateCatalog(UpdateCatalogRequest request) { + return updateCatalogCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the [Catalog][google.cloud.retail.v2alpha.Catalog]s. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) { + * UpdateCatalogRequest request = + * UpdateCatalogRequest.newBuilder() + * .setCatalog(Catalog.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = catalogServiceClient.updateCatalogCallable().futureCall(request); + * // Do something. + * Catalog response = future.get(); + * } + * }
For example, if `projects/*/locations/*/catalogs/*/branches/1` is set as + * default, setting [SearchRequest.branch][google.cloud.retail.v2alpha.SearchRequest.branch] to + * `projects/*/locations/*/catalogs/*/branches/default_branch` is equivalent to + * setting [SearchRequest.branch][google.cloud.retail.v2alpha.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.v2alpha.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: + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * 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.v2alpha.SearchService.Search], + * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct], + * [ProductService.ListProducts][google.cloud.retail.v2alpha.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.v2alpha.SearchRequest.branch] to + * `projects/*/locations/*/catalogs/*/branches/default_branch` is equivalent to + * setting [SearchRequest.branch][google.cloud.retail.v2alpha.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.v2alpha.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: + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * 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.v2alpha.SearchService.Search], + * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct], + * [ProductService.ListProducts][google.cloud.retail.v2alpha.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.v2alpha.SearchRequest.branch] to + * `projects/*/locations/*/catalogs/*/branches/default_branch` is equivalent to + * setting [SearchRequest.branch][google.cloud.retail.v2alpha.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.v2alpha.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: + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * 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") + * .setForce(true) + * .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.v2alpha.SearchService.Search], + * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct], + * [ProductService.ListProducts][google.cloud.retail.v2alpha.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.v2alpha.SearchRequest.branch] to + * `projects/*/locations/*/catalogs/*/branches/default_branch` is equivalent to + * setting [SearchRequest.branch][google.cloud.retail.v2alpha.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.v2alpha.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: + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * 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") + * .setForce(true) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = catalogServiceClient.setDefaultBranchCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * 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.v2alpha.CatalogService.SetDefaultBranch] + * method under a specified parent catalog. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * 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.v2alpha.CatalogService.SetDefaultBranch] + * method under a specified parent catalog. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * 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.v2alpha.CatalogService.SetDefaultBranch] + * method under a specified parent catalog. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) { + * GetDefaultBranchRequest request = + * GetDefaultBranchRequest.newBuilder() + * .setCatalog(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * catalogServiceClient.getDefaultBranchCallable().futureCall(request); + * // Do something. + * GetDefaultBranchResponse response = future.get(); + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) { + * CompletionConfigName name = CompletionConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]"); + * CompletionConfig response = catalogServiceClient.getCompletionConfig(name); + * } + * }+ * + * @param name Required. Full CompletionConfig resource name. Format: + * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final CompletionConfig getCompletionConfig(CompletionConfigName name) { + GetCompletionConfigRequest request = + GetCompletionConfigRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getCompletionConfig(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig]. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) { + * String name = CompletionConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString(); + * CompletionConfig response = catalogServiceClient.getCompletionConfig(name); + * } + * }+ * + * @param name Required. Full CompletionConfig resource name. Format: + * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final CompletionConfig getCompletionConfig(String name) { + GetCompletionConfigRequest request = + GetCompletionConfigRequest.newBuilder().setName(name).build(); + return getCompletionConfig(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig]. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) { + * GetCompletionConfigRequest request = + * GetCompletionConfigRequest.newBuilder() + * .setName(CompletionConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + * .build(); + * CompletionConfig response = catalogServiceClient.getCompletionConfig(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 CompletionConfig getCompletionConfig(GetCompletionConfigRequest request) { + return getCompletionConfigCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig]. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) { + * GetCompletionConfigRequest request = + * GetCompletionConfigRequest.newBuilder() + * .setName(CompletionConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * catalogServiceClient.getCompletionConfigCallable().futureCall(request); + * // Do something. + * CompletionConfig response = future.get(); + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) { + * CompletionConfig completionConfig = CompletionConfig.newBuilder().build(); + * FieldMask updateMask = FieldMask.newBuilder().build(); + * CompletionConfig response = + * catalogServiceClient.updateCompletionConfig(completionConfig, updateMask); + * } + * }+ * + * @param completionConfig Required. The + * [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig] to update. + *
If the caller does not have permission to update the + * [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig], then a PERMISSION_DENIED + * error is returned. + *
If the [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig] to update does + * not exist, a NOT_FOUND error is returned. + * @param updateMask Indicates which fields in the provided + * [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig] to update. The following + * are the only supported fields: + *
If not set, all supported fields are updated. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final CompletionConfig updateCompletionConfig( + CompletionConfig completionConfig, FieldMask updateMask) { + UpdateCompletionConfigRequest request = + UpdateCompletionConfigRequest.newBuilder() + .setCompletionConfig(completionConfig) + .setUpdateMask(updateMask) + .build(); + return updateCompletionConfig(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig]s. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) { + * UpdateCompletionConfigRequest request = + * UpdateCompletionConfigRequest.newBuilder() + * .setCompletionConfig(CompletionConfig.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * CompletionConfig response = catalogServiceClient.updateCompletionConfig(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 CompletionConfig updateCompletionConfig(UpdateCompletionConfigRequest request) { + return updateCompletionConfigCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig]s. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) { + * UpdateCompletionConfigRequest request = + * UpdateCompletionConfigRequest.newBuilder() + * .setCompletionConfig(CompletionConfig.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * catalogServiceClient.updateCompletionConfigCallable().futureCall(request); + * // Do something. + * CompletionConfig response = future.get(); + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) { + * AttributesConfigName name = AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]"); + * AttributesConfig response = catalogServiceClient.getAttributesConfig(name); + * } + * }+ * + * @param name Required. Full AttributesConfig resource name. Format: + * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AttributesConfig getAttributesConfig(AttributesConfigName name) { + GetAttributesConfigRequest request = + GetAttributesConfigRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getAttributesConfig(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets an [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig]. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) { + * String name = AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString(); + * AttributesConfig response = catalogServiceClient.getAttributesConfig(name); + * } + * }+ * + * @param name Required. Full AttributesConfig resource name. Format: + * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AttributesConfig getAttributesConfig(String name) { + GetAttributesConfigRequest request = + GetAttributesConfigRequest.newBuilder().setName(name).build(); + return getAttributesConfig(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets an [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig]. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) { + * GetAttributesConfigRequest request = + * GetAttributesConfigRequest.newBuilder() + * .setName(AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + * .build(); + * AttributesConfig response = catalogServiceClient.getAttributesConfig(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 AttributesConfig getAttributesConfig(GetAttributesConfigRequest request) { + return getAttributesConfigCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets an [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig]. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) { + * GetAttributesConfigRequest request = + * GetAttributesConfigRequest.newBuilder() + * .setName(AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * catalogServiceClient.getAttributesConfigCallable().futureCall(request); + * // Do something. + * AttributesConfig response = future.get(); + * } + * }
The catalog attributes in the request will be updated in the catalog, or inserted if they do + * not exist. Existing catalog attributes not included in the request will remain unchanged. + * Attributes that are assigned to products, but do not exist at the catalog level, are always + * included in the response. The product attribute is assigned default values for missing catalog + * attribute fields, e.g., searchable and dynamic facetable options. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) { + * AttributesConfig attributesConfig = AttributesConfig.newBuilder().build(); + * FieldMask updateMask = FieldMask.newBuilder().build(); + * AttributesConfig response = + * catalogServiceClient.updateAttributesConfig(attributesConfig, updateMask); + * } + * }+ * + * @param attributesConfig Required. The + * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig] to update. + * @param updateMask Indicates which fields in the provided + * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig] to update. The following + * is the only supported field: + *
If not set, all supported fields are updated. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AttributesConfig updateAttributesConfig( + AttributesConfig attributesConfig, FieldMask updateMask) { + UpdateAttributesConfigRequest request = + UpdateAttributesConfigRequest.newBuilder() + .setAttributesConfig(attributesConfig) + .setUpdateMask(updateMask) + .build(); + return updateAttributesConfig(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig]. + * + *
The catalog attributes in the request will be updated in the catalog, or inserted if they do + * not exist. Existing catalog attributes not included in the request will remain unchanged. + * Attributes that are assigned to products, but do not exist at the catalog level, are always + * included in the response. The product attribute is assigned default values for missing catalog + * attribute fields, e.g., searchable and dynamic facetable options. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) { + * UpdateAttributesConfigRequest request = + * UpdateAttributesConfigRequest.newBuilder() + * .setAttributesConfig(AttributesConfig.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * AttributesConfig response = catalogServiceClient.updateAttributesConfig(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 AttributesConfig updateAttributesConfig(UpdateAttributesConfigRequest request) { + return updateAttributesConfigCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig]. + * + *
The catalog attributes in the request will be updated in the catalog, or inserted if they do + * not exist. Existing catalog attributes not included in the request will remain unchanged. + * Attributes that are assigned to products, but do not exist at the catalog level, are always + * included in the response. The product attribute is assigned default values for missing catalog + * attribute fields, e.g., searchable and dynamic facetable options. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) { + * UpdateAttributesConfigRequest request = + * UpdateAttributesConfigRequest.newBuilder() + * .setAttributesConfig(AttributesConfig.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * catalogServiceClient.updateAttributesConfigCallable().futureCall(request); + * // Do something. + * AttributesConfig response = future.get(); + * } + * }
If the [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to add already + * exists, an ALREADY_EXISTS error is returned. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) { + * AddCatalogAttributeRequest request = + * AddCatalogAttributeRequest.newBuilder() + * .setAttributesConfig( + * AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + * .setCatalogAttribute(CatalogAttribute.newBuilder().build()) + * .build(); + * AttributesConfig response = catalogServiceClient.addCatalogAttribute(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 AttributesConfig addCatalogAttribute(AddCatalogAttributeRequest request) { + return addCatalogAttributeCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Adds the specified [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to the + * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig]. + * + *
If the [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to add already + * exists, an ALREADY_EXISTS error is returned. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) { + * AddCatalogAttributeRequest request = + * AddCatalogAttributeRequest.newBuilder() + * .setAttributesConfig( + * AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + * .setCatalogAttribute(CatalogAttribute.newBuilder().build()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * catalogServiceClient.addCatalogAttributeCallable().futureCall(request); + * // Do something. + * AttributesConfig response = future.get(); + * } + * }
If the [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to remove does not + * exist, a NOT_FOUND error is returned. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) { + * RemoveCatalogAttributeRequest request = + * RemoveCatalogAttributeRequest.newBuilder() + * .setAttributesConfig( + * AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + * .setKey("key106079") + * .build(); + * AttributesConfig response = catalogServiceClient.removeCatalogAttribute(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 AttributesConfig removeCatalogAttribute(RemoveCatalogAttributeRequest request) { + return removeCatalogAttributeCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Removes the specified [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] from the + * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig]. + * + *
If the [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to remove does not + * exist, a NOT_FOUND error is returned. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) { + * RemoveCatalogAttributeRequest request = + * RemoveCatalogAttributeRequest.newBuilder() + * .setAttributesConfig( + * AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + * .setKey("key106079") + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * catalogServiceClient.removeCatalogAttributeCallable().futureCall(request); + * // Do something. + * AttributesConfig response = future.get(); + * } + * }
If the [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to replace does not + * exist, a NOT_FOUND error is returned. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) { + * ReplaceCatalogAttributeRequest request = + * ReplaceCatalogAttributeRequest.newBuilder() + * .setAttributesConfig( + * AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + * .setCatalogAttribute(CatalogAttribute.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * AttributesConfig response = catalogServiceClient.replaceCatalogAttribute(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 AttributesConfig replaceCatalogAttribute(ReplaceCatalogAttributeRequest request) { + return replaceCatalogAttributeCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Replaces the specified [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] in the + * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig] by updating the catalog + * attribute with the same + * [CatalogAttribute.key][google.cloud.retail.v2alpha.CatalogAttribute.key]. + * + *
If the [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to replace does not + * exist, a NOT_FOUND error is returned. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) { + * ReplaceCatalogAttributeRequest request = + * ReplaceCatalogAttributeRequest.newBuilder() + * .setAttributesConfig( + * AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + * .setCatalogAttribute(CatalogAttribute.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * catalogServiceClient.replaceCatalogAttributeCallable().futureCall(request); + * // Do something. + * AttributesConfig response = future.get(); + * } + * }
The default instance has everything set to sensible defaults: + * + *
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 updateCatalog to 30 seconds: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * CatalogServiceSettings.Builder catalogServiceSettingsBuilder = + * CatalogServiceSettings.newBuilder(); + * catalogServiceSettingsBuilder + * .updateCatalogSettings() + * .setRetrySettings( + * catalogServiceSettingsBuilder + * .updateCatalogSettings() + * .getRetrySettings() + * .toBuilder() + * .setTotalTimeout(Duration.ofSeconds(30)) + * .build()); + * CatalogServiceSettings catalogServiceSettings = catalogServiceSettingsBuilder.build(); + * }+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class CatalogServiceSettings extends ClientSettings
Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction This feature is only available for users who have Retail Search enabled. Please enable Retail
+ * Search on Cloud Console before using this feature.
+ *
+ * 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:
+ *
+ * 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:
+ *
+ * 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:
+ *
+ * To customize the endpoint:
+ *
+ * Please refer to the GitHub repository's samples for more quickstart code snippets.
+ */
+@BetaApi
+@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).
+ */
+ 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());
+ }
+
+ protected CompletionServiceClient(CompletionServiceStub stub) {
+ this.settings = null;
+ this.stub = stub;
+ this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
+ }
+
+ public final CompletionServiceSettings getSettings() {
+ return settings;
+ }
+
+ 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. Please enable
+ * Retail Search on Cloud Console before using this feature.
+ *
+ * Sample code:
+ *
+ * This feature is only available for users who have Retail Search enabled. Please enable
+ * Retail Search on Cloud Console before using this feature.
+ *
+ * Sample code:
+ *
+ * Request processing is asynchronous. Partial updating is not supported.
+ *
+ * The operation is successfully finished only after the imported suggestions are indexed
+ * successfully and ready for serving. The process takes hours.
+ *
+ * This feature is only available for users who have Retail Search enabled. Please enable
+ * Retail Search on Cloud Console before using this feature.
+ *
+ * Sample code:
+ *
+ * Request processing is asynchronous. Partial updating is not supported.
+ *
+ * The operation is successfully finished only after the imported suggestions are indexed
+ * successfully and ready for serving. The process takes hours.
+ *
+ * This feature is only available for users who have Retail Search enabled. Please enable
+ * Retail Search on Cloud Console before using this feature.
+ *
+ * Sample code:
+ *
+ * Request processing is asynchronous. Partial updating is not supported.
+ *
+ * The operation is successfully finished only after the imported suggestions are indexed
+ * successfully and ready for serving. The process takes hours.
+ *
+ * This feature is only available for users who have Retail Search enabled. Please enable
+ * Retail Search on Cloud Console before using this feature.
+ *
+ * Sample code:
+ *
+ * The default instance has everything set to sensible defaults:
+ *
+ * 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:
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction 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:
+ *
+ * Note: close() needs to be called on the ControlServiceClient 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:
+ *
+ * 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 ControlServiceSettings to
+ * create(). For example:
+ *
+ * To customize credentials:
+ *
+ * To customize the endpoint:
+ *
+ * Please refer to the GitHub repository's samples for more quickstart code snippets.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class ControlServiceClient implements BackgroundResource {
+ private final ControlServiceSettings settings;
+ private final ControlServiceStub stub;
+
+ /** Constructs an instance of ControlServiceClient with default settings. */
+ public static final ControlServiceClient create() throws IOException {
+ return create(ControlServiceSettings.newBuilder().build());
+ }
+
+ /**
+ * Constructs an instance of ControlServiceClient, 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 ControlServiceClient create(ControlServiceSettings settings)
+ throws IOException {
+ return new ControlServiceClient(settings);
+ }
+
+ /**
+ * Constructs an instance of ControlServiceClient, using the given stub for making calls. This is
+ * for advanced usage - prefer using create(ControlServiceSettings).
+ */
+ public static final ControlServiceClient create(ControlServiceStub stub) {
+ return new ControlServiceClient(stub);
+ }
+
+ /**
+ * Constructs an instance of ControlServiceClient, 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 ControlServiceClient(ControlServiceSettings settings) throws IOException {
+ this.settings = settings;
+ this.stub = ((ControlServiceStubSettings) settings.getStubSettings()).createStub();
+ }
+
+ protected ControlServiceClient(ControlServiceStub stub) {
+ this.settings = null;
+ this.stub = stub;
+ }
+
+ public final ControlServiceSettings getSettings() {
+ return settings;
+ }
+
+ public ControlServiceStub getStub() {
+ return stub;
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a Control.
+ *
+ * If the [Control][google.cloud.retail.v2alpha.Control] to create already exists, an
+ * ALREADY_EXISTS error is returned.
+ *
+ * Sample code:
+ *
+ * This value should be 4-63 characters, and valid characters are /[a-z][0-9]-_/.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Control createControl(CatalogName parent, Control control, String controlId) {
+ CreateControlRequest request =
+ CreateControlRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setControl(control)
+ .setControlId(controlId)
+ .build();
+ return createControl(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a Control.
+ *
+ * If the [Control][google.cloud.retail.v2alpha.Control] to create already exists, an
+ * ALREADY_EXISTS error is returned.
+ *
+ * Sample code:
+ *
+ * This value should be 4-63 characters, and valid characters are /[a-z][0-9]-_/.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Control createControl(String parent, Control control, String controlId) {
+ CreateControlRequest request =
+ CreateControlRequest.newBuilder()
+ .setParent(parent)
+ .setControl(control)
+ .setControlId(controlId)
+ .build();
+ return createControl(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a Control.
+ *
+ * If the [Control][google.cloud.retail.v2alpha.Control] to create already exists, an
+ * ALREADY_EXISTS error is returned.
+ *
+ * Sample code:
+ *
+ * If the [Control][google.cloud.retail.v2alpha.Control] to create already exists, an
+ * ALREADY_EXISTS error is returned.
+ *
+ * Sample code:
+ *
+ * If the [Control][google.cloud.retail.v2alpha.Control] to delete does not exist, a NOT_FOUND
+ * error is returned.
+ *
+ * Sample code:
+ *
+ * If the [Control][google.cloud.retail.v2alpha.Control] to delete does not exist, a NOT_FOUND
+ * error is returned.
+ *
+ * Sample code:
+ *
+ * If the [Control][google.cloud.retail.v2alpha.Control] to delete does not exist, a NOT_FOUND
+ * error is returned.
+ *
+ * Sample code:
+ *
+ * If the [Control][google.cloud.retail.v2alpha.Control] to delete does not exist, a NOT_FOUND
+ * error is returned.
+ *
+ * Sample code:
+ *
+ * [Control][google.cloud.retail.v2alpha.Control] cannot be set to a different oneof field, if
+ * so an INVALID_ARGUMENT is returned. If the [Control][google.cloud.retail.v2alpha.Control] to
+ * delete does not exist, a NOT_FOUND error is returned.
+ *
+ * Sample code:
+ *
+ * If not set or empty, all supported fields are updated.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Control updateControl(Control control, FieldMask updateMask) {
+ UpdateControlRequest request =
+ UpdateControlRequest.newBuilder().setControl(control).setUpdateMask(updateMask).build();
+ return updateControl(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates a Control.
+ *
+ * [Control][google.cloud.retail.v2alpha.Control] cannot be set to a different oneof field, if
+ * so an INVALID_ARGUMENT is returned. If the [Control][google.cloud.retail.v2alpha.Control] to
+ * delete does not exist, a NOT_FOUND error is returned.
+ *
+ * Sample code:
+ *
+ * [Control][google.cloud.retail.v2alpha.Control] cannot be set to a different oneof field, if
+ * so an INVALID_ARGUMENT is returned. If the [Control][google.cloud.retail.v2alpha.Control] to
+ * delete does not exist, a NOT_FOUND error is returned.
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * The default instance has everything set to sensible defaults:
+ *
+ * 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 createControl to 30 seconds:
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction 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:
+ *
+ * Note: close() needs to be called on the PredictionServiceClient 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:
+ *
+ * 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 PredictionServiceSettings to
+ * create(). For example:
+ *
+ * To customize credentials:
+ *
+ * To customize the endpoint:
+ *
+ * Please refer to the GitHub repository's samples for more quickstart code snippets.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class PredictionServiceClient implements BackgroundResource {
+ private final PredictionServiceSettings settings;
+ private final PredictionServiceStub stub;
+
+ /** Constructs an instance of PredictionServiceClient with default settings. */
+ public static final PredictionServiceClient create() throws IOException {
+ return create(PredictionServiceSettings.newBuilder().build());
+ }
+
+ /**
+ * Constructs an instance of PredictionServiceClient, 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 PredictionServiceClient create(PredictionServiceSettings settings)
+ throws IOException {
+ return new PredictionServiceClient(settings);
+ }
+
+ /**
+ * Constructs an instance of PredictionServiceClient, using the given stub for making calls. This
+ * is for advanced usage - prefer using create(PredictionServiceSettings).
+ */
+ public static final PredictionServiceClient create(PredictionServiceStub stub) {
+ return new PredictionServiceClient(stub);
+ }
+
+ /**
+ * Constructs an instance of PredictionServiceClient, 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 PredictionServiceClient(PredictionServiceSettings settings) throws IOException {
+ this.settings = settings;
+ this.stub = ((PredictionServiceStubSettings) settings.getStubSettings()).createStub();
+ }
+
+ protected PredictionServiceClient(PredictionServiceStub stub) {
+ this.settings = null;
+ this.stub = stub;
+ }
+
+ public final PredictionServiceSettings getSettings() {
+ return settings;
+ }
+
+ public PredictionServiceStub getStub() {
+ return stub;
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Makes a recommendation prediction.
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * The default instance has everything set to sensible defaults:
+ *
+ * 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 predict to 30 seconds:
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction 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:
+ *
+ * Note: close() needs to be called on the ProductServiceClient 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:
+ *
+ * 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 ProductServiceSettings to
+ * create(). For example:
+ *
+ * To customize credentials:
+ *
+ * To customize the endpoint:
+ *
+ * Please refer to the GitHub repository's samples for more quickstart code snippets.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class ProductServiceClient implements BackgroundResource {
+ private final ProductServiceSettings settings;
+ private final ProductServiceStub stub;
+ private final OperationsClient operationsClient;
+
+ /** Constructs an instance of ProductServiceClient with default settings. */
+ public static final ProductServiceClient create() throws IOException {
+ return create(ProductServiceSettings.newBuilder().build());
+ }
+
+ /**
+ * Constructs an instance of ProductServiceClient, 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 ProductServiceClient create(ProductServiceSettings settings)
+ throws IOException {
+ return new ProductServiceClient(settings);
+ }
+
+ /**
+ * Constructs an instance of ProductServiceClient, using the given stub for making calls. This is
+ * for advanced usage - prefer using create(ProductServiceSettings).
+ */
+ public static final ProductServiceClient create(ProductServiceStub stub) {
+ return new ProductServiceClient(stub);
+ }
+
+ /**
+ * Constructs an instance of ProductServiceClient, 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 ProductServiceClient(ProductServiceSettings settings) throws IOException {
+ this.settings = settings;
+ this.stub = ((ProductServiceStubSettings) settings.getStubSettings()).createStub();
+ this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
+ }
+
+ protected ProductServiceClient(ProductServiceStub stub) {
+ this.settings = null;
+ this.stub = stub;
+ this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
+ }
+
+ public final ProductServiceSettings getSettings() {
+ return settings;
+ }
+
+ public ProductServiceStub 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.
+ /**
+ * Creates a [Product][google.cloud.retail.v2alpha.Product].
+ *
+ * Sample code:
+ *
+ * If the caller does not have permission to create the
+ * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or not it exists, a
+ * PERMISSION_DENIED error is returned.
+ * This field must be unique among all [Product][google.cloud.retail.v2alpha.Product]s with
+ * the same [parent][google.cloud.retail.v2alpha.CreateProductRequest.parent]. Otherwise, an
+ * ALREADY_EXISTS error is returned.
+ * This field must be a UTF-8 encoded string with a length limit of 128 characters.
+ * Otherwise, an INVALID_ARGUMENT error is returned.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Product createProduct(BranchName parent, Product product, String productId) {
+ CreateProductRequest request =
+ CreateProductRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setProduct(product)
+ .setProductId(productId)
+ .build();
+ return createProduct(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a [Product][google.cloud.retail.v2alpha.Product].
+ *
+ * Sample code:
+ *
+ * If the caller does not have permission to create the
+ * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or not it exists, a
+ * PERMISSION_DENIED error is returned.
+ * This field must be unique among all [Product][google.cloud.retail.v2alpha.Product]s with
+ * the same [parent][google.cloud.retail.v2alpha.CreateProductRequest.parent]. Otherwise, an
+ * ALREADY_EXISTS error is returned.
+ * This field must be a UTF-8 encoded string with a length limit of 128 characters.
+ * Otherwise, an INVALID_ARGUMENT error is returned.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Product createProduct(String parent, Product product, String productId) {
+ CreateProductRequest request =
+ CreateProductRequest.newBuilder()
+ .setParent(parent)
+ .setProduct(product)
+ .setProductId(productId)
+ .build();
+ return createProduct(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a [Product][google.cloud.retail.v2alpha.Product].
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * If the caller does not have permission to access the
+ * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or not it exists, a
+ * PERMISSION_DENIED error is returned.
+ * If the requested [Product][google.cloud.retail.v2alpha.Product] does not exist, a
+ * NOT_FOUND error is returned.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Product getProduct(ProductName name) {
+ GetProductRequest request =
+ GetProductRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getProduct(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets a [Product][google.cloud.retail.v2alpha.Product].
+ *
+ * Sample code:
+ *
+ * If the caller does not have permission to access the
+ * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or not it exists, a
+ * PERMISSION_DENIED error is returned.
+ * If the requested [Product][google.cloud.retail.v2alpha.Product] does not exist, a
+ * NOT_FOUND error is returned.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Product getProduct(String name) {
+ GetProductRequest request = GetProductRequest.newBuilder().setName(name).build();
+ return getProduct(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets a [Product][google.cloud.retail.v2alpha.Product].
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * If the caller does not have permission to list
+ * [Product][google.cloud.retail.v2alpha.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.v2alpha.Product]s.
+ *
+ * Sample code:
+ *
+ * If the caller does not have permission to list
+ * [Product][google.cloud.retail.v2alpha.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.v2alpha.Product]s.
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * If the caller does not have permission to update the
+ * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or not it exists, a
+ * PERMISSION_DENIED error is returned.
+ * If the [Product][google.cloud.retail.v2alpha.Product] to update does not exist and
+ * [allow_missing][google.cloud.retail.v2alpha.UpdateProductRequest.allow_missing] is not set,
+ * a NOT_FOUND error is returned.
+ * @param updateMask Indicates which fields in the provided
+ * [Product][google.cloud.retail.v2alpha.Product] to update. The immutable and output only
+ * fields are NOT supported. If not set, all supported fields (the fields that are neither
+ * immutable nor output only) are updated.
+ * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error is returned.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Product updateProduct(Product product, FieldMask updateMask) {
+ UpdateProductRequest request =
+ UpdateProductRequest.newBuilder().setProduct(product).setUpdateMask(updateMask).build();
+ return updateProduct(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates a [Product][google.cloud.retail.v2alpha.Product].
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * If the caller does not have permission to delete the
+ * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or not it exists, a
+ * PERMISSION_DENIED error is returned.
+ * If the [Product][google.cloud.retail.v2alpha.Product] to delete does not exist, a
+ * NOT_FOUND error is returned.
+ * The [Product][google.cloud.retail.v2alpha.Product] to delete can neither be a
+ * [Product.Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION]
+ * [Product][google.cloud.retail.v2alpha.Product] member nor a
+ * [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+ * [Product][google.cloud.retail.v2alpha.Product] with more than one
+ * [variants][google.cloud.retail.v2alpha.Product.Type.VARIANT]. Otherwise, an
+ * INVALID_ARGUMENT error is returned.
+ * All inventory information for the named [Product][google.cloud.retail.v2alpha.Product]
+ * will be deleted.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteProduct(ProductName name) {
+ DeleteProductRequest request =
+ DeleteProductRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ deleteProduct(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a [Product][google.cloud.retail.v2alpha.Product].
+ *
+ * Sample code:
+ *
+ * If the caller does not have permission to delete the
+ * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or not it exists, a
+ * PERMISSION_DENIED error is returned.
+ * If the [Product][google.cloud.retail.v2alpha.Product] to delete does not exist, a
+ * NOT_FOUND error is returned.
+ * The [Product][google.cloud.retail.v2alpha.Product] to delete can neither be a
+ * [Product.Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION]
+ * [Product][google.cloud.retail.v2alpha.Product] member nor a
+ * [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+ * [Product][google.cloud.retail.v2alpha.Product] with more than one
+ * [variants][google.cloud.retail.v2alpha.Product.Type.VARIANT]. Otherwise, an
+ * INVALID_ARGUMENT error is returned.
+ * All inventory information for the named [Product][google.cloud.retail.v2alpha.Product]
+ * will be deleted.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteProduct(String name) {
+ DeleteProductRequest request = DeleteProductRequest.newBuilder().setName(name).build();
+ deleteProduct(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a [Product][google.cloud.retail.v2alpha.Product].
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * This process is asynchronous. If the request is valid, the removal will be enqueued and
+ * processed offline. Depending on the number of [Product][google.cloud.retail.v2alpha.Product]s,
+ * this operation could take hours to complete. Before the operation completes, some
+ * [Product][google.cloud.retail.v2alpha.Product]s may still be returned by
+ * [GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or
+ * [ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+ *
+ * Depending on the number of [Product][google.cloud.retail.v2alpha.Product]s, this operation
+ * could take hours to complete. To get a sample of
+ * [Product][google.cloud.retail.v2alpha.Product]s that would be deleted, set
+ * [PurgeProductsRequest.force][google.cloud.retail.v2alpha.PurgeProductsRequest.force] to false.
+ *
+ * Sample code:
+ *
+ * This process is asynchronous. If the request is valid, the removal will be enqueued and
+ * processed offline. Depending on the number of [Product][google.cloud.retail.v2alpha.Product]s,
+ * this operation could take hours to complete. Before the operation completes, some
+ * [Product][google.cloud.retail.v2alpha.Product]s may still be returned by
+ * [GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or
+ * [ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+ *
+ * Depending on the number of [Product][google.cloud.retail.v2alpha.Product]s, this operation
+ * could take hours to complete. To get a sample of
+ * [Product][google.cloud.retail.v2alpha.Product]s that would be deleted, set
+ * [PurgeProductsRequest.force][google.cloud.retail.v2alpha.PurgeProductsRequest.force] to false.
+ *
+ * Sample code:
+ *
+ * This process is asynchronous. If the request is valid, the removal will be enqueued and
+ * processed offline. Depending on the number of [Product][google.cloud.retail.v2alpha.Product]s,
+ * this operation could take hours to complete. Before the operation completes, some
+ * [Product][google.cloud.retail.v2alpha.Product]s may still be returned by
+ * [GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or
+ * [ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+ *
+ * Depending on the number of [Product][google.cloud.retail.v2alpha.Product]s, this operation
+ * could take hours to complete. To get a sample of
+ * [Product][google.cloud.retail.v2alpha.Product]s that would be deleted, set
+ * [PurgeProductsRequest.force][google.cloud.retail.v2alpha.PurgeProductsRequest.force] to false.
+ *
+ * Sample code:
+ *
+ * Request processing may be synchronous. No partial updating is supported. Non-existing items
+ * are created.
+ *
+ * Note that it is possible for a subset of the [Product][google.cloud.retail.v2alpha.Product]s
+ * to be successfully updated.
+ *
+ * Sample code:
+ *
+ * Request processing may be synchronous. No partial updating is supported. Non-existing items
+ * are created.
+ *
+ * Note that it is possible for a subset of the [Product][google.cloud.retail.v2alpha.Product]s
+ * to be successfully updated.
+ *
+ * Sample code:
+ *
+ * Request processing may be synchronous. No partial updating is supported. Non-existing items
+ * are created.
+ *
+ * Note that it is possible for a subset of the [Product][google.cloud.retail.v2alpha.Product]s
+ * to be successfully updated.
+ *
+ * Sample code:
+ *
+ * This process is asynchronous and does not require the
+ * [Product][google.cloud.retail.v2alpha.Product] to exist before updating fulfillment
+ * information. If the request is valid, the update will be enqueued and processed downstream. As
+ * a consequence, when a response is returned, updates are not immediately manifested in the
+ * [Product][google.cloud.retail.v2alpha.Product] queried by
+ * [GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or
+ * [ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+ *
+ * When inventory is updated with
+ * [CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and
+ * [UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct], the specified
+ * inventory field value(s) will overwrite any existing value(s) while ignoring the last update
+ * time for this field. Furthermore, the last update time for the specified inventory fields will
+ * be overwritten to the time of the
+ * [CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] or
+ * [UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] request.
+ *
+ * If no inventory fields are set in
+ * [CreateProductRequest.product][google.cloud.retail.v2alpha.CreateProductRequest.product], then
+ * any pre-existing inventory information for this product will be used.
+ *
+ * If no inventory fields are set in
+ * [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask], then
+ * any existing inventory information will be preserved.
+ *
+ * Pre-existing inventory information can only be updated with
+ * [SetInventory][google.cloud.retail.v2alpha.ProductService.SetInventory],
+ * [AddFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.AddFulfillmentPlaces], and
+ * [RemoveFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.RemoveFulfillmentPlaces].
+ *
+ * This feature is only available for users who have Retail Search enabled. Please enable
+ * Retail Search on Cloud Console before using this feature.
+ *
+ * Sample code:
+ *
+ * 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.v2alpha.Product] named in
+ * [Product.name][google.cloud.retail.v2alpha.Product.name], regardless of whether or not it
+ * exists, a PERMISSION_DENIED error is returned.
+ * If the [Product][google.cloud.retail.v2alpha.Product] to update does not have existing
+ * inventory information, the provided inventory information will be inserted.
+ * If the [Product][google.cloud.retail.v2alpha.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.v2alpha.SetInventoryRequest.set_time].
+ * The caller can replace place IDs for a subset of fulfillment types in the following
+ * ways:
+ * The caller can clear all place IDs from a subset of fulfillment types in the following
+ * ways:
+ * The last update time is recorded for the following inventory fields:
+ * 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.v2alpha.Product] to update.
+ * At least one field must be provided.
+ * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error is returned
+ * and the entire update will be ignored.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture This process is asynchronous and does not require the
+ * [Product][google.cloud.retail.v2alpha.Product] to exist before updating fulfillment
+ * information. If the request is valid, the update will be enqueued and processed downstream. As
+ * a consequence, when a response is returned, updates are not immediately manifested in the
+ * [Product][google.cloud.retail.v2alpha.Product] queried by
+ * [GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or
+ * [ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+ *
+ * When inventory is updated with
+ * [CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and
+ * [UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct], the specified
+ * inventory field value(s) will overwrite any existing value(s) while ignoring the last update
+ * time for this field. Furthermore, the last update time for the specified inventory fields will
+ * be overwritten to the time of the
+ * [CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] or
+ * [UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] request.
+ *
+ * If no inventory fields are set in
+ * [CreateProductRequest.product][google.cloud.retail.v2alpha.CreateProductRequest.product], then
+ * any pre-existing inventory information for this product will be used.
+ *
+ * If no inventory fields are set in
+ * [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask], then
+ * any existing inventory information will be preserved.
+ *
+ * Pre-existing inventory information can only be updated with
+ * [SetInventory][google.cloud.retail.v2alpha.ProductService.SetInventory],
+ * [AddFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.AddFulfillmentPlaces], and
+ * [RemoveFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.RemoveFulfillmentPlaces].
+ *
+ * This feature is only available for users who have Retail Search enabled. Please enable
+ * Retail Search on Cloud Console before using this feature.
+ *
+ * Sample code:
+ *
+ * This process is asynchronous and does not require the
+ * [Product][google.cloud.retail.v2alpha.Product] to exist before updating fulfillment
+ * information. If the request is valid, the update will be enqueued and processed downstream. As
+ * a consequence, when a response is returned, updates are not immediately manifested in the
+ * [Product][google.cloud.retail.v2alpha.Product] queried by
+ * [GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or
+ * [ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+ *
+ * When inventory is updated with
+ * [CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and
+ * [UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct], the specified
+ * inventory field value(s) will overwrite any existing value(s) while ignoring the last update
+ * time for this field. Furthermore, the last update time for the specified inventory fields will
+ * be overwritten to the time of the
+ * [CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] or
+ * [UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] request.
+ *
+ * If no inventory fields are set in
+ * [CreateProductRequest.product][google.cloud.retail.v2alpha.CreateProductRequest.product], then
+ * any pre-existing inventory information for this product will be used.
+ *
+ * If no inventory fields are set in
+ * [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask], then
+ * any existing inventory information will be preserved.
+ *
+ * Pre-existing inventory information can only be updated with
+ * [SetInventory][google.cloud.retail.v2alpha.ProductService.SetInventory],
+ * [AddFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.AddFulfillmentPlaces], and
+ * [RemoveFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.RemoveFulfillmentPlaces].
+ *
+ * This feature is only available for users who have Retail Search enabled. Please enable
+ * Retail Search on Cloud Console before using this feature.
+ *
+ * Sample code:
+ *
+ * This process is asynchronous and does not require the
+ * [Product][google.cloud.retail.v2alpha.Product] to exist before updating fulfillment
+ * information. If the request is valid, the update will be enqueued and processed downstream. As
+ * a consequence, when a response is returned, updates are not immediately manifested in the
+ * [Product][google.cloud.retail.v2alpha.Product] queried by
+ * [GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or
+ * [ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+ *
+ * When inventory is updated with
+ * [CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and
+ * [UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct], the specified
+ * inventory field value(s) will overwrite any existing value(s) while ignoring the last update
+ * time for this field. Furthermore, the last update time for the specified inventory fields will
+ * be overwritten to the time of the
+ * [CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] or
+ * [UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] request.
+ *
+ * If no inventory fields are set in
+ * [CreateProductRequest.product][google.cloud.retail.v2alpha.CreateProductRequest.product], then
+ * any pre-existing inventory information for this product will be used.
+ *
+ * If no inventory fields are set in
+ * [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask], then
+ * any existing inventory information will be preserved.
+ *
+ * Pre-existing inventory information can only be updated with
+ * [SetInventory][google.cloud.retail.v2alpha.ProductService.SetInventory],
+ * [AddFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.AddFulfillmentPlaces], and
+ * [RemoveFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.RemoveFulfillmentPlaces].
+ *
+ * This feature is only available for users who have Retail Search enabled. Please enable
+ * Retail Search on Cloud Console before using this feature.
+ *
+ * Sample code:
+ *
+ * This process is asynchronous and does not require the
+ * [Product][google.cloud.retail.v2alpha.Product] to exist before updating fulfillment
+ * information. If the request is valid, the update will be enqueued and processed downstream. As
+ * a consequence, when a response is returned, the added place IDs are not immediately manifested
+ * in the [Product][google.cloud.retail.v2alpha.Product] queried by
+ * [GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or
+ * [ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+ *
+ * This feature is only available for users who have Retail Search enabled. Please enable
+ * Retail Search on Cloud Console before using this feature.
+ *
+ * Sample code:
+ *
+ * If the caller does not have permission to access the
+ * [Product][google.cloud.retail.v2alpha.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 This process is asynchronous and does not require the
+ * [Product][google.cloud.retail.v2alpha.Product] to exist before updating fulfillment
+ * information. If the request is valid, the update will be enqueued and processed downstream. As
+ * a consequence, when a response is returned, the added place IDs are not immediately manifested
+ * in the [Product][google.cloud.retail.v2alpha.Product] queried by
+ * [GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or
+ * [ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+ *
+ * This feature is only available for users who have Retail Search enabled. Please enable
+ * Retail Search on Cloud Console before using this feature.
+ *
+ * Sample code:
+ *
+ * If the caller does not have permission to access the
+ * [Product][google.cloud.retail.v2alpha.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 This process is asynchronous and does not require the
+ * [Product][google.cloud.retail.v2alpha.Product] to exist before updating fulfillment
+ * information. If the request is valid, the update will be enqueued and processed downstream. As
+ * a consequence, when a response is returned, the added place IDs are not immediately manifested
+ * in the [Product][google.cloud.retail.v2alpha.Product] queried by
+ * [GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or
+ * [ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+ *
+ * This feature is only available for users who have Retail Search enabled. Please enable
+ * Retail Search on Cloud Console before using this feature.
+ *
+ * Sample code:
+ *
+ * This process is asynchronous and does not require the
+ * [Product][google.cloud.retail.v2alpha.Product] to exist before updating fulfillment
+ * information. If the request is valid, the update will be enqueued and processed downstream. As
+ * a consequence, when a response is returned, the added place IDs are not immediately manifested
+ * in the [Product][google.cloud.retail.v2alpha.Product] queried by
+ * [GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or
+ * [ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+ *
+ * This feature is only available for users who have Retail Search enabled. Please enable
+ * Retail Search on Cloud Console before using this feature.
+ *
+ * Sample code:
+ *
+ * This process is asynchronous and does not require the
+ * [Product][google.cloud.retail.v2alpha.Product] to exist before updating fulfillment
+ * information. If the request is valid, the update will be enqueued and processed downstream. As
+ * a consequence, when a response is returned, the added place IDs are not immediately manifested
+ * in the [Product][google.cloud.retail.v2alpha.Product] queried by
+ * [GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or
+ * [ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+ *
+ * This feature is only available for users who have Retail Search enabled. Please enable
+ * Retail Search on Cloud Console before using this feature.
+ *
+ * Sample code:
+ *
+ * This process is asynchronous and does not require the
+ * [Product][google.cloud.retail.v2alpha.Product] to exist before updating fulfillment
+ * information. If the request is valid, the update will be enqueued and processed downstream. As
+ * a consequence, when a response is returned, the removed place IDs are not immediately
+ * manifested in the [Product][google.cloud.retail.v2alpha.Product] queried by
+ * [GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or
+ * [ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+ *
+ * This feature is only available for users who have Retail Search enabled. Please enable
+ * Retail Search on Cloud Console before using this feature.
+ *
+ * Sample code:
+ *
+ * If the caller does not have permission to access the
+ * [Product][google.cloud.retail.v2alpha.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 This process is asynchronous and does not require the
+ * [Product][google.cloud.retail.v2alpha.Product] to exist before updating fulfillment
+ * information. If the request is valid, the update will be enqueued and processed downstream. As
+ * a consequence, when a response is returned, the removed place IDs are not immediately
+ * manifested in the [Product][google.cloud.retail.v2alpha.Product] queried by
+ * [GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or
+ * [ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+ *
+ * This feature is only available for users who have Retail Search enabled. Please enable
+ * Retail Search on Cloud Console before using this feature.
+ *
+ * Sample code:
+ *
+ * If the caller does not have permission to access the
+ * [Product][google.cloud.retail.v2alpha.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 This process is asynchronous and does not require the
+ * [Product][google.cloud.retail.v2alpha.Product] to exist before updating fulfillment
+ * information. If the request is valid, the update will be enqueued and processed downstream. As
+ * a consequence, when a response is returned, the removed place IDs are not immediately
+ * manifested in the [Product][google.cloud.retail.v2alpha.Product] queried by
+ * [GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or
+ * [ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+ *
+ * This feature is only available for users who have Retail Search enabled. Please enable
+ * Retail Search on Cloud Console before using this feature.
+ *
+ * Sample code:
+ *
+ * This process is asynchronous and does not require the
+ * [Product][google.cloud.retail.v2alpha.Product] to exist before updating fulfillment
+ * information. If the request is valid, the update will be enqueued and processed downstream. As
+ * a consequence, when a response is returned, the removed place IDs are not immediately
+ * manifested in the [Product][google.cloud.retail.v2alpha.Product] queried by
+ * [GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or
+ * [ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+ *
+ * This feature is only available for users who have Retail Search enabled. Please enable
+ * Retail Search on Cloud Console before using this feature.
+ *
+ * Sample code:
+ *
+ * This process is asynchronous and does not require the
+ * [Product][google.cloud.retail.v2alpha.Product] to exist before updating fulfillment
+ * information. If the request is valid, the update will be enqueued and processed downstream. As
+ * a consequence, when a response is returned, the removed place IDs are not immediately
+ * manifested in the [Product][google.cloud.retail.v2alpha.Product] queried by
+ * [GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or
+ * [ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+ *
+ * This feature is only available for users who have Retail Search enabled. Please enable
+ * Retail Search on Cloud Console before using this feature.
+ *
+ * Sample code:
+ *
+ * This process is asynchronous and does not require the
+ * [Product][google.cloud.retail.v2alpha.Product] to exist before updating inventory information.
+ * If the request is valid, the update will be enqueued and processed downstream. As a
+ * consequence, when a response is returned, updates are not immediately manifested in the
+ * [Product][google.cloud.retail.v2alpha.Product] queried by
+ * [GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or
+ * [ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+ *
+ * Local inventory information can only be modified using this method.
+ * [CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and
+ * [UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] has no effect on
+ * local inventories.
+ *
+ * This feature is only available for users who have Retail Search enabled. Please enable
+ * Retail Search on Cloud Console before using this feature.
+ *
+ * Sample code:
+ *
+ * If the caller does not have permission to access the
+ * [Product][google.cloud.retail.v2alpha.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 This process is asynchronous and does not require the
+ * [Product][google.cloud.retail.v2alpha.Product] to exist before updating inventory information.
+ * If the request is valid, the update will be enqueued and processed downstream. As a
+ * consequence, when a response is returned, updates are not immediately manifested in the
+ * [Product][google.cloud.retail.v2alpha.Product] queried by
+ * [GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or
+ * [ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+ *
+ * Local inventory information can only be modified using this method.
+ * [CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and
+ * [UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] has no effect on
+ * local inventories.
+ *
+ * This feature is only available for users who have Retail Search enabled. Please enable
+ * Retail Search on Cloud Console before using this feature.
+ *
+ * Sample code:
+ *
+ * If the caller does not have permission to access the
+ * [Product][google.cloud.retail.v2alpha.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 This process is asynchronous and does not require the
+ * [Product][google.cloud.retail.v2alpha.Product] to exist before updating inventory information.
+ * If the request is valid, the update will be enqueued and processed downstream. As a
+ * consequence, when a response is returned, updates are not immediately manifested in the
+ * [Product][google.cloud.retail.v2alpha.Product] queried by
+ * [GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or
+ * [ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+ *
+ * Local inventory information can only be modified using this method.
+ * [CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and
+ * [UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] has no effect on
+ * local inventories.
+ *
+ * This feature is only available for users who have Retail Search enabled. Please enable
+ * Retail Search on Cloud Console before using this feature.
+ *
+ * Sample code:
+ *
+ * This process is asynchronous and does not require the
+ * [Product][google.cloud.retail.v2alpha.Product] to exist before updating inventory information.
+ * If the request is valid, the update will be enqueued and processed downstream. As a
+ * consequence, when a response is returned, updates are not immediately manifested in the
+ * [Product][google.cloud.retail.v2alpha.Product] queried by
+ * [GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or
+ * [ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+ *
+ * Local inventory information can only be modified using this method.
+ * [CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and
+ * [UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] has no effect on
+ * local inventories.
+ *
+ * This feature is only available for users who have Retail Search enabled. Please enable
+ * Retail Search on Cloud Console before using this feature.
+ *
+ * Sample code:
+ *
+ * This process is asynchronous and does not require the
+ * [Product][google.cloud.retail.v2alpha.Product] to exist before updating inventory information.
+ * If the request is valid, the update will be enqueued and processed downstream. As a
+ * consequence, when a response is returned, updates are not immediately manifested in the
+ * [Product][google.cloud.retail.v2alpha.Product] queried by
+ * [GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or
+ * [ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+ *
+ * Local inventory information can only be modified using this method.
+ * [CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and
+ * [UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] has no effect on
+ * local inventories.
+ *
+ * This feature is only available for users who have Retail Search enabled. Please enable
+ * Retail Search on Cloud Console before using this feature.
+ *
+ * Sample code:
+ *
+ * This process is asynchronous. If the request is valid, the removal will be enqueued and
+ * processed downstream. As a consequence, when a response is returned, removals are not
+ * immediately manifested in the [Product][google.cloud.retail.v2alpha.Product] queried by
+ * [GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or
+ * [ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+ *
+ * Local inventory information can only be removed using this method.
+ * [CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and
+ * [UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] has no effect on
+ * local inventories.
+ *
+ * This feature is only available for users who have Retail Search enabled. Please enable
+ * Retail Search on Cloud Console before using this feature.
+ *
+ * Sample code:
+ *
+ * If the caller does not have permission to access the
+ * [Product][google.cloud.retail.v2alpha.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 This process is asynchronous. If the request is valid, the removal will be enqueued and
+ * processed downstream. As a consequence, when a response is returned, removals are not
+ * immediately manifested in the [Product][google.cloud.retail.v2alpha.Product] queried by
+ * [GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or
+ * [ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+ *
+ * Local inventory information can only be removed using this method.
+ * [CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and
+ * [UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] has no effect on
+ * local inventories.
+ *
+ * This feature is only available for users who have Retail Search enabled. Please enable
+ * Retail Search on Cloud Console before using this feature.
+ *
+ * Sample code:
+ *
+ * If the caller does not have permission to access the
+ * [Product][google.cloud.retail.v2alpha.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 This process is asynchronous. If the request is valid, the removal will be enqueued and
+ * processed downstream. As a consequence, when a response is returned, removals are not
+ * immediately manifested in the [Product][google.cloud.retail.v2alpha.Product] queried by
+ * [GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or
+ * [ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+ *
+ * Local inventory information can only be removed using this method.
+ * [CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and
+ * [UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] has no effect on
+ * local inventories.
+ *
+ * This feature is only available for users who have Retail Search enabled. Please enable
+ * Retail Search on Cloud Console before using this feature.
+ *
+ * Sample code:
+ *
+ * This process is asynchronous. If the request is valid, the removal will be enqueued and
+ * processed downstream. As a consequence, when a response is returned, removals are not
+ * immediately manifested in the [Product][google.cloud.retail.v2alpha.Product] queried by
+ * [GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or
+ * [ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+ *
+ * Local inventory information can only be removed using this method.
+ * [CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and
+ * [UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] has no effect on
+ * local inventories.
+ *
+ * This feature is only available for users who have Retail Search enabled. Please enable
+ * Retail Search on Cloud Console before using this feature.
+ *
+ * Sample code:
+ *
+ * This process is asynchronous. If the request is valid, the removal will be enqueued and
+ * processed downstream. As a consequence, when a response is returned, removals are not
+ * immediately manifested in the [Product][google.cloud.retail.v2alpha.Product] queried by
+ * [GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or
+ * [ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+ *
+ * Local inventory information can only be removed using this method.
+ * [CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and
+ * [UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] has no effect on
+ * local inventories.
+ *
+ * This feature is only available for users who have Retail Search enabled. Please enable
+ * Retail Search on Cloud Console before using this feature.
+ *
+ * Sample code:
+ *
+ * The default instance has everything set to sensible defaults:
+ *
+ * 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 createProduct to 30 seconds:
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction This feature is only available for users who have Retail Search enabled. Please enable Retail
+ * Search on Cloud Console before using this feature.
+ *
+ * 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:
+ *
+ * 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:
+ *
+ * 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:
+ *
+ * To customize the endpoint:
+ *
+ * Please refer to the GitHub repository's samples for more quickstart code snippets.
+ */
+@BetaApi
+@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).
+ */
+ 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();
+ }
+
+ protected SearchServiceClient(SearchServiceStub stub) {
+ this.settings = null;
+ this.stub = stub;
+ }
+
+ public final SearchServiceSettings getSettings() {
+ return settings;
+ }
+
+ 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. Please enable
+ * Retail Search on Cloud Console before using this feature.
+ *
+ * Sample code:
+ *
+ * This feature is only available for users who have Retail Search enabled. Please enable
+ * Retail Search on Cloud Console before using this feature.
+ *
+ * Sample code:
+ *
+ * This feature is only available for users who have Retail Search enabled. Please enable
+ * Retail Search on Cloud Console before using this feature.
+ *
+ * Sample code:
+ *
+ * The default instance has everything set to sensible defaults:
+ *
+ * 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:
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction 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:
+ *
+ * Note: close() needs to be called on the ServingConfigServiceClient 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:
+ *
+ * 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 ServingConfigServiceSettings
+ * to create(). For example:
+ *
+ * To customize credentials:
+ *
+ * To customize the endpoint:
+ *
+ * Please refer to the GitHub repository's samples for more quickstart code snippets.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class ServingConfigServiceClient implements BackgroundResource {
+ private final ServingConfigServiceSettings settings;
+ private final ServingConfigServiceStub stub;
+
+ /** Constructs an instance of ServingConfigServiceClient with default settings. */
+ public static final ServingConfigServiceClient create() throws IOException {
+ return create(ServingConfigServiceSettings.newBuilder().build());
+ }
+
+ /**
+ * Constructs an instance of ServingConfigServiceClient, 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 ServingConfigServiceClient create(ServingConfigServiceSettings settings)
+ throws IOException {
+ return new ServingConfigServiceClient(settings);
+ }
+
+ /**
+ * Constructs an instance of ServingConfigServiceClient, using the given stub for making calls.
+ * This is for advanced usage - prefer using create(ServingConfigServiceSettings).
+ */
+ public static final ServingConfigServiceClient create(ServingConfigServiceStub stub) {
+ return new ServingConfigServiceClient(stub);
+ }
+
+ /**
+ * Constructs an instance of ServingConfigServiceClient, 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 ServingConfigServiceClient(ServingConfigServiceSettings settings) throws IOException {
+ this.settings = settings;
+ this.stub = ((ServingConfigServiceStubSettings) settings.getStubSettings()).createStub();
+ }
+
+ protected ServingConfigServiceClient(ServingConfigServiceStub stub) {
+ this.settings = null;
+ this.stub = stub;
+ }
+
+ public final ServingConfigServiceSettings getSettings() {
+ return settings;
+ }
+
+ public ServingConfigServiceStub getStub() {
+ return stub;
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a ServingConfig.
+ *
+ * A maximum of 100 [ServingConfig][google.cloud.retail.v2alpha.ServingConfig]s are allowed in
+ * a [Catalog][google.cloud.retail.v2alpha.Catalog], otherwise a FAILED_PRECONDITION error is
+ * returned.
+ *
+ * Sample code:
+ *
+ * This value should be 4-63 characters, and valid characters are /[a-z][0-9]-_/.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ServingConfig createServingConfig(
+ CatalogName parent, ServingConfig servingConfig, String servingConfigId) {
+ CreateServingConfigRequest request =
+ CreateServingConfigRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setServingConfig(servingConfig)
+ .setServingConfigId(servingConfigId)
+ .build();
+ return createServingConfig(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a ServingConfig.
+ *
+ * A maximum of 100 [ServingConfig][google.cloud.retail.v2alpha.ServingConfig]s are allowed in
+ * a [Catalog][google.cloud.retail.v2alpha.Catalog], otherwise a FAILED_PRECONDITION error is
+ * returned.
+ *
+ * Sample code:
+ *
+ * This value should be 4-63 characters, and valid characters are /[a-z][0-9]-_/.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ServingConfig createServingConfig(
+ String parent, ServingConfig servingConfig, String servingConfigId) {
+ CreateServingConfigRequest request =
+ CreateServingConfigRequest.newBuilder()
+ .setParent(parent)
+ .setServingConfig(servingConfig)
+ .setServingConfigId(servingConfigId)
+ .build();
+ return createServingConfig(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a ServingConfig.
+ *
+ * A maximum of 100 [ServingConfig][google.cloud.retail.v2alpha.ServingConfig]s are allowed in
+ * a [Catalog][google.cloud.retail.v2alpha.Catalog], otherwise a FAILED_PRECONDITION error is
+ * returned.
+ *
+ * Sample code:
+ *
+ * A maximum of 100 [ServingConfig][google.cloud.retail.v2alpha.ServingConfig]s are allowed in
+ * a [Catalog][google.cloud.retail.v2alpha.Catalog], otherwise a FAILED_PRECONDITION error is
+ * returned.
+ *
+ * Sample code:
+ *
+ * Returns a NotFound error if the ServingConfig does not exist.
+ *
+ * Sample code:
+ *
+ * Returns a NotFound error if the ServingConfig does not exist.
+ *
+ * Sample code:
+ *
+ * Returns a NotFound error if the ServingConfig does not exist.
+ *
+ * Sample code:
+ *
+ * Returns a NotFound error if the ServingConfig does not exist.
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * If not set, all supported fields are updated.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ServingConfig updateServingConfig(
+ ServingConfig servingConfig, FieldMask updateMask) {
+ UpdateServingConfigRequest request =
+ UpdateServingConfigRequest.newBuilder()
+ .setServingConfig(servingConfig)
+ .setUpdateMask(updateMask)
+ .build();
+ return updateServingConfig(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates a ServingConfig.
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Returns a NotFound error if the ServingConfig does not exist.
+ *
+ * Sample code:
+ *
+ * Returns a NotFound error if the ServingConfig does not exist.
+ *
+ * Sample code:
+ *
+ * Returns a NotFound error if the ServingConfig does not exist.
+ *
+ * Sample code:
+ *
+ * Returns a NotFound error if the ServingConfig does not exist.
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * The default instance has everything set to sensible defaults:
+ *
+ * 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 createServingConfig to 30 seconds:
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction 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:
+ *
+ * Note: close() needs to be called on the UserEventServiceClient 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:
+ *
+ * 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 UserEventServiceSettings to
+ * create(). For example:
+ *
+ * To customize credentials:
+ *
+ * To customize the endpoint:
+ *
+ * Please refer to the GitHub repository's samples for more quickstart code snippets.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class UserEventServiceClient implements BackgroundResource {
+ private final UserEventServiceSettings settings;
+ private final UserEventServiceStub stub;
+ private final OperationsClient operationsClient;
+
+ /** Constructs an instance of UserEventServiceClient with default settings. */
+ public static final UserEventServiceClient create() throws IOException {
+ return create(UserEventServiceSettings.newBuilder().build());
+ }
+
+ /**
+ * Constructs an instance of UserEventServiceClient, 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 UserEventServiceClient create(UserEventServiceSettings settings)
+ throws IOException {
+ return new UserEventServiceClient(settings);
+ }
+
+ /**
+ * Constructs an instance of UserEventServiceClient, using the given stub for making calls. This
+ * is for advanced usage - prefer using create(UserEventServiceSettings).
+ */
+ public static final UserEventServiceClient create(UserEventServiceStub stub) {
+ return new UserEventServiceClient(stub);
+ }
+
+ /**
+ * Constructs an instance of UserEventServiceClient, 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 UserEventServiceClient(UserEventServiceSettings settings) throws IOException {
+ this.settings = settings;
+ this.stub = ((UserEventServiceStubSettings) settings.getStubSettings()).createStub();
+ this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
+ }
+
+ protected UserEventServiceClient(UserEventServiceStub stub) {
+ this.settings = null;
+ this.stub = stub;
+ this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
+ }
+
+ public final UserEventServiceSettings getSettings() {
+ return settings;
+ }
+
+ public UserEventServiceStub 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.
+ /**
+ * Writes a single user event.
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * This method is used only by the Retail API JavaScript pixel and Google Tag Manager. Users
+ * should not call this method directly.
+ *
+ * Sample code:
+ *
+ * This method is used only by the Retail API JavaScript pixel and Google Tag Manager. Users
+ * should not call this method directly.
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Operation.response is of type ImportResponse. Note that it is possible for a subset of the
+ * items to be successfully inserted. Operation.metadata is of type ImportMetadata.
+ *
+ * Sample code:
+ *
+ * Operation.response is of type ImportResponse. Note that it is possible for a subset of the
+ * items to be successfully inserted. Operation.metadata is of type ImportMetadata.
+ *
+ * Sample code:
+ *
+ * Operation.response is of type ImportResponse. Note that it is possible for a subset of the
+ * items to be successfully inserted. Operation.metadata is of type ImportMetadata.
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (CompletionServiceClient completionServiceClient = CompletionServiceClient.create()) {
+ * CompleteQueryRequest request =
+ * CompleteQueryRequest.newBuilder()
+ * .setCatalog(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+ * .setQuery("query107944136")
+ * .setVisitorId("visitorId1880545833")
+ * .addAllLanguageCodes(new ArrayList
+ *
+ *
+ *
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * CompletionServiceSettings completionServiceSettings =
+ * CompletionServiceSettings.newBuilder()
+ * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ * .build();
+ * CompletionServiceClient completionServiceClient =
+ * CompletionServiceClient.create(completionServiceSettings);
+ * }
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * CompletionServiceSettings completionServiceSettings =
+ * CompletionServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * CompletionServiceClient completionServiceClient =
+ * CompletionServiceClient.create(completionServiceSettings);
+ * }
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (CompletionServiceClient completionServiceClient = CompletionServiceClient.create()) {
+ * CompleteQueryRequest request =
+ * CompleteQueryRequest.newBuilder()
+ * .setCatalog(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+ * .setQuery("query107944136")
+ * .setVisitorId("visitorId1880545833")
+ * .addAllLanguageCodes(new ArrayList
+ *
+ * @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.
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (CompletionServiceClient completionServiceClient = CompletionServiceClient.create()) {
+ * CompleteQueryRequest request =
+ * CompleteQueryRequest.newBuilder()
+ * .setCatalog(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+ * .setQuery("query107944136")
+ * .setVisitorId("visitorId1880545833")
+ * .addAllLanguageCodes(new ArrayList
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * 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{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * 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
+ */
+ public final OperationCallable<
+ ImportCompletionDataRequest, ImportCompletionDataResponse, ImportMetadata>
+ importCompletionDataOperationCallable() {
+ return stub.importCompletionDataOperationCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Bulk import of processed completion dataset.
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * 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
+ */
+ public final UnaryCallable
+ *
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * CompletionServiceSettings.Builder completionServiceSettingsBuilder =
+ * CompletionServiceSettings.newBuilder();
+ * completionServiceSettingsBuilder
+ * .completeQuerySettings()
+ * .setRetrySettings(
+ * completionServiceSettingsBuilder
+ * .completeQuerySettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30))
+ * .build());
+ * CompletionServiceSettings completionServiceSettings = completionServiceSettingsBuilder.build();
+ * }
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class CompletionServiceSettings extends ClientSettings{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+ * CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]");
+ * Control control = Control.newBuilder().build();
+ * String controlId = "controlId-395080872";
+ * Control response = controlServiceClient.createControl(parent, control, controlId);
+ * }
+ * }
+ *
+ *
+ *
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * ControlServiceSettings controlServiceSettings =
+ * ControlServiceSettings.newBuilder()
+ * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ * .build();
+ * ControlServiceClient controlServiceClient = ControlServiceClient.create(controlServiceSettings);
+ * }
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * ControlServiceSettings controlServiceSettings =
+ * ControlServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * ControlServiceClient controlServiceClient = ControlServiceClient.create(controlServiceSettings);
+ * }
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+ * CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]");
+ * Control control = Control.newBuilder().build();
+ * String controlId = "controlId-395080872";
+ * Control response = controlServiceClient.createControl(parent, control, controlId);
+ * }
+ * }
+ *
+ * @param parent Required. Full resource name of parent catalog. Format:
+ * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}
+ * @param control Required. The Control to create.
+ * @param controlId Required. The ID to use for the Control, which will become the final component
+ * of the Control's resource name.
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+ * String parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString();
+ * Control control = Control.newBuilder().build();
+ * String controlId = "controlId-395080872";
+ * Control response = controlServiceClient.createControl(parent, control, controlId);
+ * }
+ * }
+ *
+ * @param parent Required. Full resource name of parent catalog. Format:
+ * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}
+ * @param control Required. The Control to create.
+ * @param controlId Required. The ID to use for the Control, which will become the final component
+ * of the Control's resource name.
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+ * CreateControlRequest request =
+ * CreateControlRequest.newBuilder()
+ * .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+ * .setControl(Control.newBuilder().build())
+ * .setControlId("controlId-395080872")
+ * .build();
+ * Control response = controlServiceClient.createControl(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 Control createControl(CreateControlRequest request) {
+ return createControlCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a Control.
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+ * CreateControlRequest request =
+ * CreateControlRequest.newBuilder()
+ * .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+ * .setControl(Control.newBuilder().build())
+ * .setControlId("controlId-395080872")
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+ * ControlName name = ControlName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CONTROL]");
+ * controlServiceClient.deleteControl(name);
+ * }
+ * }
+ *
+ * @param name Required. The resource name of the Control to delete. Format:
+ * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteControl(ControlName name) {
+ DeleteControlRequest request =
+ DeleteControlRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ deleteControl(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a Control.
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+ * String name = ControlName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CONTROL]").toString();
+ * controlServiceClient.deleteControl(name);
+ * }
+ * }
+ *
+ * @param name Required. The resource name of the Control to delete. Format:
+ * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteControl(String name) {
+ DeleteControlRequest request = DeleteControlRequest.newBuilder().setName(name).build();
+ deleteControl(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a Control.
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+ * DeleteControlRequest request =
+ * DeleteControlRequest.newBuilder()
+ * .setName(
+ * ControlName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CONTROL]").toString())
+ * .build();
+ * controlServiceClient.deleteControl(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 deleteControl(DeleteControlRequest request) {
+ deleteControlCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a Control.
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+ * DeleteControlRequest request =
+ * DeleteControlRequest.newBuilder()
+ * .setName(
+ * ControlName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CONTROL]").toString())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+ * Control control = Control.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * Control response = controlServiceClient.updateControl(control, updateMask);
+ * }
+ * }
+ *
+ * @param control Required. The Control to update.
+ * @param updateMask Indicates which fields in the provided
+ * [Control][google.cloud.retail.v2alpha.Control] to update. The following are NOT supported:
+ *
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+ * UpdateControlRequest request =
+ * UpdateControlRequest.newBuilder()
+ * .setControl(Control.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * Control response = controlServiceClient.updateControl(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 Control updateControl(UpdateControlRequest request) {
+ return updateControlCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates a Control.
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+ * UpdateControlRequest request =
+ * UpdateControlRequest.newBuilder()
+ * .setControl(Control.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+ * ControlName name = ControlName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CONTROL]");
+ * Control response = controlServiceClient.getControl(name);
+ * }
+ * }
+ *
+ * @param name Required. The resource name of the Control to delete. Format:
+ * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Control getControl(ControlName name) {
+ GetControlRequest request =
+ GetControlRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getControl(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets a Control.
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+ * String name = ControlName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CONTROL]").toString();
+ * Control response = controlServiceClient.getControl(name);
+ * }
+ * }
+ *
+ * @param name Required. The resource name of the Control to delete. Format:
+ * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Control getControl(String name) {
+ GetControlRequest request = GetControlRequest.newBuilder().setName(name).build();
+ return getControl(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets a Control.
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+ * GetControlRequest request =
+ * GetControlRequest.newBuilder()
+ * .setName(
+ * ControlName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CONTROL]").toString())
+ * .build();
+ * Control response = controlServiceClient.getControl(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 Control getControl(GetControlRequest request) {
+ return getControlCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets a Control.
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+ * GetControlRequest request =
+ * GetControlRequest.newBuilder()
+ * .setName(
+ * ControlName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CONTROL]").toString())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+ * CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]");
+ * for (Control element : controlServiceClient.listControls(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The catalog resource name. Format:
+ * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListControlsPagedResponse listControls(CatalogName parent) {
+ ListControlsRequest request =
+ ListControlsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listControls(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists all Controls linked to this catalog.
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+ * String parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString();
+ * for (Control element : controlServiceClient.listControls(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The catalog resource name. Format:
+ * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListControlsPagedResponse listControls(String parent) {
+ ListControlsRequest request = ListControlsRequest.newBuilder().setParent(parent).build();
+ return listControls(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists all Controls linked to this catalog.
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+ * ListControlsRequest request =
+ * ListControlsRequest.newBuilder()
+ * .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .build();
+ * for (Control element : controlServiceClient.listControls(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 ListControlsPagedResponse listControls(ListControlsRequest request) {
+ return listControlsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists all Controls linked to this catalog.
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+ * ListControlsRequest request =
+ * ListControlsRequest.newBuilder()
+ * .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+ * ListControlsRequest request =
+ * ListControlsRequest.newBuilder()
+ * .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .build();
+ * while (true) {
+ * ListControlsResponse response = controlServiceClient.listControlsCallable().call(request);
+ * for (Control element : response.getResponsesList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable
+ *
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * ControlServiceSettings.Builder controlServiceSettingsBuilder =
+ * ControlServiceSettings.newBuilder();
+ * controlServiceSettingsBuilder
+ * .createControlSettings()
+ * .setRetrySettings(
+ * controlServiceSettingsBuilder
+ * .createControlSettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30))
+ * .build());
+ * ControlServiceSettings controlServiceSettings = controlServiceSettingsBuilder.build();
+ * }
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class ControlServiceSettings extends ClientSettings{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+ * PredictRequest request =
+ * PredictRequest.newBuilder()
+ * .setPlacement("placement1792938725")
+ * .setUserEvent(UserEvent.newBuilder().build())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .setValidateOnly(true)
+ * .putAllParams(new HashMap
+ *
+ *
+ *
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * PredictionServiceSettings predictionServiceSettings =
+ * PredictionServiceSettings.newBuilder()
+ * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ * .build();
+ * PredictionServiceClient predictionServiceClient =
+ * PredictionServiceClient.create(predictionServiceSettings);
+ * }
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * PredictionServiceSettings predictionServiceSettings =
+ * PredictionServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * PredictionServiceClient predictionServiceClient =
+ * PredictionServiceClient.create(predictionServiceSettings);
+ * }
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+ * PredictRequest request =
+ * PredictRequest.newBuilder()
+ * .setPlacement("placement1792938725")
+ * .setUserEvent(UserEvent.newBuilder().build())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .setValidateOnly(true)
+ * .putAllParams(new HashMap
+ *
+ * @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 PredictResponse predict(PredictRequest request) {
+ return predictCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Makes a recommendation prediction.
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+ * PredictRequest request =
+ * PredictRequest.newBuilder()
+ * .setPlacement("placement1792938725")
+ * .setUserEvent(UserEvent.newBuilder().build())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .setValidateOnly(true)
+ * .putAllParams(new HashMap
+ */
+ public final UnaryCallable
+ *
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * PredictionServiceSettings.Builder predictionServiceSettingsBuilder =
+ * PredictionServiceSettings.newBuilder();
+ * predictionServiceSettingsBuilder
+ * .predictSettings()
+ * .setRetrySettings(
+ * predictionServiceSettingsBuilder
+ * .predictSettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30))
+ * .build());
+ * PredictionServiceSettings predictionServiceSettings = predictionServiceSettingsBuilder.build();
+ * }
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class PredictionServiceSettings extends ClientSettings{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+ * BranchName parent = BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]");
+ * Product product = Product.newBuilder().build();
+ * String productId = "productId-1051830678";
+ * Product response = productServiceClient.createProduct(parent, product, productId);
+ * }
+ * }
+ *
+ *
+ *
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * ProductServiceSettings productServiceSettings =
+ * ProductServiceSettings.newBuilder()
+ * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ * .build();
+ * ProductServiceClient productServiceClient = ProductServiceClient.create(productServiceSettings);
+ * }
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * ProductServiceSettings productServiceSettings =
+ * ProductServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * ProductServiceClient productServiceClient = ProductServiceClient.create(productServiceSettings);
+ * }
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+ * BranchName parent = BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]");
+ * Product product = Product.newBuilder().build();
+ * String productId = "productId-1051830678";
+ * Product response = productServiceClient.createProduct(parent, product, productId);
+ * }
+ * }
+ *
+ * @param parent Required. The parent catalog resource name, such as
+ * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch`.
+ * @param product Required. The [Product][google.cloud.retail.v2alpha.Product] to create.
+ * @param productId Required. The ID to use for the
+ * [Product][google.cloud.retail.v2alpha.Product], which will become the final component of
+ * the [Product.name][google.cloud.retail.v2alpha.Product.name].
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+ * String parent = BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString();
+ * Product product = Product.newBuilder().build();
+ * String productId = "productId-1051830678";
+ * Product response = productServiceClient.createProduct(parent, product, productId);
+ * }
+ * }
+ *
+ * @param parent Required. The parent catalog resource name, such as
+ * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch`.
+ * @param product Required. The [Product][google.cloud.retail.v2alpha.Product] to create.
+ * @param productId Required. The ID to use for the
+ * [Product][google.cloud.retail.v2alpha.Product], which will become the final component of
+ * the [Product.name][google.cloud.retail.v2alpha.Product.name].
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+ * CreateProductRequest request =
+ * CreateProductRequest.newBuilder()
+ * .setParent(
+ * BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString())
+ * .setProduct(Product.newBuilder().build())
+ * .setProductId("productId-1051830678")
+ * .build();
+ * Product response = productServiceClient.createProduct(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 Product createProduct(CreateProductRequest request) {
+ return createProductCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a [Product][google.cloud.retail.v2alpha.Product].
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+ * CreateProductRequest request =
+ * CreateProductRequest.newBuilder()
+ * .setParent(
+ * BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString())
+ * .setProduct(Product.newBuilder().build())
+ * .setProductId("productId-1051830678")
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+ * ProductName name =
+ * ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]");
+ * Product response = productServiceClient.getProduct(name);
+ * }
+ * }
+ *
+ * @param name Required. Full resource name of [Product][google.cloud.retail.v2alpha.Product],
+ * such as
+ * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+ * String name =
+ * ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+ * .toString();
+ * Product response = productServiceClient.getProduct(name);
+ * }
+ * }
+ *
+ * @param name Required. Full resource name of [Product][google.cloud.retail.v2alpha.Product],
+ * such as
+ * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+ * GetProductRequest request =
+ * GetProductRequest.newBuilder()
+ * .setName(
+ * ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+ * .toString())
+ * .build();
+ * Product response = productServiceClient.getProduct(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 Product getProduct(GetProductRequest request) {
+ return getProductCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets a [Product][google.cloud.retail.v2alpha.Product].
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+ * GetProductRequest request =
+ * GetProductRequest.newBuilder()
+ * .setName(
+ * ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+ * .toString())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * 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.
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * 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.
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * 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())
+ * .setRequireTotalSize(true)
+ * .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.v2alpha.Product]s.
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * 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())
+ * .setRequireTotalSize(true)
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * 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())
+ * .setRequireTotalSize(true)
+ * .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{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+ * Product product = Product.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * Product response = productServiceClient.updateProduct(product, updateMask);
+ * }
+ * }
+ *
+ * @param product Required. The product to update/create.
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+ * UpdateProductRequest request =
+ * UpdateProductRequest.newBuilder()
+ * .setProduct(Product.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .setAllowMissing(true)
+ * .build();
+ * Product response = productServiceClient.updateProduct(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 Product updateProduct(UpdateProductRequest request) {
+ return updateProductCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates a [Product][google.cloud.retail.v2alpha.Product].
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+ * UpdateProductRequest request =
+ * UpdateProductRequest.newBuilder()
+ * .setProduct(Product.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .setAllowMissing(true)
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+ * ProductName name =
+ * ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]");
+ * productServiceClient.deleteProduct(name);
+ * }
+ * }
+ *
+ * @param name Required. Full resource name of [Product][google.cloud.retail.v2alpha.Product],
+ * such as
+ * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+ * String name =
+ * ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+ * .toString();
+ * productServiceClient.deleteProduct(name);
+ * }
+ * }
+ *
+ * @param name Required. Full resource name of [Product][google.cloud.retail.v2alpha.Product],
+ * such as
+ * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+ * DeleteProductRequest request =
+ * DeleteProductRequest.newBuilder()
+ * .setName(
+ * ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+ * .toString())
+ * .build();
+ * productServiceClient.deleteProduct(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 deleteProduct(DeleteProductRequest request) {
+ deleteProductCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a [Product][google.cloud.retail.v2alpha.Product].
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+ * DeleteProductRequest request =
+ * DeleteProductRequest.newBuilder()
+ * .setName(
+ * ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+ * .toString())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+ * PurgeProductsRequest request =
+ * PurgeProductsRequest.newBuilder()
+ * .setParent(
+ * BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString())
+ * .setFilter("filter-1274492040")
+ * .setForce(true)
+ * .build();
+ * PurgeProductsResponse response = productServiceClient.purgeProductsAsync(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{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+ * PurgeProductsRequest request =
+ * PurgeProductsRequest.newBuilder()
+ * .setParent(
+ * BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString())
+ * .setFilter("filter-1274492040")
+ * .setForce(true)
+ * .build();
+ * OperationFuture
+ */
+ public final OperationCallable{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+ * PurgeProductsRequest request =
+ * PurgeProductsRequest.newBuilder()
+ * .setParent(
+ * BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString())
+ * .setFilter("filter-1274492040")
+ * .setForce(true)
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+ * ImportProductsRequest request =
+ * ImportProductsRequest.newBuilder()
+ * .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();
+ * }
+ * }
+ *
+ * @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{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+ * ImportProductsRequest request =
+ * ImportProductsRequest.newBuilder()
+ * .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
+ */
+ public final OperationCallable{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+ * ImportProductsRequest request =
+ * ImportProductsRequest.newBuilder()
+ * .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
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * 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:
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * 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{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * 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
+ */
+ public final OperationCallable{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * 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
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * 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.v2alpha.Product],
+ * such as
+ * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * 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.v2alpha.Product],
+ * such as
+ * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+ * AddFulfillmentPlacesRequest request =
+ * AddFulfillmentPlacesRequest.newBuilder()
+ * .setProduct(
+ * ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+ * .toString())
+ * .setType("type3575610")
+ * .addAllPlaceIds(new ArrayList
+ *
+ * @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{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+ * AddFulfillmentPlacesRequest request =
+ * AddFulfillmentPlacesRequest.newBuilder()
+ * .setProduct(
+ * ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+ * .toString())
+ * .setType("type3575610")
+ * .addAllPlaceIds(new ArrayList
+ */
+ 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.v2alpha.FulfillmentInfo.place_ids].
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+ * AddFulfillmentPlacesRequest request =
+ * AddFulfillmentPlacesRequest.newBuilder()
+ * .setProduct(
+ * ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+ * .toString())
+ * .setType("type3575610")
+ * .addAllPlaceIds(new ArrayList
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * 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.v2alpha.Product],
+ * such as
+ * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * 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.v2alpha.Product],
+ * such as
+ * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+ * RemoveFulfillmentPlacesRequest request =
+ * RemoveFulfillmentPlacesRequest.newBuilder()
+ * .setProduct(
+ * ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+ * .toString())
+ * .setType("type3575610")
+ * .addAllPlaceIds(new ArrayList
+ *
+ * @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{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+ * RemoveFulfillmentPlacesRequest request =
+ * RemoveFulfillmentPlacesRequest.newBuilder()
+ * .setProduct(
+ * ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+ * .toString())
+ * .setType("type3575610")
+ * .addAllPlaceIds(new ArrayList
+ */
+ 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.v2alpha.FulfillmentInfo.place_ids].
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+ * RemoveFulfillmentPlacesRequest request =
+ * RemoveFulfillmentPlacesRequest.newBuilder()
+ * .setProduct(
+ * ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+ * .toString())
+ * .setType("type3575610")
+ * .addAllPlaceIds(new ArrayList
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+ * ProductName product =
+ * ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]");
+ * AddLocalInventoriesResponse response =
+ * productServiceClient.addLocalInventoriesAsync(product).get();
+ * }
+ * }
+ *
+ * @param product Required. Full resource name of [Product][google.cloud.retail.v2alpha.Product],
+ * such as
+ * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+ * String product =
+ * ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+ * .toString();
+ * AddLocalInventoriesResponse response =
+ * productServiceClient.addLocalInventoriesAsync(product).get();
+ * }
+ * }
+ *
+ * @param product Required. Full resource name of [Product][google.cloud.retail.v2alpha.Product],
+ * such as
+ * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+ * AddLocalInventoriesRequest request =
+ * AddLocalInventoriesRequest.newBuilder()
+ * .setProduct(
+ * ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+ * .toString())
+ * .addAllLocalInventories(new ArrayList
+ *
+ * @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{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+ * AddLocalInventoriesRequest request =
+ * AddLocalInventoriesRequest.newBuilder()
+ * .setProduct(
+ * ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+ * .toString())
+ * .addAllLocalInventories(new ArrayList
+ */
+ public final OperationCallable<
+ AddLocalInventoriesRequest, AddLocalInventoriesResponse, AddLocalInventoriesMetadata>
+ addLocalInventoriesOperationCallable() {
+ return stub.addLocalInventoriesOperationCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates local inventory information for a [Product][google.cloud.retail.v2alpha.Product] at a
+ * list of places, while respecting the last update timestamps of each inventory field.
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+ * AddLocalInventoriesRequest request =
+ * AddLocalInventoriesRequest.newBuilder()
+ * .setProduct(
+ * ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+ * .toString())
+ * .addAllLocalInventories(new ArrayList
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+ * ProductName product =
+ * ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]");
+ * RemoveLocalInventoriesResponse response =
+ * productServiceClient.removeLocalInventoriesAsync(product).get();
+ * }
+ * }
+ *
+ * @param product Required. Full resource name of [Product][google.cloud.retail.v2alpha.Product],
+ * such as
+ * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+ * String product =
+ * ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+ * .toString();
+ * RemoveLocalInventoriesResponse response =
+ * productServiceClient.removeLocalInventoriesAsync(product).get();
+ * }
+ * }
+ *
+ * @param product Required. Full resource name of [Product][google.cloud.retail.v2alpha.Product],
+ * such as
+ * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+ * RemoveLocalInventoriesRequest request =
+ * RemoveLocalInventoriesRequest.newBuilder()
+ * .setProduct(
+ * ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+ * .toString())
+ * .addAllPlaceIds(new ArrayList
+ *
+ * @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{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+ * RemoveLocalInventoriesRequest request =
+ * RemoveLocalInventoriesRequest.newBuilder()
+ * .setProduct(
+ * ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+ * .toString())
+ * .addAllPlaceIds(new ArrayList
+ */
+ public final OperationCallable<
+ RemoveLocalInventoriesRequest,
+ RemoveLocalInventoriesResponse,
+ RemoveLocalInventoriesMetadata>
+ removeLocalInventoriesOperationCallable() {
+ return stub.removeLocalInventoriesOperationCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Remove local inventory information for a [Product][google.cloud.retail.v2alpha.Product] at a
+ * list of places at a removal timestamp.
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+ * RemoveLocalInventoriesRequest request =
+ * RemoveLocalInventoriesRequest.newBuilder()
+ * .setProduct(
+ * ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+ * .toString())
+ * .addAllPlaceIds(new ArrayList
+ */
+ public final UnaryCallable
+ *
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * ProductServiceSettings.Builder productServiceSettingsBuilder =
+ * ProductServiceSettings.newBuilder();
+ * productServiceSettingsBuilder
+ * .createProductSettings()
+ * .setRetrySettings(
+ * productServiceSettingsBuilder
+ * .createProductSettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30))
+ * .build());
+ * ProductServiceSettings productServiceSettings = productServiceSettingsBuilder.build();
+ * }
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class ProductServiceSettings extends ClientSettings{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * 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
+ *
+ *
+ *
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * SearchServiceSettings searchServiceSettings =
+ * SearchServiceSettings.newBuilder()
+ * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ * .build();
+ * SearchServiceClient searchServiceClient = SearchServiceClient.create(searchServiceSettings);
+ * }
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * SearchServiceSettings searchServiceSettings =
+ * SearchServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * SearchServiceClient searchServiceClient = SearchServiceClient.create(searchServiceSettings);
+ * }
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * 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
+ *
+ * @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.
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * 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
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * 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
+ */
+ public final UnaryCallable
+ *
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * SearchServiceSettings.Builder searchServiceSettingsBuilder = SearchServiceSettings.newBuilder();
+ * searchServiceSettingsBuilder
+ * .searchSettings()
+ * .setRetrySettings(
+ * searchServiceSettingsBuilder
+ * .searchSettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30))
+ * .build());
+ * SearchServiceSettings searchServiceSettings = searchServiceSettingsBuilder.build();
+ * }
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class SearchServiceSettings extends ClientSettings{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ServingConfigServiceClient servingConfigServiceClient =
+ * ServingConfigServiceClient.create()) {
+ * CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]");
+ * ServingConfig servingConfig = ServingConfig.newBuilder().build();
+ * String servingConfigId = "servingConfigId-831052759";
+ * ServingConfig response =
+ * servingConfigServiceClient.createServingConfig(parent, servingConfig, servingConfigId);
+ * }
+ * }
+ *
+ *
+ *
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * ServingConfigServiceSettings servingConfigServiceSettings =
+ * ServingConfigServiceSettings.newBuilder()
+ * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ * .build();
+ * ServingConfigServiceClient servingConfigServiceClient =
+ * ServingConfigServiceClient.create(servingConfigServiceSettings);
+ * }
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * ServingConfigServiceSettings servingConfigServiceSettings =
+ * ServingConfigServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * ServingConfigServiceClient servingConfigServiceClient =
+ * ServingConfigServiceClient.create(servingConfigServiceSettings);
+ * }
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ServingConfigServiceClient servingConfigServiceClient =
+ * ServingConfigServiceClient.create()) {
+ * CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]");
+ * ServingConfig servingConfig = ServingConfig.newBuilder().build();
+ * String servingConfigId = "servingConfigId-831052759";
+ * ServingConfig response =
+ * servingConfigServiceClient.createServingConfig(parent, servingConfig, servingConfigId);
+ * }
+ * }
+ *
+ * @param parent Required. Full resource name of parent. Format:
+ * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}
+ * @param servingConfig Required. The ServingConfig to create.
+ * @param servingConfigId Required. The ID to use for the ServingConfig, which will become the
+ * final component of the ServingConfig's resource name.
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ServingConfigServiceClient servingConfigServiceClient =
+ * ServingConfigServiceClient.create()) {
+ * String parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString();
+ * ServingConfig servingConfig = ServingConfig.newBuilder().build();
+ * String servingConfigId = "servingConfigId-831052759";
+ * ServingConfig response =
+ * servingConfigServiceClient.createServingConfig(parent, servingConfig, servingConfigId);
+ * }
+ * }
+ *
+ * @param parent Required. Full resource name of parent. Format:
+ * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}
+ * @param servingConfig Required. The ServingConfig to create.
+ * @param servingConfigId Required. The ID to use for the ServingConfig, which will become the
+ * final component of the ServingConfig's resource name.
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ServingConfigServiceClient servingConfigServiceClient =
+ * ServingConfigServiceClient.create()) {
+ * CreateServingConfigRequest request =
+ * CreateServingConfigRequest.newBuilder()
+ * .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+ * .setServingConfig(ServingConfig.newBuilder().build())
+ * .setServingConfigId("servingConfigId-831052759")
+ * .build();
+ * ServingConfig response = servingConfigServiceClient.createServingConfig(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 ServingConfig createServingConfig(CreateServingConfigRequest request) {
+ return createServingConfigCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a ServingConfig.
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ServingConfigServiceClient servingConfigServiceClient =
+ * ServingConfigServiceClient.create()) {
+ * CreateServingConfigRequest request =
+ * CreateServingConfigRequest.newBuilder()
+ * .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+ * .setServingConfig(ServingConfig.newBuilder().build())
+ * .setServingConfigId("servingConfigId-831052759")
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ServingConfigServiceClient servingConfigServiceClient =
+ * ServingConfigServiceClient.create()) {
+ * ServingConfigName name =
+ * ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]");
+ * servingConfigServiceClient.deleteServingConfig(name);
+ * }
+ * }
+ *
+ * @param name Required. The resource name of the ServingConfig to delete. Format:
+ * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteServingConfig(ServingConfigName name) {
+ DeleteServingConfigRequest request =
+ DeleteServingConfigRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .build();
+ deleteServingConfig(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a ServingConfig.
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ServingConfigServiceClient servingConfigServiceClient =
+ * ServingConfigServiceClient.create()) {
+ * String name =
+ * ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]")
+ * .toString();
+ * servingConfigServiceClient.deleteServingConfig(name);
+ * }
+ * }
+ *
+ * @param name Required. The resource name of the ServingConfig to delete. Format:
+ * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteServingConfig(String name) {
+ DeleteServingConfigRequest request =
+ DeleteServingConfigRequest.newBuilder().setName(name).build();
+ deleteServingConfig(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a ServingConfig.
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ServingConfigServiceClient servingConfigServiceClient =
+ * ServingConfigServiceClient.create()) {
+ * DeleteServingConfigRequest request =
+ * DeleteServingConfigRequest.newBuilder()
+ * .setName(
+ * ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]")
+ * .toString())
+ * .build();
+ * servingConfigServiceClient.deleteServingConfig(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 deleteServingConfig(DeleteServingConfigRequest request) {
+ deleteServingConfigCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a ServingConfig.
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ServingConfigServiceClient servingConfigServiceClient =
+ * ServingConfigServiceClient.create()) {
+ * DeleteServingConfigRequest request =
+ * DeleteServingConfigRequest.newBuilder()
+ * .setName(
+ * ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]")
+ * .toString())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ServingConfigServiceClient servingConfigServiceClient =
+ * ServingConfigServiceClient.create()) {
+ * ServingConfig servingConfig = ServingConfig.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * ServingConfig response =
+ * servingConfigServiceClient.updateServingConfig(servingConfig, updateMask);
+ * }
+ * }
+ *
+ * @param servingConfig Required. The ServingConfig to update.
+ * @param updateMask Indicates which fields in the provided
+ * [ServingConfig][google.cloud.retail.v2alpha.ServingConfig] to update. The following are NOT
+ * supported:
+ *
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ServingConfigServiceClient servingConfigServiceClient =
+ * ServingConfigServiceClient.create()) {
+ * UpdateServingConfigRequest request =
+ * UpdateServingConfigRequest.newBuilder()
+ * .setServingConfig(ServingConfig.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * ServingConfig response = servingConfigServiceClient.updateServingConfig(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 ServingConfig updateServingConfig(UpdateServingConfigRequest request) {
+ return updateServingConfigCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates a ServingConfig.
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ServingConfigServiceClient servingConfigServiceClient =
+ * ServingConfigServiceClient.create()) {
+ * UpdateServingConfigRequest request =
+ * UpdateServingConfigRequest.newBuilder()
+ * .setServingConfig(ServingConfig.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ServingConfigServiceClient servingConfigServiceClient =
+ * ServingConfigServiceClient.create()) {
+ * ServingConfigName name =
+ * ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]");
+ * ServingConfig response = servingConfigServiceClient.getServingConfig(name);
+ * }
+ * }
+ *
+ * @param name Required. The resource name of the ServingConfig to get. Format:
+ * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ServingConfig getServingConfig(ServingConfigName name) {
+ GetServingConfigRequest request =
+ GetServingConfigRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getServingConfig(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets a ServingConfig.
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ServingConfigServiceClient servingConfigServiceClient =
+ * ServingConfigServiceClient.create()) {
+ * String name =
+ * ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]")
+ * .toString();
+ * ServingConfig response = servingConfigServiceClient.getServingConfig(name);
+ * }
+ * }
+ *
+ * @param name Required. The resource name of the ServingConfig to get. Format:
+ * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ServingConfig getServingConfig(String name) {
+ GetServingConfigRequest request = GetServingConfigRequest.newBuilder().setName(name).build();
+ return getServingConfig(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets a ServingConfig.
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ServingConfigServiceClient servingConfigServiceClient =
+ * ServingConfigServiceClient.create()) {
+ * GetServingConfigRequest request =
+ * GetServingConfigRequest.newBuilder()
+ * .setName(
+ * ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]")
+ * .toString())
+ * .build();
+ * ServingConfig response = servingConfigServiceClient.getServingConfig(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 ServingConfig getServingConfig(GetServingConfigRequest request) {
+ return getServingConfigCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets a ServingConfig.
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ServingConfigServiceClient servingConfigServiceClient =
+ * ServingConfigServiceClient.create()) {
+ * GetServingConfigRequest request =
+ * GetServingConfigRequest.newBuilder()
+ * .setName(
+ * ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]")
+ * .toString())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ServingConfigServiceClient servingConfigServiceClient =
+ * ServingConfigServiceClient.create()) {
+ * CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]");
+ * for (ServingConfig element :
+ * servingConfigServiceClient.listServingConfigs(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The catalog resource name. Format:
+ * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListServingConfigsPagedResponse listServingConfigs(CatalogName parent) {
+ ListServingConfigsRequest request =
+ ListServingConfigsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listServingConfigs(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists all ServingConfigs linked to this catalog.
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ServingConfigServiceClient servingConfigServiceClient =
+ * ServingConfigServiceClient.create()) {
+ * String parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString();
+ * for (ServingConfig element :
+ * servingConfigServiceClient.listServingConfigs(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The catalog resource name. Format:
+ * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListServingConfigsPagedResponse listServingConfigs(String parent) {
+ ListServingConfigsRequest request =
+ ListServingConfigsRequest.newBuilder().setParent(parent).build();
+ return listServingConfigs(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists all ServingConfigs linked to this catalog.
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ServingConfigServiceClient servingConfigServiceClient =
+ * ServingConfigServiceClient.create()) {
+ * ListServingConfigsRequest request =
+ * ListServingConfigsRequest.newBuilder()
+ * .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * for (ServingConfig element :
+ * servingConfigServiceClient.listServingConfigs(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 ListServingConfigsPagedResponse listServingConfigs(
+ ListServingConfigsRequest request) {
+ return listServingConfigsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists all ServingConfigs linked to this catalog.
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ServingConfigServiceClient servingConfigServiceClient =
+ * ServingConfigServiceClient.create()) {
+ * ListServingConfigsRequest request =
+ * ListServingConfigsRequest.newBuilder()
+ * .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ServingConfigServiceClient servingConfigServiceClient =
+ * ServingConfigServiceClient.create()) {
+ * ListServingConfigsRequest request =
+ * ListServingConfigsRequest.newBuilder()
+ * .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * while (true) {
+ * ListServingConfigsResponse response =
+ * servingConfigServiceClient.listServingConfigsCallable().call(request);
+ * for (ServingConfig element : response.getResponsesList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ServingConfigServiceClient servingConfigServiceClient =
+ * ServingConfigServiceClient.create()) {
+ * ServingConfigName servingConfig =
+ * ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]");
+ * ServingConfig response = servingConfigServiceClient.addControl(servingConfig);
+ * }
+ * }
+ *
+ * @param servingConfig Required. The source ServingConfig resource name . Format:
+ * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ServingConfig addControl(ServingConfigName servingConfig) {
+ AddControlRequest request =
+ AddControlRequest.newBuilder()
+ .setServingConfig(servingConfig == null ? null : servingConfig.toString())
+ .build();
+ return addControl(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Enables a Control on the specified ServingConfig. The control is added in the last position of
+ * the list of controls it belongs to (e.g. if it's a facet spec control it will be applied in the
+ * last position of servingConfig.facetSpecIds) Returns a ALREADY_EXISTS error if the control has
+ * already been applied. Returns a FAILED_PRECONDITION error if the addition could exceed maximum
+ * number of control allowed for that type of control.
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ServingConfigServiceClient servingConfigServiceClient =
+ * ServingConfigServiceClient.create()) {
+ * String servingConfig =
+ * ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]")
+ * .toString();
+ * ServingConfig response = servingConfigServiceClient.addControl(servingConfig);
+ * }
+ * }
+ *
+ * @param servingConfig Required. The source ServingConfig resource name . Format:
+ * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ServingConfig addControl(String servingConfig) {
+ AddControlRequest request =
+ AddControlRequest.newBuilder().setServingConfig(servingConfig).build();
+ return addControl(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Enables a Control on the specified ServingConfig. The control is added in the last position of
+ * the list of controls it belongs to (e.g. if it's a facet spec control it will be applied in the
+ * last position of servingConfig.facetSpecIds) Returns a ALREADY_EXISTS error if the control has
+ * already been applied. Returns a FAILED_PRECONDITION error if the addition could exceed maximum
+ * number of control allowed for that type of control.
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ServingConfigServiceClient servingConfigServiceClient =
+ * ServingConfigServiceClient.create()) {
+ * AddControlRequest request =
+ * AddControlRequest.newBuilder()
+ * .setServingConfig(
+ * ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]")
+ * .toString())
+ * .setControlId("controlId-395080872")
+ * .build();
+ * ServingConfig response = servingConfigServiceClient.addControl(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 ServingConfig addControl(AddControlRequest request) {
+ return addControlCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Enables a Control on the specified ServingConfig. The control is added in the last position of
+ * the list of controls it belongs to (e.g. if it's a facet spec control it will be applied in the
+ * last position of servingConfig.facetSpecIds) Returns a ALREADY_EXISTS error if the control has
+ * already been applied. Returns a FAILED_PRECONDITION error if the addition could exceed maximum
+ * number of control allowed for that type of control.
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ServingConfigServiceClient servingConfigServiceClient =
+ * ServingConfigServiceClient.create()) {
+ * AddControlRequest request =
+ * AddControlRequest.newBuilder()
+ * .setServingConfig(
+ * ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]")
+ * .toString())
+ * .setControlId("controlId-395080872")
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ServingConfigServiceClient servingConfigServiceClient =
+ * ServingConfigServiceClient.create()) {
+ * ServingConfigName servingConfig =
+ * ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]");
+ * ServingConfig response = servingConfigServiceClient.removeControl(servingConfig);
+ * }
+ * }
+ *
+ * @param servingConfig Required. The source ServingConfig resource name . Format:
+ * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ServingConfig removeControl(ServingConfigName servingConfig) {
+ RemoveControlRequest request =
+ RemoveControlRequest.newBuilder()
+ .setServingConfig(servingConfig == null ? null : servingConfig.toString())
+ .build();
+ return removeControl(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Disables a Control on the specified ServingConfig. The control is removed from the
+ * ServingConfig. Returns a NOT_FOUND error if the Control is not enabled for the ServingConfig.
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ServingConfigServiceClient servingConfigServiceClient =
+ * ServingConfigServiceClient.create()) {
+ * String servingConfig =
+ * ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]")
+ * .toString();
+ * ServingConfig response = servingConfigServiceClient.removeControl(servingConfig);
+ * }
+ * }
+ *
+ * @param servingConfig Required. The source ServingConfig resource name . Format:
+ * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ServingConfig removeControl(String servingConfig) {
+ RemoveControlRequest request =
+ RemoveControlRequest.newBuilder().setServingConfig(servingConfig).build();
+ return removeControl(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Disables a Control on the specified ServingConfig. The control is removed from the
+ * ServingConfig. Returns a NOT_FOUND error if the Control is not enabled for the ServingConfig.
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ServingConfigServiceClient servingConfigServiceClient =
+ * ServingConfigServiceClient.create()) {
+ * RemoveControlRequest request =
+ * RemoveControlRequest.newBuilder()
+ * .setServingConfig(
+ * ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]")
+ * .toString())
+ * .setControlId("controlId-395080872")
+ * .build();
+ * ServingConfig response = servingConfigServiceClient.removeControl(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 ServingConfig removeControl(RemoveControlRequest request) {
+ return removeControlCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Disables a Control on the specified ServingConfig. The control is removed from the
+ * ServingConfig. Returns a NOT_FOUND error if the Control is not enabled for the ServingConfig.
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ServingConfigServiceClient servingConfigServiceClient =
+ * ServingConfigServiceClient.create()) {
+ * RemoveControlRequest request =
+ * RemoveControlRequest.newBuilder()
+ * .setServingConfig(
+ * ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]")
+ * .toString())
+ * .setControlId("controlId-395080872")
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable
+ *
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * ServingConfigServiceSettings.Builder servingConfigServiceSettingsBuilder =
+ * ServingConfigServiceSettings.newBuilder();
+ * servingConfigServiceSettingsBuilder
+ * .createServingConfigSettings()
+ * .setRetrySettings(
+ * servingConfigServiceSettingsBuilder
+ * .createServingConfigSettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30))
+ * .build());
+ * ServingConfigServiceSettings servingConfigServiceSettings =
+ * servingConfigServiceSettingsBuilder.build();
+ * }
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class ServingConfigServiceSettings extends ClientSettings{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+ * WriteUserEventRequest request =
+ * WriteUserEventRequest.newBuilder()
+ * .setParent("parent-995424086")
+ * .setUserEvent(UserEvent.newBuilder().build())
+ * .build();
+ * UserEvent response = userEventServiceClient.writeUserEvent(request);
+ * }
+ * }
+ *
+ *
+ *
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * UserEventServiceSettings userEventServiceSettings =
+ * UserEventServiceSettings.newBuilder()
+ * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ * .build();
+ * UserEventServiceClient userEventServiceClient =
+ * UserEventServiceClient.create(userEventServiceSettings);
+ * }
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * UserEventServiceSettings userEventServiceSettings =
+ * UserEventServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * UserEventServiceClient userEventServiceClient =
+ * UserEventServiceClient.create(userEventServiceSettings);
+ * }
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+ * WriteUserEventRequest request =
+ * WriteUserEventRequest.newBuilder()
+ * .setParent("parent-995424086")
+ * .setUserEvent(UserEvent.newBuilder().build())
+ * .build();
+ * UserEvent response = userEventServiceClient.writeUserEvent(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 UserEvent writeUserEvent(WriteUserEventRequest request) {
+ return writeUserEventCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Writes a single user event.
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+ * WriteUserEventRequest request =
+ * WriteUserEventRequest.newBuilder()
+ * .setParent("parent-995424086")
+ * .setUserEvent(UserEvent.newBuilder().build())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+ * CollectUserEventRequest request =
+ * CollectUserEventRequest.newBuilder()
+ * .setParent("parent-995424086")
+ * .setUserEvent("userEvent315571599")
+ * .setUri("uri116076")
+ * .setEts(100772)
+ * .build();
+ * HttpBody response = userEventServiceClient.collectUserEvent(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 HttpBody collectUserEvent(CollectUserEventRequest request) {
+ return collectUserEventCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Writes a single user event from the browser. This uses a GET request to due to browser
+ * restriction of POST-ing to a 3rd party domain.
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+ * CollectUserEventRequest request =
+ * CollectUserEventRequest.newBuilder()
+ * .setParent("parent-995424086")
+ * .setUserEvent("userEvent315571599")
+ * .setUri("uri116076")
+ * .setEts(100772)
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+ * PurgeUserEventsRequest request =
+ * PurgeUserEventsRequest.newBuilder()
+ * .setParent("parent-995424086")
+ * .setFilter("filter-1274492040")
+ * .setForce(true)
+ * .build();
+ * PurgeUserEventsResponse response = userEventServiceClient.purgeUserEventsAsync(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{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+ * PurgeUserEventsRequest request =
+ * PurgeUserEventsRequest.newBuilder()
+ * .setParent("parent-995424086")
+ * .setFilter("filter-1274492040")
+ * .setForce(true)
+ * .build();
+ * OperationFuture
+ */
+ public final OperationCallable{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+ * PurgeUserEventsRequest request =
+ * PurgeUserEventsRequest.newBuilder()
+ * .setParent("parent-995424086")
+ * .setFilter("filter-1274492040")
+ * .setForce(true)
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+ * ImportUserEventsRequest request =
+ * ImportUserEventsRequest.newBuilder()
+ * .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+ * .setInputConfig(UserEventInputConfig.newBuilder().build())
+ * .setErrorsConfig(ImportErrorsConfig.newBuilder().build())
+ * .build();
+ * ImportUserEventsResponse response =
+ * userEventServiceClient.importUserEventsAsync(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{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+ * ImportUserEventsRequest request =
+ * ImportUserEventsRequest.newBuilder()
+ * .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+ * .setInputConfig(UserEventInputConfig.newBuilder().build())
+ * .setErrorsConfig(ImportErrorsConfig.newBuilder().build())
+ * .build();
+ * OperationFuture
+ */
+ public final OperationCallable{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+ * ImportUserEventsRequest request =
+ * ImportUserEventsRequest.newBuilder()
+ * .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+ * .setInputConfig(UserEventInputConfig.newBuilder().build())
+ * .setErrorsConfig(ImportErrorsConfig.newBuilder().build())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+ * RejoinUserEventsRequest request =
+ * RejoinUserEventsRequest.newBuilder().setParent("parent-995424086").build();
+ * RejoinUserEventsResponse response =
+ * userEventServiceClient.rejoinUserEventsAsync(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{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+ * RejoinUserEventsRequest request =
+ * RejoinUserEventsRequest.newBuilder().setParent("parent-995424086").build();
+ * OperationFuture