diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/CatalogServiceClient.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/CatalogServiceClient.java index 862bd411d6de..320310e55828 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/CatalogServiceClient.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/CatalogServiceClient.java @@ -738,6 +738,613 @@ public final GetDefaultBranchResponse getDefaultBranch(GetDefaultBranchRequest r return stub.getDefaultBranchCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a [CompletionConfig][google.cloud.retail.v2.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()) { + * 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.v2.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.v2.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.v2.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.v2.CompletionConfig] to update. + *
If the caller does not have permission to update the + * [CompletionConfig][google.cloud.retail.v2.CompletionConfig], then a PERMISSION_DENIED error + * is returned. + *
If the [CompletionConfig][google.cloud.retail.v2.CompletionConfig] to update does not + * exist, a NOT_FOUND error is returned. + * @param updateMask Indicates which fields in the provided + * [CompletionConfig][google.cloud.retail.v2.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.v2.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.v2.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.v2.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.v2.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.v2.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.v2.AttributesConfig] to update. + * @param updateMask Indicates which fields in the provided + * [AttributesConfig][google.cloud.retail.v2.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.v2.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.v2.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.v2.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.v2.CatalogAttribute] to the + * [AttributesConfig][google.cloud.retail.v2.AttributesConfig]. + * + *
If the [CatalogAttribute][google.cloud.retail.v2.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.v2.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.v2.CatalogAttribute] from the + * [AttributesConfig][google.cloud.retail.v2.AttributesConfig]. + * + *
If the [CatalogAttribute][google.cloud.retail.v2.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.v2.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.v2.CatalogAttribute] in the + * [AttributesConfig][google.cloud.retail.v2.AttributesConfig] by updating the catalog attribute + * with the same [CatalogAttribute.key][google.cloud.retail.v2.CatalogAttribute.key]. + * + *
If the [CatalogAttribute][google.cloud.retail.v2.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(); + * } + * }
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 (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); + * } + * }+ * + *
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: + * + *
{@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); + * }+ * + *
To customize the endpoint: + * + *
{@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); + * }+ * + *
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * ControlServiceSettings controlServiceSettings = + * ControlServiceSettings.newBuilder() + * .setTransportChannelProvider( + * ControlServiceSettings.defaultHttpJsonTransportProviderBuilder().build()) + * .build(); + * ControlServiceClient controlServiceClient = ControlServiceClient.create(controlServiceSettings); + * }+ * + *
Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@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.v2.Control] to create 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 (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. + *
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.v2.Control] to create 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 (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. + *
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.v2.Control] to create 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 (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. + * + *
If the [Control][google.cloud.retail.v2.Control] to create 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 (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 UnaryCallablefuture = controlServiceClient.createControlCallable().futureCall(request); + * // Do something. + * Control response = future.get(); + * } + * }
If the [Control][google.cloud.retail.v2.Control] to delete 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 (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. + * + *
If the [Control][google.cloud.retail.v2.Control] to delete 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 (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. + * + *
If the [Control][google.cloud.retail.v2.Control] to delete 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 (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. + * + *
If the [Control][google.cloud.retail.v2.Control] to delete 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 (ControlServiceClient controlServiceClient = ControlServiceClient.create()) { + * DeleteControlRequest request = + * DeleteControlRequest.newBuilder() + * .setName( + * ControlName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CONTROL]").toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = controlServiceClient.deleteControlCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
[Control][google.cloud.retail.v2.Control] cannot be set to a different oneof field, if so an + * INVALID_ARGUMENT is returned. If the [Control][google.cloud.retail.v2.Control] to update 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 (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.v2.Control] to update. The following are NOT supported: + *
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.v2.Control] cannot be set to a different oneof field, if so an + * INVALID_ARGUMENT is returned. If the [Control][google.cloud.retail.v2.Control] to update 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 (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. + * + *
[Control][google.cloud.retail.v2.Control] cannot be set to a different oneof field, if so an + * INVALID_ARGUMENT is returned. If the [Control][google.cloud.retail.v2.Control] to update 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 (ControlServiceClient controlServiceClient = ControlServiceClient.create()) { + * UpdateControlRequest request = + * UpdateControlRequest.newBuilder() + * .setControl(Control.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = controlServiceClient.updateControlCallable().futureCall(request); + * // Do something. + * Control 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 (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 get. 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. + * + *
Sample code: + * + *
{@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 get. 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. + * + *
Sample code: + * + *
{@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. + * + *
Sample code: + * + *
{@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 UnaryCallablefuture = controlServiceClient.getControlCallable().futureCall(request); + * // Do something. + * Control 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 (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 by their parent [Catalog][google.cloud.retail.v2.Catalog]. + * + *
Sample code: + * + *
{@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 by their parent [Catalog][google.cloud.retail.v2.Catalog]. + * + *
Sample code: + * + *
{@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 by their parent [Catalog][google.cloud.retail.v2.Catalog]. + * + *
Sample code: + * + *
{@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 UnaryCallablefuture = + * controlServiceClient.listControlsPagedCallable().futureCall(request); + * // Do something. + * for (Control 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 (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.getControlsList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }+ */ + public final UnaryCallable
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: + * + *
{@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(); + * }+ */ +@Generated("by gapic-generator-java") +public class ControlServiceSettings extends ClientSettings
Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction The returned [Operation][]s will be obsolete after 1 day, and [GetOperation][] API will
+ * return NOT_FOUND afterwards.
+ *
+ * If conflicting updates are issued, the [Operation][]s associated with the stale updates will
+ * not be marked as [done][Operation.done] until being obsolete.
+ *
* This feature is only available for users who have Retail Search enabled. Please enable
* Retail Search on Cloud Console before using this feature.
*
@@ -1106,6 +1112,12 @@ public final OperationFuture The returned [Operation][]s will be obsolete after 1 day, and [GetOperation][] API will
+ * return NOT_FOUND afterwards.
+ *
+ * If conflicting updates are issued, the [Operation][]s associated with the stale updates will
+ * not be marked as [done][Operation.done] until being obsolete.
+ *
* This feature is only available for users who have Retail Search enabled. Please enable
* Retail Search on Cloud Console before using this feature.
*
@@ -1170,6 +1182,12 @@ public final OperationFuture The returned [Operation][]s will be obsolete after 1 day, and [GetOperation][] API will
+ * return NOT_FOUND afterwards.
+ *
+ * If conflicting updates are issued, the [Operation][]s associated with the stale updates will
+ * not be marked as [done][Operation.done] until being obsolete.
+ *
* This feature is only available for users who have Retail Search enabled. Please enable
* Retail Search on Cloud Console before using this feature.
*
@@ -1234,6 +1252,12 @@ public final OperationFuture The returned [Operation][]s will be obsolete after 1 day, and [GetOperation][] API will
+ * return NOT_FOUND afterwards.
+ *
+ * If conflicting updates are issued, the [Operation][]s associated with the stale updates will
+ * not be marked as [done][Operation.done] until being obsolete.
+ *
* This feature is only available for users who have Retail Search enabled. Please enable
* Retail Search on Cloud Console before using this feature.
*
@@ -1273,6 +1297,12 @@ public final UnaryCallable The returned [Operation][]s will be obsolete after 1 day, and [GetOperation][] API will
+ * return NOT_FOUND afterwards.
+ *
+ * If conflicting updates are issued, the [Operation][]s associated with the stale updates will
+ * not be marked as [done][Operation.done] until being obsolete.
+ *
* This feature is only available for users who have Retail Search enabled. Please enable
* Retail Search on Cloud Console before using this feature.
*
@@ -1319,6 +1349,12 @@ public final UnaryCallable The returned [Operation][]s will be obsolete after 1 day, and [GetOperation][] API will
+ * return NOT_FOUND afterwards.
+ *
+ * If conflicting updates are issued, the [Operation][]s associated with the stale updates will
+ * not be marked as [done][Operation.done] until being obsolete.
+ *
* This feature is only available for users who have Retail Search enabled. Please enable
* Retail Search on Cloud Console before using this feature.
*
@@ -1364,6 +1400,12 @@ public final UnaryCallable The returned [Operation][]s will be obsolete after 1 day, and [GetOperation][] API will
+ * return NOT_FOUND afterwards.
+ *
+ * If conflicting updates are issued, the [Operation][]s associated with the stale updates will
+ * not be marked as [done][Operation.done] until being obsolete.
+ *
* This feature is only available for users who have Retail Search enabled. Please enable
* Retail Search on Cloud Console before using this feature.
*
@@ -1409,6 +1451,12 @@ public final UnaryCallable The returned [Operation][]s will be obsolete after 1 day, and [GetOperation][] API will
+ * return NOT_FOUND afterwards.
+ *
+ * If conflicting updates are issued, the [Operation][]s associated with the stale updates will
+ * not be marked as [done][Operation.done] until being obsolete.
+ *
* This feature is only available for users who have Retail Search enabled. Please enable
* Retail Search on Cloud Console before using this feature.
*
@@ -1454,6 +1502,12 @@ public final UnaryCallable The returned [Operation][]s will be obsolete after 1 day, and [GetOperation][] API will
+ * return NOT_FOUND afterwards.
+ *
+ * If conflicting updates are issued, the [Operation][]s associated with the stale updates will
+ * not be marked as [done][Operation.done] until being obsolete.
+ *
* This feature is only available for users who have Retail Search enabled. Please enable
* Retail Search on Cloud Console before using this feature.
*
@@ -1498,6 +1552,12 @@ public final UnaryCallable The returned [Operation][]s will be obsolete after 1 day, and [GetOperation][] API will
+ * return NOT_FOUND afterwards.
+ *
+ * If conflicting updates are issued, the [Operation][]s associated with the stale updates will
+ * not be marked as [done][Operation.done] until being obsolete.
+ *
* This feature is only available for users who have Retail Search enabled. Please enable
* Retail Search on Cloud Console before using this feature.
*
@@ -1544,6 +1604,12 @@ public final UnaryCallable The returned [Operation][]s will be obsolete after 1 day, and [GetOperation][] API will
+ * return NOT_FOUND afterwards.
+ *
+ * If conflicting updates are issued, the [Operation][]s associated with the stale updates will
+ * not be marked as [done][Operation.done] until being obsolete.
+ *
* This feature is only available for users who have Retail Search enabled. Please enable
* Retail Search on Cloud Console before using this feature.
*
@@ -1589,6 +1655,12 @@ public final UnaryCallable The returned [Operation][]s will be obsolete after 1 day, and [GetOperation][] API will
+ * return NOT_FOUND afterwards.
+ *
+ * If conflicting updates are issued, the [Operation][]s associated with the stale updates will
+ * not be marked as [done][Operation.done] until being obsolete.
+ *
* This feature is only available for users who have Retail Search enabled. Please enable
* Retail Search on Cloud Console before using this feature.
*
@@ -1634,6 +1706,12 @@ public final UnaryCallable The returned [Operation][]s will be obsolete after 1 day, and [GetOperation][] API will
+ * return NOT_FOUND afterwards.
+ *
+ * If conflicting updates are issued, the [Operation][]s associated with the stale updates will
+ * not be marked as [done][Operation.done] until being obsolete.
+ *
* This feature is only available for users who have Retail Search enabled. Please enable
* Retail Search on Cloud Console before using this feature.
*
@@ -1681,6 +1759,12 @@ public final UnaryCallable The returned [Operation][]s will be obsolete after 1 day, and [GetOperation][] API will
+ * return NOT_FOUND afterwards.
+ *
+ * If conflicting updates are issued, the [Operation][]s associated with the stale updates will
+ * not be marked as [done][Operation.done] until being obsolete.
+ *
* This feature is only available for users who have Retail Search enabled. Please enable
* Retail Search on Cloud Console before using this feature.
*
@@ -1730,6 +1814,12 @@ public final UnaryCallable The returned [Operation][]s will be obsolete after 1 day, and [GetOperation][] API will
+ * return NOT_FOUND afterwards.
+ *
+ * If conflicting updates are issued, the [Operation][]s associated with the stale updates will
+ * not be marked as [done][Operation.done] until being obsolete.
+ *
* This feature is only available for users who have Retail Search enabled. Please enable
* Retail Search on Cloud Console before using this feature.
*
@@ -1781,6 +1871,12 @@ public final UnaryCallable The returned [Operation][]s will be obsolete after 1 day, and [GetOperation][] API will
+ * return NOT_FOUND afterwards.
+ *
+ * If conflicting updates are issued, the [Operation][]s associated with the stale updates will
+ * not be marked as [done][Operation.done] until being obsolete.
+ *
* This feature is only available for users who have Retail Search enabled. Please enable
* Retail Search on Cloud Console before using this feature.
*
@@ -1831,6 +1927,12 @@ public final UnaryCallable The returned [Operation][]s will be obsolete after 1 day, and [GetOperation][] API will
+ * return NOT_FOUND afterwards.
+ *
+ * If conflicting updates are issued, the [Operation][]s associated with the stale updates will
+ * not be marked as [done][Operation.done] until being obsolete.
+ *
* This feature is only available for users who have Retail Search enabled. Please enable
* Retail Search on Cloud Console before using this feature.
*
@@ -1881,6 +1983,12 @@ public final UnaryCallable The returned [Operation][]s will be obsolete after 1 day, and [GetOperation][] API will
+ * return NOT_FOUND afterwards.
+ *
+ * If conflicting updates are issued, the [Operation][]s associated with the stale updates will
+ * not be marked as [done][Operation.done] until being obsolete.
+ *
* This feature is only available for users who have Retail Search enabled. Please enable
* Retail Search on Cloud Console before using this feature.
*
@@ -1931,6 +2039,12 @@ public final UnaryCallable The returned [Operation][]s will be obsolete after 1 day, and [GetOperation][] API will
+ * return NOT_FOUND afterwards.
+ *
+ * If conflicting updates are issued, the [Operation][]s associated with the stale updates will
+ * not be marked as [done][Operation.done] until being obsolete.
+ *
* This feature is only available for users who have Retail Search enabled. Please enable
* Retail Search on Cloud Console before using this feature.
*
@@ -1977,6 +2091,12 @@ public final UnaryCallable The returned [Operation][]s will be obsolete after 1 day, and [GetOperation][] API will
+ * return NOT_FOUND afterwards.
+ *
+ * If conflicting updates are issued, the [Operation][]s associated with the stale updates will
+ * not be marked as [done][Operation.done] until being obsolete.
+ *
* This feature is only available for users who have Retail Search enabled. Please enable
* Retail Search on Cloud Console before using this feature.
*
@@ -2026,6 +2146,12 @@ public final UnaryCallable The returned [Operation][]s will be obsolete after 1 day, and [GetOperation][] API will
+ * return NOT_FOUND afterwards.
+ *
+ * If conflicting updates are issued, the [Operation][]s associated with the stale updates will
+ * not be marked as [done][Operation.done] until being obsolete.
+ *
* This feature is only available for users who have Retail Search enabled. Please enable
* Retail Search on Cloud Console before using this feature.
*
@@ -2074,6 +2200,12 @@ public final UnaryCallable The returned [Operation][]s will be obsolete after 1 day, and [GetOperation][] API will
+ * return NOT_FOUND afterwards.
+ *
+ * If conflicting updates are issued, the [Operation][]s associated with the stale updates will
+ * not be marked as [done][Operation.done] until being obsolete.
+ *
* This feature is only available for users who have Retail Search enabled. Please enable
* Retail Search on Cloud Console before using this feature.
*
@@ -2121,6 +2253,12 @@ public final UnaryCallable The returned [Operation][]s will be obsolete after 1 day, and [GetOperation][] API will
+ * return NOT_FOUND afterwards.
+ *
+ * If conflicting updates are issued, the [Operation][]s associated with the stale updates will
+ * not be marked as [done][Operation.done] until being obsolete.
+ *
* This feature is only available for users who have Retail Search enabled. Please enable
* Retail Search on Cloud Console before using this feature.
*
@@ -2170,6 +2308,12 @@ public final UnaryCallable The returned [Operation][]s will be obsolete after 1 day, and [GetOperation][] API will
+ * return NOT_FOUND afterwards.
+ *
+ * If conflicting updates are issued, the [Operation][]s associated with the stale updates will
+ * not be marked as [done][Operation.done] until being obsolete.
+ *
* This feature is only available for users who have Retail Search enabled. Please enable
* Retail Search on Cloud Console before using this feature.
*
diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/ServingConfigServiceClient.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/ServingConfigServiceClient.java
new file mode 100644
index 000000000000..69e3c868686b
--- /dev/null
+++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/ServingConfigServiceClient.java
@@ -0,0 +1,1172 @@
+/*
+ * Copyright 2022 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.cloud.retail.v2;
+
+import com.google.api.core.ApiFuture;
+import com.google.api.core.ApiFutures;
+import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.paging.AbstractFixedSizeCollection;
+import com.google.api.gax.paging.AbstractPage;
+import com.google.api.gax.paging.AbstractPagedListResponse;
+import com.google.api.gax.rpc.PageContext;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.cloud.retail.v2.stub.ServingConfigServiceStub;
+import com.google.cloud.retail.v2.stub.ServingConfigServiceStubSettings;
+import com.google.common.util.concurrent.MoreExecutors;
+import com.google.protobuf.Empty;
+import com.google.protobuf.FieldMask;
+import java.io.IOException;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * Service Description: Service for modifying ServingConfig.
+ *
+ * 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:
+ *
+ * To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over
+ * the wire:
+ *
+ * Please refer to the GitHub repository's samples for more quickstart code snippets.
+ */
+@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.v2.ServingConfig]s are allowed in a
+ * [Catalog][google.cloud.retail.v2.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.v2.ServingConfig]s are allowed in a
+ * [Catalog][google.cloud.retail.v2.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.v2.ServingConfig]s are allowed in a
+ * [Catalog][google.cloud.retail.v2.Catalog], otherwise a FAILED_PRECONDITION error is returned.
+ *
+ * Sample code:
+ *
+ * A maximum of 100 [ServingConfig][google.cloud.retail.v2.ServingConfig]s are allowed in a
+ * [Catalog][google.cloud.retail.v2.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 Operation.response is of type ImportResponse. Note that it is possible for a subset of the
- * items to be successfully inserted. Operation.metadata is of type ImportMetadata.
+ * `Operation.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:
*
@@ -436,8 +436,8 @@ public final OperationFuture Operation.response is of type ImportResponse. Note that it is possible for a subset of the
- * items to be successfully inserted. Operation.metadata is of type ImportMetadata.
+ * `Operation.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:
*
@@ -468,8 +468,8 @@ public final OperationFuture Operation.response is of type ImportResponse. Note that it is possible for a subset of the
- * items to be successfully inserted. Operation.metadata is of type ImportMetadata.
+ * `Operation.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:
*
diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/gapic_metadata.json b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/gapic_metadata.json
index b27e46ab9dbe..fb810b2c0f00 100644
--- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/gapic_metadata.json
+++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/gapic_metadata.json
@@ -10,17 +10,38 @@
"grpc": {
"libraryClient": "CatalogServiceClient",
"rpcs": {
+ "AddCatalogAttribute": {
+ "methods": ["addCatalogAttribute", "addCatalogAttributeCallable"]
+ },
+ "GetAttributesConfig": {
+ "methods": ["getAttributesConfig", "getAttributesConfig", "getAttributesConfig", "getAttributesConfigCallable"]
+ },
+ "GetCompletionConfig": {
+ "methods": ["getCompletionConfig", "getCompletionConfig", "getCompletionConfig", "getCompletionConfigCallable"]
+ },
"GetDefaultBranch": {
"methods": ["getDefaultBranch", "getDefaultBranch", "getDefaultBranch", "getDefaultBranchCallable"]
},
"ListCatalogs": {
"methods": ["listCatalogs", "listCatalogs", "listCatalogs", "listCatalogsPagedCallable", "listCatalogsCallable"]
},
+ "RemoveCatalogAttribute": {
+ "methods": ["removeCatalogAttribute", "removeCatalogAttributeCallable"]
+ },
+ "ReplaceCatalogAttribute": {
+ "methods": ["replaceCatalogAttribute", "replaceCatalogAttributeCallable"]
+ },
"SetDefaultBranch": {
"methods": ["setDefaultBranch", "setDefaultBranch", "setDefaultBranch", "setDefaultBranchCallable"]
},
+ "UpdateAttributesConfig": {
+ "methods": ["updateAttributesConfig", "updateAttributesConfig", "updateAttributesConfigCallable"]
+ },
"UpdateCatalog": {
"methods": ["updateCatalog", "updateCatalog", "updateCatalogCallable"]
+ },
+ "UpdateCompletionConfig": {
+ "methods": ["updateCompletionConfig", "updateCompletionConfig", "updateCompletionConfigCallable"]
}
}
}
@@ -41,6 +62,30 @@
}
}
},
+ "ControlService": {
+ "clients": {
+ "grpc": {
+ "libraryClient": "ControlServiceClient",
+ "rpcs": {
+ "CreateControl": {
+ "methods": ["createControl", "createControl", "createControl", "createControlCallable"]
+ },
+ "DeleteControl": {
+ "methods": ["deleteControl", "deleteControl", "deleteControl", "deleteControlCallable"]
+ },
+ "GetControl": {
+ "methods": ["getControl", "getControl", "getControl", "getControlCallable"]
+ },
+ "ListControls": {
+ "methods": ["listControls", "listControls", "listControls", "listControlsPagedCallable", "listControlsCallable"]
+ },
+ "UpdateControl": {
+ "methods": ["updateControl", "updateControl", "updateControlCallable"]
+ }
+ }
+ }
+ }
+ },
"PredictionService": {
"clients": {
"grpc": {
@@ -107,6 +152,36 @@
}
}
},
+ "ServingConfigService": {
+ "clients": {
+ "grpc": {
+ "libraryClient": "ServingConfigServiceClient",
+ "rpcs": {
+ "AddControl": {
+ "methods": ["addControl", "addControl", "addControl", "addControlCallable"]
+ },
+ "CreateServingConfig": {
+ "methods": ["createServingConfig", "createServingConfig", "createServingConfig", "createServingConfigCallable"]
+ },
+ "DeleteServingConfig": {
+ "methods": ["deleteServingConfig", "deleteServingConfig", "deleteServingConfig", "deleteServingConfigCallable"]
+ },
+ "GetServingConfig": {
+ "methods": ["getServingConfig", "getServingConfig", "getServingConfig", "getServingConfigCallable"]
+ },
+ "ListServingConfigs": {
+ "methods": ["listServingConfigs", "listServingConfigs", "listServingConfigs", "listServingConfigsPagedCallable", "listServingConfigsCallable"]
+ },
+ "RemoveControl": {
+ "methods": ["removeControl", "removeControl", "removeControl", "removeControlCallable"]
+ },
+ "UpdateServingConfig": {
+ "methods": ["updateServingConfig", "updateServingConfig", "updateServingConfigCallable"]
+ }
+ }
+ }
+ }
+ },
"UserEventService": {
"clients": {
"grpc": {
diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/package-info.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/package-info.java
index d2822d28d782..d6892b47a2bc 100644
--- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/package-info.java
+++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/package-info.java
@@ -62,6 +62,23 @@
* }
* }
*
+ * ======================= ControlServiceClient =======================
+ *
+ * Service Description: Service for modifying Control.
+ *
+ * Sample for ControlServiceClient:
+ *
+ * ======================= PredictionServiceClient =======================
*
* Service Description: Service for making recommendation prediction.
@@ -148,6 +165,25 @@
* }
* }
*
+ * ======================= ServingConfigServiceClient =======================
+ *
+ * Service Description: Service for modifying ServingConfig.
+ *
+ * Sample for ServingConfigServiceClient:
+ *
+ * ======================= UserEventServiceClient =======================
*
* Service Description: Service for ingesting end user actions on the customer website.
diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/CatalogServiceStub.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/CatalogServiceStub.java
index d9b20854a453..d3f66147e0cb 100644
--- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/CatalogServiceStub.java
+++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/CatalogServiceStub.java
@@ -20,13 +20,22 @@
import com.google.api.gax.core.BackgroundResource;
import com.google.api.gax.rpc.UnaryCallable;
+import com.google.cloud.retail.v2.AddCatalogAttributeRequest;
+import com.google.cloud.retail.v2.AttributesConfig;
import com.google.cloud.retail.v2.Catalog;
+import com.google.cloud.retail.v2.CompletionConfig;
+import com.google.cloud.retail.v2.GetAttributesConfigRequest;
+import com.google.cloud.retail.v2.GetCompletionConfigRequest;
import com.google.cloud.retail.v2.GetDefaultBranchRequest;
import com.google.cloud.retail.v2.GetDefaultBranchResponse;
import com.google.cloud.retail.v2.ListCatalogsRequest;
import com.google.cloud.retail.v2.ListCatalogsResponse;
+import com.google.cloud.retail.v2.RemoveCatalogAttributeRequest;
+import com.google.cloud.retail.v2.ReplaceCatalogAttributeRequest;
import com.google.cloud.retail.v2.SetDefaultBranchRequest;
+import com.google.cloud.retail.v2.UpdateAttributesConfigRequest;
import com.google.cloud.retail.v2.UpdateCatalogRequest;
+import com.google.cloud.retail.v2.UpdateCompletionConfigRequest;
import com.google.protobuf.Empty;
import javax.annotation.Generated;
@@ -60,6 +69,38 @@ public UnaryCallable This class is for advanced usage and reflects the underlying API directly.
+ */
+@Generated("by gapic-generator-java")
+public abstract class ControlServiceStub implements BackgroundResource {
+
+ public UnaryCallable 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{@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.
+ * ServingConfigServiceSettings servingConfigServiceSettings =
+ * ServingConfigServiceSettings.newBuilder()
+ * .setTransportChannelProvider(
+ * ServingConfigServiceSettings.defaultHttpJsonTransportProviderBuilder().build())
+ * .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.v2.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.getServingConfigsList()) {
+ * // 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();
+ * }
+ */
+@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 (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.
+ * 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.
+ * ControlServiceStubSettings.Builder controlServiceSettingsBuilder =
+ * ControlServiceStubSettings.newBuilder();
+ * controlServiceSettingsBuilder
+ * .createControlSettings()
+ * .setRetrySettings(
+ * controlServiceSettingsBuilder
+ * .createControlSettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30))
+ * .build());
+ * ControlServiceStubSettings controlServiceSettings = controlServiceSettingsBuilder.build();
+ * }
+ */
+@Generated("by gapic-generator-java")
+public class ControlServiceStubSettings extends StubSettings