diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 89e2183bcc93..6cbeefdb6306 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -42,6 +42,7 @@
"java-contact-center-insights": "2.4.1-SNAPSHOT",
"java-containeranalysis": "2.5.1-SNAPSHOT",
"java-container": "2.7.1-SNAPSHOT",
+ "java-contentwarehouse": "0.0.1-SNAPSHOT",
"java-datacatalog": "1.10.1-SNAPSHOT",
"java-dataflow": "0.8.1-SNAPSHOT",
"java-dataform": "0.3.1-SNAPSHOT",
diff --git a/java-contentwarehouse/.OwlBot.yaml b/java-contentwarehouse/.OwlBot.yaml
new file mode 100644
index 000000000000..f88038a9c229
--- /dev/null
+++ b/java-contentwarehouse/.OwlBot.yaml
@@ -0,0 +1,30 @@
+# 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
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+deep-remove-regex:
+- "/java-contentwarehouse/grpc-google-.*/src"
+- "/java-contentwarehouse/proto-google-.*/src"
+- "/java-contentwarehouse/google-.*/src"
+
+deep-preserve-regex:
+- "/java-contentwarehouse/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java"
+
+deep-copy-regex:
+- source: "/google/cloud/contentwarehouse/(v.*)/.*-java/proto-google-.*/src"
+ dest: "/owl-bot-staging/java-contentwarehouse/$1/proto-google-cloud-contentwarehouse-$1/src"
+- source: "/google/cloud/contentwarehouse/(v.*)/.*-java/grpc-google-.*/src"
+ dest: "/owl-bot-staging/java-contentwarehouse/$1/grpc-google-cloud-contentwarehouse-$1/src"
+- source: "/google/cloud/contentwarehouse/(v.*)/.*-java/gapic-google-.*/src"
+ dest: "/owl-bot-staging/java-contentwarehouse/$1/google-cloud-contentwarehouse/src"
diff --git a/java-contentwarehouse/.repo-metadata.json b/java-contentwarehouse/.repo-metadata.json
new file mode 100644
index 000000000000..0cf5ba0d595f
--- /dev/null
+++ b/java-contentwarehouse/.repo-metadata.json
@@ -0,0 +1,16 @@
+{
+ "api_shortname": "contentwarehouse",
+ "name_pretty": "Document AI Warehouse",
+ "product_documentation": "https://cloud.google.com/document-warehouse/docs/overview",
+ "api_description": "Document AI Warehouse is an integrated cloud-native GCP platform to store, search, organize, govern and analyze documents and their structured metadata.",
+ "client_documentation": "https://cloud.google.com/java/docs/reference/google-cloud-contentwarehouse/latest/overview",
+ "release_level": "preview",
+ "transport": "grpc",
+ "language": "java",
+ "repo": "googleapis/java-contentwarehouse",
+ "repo_short": "java-contentwarehouse",
+ "distribution_name": "com.google.cloud:google-cloud-contentwarehouse",
+ "api_id": "contentwarehouse.googleapis.com",
+ "library_type": "GAPIC_AUTO",
+ "requires_billing": true
+}
\ No newline at end of file
diff --git a/java-contentwarehouse/README.md b/java-contentwarehouse/README.md
new file mode 100644
index 000000000000..e8789f4f6997
--- /dev/null
+++ b/java-contentwarehouse/README.md
@@ -0,0 +1,201 @@
+# Google Document AI Warehouse Client for Java
+
+Java idiomatic client for [Document AI Warehouse][product-docs].
+
+[![Maven][maven-version-image]][maven-version-link]
+![Stability][stability-image]
+
+- [Product Documentation][product-docs]
+- [Client Library Documentation][javadocs]
+
+> Note: This client is a work-in-progress, and may occasionally
+> make backwards-incompatible changes.
+
+
+## Quickstart
+
+
+If you are using Maven, add this to your pom.xml file:
+
+
+```xml
+
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 and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (DocumentLinkServiceClient documentLinkServiceClient = DocumentLinkServiceClient.create()) { + * DocumentName parent = + * DocumentName.ofProjectLocationDocumentName("[PROJECT]", "[LOCATION]", "[DOCUMENT]"); + * ListLinkedTargetsResponse response = documentLinkServiceClient.listLinkedTargets(parent); + * } + * }+ * + *
Note: close() needs to be called on the DocumentLinkServiceClient 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 DocumentLinkServiceSettings to + * create(). For example: + * + *
To customize credentials: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * DocumentLinkServiceSettings documentLinkServiceSettings = + * DocumentLinkServiceSettings.newBuilder() + * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + * .build(); + * DocumentLinkServiceClient documentLinkServiceClient = + * DocumentLinkServiceClient.create(documentLinkServiceSettings); + * }+ * + *
To customize the endpoint: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * DocumentLinkServiceSettings documentLinkServiceSettings = + * DocumentLinkServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + * DocumentLinkServiceClient documentLinkServiceClient = + * DocumentLinkServiceClient.create(documentLinkServiceSettings); + * }+ * + *
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 and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * DocumentLinkServiceSettings documentLinkServiceSettings = + * DocumentLinkServiceSettings.newBuilder() + * .setTransportChannelProvider( + * DocumentLinkServiceSettings.defaultHttpJsonTransportProviderBuilder().build()) + * .build(); + * DocumentLinkServiceClient documentLinkServiceClient = + * DocumentLinkServiceClient.create(documentLinkServiceSettings); + * }+ * + *
Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class DocumentLinkServiceClient implements BackgroundResource { + private final DocumentLinkServiceSettings settings; + private final DocumentLinkServiceStub stub; + + /** Constructs an instance of DocumentLinkServiceClient with default settings. */ + public static final DocumentLinkServiceClient create() throws IOException { + return create(DocumentLinkServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of DocumentLinkServiceClient, 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 DocumentLinkServiceClient create(DocumentLinkServiceSettings settings) + throws IOException { + return new DocumentLinkServiceClient(settings); + } + + /** + * Constructs an instance of DocumentLinkServiceClient, using the given stub for making calls. + * This is for advanced usage - prefer using create(DocumentLinkServiceSettings). + */ + public static final DocumentLinkServiceClient create(DocumentLinkServiceStub stub) { + return new DocumentLinkServiceClient(stub); + } + + /** + * Constructs an instance of DocumentLinkServiceClient, 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 DocumentLinkServiceClient(DocumentLinkServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((DocumentLinkServiceStubSettings) settings.getStubSettings()).createStub(); + } + + protected DocumentLinkServiceClient(DocumentLinkServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final DocumentLinkServiceSettings getSettings() { + return settings; + } + + public DocumentLinkServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Return all target document-links from the document. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (DocumentLinkServiceClient documentLinkServiceClient = DocumentLinkServiceClient.create()) { + * DocumentName parent = + * DocumentName.ofProjectLocationDocumentName("[PROJECT]", "[LOCATION]", "[DOCUMENT]"); + * ListLinkedTargetsResponse response = documentLinkServiceClient.listLinkedTargets(parent); + * } + * }+ * + * @param parent Required. The name of the document, for which all target links are returned. + * Format: projects/{project_number}/locations/{location}/documents/{target_document_id}. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListLinkedTargetsResponse listLinkedTargets(DocumentName parent) { + ListLinkedTargetsRequest request = + ListLinkedTargetsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listLinkedTargets(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Return all target document-links from the document. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (DocumentLinkServiceClient documentLinkServiceClient = DocumentLinkServiceClient.create()) { + * String parent = + * DocumentName.ofProjectLocationDocumentName("[PROJECT]", "[LOCATION]", "[DOCUMENT]") + * .toString(); + * ListLinkedTargetsResponse response = documentLinkServiceClient.listLinkedTargets(parent); + * } + * }+ * + * @param parent Required. The name of the document, for which all target links are returned. + * Format: projects/{project_number}/locations/{location}/documents/{target_document_id}. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListLinkedTargetsResponse listLinkedTargets(String parent) { + ListLinkedTargetsRequest request = + ListLinkedTargetsRequest.newBuilder().setParent(parent).build(); + return listLinkedTargets(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Return all target document-links from the document. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (DocumentLinkServiceClient documentLinkServiceClient = DocumentLinkServiceClient.create()) { + * ListLinkedTargetsRequest request = + * ListLinkedTargetsRequest.newBuilder() + * .setParent( + * DocumentName.ofProjectLocationDocumentName( + * "[PROJECT]", "[LOCATION]", "[DOCUMENT]") + * .toString()) + * .setRequestMetadata(RequestMetadata.newBuilder().build()) + * .build(); + * ListLinkedTargetsResponse response = documentLinkServiceClient.listLinkedTargets(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 ListLinkedTargetsResponse listLinkedTargets(ListLinkedTargetsRequest request) { + return listLinkedTargetsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Return all target document-links from the document. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (DocumentLinkServiceClient documentLinkServiceClient = DocumentLinkServiceClient.create()) { + * ListLinkedTargetsRequest request = + * ListLinkedTargetsRequest.newBuilder() + * .setParent( + * DocumentName.ofProjectLocationDocumentName( + * "[PROJECT]", "[LOCATION]", "[DOCUMENT]") + * .toString()) + * .setRequestMetadata(RequestMetadata.newBuilder().build()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * documentLinkServiceClient.listLinkedTargetsCallable().futureCall(request); + * // Do something. + * ListLinkedTargetsResponse response = future.get(); + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (DocumentLinkServiceClient documentLinkServiceClient = DocumentLinkServiceClient.create()) { + * DocumentName parent = + * DocumentName.ofProjectLocationDocumentName("[PROJECT]", "[LOCATION]", "[DOCUMENT]"); + * for (DocumentLink element : + * documentLinkServiceClient.listLinkedSources(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. The name of the document, for which all source links are returned. + * Format: projects/{project_number}/locations/{location}/documents/{source_document_id}. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListLinkedSourcesPagedResponse listLinkedSources(DocumentName parent) { + ListLinkedSourcesRequest request = + ListLinkedSourcesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listLinkedSources(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Return all source document-links from the document. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (DocumentLinkServiceClient documentLinkServiceClient = DocumentLinkServiceClient.create()) { + * String parent = + * DocumentName.ofProjectLocationDocumentName("[PROJECT]", "[LOCATION]", "[DOCUMENT]") + * .toString(); + * for (DocumentLink element : + * documentLinkServiceClient.listLinkedSources(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. The name of the document, for which all source links are returned. + * Format: projects/{project_number}/locations/{location}/documents/{source_document_id}. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListLinkedSourcesPagedResponse listLinkedSources(String parent) { + ListLinkedSourcesRequest request = + ListLinkedSourcesRequest.newBuilder().setParent(parent).build(); + return listLinkedSources(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Return all source document-links from the document. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (DocumentLinkServiceClient documentLinkServiceClient = DocumentLinkServiceClient.create()) { + * ListLinkedSourcesRequest request = + * ListLinkedSourcesRequest.newBuilder() + * .setParent( + * DocumentName.ofProjectLocationDocumentName( + * "[PROJECT]", "[LOCATION]", "[DOCUMENT]") + * .toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setRequestMetadata(RequestMetadata.newBuilder().build()) + * .build(); + * for (DocumentLink element : + * documentLinkServiceClient.listLinkedSources(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 ListLinkedSourcesPagedResponse listLinkedSources(ListLinkedSourcesRequest request) { + return listLinkedSourcesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Return all source document-links from the document. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (DocumentLinkServiceClient documentLinkServiceClient = DocumentLinkServiceClient.create()) { + * ListLinkedSourcesRequest request = + * ListLinkedSourcesRequest.newBuilder() + * .setParent( + * DocumentName.ofProjectLocationDocumentName( + * "[PROJECT]", "[LOCATION]", "[DOCUMENT]") + * .toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setRequestMetadata(RequestMetadata.newBuilder().build()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * documentLinkServiceClient.listLinkedSourcesPagedCallable().futureCall(request); + * // Do something. + * for (DocumentLink element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (DocumentLinkServiceClient documentLinkServiceClient = DocumentLinkServiceClient.create()) { + * ListLinkedSourcesRequest request = + * ListLinkedSourcesRequest.newBuilder() + * .setParent( + * DocumentName.ofProjectLocationDocumentName( + * "[PROJECT]", "[LOCATION]", "[DOCUMENT]") + * .toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setRequestMetadata(RequestMetadata.newBuilder().build()) + * .build(); + * while (true) { + * ListLinkedSourcesResponse response = + * documentLinkServiceClient.listLinkedSourcesCallable().call(request); + * for (DocumentLink element : response.getDocumentLinksList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }+ */ + public final UnaryCallable
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (DocumentLinkServiceClient documentLinkServiceClient = DocumentLinkServiceClient.create()) { + * DocumentName parent = + * DocumentName.ofProjectLocationDocumentName("[PROJECT]", "[LOCATION]", "[DOCUMENT]"); + * DocumentLink documentLink = DocumentLink.newBuilder().build(); + * DocumentLink response = documentLinkServiceClient.createDocumentLink(parent, documentLink); + * } + * }+ * + * @param parent Required. Parent of the document-link to be created. parent of document-link + * should be a document. Format: + * projects/{project_number}/locations/{location}/documents/{source_document_id}. + * @param documentLink Required. Document links associated with the source documents + * (source_document_id). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final DocumentLink createDocumentLink(DocumentName parent, DocumentLink documentLink) { + CreateDocumentLinkRequest request = + CreateDocumentLinkRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setDocumentLink(documentLink) + .build(); + return createDocumentLink(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a link between a source document and a target document. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (DocumentLinkServiceClient documentLinkServiceClient = DocumentLinkServiceClient.create()) { + * String parent = + * DocumentName.ofProjectLocationDocumentName("[PROJECT]", "[LOCATION]", "[DOCUMENT]") + * .toString(); + * DocumentLink documentLink = DocumentLink.newBuilder().build(); + * DocumentLink response = documentLinkServiceClient.createDocumentLink(parent, documentLink); + * } + * }+ * + * @param parent Required. Parent of the document-link to be created. parent of document-link + * should be a document. Format: + * projects/{project_number}/locations/{location}/documents/{source_document_id}. + * @param documentLink Required. Document links associated with the source documents + * (source_document_id). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final DocumentLink createDocumentLink(String parent, DocumentLink documentLink) { + CreateDocumentLinkRequest request = + CreateDocumentLinkRequest.newBuilder() + .setParent(parent) + .setDocumentLink(documentLink) + .build(); + return createDocumentLink(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a link between a source document and a target document. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (DocumentLinkServiceClient documentLinkServiceClient = DocumentLinkServiceClient.create()) { + * CreateDocumentLinkRequest request = + * CreateDocumentLinkRequest.newBuilder() + * .setParent( + * DocumentName.ofProjectLocationDocumentName( + * "[PROJECT]", "[LOCATION]", "[DOCUMENT]") + * .toString()) + * .setDocumentLink(DocumentLink.newBuilder().build()) + * .setRequestMetadata(RequestMetadata.newBuilder().build()) + * .build(); + * DocumentLink response = documentLinkServiceClient.createDocumentLink(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 DocumentLink createDocumentLink(CreateDocumentLinkRequest request) { + return createDocumentLinkCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a link between a source document and a target document. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (DocumentLinkServiceClient documentLinkServiceClient = DocumentLinkServiceClient.create()) { + * CreateDocumentLinkRequest request = + * CreateDocumentLinkRequest.newBuilder() + * .setParent( + * DocumentName.ofProjectLocationDocumentName( + * "[PROJECT]", "[LOCATION]", "[DOCUMENT]") + * .toString()) + * .setDocumentLink(DocumentLink.newBuilder().build()) + * .setRequestMetadata(RequestMetadata.newBuilder().build()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * documentLinkServiceClient.createDocumentLinkCallable().futureCall(request); + * // Do something. + * DocumentLink response = future.get(); + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (DocumentLinkServiceClient documentLinkServiceClient = DocumentLinkServiceClient.create()) { + * DocumentLinkName name = + * DocumentLinkName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT]", "[DOCUMENT_LINK]"); + * documentLinkServiceClient.deleteDocumentLink(name); + * } + * }+ * + * @param name Required. The name of the document-link to be deleted. Format: + * projects/{project_number}/locations/{location}/documents/{source_document_id}/documentLinks/{document_link_id}. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteDocumentLink(DocumentLinkName name) { + DeleteDocumentLinkRequest request = + DeleteDocumentLinkRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + deleteDocumentLink(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Remove the link between the source and target documents. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (DocumentLinkServiceClient documentLinkServiceClient = DocumentLinkServiceClient.create()) { + * String name = + * DocumentLinkName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT]", "[DOCUMENT_LINK]") + * .toString(); + * documentLinkServiceClient.deleteDocumentLink(name); + * } + * }+ * + * @param name Required. The name of the document-link to be deleted. Format: + * projects/{project_number}/locations/{location}/documents/{source_document_id}/documentLinks/{document_link_id}. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteDocumentLink(String name) { + DeleteDocumentLinkRequest request = + DeleteDocumentLinkRequest.newBuilder().setName(name).build(); + deleteDocumentLink(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Remove the link between the source and target documents. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (DocumentLinkServiceClient documentLinkServiceClient = DocumentLinkServiceClient.create()) { + * DeleteDocumentLinkRequest request = + * DeleteDocumentLinkRequest.newBuilder() + * .setName( + * DocumentLinkName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT]", "[DOCUMENT_LINK]") + * .toString()) + * .setRequestMetadata(RequestMetadata.newBuilder().build()) + * .build(); + * documentLinkServiceClient.deleteDocumentLink(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 deleteDocumentLink(DeleteDocumentLinkRequest request) { + deleteDocumentLinkCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Remove the link between the source and target documents. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (DocumentLinkServiceClient documentLinkServiceClient = DocumentLinkServiceClient.create()) { + * DeleteDocumentLinkRequest request = + * DeleteDocumentLinkRequest.newBuilder() + * .setName( + * DocumentLinkName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT]", "[DOCUMENT_LINK]") + * .toString()) + * .setRequestMetadata(RequestMetadata.newBuilder().build()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * documentLinkServiceClient.deleteDocumentLinkCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
The default instance has everything set to sensible defaults: + * + *
The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *
For example, to set the total timeout of listLinkedTargets to 30 seconds: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * DocumentLinkServiceSettings.Builder documentLinkServiceSettingsBuilder = + * DocumentLinkServiceSettings.newBuilder(); + * documentLinkServiceSettingsBuilder + * .listLinkedTargetsSettings() + * .setRetrySettings( + * documentLinkServiceSettingsBuilder + * .listLinkedTargetsSettings() + * .getRetrySettings() + * .toBuilder() + * .setTotalTimeout(Duration.ofSeconds(30)) + * .build()); + * DocumentLinkServiceSettings documentLinkServiceSettings = + * documentLinkServiceSettingsBuilder.build(); + * }+ */ +@Generated("by gapic-generator-java") +public class DocumentLinkServiceSettings extends ClientSettings
Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction This class provides the ability to make remote calls to the backing service through method
+ * calls that map to API methods. Sample code to get started:
+ *
+ * Note: close() needs to be called on the DocumentSchemaServiceClient 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 DocumentSchemaServiceSettings
+ * 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 DocumentSchemaServiceClient implements BackgroundResource {
+ private final DocumentSchemaServiceSettings settings;
+ private final DocumentSchemaServiceStub stub;
+
+ /** Constructs an instance of DocumentSchemaServiceClient with default settings. */
+ public static final DocumentSchemaServiceClient create() throws IOException {
+ return create(DocumentSchemaServiceSettings.newBuilder().build());
+ }
+
+ /**
+ * Constructs an instance of DocumentSchemaServiceClient, 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 DocumentSchemaServiceClient create(DocumentSchemaServiceSettings settings)
+ throws IOException {
+ return new DocumentSchemaServiceClient(settings);
+ }
+
+ /**
+ * Constructs an instance of DocumentSchemaServiceClient, using the given stub for making calls.
+ * This is for advanced usage - prefer using create(DocumentSchemaServiceSettings).
+ */
+ public static final DocumentSchemaServiceClient create(DocumentSchemaServiceStub stub) {
+ return new DocumentSchemaServiceClient(stub);
+ }
+
+ /**
+ * Constructs an instance of DocumentSchemaServiceClient, 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 DocumentSchemaServiceClient(DocumentSchemaServiceSettings settings) throws IOException {
+ this.settings = settings;
+ this.stub = ((DocumentSchemaServiceStubSettings) settings.getStubSettings()).createStub();
+ }
+
+ protected DocumentSchemaServiceClient(DocumentSchemaServiceStub stub) {
+ this.settings = null;
+ this.stub = stub;
+ }
+
+ public final DocumentSchemaServiceSettings getSettings() {
+ return settings;
+ }
+
+ public DocumentSchemaServiceStub getStub() {
+ return stub;
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a document schema.
+ *
+ * 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:
+ *
+ * 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 createDocumentSchema to 30 seconds:
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction This class provides the ability to make remote calls to the backing service through method
+ * calls that map to API methods. Sample code to get started:
+ *
+ * Note: close() needs to be called on the DocumentServiceClient 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 DocumentServiceSettings 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 DocumentServiceClient implements BackgroundResource {
+ private final DocumentServiceSettings settings;
+ private final DocumentServiceStub stub;
+
+ /** Constructs an instance of DocumentServiceClient with default settings. */
+ public static final DocumentServiceClient create() throws IOException {
+ return create(DocumentServiceSettings.newBuilder().build());
+ }
+
+ /**
+ * Constructs an instance of DocumentServiceClient, 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 DocumentServiceClient create(DocumentServiceSettings settings)
+ throws IOException {
+ return new DocumentServiceClient(settings);
+ }
+
+ /**
+ * Constructs an instance of DocumentServiceClient, using the given stub for making calls. This is
+ * for advanced usage - prefer using create(DocumentServiceSettings).
+ */
+ public static final DocumentServiceClient create(DocumentServiceStub stub) {
+ return new DocumentServiceClient(stub);
+ }
+
+ /**
+ * Constructs an instance of DocumentServiceClient, 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 DocumentServiceClient(DocumentServiceSettings settings) throws IOException {
+ this.settings = settings;
+ this.stub = ((DocumentServiceStubSettings) settings.getStubSettings()).createStub();
+ }
+
+ protected DocumentServiceClient(DocumentServiceStub stub) {
+ this.settings = null;
+ this.stub = stub;
+ }
+
+ public final DocumentServiceSettings getSettings() {
+ return settings;
+ }
+
+ public DocumentServiceStub getStub() {
+ return stub;
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a document.
+ *
+ * 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:
+ *
+ * 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 createDocument to 30 seconds:
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction This class provides the ability to make remote calls to the backing service through method
+ * calls that map to API methods. Sample code to get started:
+ *
+ * Note: close() needs to be called on the RuleSetServiceClient 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 RuleSetServiceSettings 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 RuleSetServiceClient implements BackgroundResource {
+ private final RuleSetServiceSettings settings;
+ private final RuleSetServiceStub stub;
+
+ /** Constructs an instance of RuleSetServiceClient with default settings. */
+ public static final RuleSetServiceClient create() throws IOException {
+ return create(RuleSetServiceSettings.newBuilder().build());
+ }
+
+ /**
+ * Constructs an instance of RuleSetServiceClient, 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 RuleSetServiceClient create(RuleSetServiceSettings settings)
+ throws IOException {
+ return new RuleSetServiceClient(settings);
+ }
+
+ /**
+ * Constructs an instance of RuleSetServiceClient, using the given stub for making calls. This is
+ * for advanced usage - prefer using create(RuleSetServiceSettings).
+ */
+ public static final RuleSetServiceClient create(RuleSetServiceStub stub) {
+ return new RuleSetServiceClient(stub);
+ }
+
+ /**
+ * Constructs an instance of RuleSetServiceClient, 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 RuleSetServiceClient(RuleSetServiceSettings settings) throws IOException {
+ this.settings = settings;
+ this.stub = ((RuleSetServiceStubSettings) settings.getStubSettings()).createStub();
+ }
+
+ protected RuleSetServiceClient(RuleSetServiceStub stub) {
+ this.settings = null;
+ this.stub = stub;
+ }
+
+ public final RuleSetServiceSettings getSettings() {
+ return settings;
+ }
+
+ public RuleSetServiceStub getStub() {
+ return stub;
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a ruleset.
+ *
+ * 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:
+ *
+ * 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 createRuleSet to 30 seconds:
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction This class provides the ability to make remote calls to the backing service through method
+ * calls that map to API methods. Sample code to get started:
+ *
+ * Note: close() needs to be called on the SynonymSetServiceClient 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 SynonymSetServiceSettings 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 SynonymSetServiceClient implements BackgroundResource {
+ private final SynonymSetServiceSettings settings;
+ private final SynonymSetServiceStub stub;
+
+ /** Constructs an instance of SynonymSetServiceClient with default settings. */
+ public static final SynonymSetServiceClient create() throws IOException {
+ return create(SynonymSetServiceSettings.newBuilder().build());
+ }
+
+ /**
+ * Constructs an instance of SynonymSetServiceClient, 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 SynonymSetServiceClient create(SynonymSetServiceSettings settings)
+ throws IOException {
+ return new SynonymSetServiceClient(settings);
+ }
+
+ /**
+ * Constructs an instance of SynonymSetServiceClient, using the given stub for making calls. This
+ * is for advanced usage - prefer using create(SynonymSetServiceSettings).
+ */
+ public static final SynonymSetServiceClient create(SynonymSetServiceStub stub) {
+ return new SynonymSetServiceClient(stub);
+ }
+
+ /**
+ * Constructs an instance of SynonymSetServiceClient, 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 SynonymSetServiceClient(SynonymSetServiceSettings settings) throws IOException {
+ this.settings = settings;
+ this.stub = ((SynonymSetServiceStubSettings) settings.getStubSettings()).createStub();
+ }
+
+ protected SynonymSetServiceClient(SynonymSetServiceStub stub) {
+ this.settings = null;
+ this.stub = stub;
+ }
+
+ public final SynonymSetServiceSettings getSettings() {
+ return settings;
+ }
+
+ public SynonymSetServiceStub getStub() {
+ return stub;
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a SynonymSet for a single context. Throws an ALREADY_EXISTS exception if a synonymset
+ * already exists for the context.
+ *
+ * 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:
+ *
+ * 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 createSynonymSet to 30 seconds:
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction The interfaces provided are listed below, along with usage samples.
+ *
+ * ======================= DocumentLinkServiceClient =======================
+ *
+ * Service Description: This service lets you manage document-links. Document-Links are treated
+ * as sub-resources under source documents.
+ *
+ * Sample for DocumentLinkServiceClient:
+ *
+ * ======================= DocumentSchemaServiceClient =======================
+ *
+ * Service Description: This service lets you manage document schema.
+ *
+ * Sample for DocumentSchemaServiceClient:
+ *
+ * ======================= DocumentServiceClient =======================
+ *
+ * Service Description: This service lets you manage document.
+ *
+ * Sample for DocumentServiceClient:
+ *
+ * ======================= RuleSetServiceClient =======================
+ *
+ * Service Description: Service to manage customer specific RuleSets.
+ *
+ * Sample for RuleSetServiceClient:
+ *
+ * ======================= SynonymSetServiceClient =======================
+ *
+ * Service Description: A Service that manage/custom customer specified SynonymSets.
+ *
+ * Sample for SynonymSetServiceClient:
+ *
+ * This class is for advanced usage and reflects the underlying API directly.
+ */
+@Generated("by gapic-generator-java")
+public abstract class DocumentLinkServiceStub 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 listLinkedTargets to 30 seconds:
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction This class is for advanced usage and reflects the underlying API directly.
+ */
+@Generated("by gapic-generator-java")
+public abstract class DocumentSchemaServiceStub 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 createDocumentSchema to 30 seconds:
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction This class is for advanced usage and reflects the underlying API directly.
+ */
+@Generated("by gapic-generator-java")
+public abstract class DocumentServiceStub 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 createDocument to 30 seconds:
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DocumentSchemaServiceClient documentSchemaServiceClient =
+ * DocumentSchemaServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * DocumentSchema documentSchema = DocumentSchema.newBuilder().build();
+ * DocumentSchema response =
+ * documentSchemaServiceClient.createDocumentSchema(parent, documentSchema);
+ * }
+ * }
+ *
+ *
+ *
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * DocumentSchemaServiceSettings documentSchemaServiceSettings =
+ * DocumentSchemaServiceSettings.newBuilder()
+ * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ * .build();
+ * DocumentSchemaServiceClient documentSchemaServiceClient =
+ * DocumentSchemaServiceClient.create(documentSchemaServiceSettings);
+ * }
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * DocumentSchemaServiceSettings documentSchemaServiceSettings =
+ * DocumentSchemaServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * DocumentSchemaServiceClient documentSchemaServiceClient =
+ * DocumentSchemaServiceClient.create(documentSchemaServiceSettings);
+ * }
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * DocumentSchemaServiceSettings documentSchemaServiceSettings =
+ * DocumentSchemaServiceSettings.newBuilder()
+ * .setTransportChannelProvider(
+ * DocumentSchemaServiceSettings.defaultHttpJsonTransportProviderBuilder().build())
+ * .build();
+ * DocumentSchemaServiceClient documentSchemaServiceClient =
+ * DocumentSchemaServiceClient.create(documentSchemaServiceSettings);
+ * }
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DocumentSchemaServiceClient documentSchemaServiceClient =
+ * DocumentSchemaServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * DocumentSchema documentSchema = DocumentSchema.newBuilder().build();
+ * DocumentSchema response =
+ * documentSchemaServiceClient.createDocumentSchema(parent, documentSchema);
+ * }
+ * }
+ *
+ * @param parent Required. The parent name.
+ * @param documentSchema Required. The document schema to create.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final DocumentSchema createDocumentSchema(
+ LocationName parent, DocumentSchema documentSchema) {
+ CreateDocumentSchemaRequest request =
+ CreateDocumentSchemaRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setDocumentSchema(documentSchema)
+ .build();
+ return createDocumentSchema(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a document schema.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DocumentSchemaServiceClient documentSchemaServiceClient =
+ * DocumentSchemaServiceClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * DocumentSchema documentSchema = DocumentSchema.newBuilder().build();
+ * DocumentSchema response =
+ * documentSchemaServiceClient.createDocumentSchema(parent, documentSchema);
+ * }
+ * }
+ *
+ * @param parent Required. The parent name.
+ * @param documentSchema Required. The document schema to create.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final DocumentSchema createDocumentSchema(String parent, DocumentSchema documentSchema) {
+ CreateDocumentSchemaRequest request =
+ CreateDocumentSchemaRequest.newBuilder()
+ .setParent(parent)
+ .setDocumentSchema(documentSchema)
+ .build();
+ return createDocumentSchema(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a document schema.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DocumentSchemaServiceClient documentSchemaServiceClient =
+ * DocumentSchemaServiceClient.create()) {
+ * CreateDocumentSchemaRequest request =
+ * CreateDocumentSchemaRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setDocumentSchema(DocumentSchema.newBuilder().build())
+ * .build();
+ * DocumentSchema response = documentSchemaServiceClient.createDocumentSchema(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 DocumentSchema createDocumentSchema(CreateDocumentSchemaRequest request) {
+ return createDocumentSchemaCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a document schema.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DocumentSchemaServiceClient documentSchemaServiceClient =
+ * DocumentSchemaServiceClient.create()) {
+ * CreateDocumentSchemaRequest request =
+ * CreateDocumentSchemaRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setDocumentSchema(DocumentSchema.newBuilder().build())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DocumentSchemaServiceClient documentSchemaServiceClient =
+ * DocumentSchemaServiceClient.create()) {
+ * DocumentSchemaName name =
+ * DocumentSchemaName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT_SCHEMA]");
+ * DocumentSchema documentSchema = DocumentSchema.newBuilder().build();
+ * DocumentSchema response =
+ * documentSchemaServiceClient.updateDocumentSchema(name, documentSchema);
+ * }
+ * }
+ *
+ * @param name Required. The name of the document schema to update. Format:
+ * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
+ * @param documentSchema Required. The document schema to update with.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final DocumentSchema updateDocumentSchema(
+ DocumentSchemaName name, DocumentSchema documentSchema) {
+ UpdateDocumentSchemaRequest request =
+ UpdateDocumentSchemaRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .setDocumentSchema(documentSchema)
+ .build();
+ return updateDocumentSchema(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates a Document Schema. Returns INVALID_ARGUMENT if the name of the Document Schema is
+ * non-empty and does not equal the existing name. Supports only appending new properties, adding
+ * new ENUM possible values, and updating the
+ * [EnumTypeOptions.validation_check_disabled][google.cloud.contentwarehouse.v1.EnumTypeOptions.validation_check_disabled]
+ * flag for ENUM possible values. Updating existing properties will result into INVALID_ARGUMENT.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DocumentSchemaServiceClient documentSchemaServiceClient =
+ * DocumentSchemaServiceClient.create()) {
+ * String name =
+ * DocumentSchemaName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT_SCHEMA]").toString();
+ * DocumentSchema documentSchema = DocumentSchema.newBuilder().build();
+ * DocumentSchema response =
+ * documentSchemaServiceClient.updateDocumentSchema(name, documentSchema);
+ * }
+ * }
+ *
+ * @param name Required. The name of the document schema to update. Format:
+ * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
+ * @param documentSchema Required. The document schema to update with.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final DocumentSchema updateDocumentSchema(String name, DocumentSchema documentSchema) {
+ UpdateDocumentSchemaRequest request =
+ UpdateDocumentSchemaRequest.newBuilder()
+ .setName(name)
+ .setDocumentSchema(documentSchema)
+ .build();
+ return updateDocumentSchema(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates a Document Schema. Returns INVALID_ARGUMENT if the name of the Document Schema is
+ * non-empty and does not equal the existing name. Supports only appending new properties, adding
+ * new ENUM possible values, and updating the
+ * [EnumTypeOptions.validation_check_disabled][google.cloud.contentwarehouse.v1.EnumTypeOptions.validation_check_disabled]
+ * flag for ENUM possible values. Updating existing properties will result into INVALID_ARGUMENT.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DocumentSchemaServiceClient documentSchemaServiceClient =
+ * DocumentSchemaServiceClient.create()) {
+ * UpdateDocumentSchemaRequest request =
+ * UpdateDocumentSchemaRequest.newBuilder()
+ * .setName(
+ * DocumentSchemaName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT_SCHEMA]").toString())
+ * .setDocumentSchema(DocumentSchema.newBuilder().build())
+ * .build();
+ * DocumentSchema response = documentSchemaServiceClient.updateDocumentSchema(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 DocumentSchema updateDocumentSchema(UpdateDocumentSchemaRequest request) {
+ return updateDocumentSchemaCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates a Document Schema. Returns INVALID_ARGUMENT if the name of the Document Schema is
+ * non-empty and does not equal the existing name. Supports only appending new properties, adding
+ * new ENUM possible values, and updating the
+ * [EnumTypeOptions.validation_check_disabled][google.cloud.contentwarehouse.v1.EnumTypeOptions.validation_check_disabled]
+ * flag for ENUM possible values. Updating existing properties will result into INVALID_ARGUMENT.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DocumentSchemaServiceClient documentSchemaServiceClient =
+ * DocumentSchemaServiceClient.create()) {
+ * UpdateDocumentSchemaRequest request =
+ * UpdateDocumentSchemaRequest.newBuilder()
+ * .setName(
+ * DocumentSchemaName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT_SCHEMA]").toString())
+ * .setDocumentSchema(DocumentSchema.newBuilder().build())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DocumentSchemaServiceClient documentSchemaServiceClient =
+ * DocumentSchemaServiceClient.create()) {
+ * DocumentSchemaName name =
+ * DocumentSchemaName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT_SCHEMA]");
+ * DocumentSchema response = documentSchemaServiceClient.getDocumentSchema(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the document schema to retrieve.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final DocumentSchema getDocumentSchema(DocumentSchemaName name) {
+ GetDocumentSchemaRequest request =
+ GetDocumentSchemaRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .build();
+ return getDocumentSchema(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets a document schema. Returns NOT_FOUND if the document schema does not exist.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DocumentSchemaServiceClient documentSchemaServiceClient =
+ * DocumentSchemaServiceClient.create()) {
+ * String name =
+ * DocumentSchemaName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT_SCHEMA]").toString();
+ * DocumentSchema response = documentSchemaServiceClient.getDocumentSchema(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the document schema to retrieve.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final DocumentSchema getDocumentSchema(String name) {
+ GetDocumentSchemaRequest request = GetDocumentSchemaRequest.newBuilder().setName(name).build();
+ return getDocumentSchema(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets a document schema. Returns NOT_FOUND if the document schema does not exist.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DocumentSchemaServiceClient documentSchemaServiceClient =
+ * DocumentSchemaServiceClient.create()) {
+ * GetDocumentSchemaRequest request =
+ * GetDocumentSchemaRequest.newBuilder()
+ * .setName(
+ * DocumentSchemaName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT_SCHEMA]").toString())
+ * .build();
+ * DocumentSchema response = documentSchemaServiceClient.getDocumentSchema(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 DocumentSchema getDocumentSchema(GetDocumentSchemaRequest request) {
+ return getDocumentSchemaCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets a document schema. Returns NOT_FOUND if the document schema does not exist.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DocumentSchemaServiceClient documentSchemaServiceClient =
+ * DocumentSchemaServiceClient.create()) {
+ * GetDocumentSchemaRequest request =
+ * GetDocumentSchemaRequest.newBuilder()
+ * .setName(
+ * DocumentSchemaName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT_SCHEMA]").toString())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DocumentSchemaServiceClient documentSchemaServiceClient =
+ * DocumentSchemaServiceClient.create()) {
+ * DocumentSchemaName name =
+ * DocumentSchemaName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT_SCHEMA]");
+ * documentSchemaServiceClient.deleteDocumentSchema(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the document schema to delete.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteDocumentSchema(DocumentSchemaName name) {
+ DeleteDocumentSchemaRequest request =
+ DeleteDocumentSchemaRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .build();
+ deleteDocumentSchema(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a document schema. Returns NOT_FOUND if the document schema does not exist. Returns
+ * BAD_REQUEST if the document schema has documents depending on it.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DocumentSchemaServiceClient documentSchemaServiceClient =
+ * DocumentSchemaServiceClient.create()) {
+ * String name =
+ * DocumentSchemaName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT_SCHEMA]").toString();
+ * documentSchemaServiceClient.deleteDocumentSchema(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the document schema to delete.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteDocumentSchema(String name) {
+ DeleteDocumentSchemaRequest request =
+ DeleteDocumentSchemaRequest.newBuilder().setName(name).build();
+ deleteDocumentSchema(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a document schema. Returns NOT_FOUND if the document schema does not exist. Returns
+ * BAD_REQUEST if the document schema has documents depending on it.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DocumentSchemaServiceClient documentSchemaServiceClient =
+ * DocumentSchemaServiceClient.create()) {
+ * DeleteDocumentSchemaRequest request =
+ * DeleteDocumentSchemaRequest.newBuilder()
+ * .setName(
+ * DocumentSchemaName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT_SCHEMA]").toString())
+ * .build();
+ * documentSchemaServiceClient.deleteDocumentSchema(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 deleteDocumentSchema(DeleteDocumentSchemaRequest request) {
+ deleteDocumentSchemaCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a document schema. Returns NOT_FOUND if the document schema does not exist. Returns
+ * BAD_REQUEST if the document schema has documents depending on it.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DocumentSchemaServiceClient documentSchemaServiceClient =
+ * DocumentSchemaServiceClient.create()) {
+ * DeleteDocumentSchemaRequest request =
+ * DeleteDocumentSchemaRequest.newBuilder()
+ * .setName(
+ * DocumentSchemaName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT_SCHEMA]").toString())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DocumentSchemaServiceClient documentSchemaServiceClient =
+ * DocumentSchemaServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * for (DocumentSchema element :
+ * documentSchemaServiceClient.listDocumentSchemas(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The parent, which owns this collection of document schemas. Format:
+ * projects/{project_number}/locations/{location}.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListDocumentSchemasPagedResponse listDocumentSchemas(LocationName parent) {
+ ListDocumentSchemasRequest request =
+ ListDocumentSchemasRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listDocumentSchemas(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists document schemas.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DocumentSchemaServiceClient documentSchemaServiceClient =
+ * DocumentSchemaServiceClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * for (DocumentSchema element :
+ * documentSchemaServiceClient.listDocumentSchemas(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The parent, which owns this collection of document schemas. Format:
+ * projects/{project_number}/locations/{location}.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListDocumentSchemasPagedResponse listDocumentSchemas(String parent) {
+ ListDocumentSchemasRequest request =
+ ListDocumentSchemasRequest.newBuilder().setParent(parent).build();
+ return listDocumentSchemas(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists document schemas.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DocumentSchemaServiceClient documentSchemaServiceClient =
+ * DocumentSchemaServiceClient.create()) {
+ * ListDocumentSchemasRequest request =
+ * ListDocumentSchemasRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * for (DocumentSchema element :
+ * documentSchemaServiceClient.listDocumentSchemas(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 ListDocumentSchemasPagedResponse listDocumentSchemas(
+ ListDocumentSchemasRequest request) {
+ return listDocumentSchemasPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists document schemas.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DocumentSchemaServiceClient documentSchemaServiceClient =
+ * DocumentSchemaServiceClient.create()) {
+ * ListDocumentSchemasRequest request =
+ * ListDocumentSchemasRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DocumentSchemaServiceClient documentSchemaServiceClient =
+ * DocumentSchemaServiceClient.create()) {
+ * ListDocumentSchemasRequest request =
+ * ListDocumentSchemasRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * while (true) {
+ * ListDocumentSchemasResponse response =
+ * documentSchemaServiceClient.listDocumentSchemasCallable().call(request);
+ * for (DocumentSchema element : response.getDocumentSchemasList()) {
+ * // 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 and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * DocumentSchemaServiceSettings.Builder documentSchemaServiceSettingsBuilder =
+ * DocumentSchemaServiceSettings.newBuilder();
+ * documentSchemaServiceSettingsBuilder
+ * .createDocumentSchemaSettings()
+ * .setRetrySettings(
+ * documentSchemaServiceSettingsBuilder
+ * .createDocumentSchemaSettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30))
+ * .build());
+ * DocumentSchemaServiceSettings documentSchemaServiceSettings =
+ * documentSchemaServiceSettingsBuilder.build();
+ * }
+ */
+@Generated("by gapic-generator-java")
+public class DocumentSchemaServiceSettings extends ClientSettings{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * Document document = Document.newBuilder().build();
+ * CreateDocumentResponse response = documentServiceClient.createDocument(parent, document);
+ * }
+ * }
+ *
+ *
+ *
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * DocumentServiceSettings documentServiceSettings =
+ * DocumentServiceSettings.newBuilder()
+ * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ * .build();
+ * DocumentServiceClient documentServiceClient =
+ * DocumentServiceClient.create(documentServiceSettings);
+ * }
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * DocumentServiceSettings documentServiceSettings =
+ * DocumentServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * DocumentServiceClient documentServiceClient =
+ * DocumentServiceClient.create(documentServiceSettings);
+ * }
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * DocumentServiceSettings documentServiceSettings =
+ * DocumentServiceSettings.newBuilder()
+ * .setTransportChannelProvider(
+ * DocumentServiceSettings.defaultHttpJsonTransportProviderBuilder().build())
+ * .build();
+ * DocumentServiceClient documentServiceClient =
+ * DocumentServiceClient.create(documentServiceSettings);
+ * }
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * Document document = Document.newBuilder().build();
+ * CreateDocumentResponse response = documentServiceClient.createDocument(parent, document);
+ * }
+ * }
+ *
+ * @param parent Required. The parent name. Format:
+ * projects/{project_number}/locations/{location}.
+ * @param document Required. The document to create.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final CreateDocumentResponse createDocument(LocationName parent, Document document) {
+ CreateDocumentRequest request =
+ CreateDocumentRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setDocument(document)
+ .build();
+ return createDocument(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a document.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * Document document = Document.newBuilder().build();
+ * CreateDocumentResponse response = documentServiceClient.createDocument(parent, document);
+ * }
+ * }
+ *
+ * @param parent Required. The parent name. Format:
+ * projects/{project_number}/locations/{location}.
+ * @param document Required. The document to create.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final CreateDocumentResponse createDocument(String parent, Document document) {
+ CreateDocumentRequest request =
+ CreateDocumentRequest.newBuilder().setParent(parent).setDocument(document).build();
+ return createDocument(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a document.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+ * CreateDocumentRequest request =
+ * CreateDocumentRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setDocument(Document.newBuilder().build())
+ * .setRequestMetadata(RequestMetadata.newBuilder().build())
+ * .setPolicy(Policy.newBuilder().build())
+ * .setCloudAiDocumentOption(CloudAIDocumentOption.newBuilder().build())
+ * .setCreateMask(FieldMask.newBuilder().build())
+ * .build();
+ * CreateDocumentResponse response = documentServiceClient.createDocument(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 CreateDocumentResponse createDocument(CreateDocumentRequest request) {
+ return createDocumentCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a document.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+ * CreateDocumentRequest request =
+ * CreateDocumentRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setDocument(Document.newBuilder().build())
+ * .setRequestMetadata(RequestMetadata.newBuilder().build())
+ * .setPolicy(Policy.newBuilder().build())
+ * .setCloudAiDocumentOption(CloudAIDocumentOption.newBuilder().build())
+ * .setCreateMask(FieldMask.newBuilder().build())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+ * DocumentName name =
+ * DocumentName.ofProjectLocationDocumentName("[PROJECT]", "[LOCATION]", "[DOCUMENT]");
+ * Document response = documentServiceClient.getDocument(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the document to retrieve. Format:
+ * projects/{project_number}/locations/{location}/documents/{document_id} or
+ * projects/{project_number}/locations/{location}/documents/referenceId/{reference_id}.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Document getDocument(DocumentName name) {
+ GetDocumentRequest request =
+ GetDocumentRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getDocument(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets a document. Returns NOT_FOUND if the document does not exist.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+ * String name =
+ * DocumentName.ofProjectLocationDocumentName("[PROJECT]", "[LOCATION]", "[DOCUMENT]")
+ * .toString();
+ * Document response = documentServiceClient.getDocument(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the document to retrieve. Format:
+ * projects/{project_number}/locations/{location}/documents/{document_id} or
+ * projects/{project_number}/locations/{location}/documents/referenceId/{reference_id}.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Document getDocument(String name) {
+ GetDocumentRequest request = GetDocumentRequest.newBuilder().setName(name).build();
+ return getDocument(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets a document. Returns NOT_FOUND if the document does not exist.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+ * GetDocumentRequest request =
+ * GetDocumentRequest.newBuilder()
+ * .setName(
+ * DocumentName.ofProjectLocationDocumentName(
+ * "[PROJECT]", "[LOCATION]", "[DOCUMENT]")
+ * .toString())
+ * .setRequestMetadata(RequestMetadata.newBuilder().build())
+ * .build();
+ * Document response = documentServiceClient.getDocument(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 Document getDocument(GetDocumentRequest request) {
+ return getDocumentCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets a document. Returns NOT_FOUND if the document does not exist.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+ * GetDocumentRequest request =
+ * GetDocumentRequest.newBuilder()
+ * .setName(
+ * DocumentName.ofProjectLocationDocumentName(
+ * "[PROJECT]", "[LOCATION]", "[DOCUMENT]")
+ * .toString())
+ * .setRequestMetadata(RequestMetadata.newBuilder().build())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+ * DocumentName name =
+ * DocumentName.ofProjectLocationDocumentName("[PROJECT]", "[LOCATION]", "[DOCUMENT]");
+ * Document document = Document.newBuilder().build();
+ * UpdateDocumentResponse response = documentServiceClient.updateDocument(name, document);
+ * }
+ * }
+ *
+ * @param name Required. The name of the document to update. Format:
+ * projects/{project_number}/locations/{location}/documents/{document_id} or
+ * projects/{project_number}/locations/{location}/documents/referenceId/{reference_id}.
+ * @param document Required. The document to update.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final UpdateDocumentResponse updateDocument(DocumentName name, Document document) {
+ UpdateDocumentRequest request =
+ UpdateDocumentRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .setDocument(document)
+ .build();
+ return updateDocument(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates a document. Returns INVALID_ARGUMENT if the name of the document is non-empty and does
+ * not equal the existing name.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+ * String name =
+ * DocumentName.ofProjectLocationDocumentName("[PROJECT]", "[LOCATION]", "[DOCUMENT]")
+ * .toString();
+ * Document document = Document.newBuilder().build();
+ * UpdateDocumentResponse response = documentServiceClient.updateDocument(name, document);
+ * }
+ * }
+ *
+ * @param name Required. The name of the document to update. Format:
+ * projects/{project_number}/locations/{location}/documents/{document_id} or
+ * projects/{project_number}/locations/{location}/documents/referenceId/{reference_id}.
+ * @param document Required. The document to update.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final UpdateDocumentResponse updateDocument(String name, Document document) {
+ UpdateDocumentRequest request =
+ UpdateDocumentRequest.newBuilder().setName(name).setDocument(document).build();
+ return updateDocument(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates a document. Returns INVALID_ARGUMENT if the name of the document is non-empty and does
+ * not equal the existing name.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+ * UpdateDocumentRequest request =
+ * UpdateDocumentRequest.newBuilder()
+ * .setName(
+ * DocumentName.ofProjectLocationDocumentName(
+ * "[PROJECT]", "[LOCATION]", "[DOCUMENT]")
+ * .toString())
+ * .setDocument(Document.newBuilder().build())
+ * .setRequestMetadata(RequestMetadata.newBuilder().build())
+ * .setCloudAiDocumentOption(CloudAIDocumentOption.newBuilder().build())
+ * .setUpdateOptions(UpdateOptions.newBuilder().build())
+ * .build();
+ * UpdateDocumentResponse response = documentServiceClient.updateDocument(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 UpdateDocumentResponse updateDocument(UpdateDocumentRequest request) {
+ return updateDocumentCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates a document. Returns INVALID_ARGUMENT if the name of the document is non-empty and does
+ * not equal the existing name.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+ * UpdateDocumentRequest request =
+ * UpdateDocumentRequest.newBuilder()
+ * .setName(
+ * DocumentName.ofProjectLocationDocumentName(
+ * "[PROJECT]", "[LOCATION]", "[DOCUMENT]")
+ * .toString())
+ * .setDocument(Document.newBuilder().build())
+ * .setRequestMetadata(RequestMetadata.newBuilder().build())
+ * .setCloudAiDocumentOption(CloudAIDocumentOption.newBuilder().build())
+ * .setUpdateOptions(UpdateOptions.newBuilder().build())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+ * DocumentName name =
+ * DocumentName.ofProjectLocationDocumentName("[PROJECT]", "[LOCATION]", "[DOCUMENT]");
+ * documentServiceClient.deleteDocument(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the document to delete. Format:
+ * projects/{project_number}/locations/{location}/documents/{document_id} or
+ * projects/{project_number}/locations/{location}/documents/referenceId/{reference_id}.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteDocument(DocumentName name) {
+ DeleteDocumentRequest request =
+ DeleteDocumentRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ deleteDocument(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a document. Returns NOT_FOUND if the document does not exist.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+ * String name =
+ * DocumentName.ofProjectLocationDocumentName("[PROJECT]", "[LOCATION]", "[DOCUMENT]")
+ * .toString();
+ * documentServiceClient.deleteDocument(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the document to delete. Format:
+ * projects/{project_number}/locations/{location}/documents/{document_id} or
+ * projects/{project_number}/locations/{location}/documents/referenceId/{reference_id}.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteDocument(String name) {
+ DeleteDocumentRequest request = DeleteDocumentRequest.newBuilder().setName(name).build();
+ deleteDocument(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a document. Returns NOT_FOUND if the document does not exist.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+ * DeleteDocumentRequest request =
+ * DeleteDocumentRequest.newBuilder()
+ * .setName(
+ * DocumentName.ofProjectLocationDocumentName(
+ * "[PROJECT]", "[LOCATION]", "[DOCUMENT]")
+ * .toString())
+ * .setRequestMetadata(RequestMetadata.newBuilder().build())
+ * .build();
+ * documentServiceClient.deleteDocument(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 deleteDocument(DeleteDocumentRequest request) {
+ deleteDocumentCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a document. Returns NOT_FOUND if the document does not exist.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+ * DeleteDocumentRequest request =
+ * DeleteDocumentRequest.newBuilder()
+ * .setName(
+ * DocumentName.ofProjectLocationDocumentName(
+ * "[PROJECT]", "[LOCATION]", "[DOCUMENT]")
+ * .toString())
+ * .setRequestMetadata(RequestMetadata.newBuilder().build())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * for (SearchDocumentsResponse.MatchingDocument element :
+ * documentServiceClient.searchDocuments(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The parent, which owns this collection of documents. Format:
+ * projects/{project_number}/locations/{location}.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final SearchDocumentsPagedResponse searchDocuments(LocationName parent) {
+ SearchDocumentsRequest request =
+ SearchDocumentsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return searchDocuments(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Searches for documents using provided
+ * [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest]. This call
+ * only returns documents that the caller has permission to search against.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * for (SearchDocumentsResponse.MatchingDocument element :
+ * documentServiceClient.searchDocuments(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The parent, which owns this collection of documents. Format:
+ * projects/{project_number}/locations/{location}.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final SearchDocumentsPagedResponse searchDocuments(String parent) {
+ SearchDocumentsRequest request = SearchDocumentsRequest.newBuilder().setParent(parent).build();
+ return searchDocuments(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Searches for documents using provided
+ * [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest]. This call
+ * only returns documents that the caller has permission to search against.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+ * SearchDocumentsRequest request =
+ * SearchDocumentsRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setRequestMetadata(RequestMetadata.newBuilder().build())
+ * .setDocumentQuery(DocumentQuery.newBuilder().build())
+ * .setOffset(-1019779949)
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setOrderBy("orderBy-1207110587")
+ * .addAllHistogramQueries(new ArrayList
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final SearchDocumentsPagedResponse searchDocuments(SearchDocumentsRequest request) {
+ return searchDocumentsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Searches for documents using provided
+ * [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest]. This call
+ * only returns documents that the caller has permission to search against.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+ * SearchDocumentsRequest request =
+ * SearchDocumentsRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setRequestMetadata(RequestMetadata.newBuilder().build())
+ * .setDocumentQuery(DocumentQuery.newBuilder().build())
+ * .setOffset(-1019779949)
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setOrderBy("orderBy-1207110587")
+ * .addAllHistogramQueries(new ArrayList
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+ * SearchDocumentsRequest request =
+ * SearchDocumentsRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setRequestMetadata(RequestMetadata.newBuilder().build())
+ * .setDocumentQuery(DocumentQuery.newBuilder().build())
+ * .setOffset(-1019779949)
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setOrderBy("orderBy-1207110587")
+ * .addAllHistogramQueries(new ArrayList
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+ * String resource = "resource-341064690";
+ * FetchAclResponse response = documentServiceClient.fetchAcl(resource);
+ * }
+ * }
+ *
+ * @param resource Required. REQUIRED: The resource for which the policy is being requested.
+ * Format for document:
+ * projects/{project_number}/locations/{location}/documents/{document_id}. Format for project:
+ * projects/{project_number}.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final FetchAclResponse fetchAcl(String resource) {
+ FetchAclRequest request = FetchAclRequest.newBuilder().setResource(resource).build();
+ return fetchAcl(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets the access control policy for a resource. Returns NOT_FOUND error if the resource does not
+ * exist. Returns an empty policy if the resource exists but does not have a policy set.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+ * FetchAclRequest request =
+ * FetchAclRequest.newBuilder()
+ * .setResource("resource-341064690")
+ * .setRequestMetadata(RequestMetadata.newBuilder().build())
+ * .setProjectOwner(true)
+ * .build();
+ * FetchAclResponse response = documentServiceClient.fetchAcl(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 FetchAclResponse fetchAcl(FetchAclRequest request) {
+ return fetchAclCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets the access control policy for a resource. Returns NOT_FOUND error if the resource does not
+ * exist. Returns an empty policy if the resource exists but does not have a policy set.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+ * FetchAclRequest request =
+ * FetchAclRequest.newBuilder()
+ * .setResource("resource-341064690")
+ * .setRequestMetadata(RequestMetadata.newBuilder().build())
+ * .setProjectOwner(true)
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+ * String resource = "resource-341064690";
+ * Policy policy = Policy.newBuilder().build();
+ * SetAclResponse response = documentServiceClient.setAcl(resource, policy);
+ * }
+ * }
+ *
+ * @param resource Required. REQUIRED: The resource for which the policy is being requested.
+ * Format for document:
+ * projects/{project_number}/locations/{location}/documents/{document_id}. Format for project:
+ * projects/{project_number}.
+ * @param policy Required. REQUIRED: The complete policy to be applied to the `resource`. The size
+ * of the policy is limited to a few 10s of KB.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final SetAclResponse setAcl(String resource, Policy policy) {
+ SetAclRequest request =
+ SetAclRequest.newBuilder().setResource(resource).setPolicy(policy).build();
+ return setAcl(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Sets the access control policy for a resource. Replaces any existing policy.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+ * SetAclRequest request =
+ * SetAclRequest.newBuilder()
+ * .setResource("resource-341064690")
+ * .setPolicy(Policy.newBuilder().build())
+ * .setRequestMetadata(RequestMetadata.newBuilder().build())
+ * .setProjectOwner(true)
+ * .build();
+ * SetAclResponse response = documentServiceClient.setAcl(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 SetAclResponse setAcl(SetAclRequest request) {
+ return setAclCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Sets the access control policy for a resource. Replaces any existing policy.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+ * SetAclRequest request =
+ * SetAclRequest.newBuilder()
+ * .setResource("resource-341064690")
+ * .setPolicy(Policy.newBuilder().build())
+ * .setRequestMetadata(RequestMetadata.newBuilder().build())
+ * .setProjectOwner(true)
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable
+ *
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * DocumentServiceSettings.Builder documentServiceSettingsBuilder =
+ * DocumentServiceSettings.newBuilder();
+ * documentServiceSettingsBuilder
+ * .createDocumentSettings()
+ * .setRetrySettings(
+ * documentServiceSettingsBuilder.createDocumentSettings().getRetrySettings().toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30))
+ * .build());
+ * DocumentServiceSettings documentServiceSettings = documentServiceSettingsBuilder.build();
+ * }
+ */
+@Generated("by gapic-generator-java")
+public class DocumentServiceSettings extends ClientSettings{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (RuleSetServiceClient ruleSetServiceClient = RuleSetServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * RuleSet ruleSet = RuleSet.newBuilder().build();
+ * RuleSet response = ruleSetServiceClient.createRuleSet(parent, ruleSet);
+ * }
+ * }
+ *
+ *
+ *
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * RuleSetServiceSettings ruleSetServiceSettings =
+ * RuleSetServiceSettings.newBuilder()
+ * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ * .build();
+ * RuleSetServiceClient ruleSetServiceClient = RuleSetServiceClient.create(ruleSetServiceSettings);
+ * }
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * RuleSetServiceSettings ruleSetServiceSettings =
+ * RuleSetServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * RuleSetServiceClient ruleSetServiceClient = RuleSetServiceClient.create(ruleSetServiceSettings);
+ * }
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * RuleSetServiceSettings ruleSetServiceSettings =
+ * RuleSetServiceSettings.newBuilder()
+ * .setTransportChannelProvider(
+ * RuleSetServiceSettings.defaultHttpJsonTransportProviderBuilder().build())
+ * .build();
+ * RuleSetServiceClient ruleSetServiceClient = RuleSetServiceClient.create(ruleSetServiceSettings);
+ * }
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (RuleSetServiceClient ruleSetServiceClient = RuleSetServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * RuleSet ruleSet = RuleSet.newBuilder().build();
+ * RuleSet response = ruleSetServiceClient.createRuleSet(parent, ruleSet);
+ * }
+ * }
+ *
+ * @param parent Required. The parent name. Format:
+ * projects/{project_number}/locations/{location}.
+ * @param ruleSet Required. The rule set to create.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final RuleSet createRuleSet(LocationName parent, RuleSet ruleSet) {
+ CreateRuleSetRequest request =
+ CreateRuleSetRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setRuleSet(ruleSet)
+ .build();
+ return createRuleSet(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a ruleset.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (RuleSetServiceClient ruleSetServiceClient = RuleSetServiceClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * RuleSet ruleSet = RuleSet.newBuilder().build();
+ * RuleSet response = ruleSetServiceClient.createRuleSet(parent, ruleSet);
+ * }
+ * }
+ *
+ * @param parent Required. The parent name. Format:
+ * projects/{project_number}/locations/{location}.
+ * @param ruleSet Required. The rule set to create.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final RuleSet createRuleSet(String parent, RuleSet ruleSet) {
+ CreateRuleSetRequest request =
+ CreateRuleSetRequest.newBuilder().setParent(parent).setRuleSet(ruleSet).build();
+ return createRuleSet(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a ruleset.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (RuleSetServiceClient ruleSetServiceClient = RuleSetServiceClient.create()) {
+ * CreateRuleSetRequest request =
+ * CreateRuleSetRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setRuleSet(RuleSet.newBuilder().build())
+ * .build();
+ * RuleSet response = ruleSetServiceClient.createRuleSet(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 RuleSet createRuleSet(CreateRuleSetRequest request) {
+ return createRuleSetCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a ruleset.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (RuleSetServiceClient ruleSetServiceClient = RuleSetServiceClient.create()) {
+ * CreateRuleSetRequest request =
+ * CreateRuleSetRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setRuleSet(RuleSet.newBuilder().build())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (RuleSetServiceClient ruleSetServiceClient = RuleSetServiceClient.create()) {
+ * RuleSetName name = RuleSetName.of("[PROJECT]", "[LOCATION]", "[RULE_SET]");
+ * RuleSet response = ruleSetServiceClient.getRuleSet(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the rule set to retrieve. Format:
+ * projects/{project_number}/locations/{location}/ruleSets/{rule_set_id}.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final RuleSet getRuleSet(RuleSetName name) {
+ GetRuleSetRequest request =
+ GetRuleSetRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getRuleSet(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets a ruleset. Returns NOT_FOUND if the ruleset does not exist.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (RuleSetServiceClient ruleSetServiceClient = RuleSetServiceClient.create()) {
+ * String name = RuleSetName.of("[PROJECT]", "[LOCATION]", "[RULE_SET]").toString();
+ * RuleSet response = ruleSetServiceClient.getRuleSet(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the rule set to retrieve. Format:
+ * projects/{project_number}/locations/{location}/ruleSets/{rule_set_id}.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final RuleSet getRuleSet(String name) {
+ GetRuleSetRequest request = GetRuleSetRequest.newBuilder().setName(name).build();
+ return getRuleSet(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets a ruleset. Returns NOT_FOUND if the ruleset does not exist.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (RuleSetServiceClient ruleSetServiceClient = RuleSetServiceClient.create()) {
+ * GetRuleSetRequest request =
+ * GetRuleSetRequest.newBuilder()
+ * .setName(RuleSetName.of("[PROJECT]", "[LOCATION]", "[RULE_SET]").toString())
+ * .build();
+ * RuleSet response = ruleSetServiceClient.getRuleSet(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 RuleSet getRuleSet(GetRuleSetRequest request) {
+ return getRuleSetCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets a ruleset. Returns NOT_FOUND if the ruleset does not exist.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (RuleSetServiceClient ruleSetServiceClient = RuleSetServiceClient.create()) {
+ * GetRuleSetRequest request =
+ * GetRuleSetRequest.newBuilder()
+ * .setName(RuleSetName.of("[PROJECT]", "[LOCATION]", "[RULE_SET]").toString())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (RuleSetServiceClient ruleSetServiceClient = RuleSetServiceClient.create()) {
+ * RuleSetName name = RuleSetName.of("[PROJECT]", "[LOCATION]", "[RULE_SET]");
+ * RuleSet ruleSet = RuleSet.newBuilder().build();
+ * RuleSet response = ruleSetServiceClient.updateRuleSet(name, ruleSet);
+ * }
+ * }
+ *
+ * @param name Required. The name of the rule set to update. Format:
+ * projects/{project_number}/locations/{location}/ruleSets/{rule_set_id}.
+ * @param ruleSet Required. The rule set to update.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final RuleSet updateRuleSet(RuleSetName name, RuleSet ruleSet) {
+ UpdateRuleSetRequest request =
+ UpdateRuleSetRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .setRuleSet(ruleSet)
+ .build();
+ return updateRuleSet(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates a ruleset. Returns INVALID_ARGUMENT if the name of the ruleset is non-empty and does
+ * not equal the existing name.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (RuleSetServiceClient ruleSetServiceClient = RuleSetServiceClient.create()) {
+ * String name = RuleSetName.of("[PROJECT]", "[LOCATION]", "[RULE_SET]").toString();
+ * RuleSet ruleSet = RuleSet.newBuilder().build();
+ * RuleSet response = ruleSetServiceClient.updateRuleSet(name, ruleSet);
+ * }
+ * }
+ *
+ * @param name Required. The name of the rule set to update. Format:
+ * projects/{project_number}/locations/{location}/ruleSets/{rule_set_id}.
+ * @param ruleSet Required. The rule set to update.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final RuleSet updateRuleSet(String name, RuleSet ruleSet) {
+ UpdateRuleSetRequest request =
+ UpdateRuleSetRequest.newBuilder().setName(name).setRuleSet(ruleSet).build();
+ return updateRuleSet(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates a ruleset. Returns INVALID_ARGUMENT if the name of the ruleset is non-empty and does
+ * not equal the existing name.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (RuleSetServiceClient ruleSetServiceClient = RuleSetServiceClient.create()) {
+ * UpdateRuleSetRequest request =
+ * UpdateRuleSetRequest.newBuilder()
+ * .setName(RuleSetName.of("[PROJECT]", "[LOCATION]", "[RULE_SET]").toString())
+ * .setRuleSet(RuleSet.newBuilder().build())
+ * .build();
+ * RuleSet response = ruleSetServiceClient.updateRuleSet(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 RuleSet updateRuleSet(UpdateRuleSetRequest request) {
+ return updateRuleSetCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates a ruleset. Returns INVALID_ARGUMENT if the name of the ruleset is non-empty and does
+ * not equal the existing name.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (RuleSetServiceClient ruleSetServiceClient = RuleSetServiceClient.create()) {
+ * UpdateRuleSetRequest request =
+ * UpdateRuleSetRequest.newBuilder()
+ * .setName(RuleSetName.of("[PROJECT]", "[LOCATION]", "[RULE_SET]").toString())
+ * .setRuleSet(RuleSet.newBuilder().build())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (RuleSetServiceClient ruleSetServiceClient = RuleSetServiceClient.create()) {
+ * RuleSetName name = RuleSetName.of("[PROJECT]", "[LOCATION]", "[RULE_SET]");
+ * ruleSetServiceClient.deleteRuleSet(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the rule set to delete. Format:
+ * projects/{project_number}/locations/{location}/ruleSets/{rule_set_id}.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteRuleSet(RuleSetName name) {
+ DeleteRuleSetRequest request =
+ DeleteRuleSetRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ deleteRuleSet(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a ruleset. Returns NOT_FOUND if the document does not exist.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (RuleSetServiceClient ruleSetServiceClient = RuleSetServiceClient.create()) {
+ * String name = RuleSetName.of("[PROJECT]", "[LOCATION]", "[RULE_SET]").toString();
+ * ruleSetServiceClient.deleteRuleSet(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the rule set to delete. Format:
+ * projects/{project_number}/locations/{location}/ruleSets/{rule_set_id}.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteRuleSet(String name) {
+ DeleteRuleSetRequest request = DeleteRuleSetRequest.newBuilder().setName(name).build();
+ deleteRuleSet(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a ruleset. Returns NOT_FOUND if the document does not exist.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (RuleSetServiceClient ruleSetServiceClient = RuleSetServiceClient.create()) {
+ * DeleteRuleSetRequest request =
+ * DeleteRuleSetRequest.newBuilder()
+ * .setName(RuleSetName.of("[PROJECT]", "[LOCATION]", "[RULE_SET]").toString())
+ * .build();
+ * ruleSetServiceClient.deleteRuleSet(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 deleteRuleSet(DeleteRuleSetRequest request) {
+ deleteRuleSetCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a ruleset. Returns NOT_FOUND if the document does not exist.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (RuleSetServiceClient ruleSetServiceClient = RuleSetServiceClient.create()) {
+ * DeleteRuleSetRequest request =
+ * DeleteRuleSetRequest.newBuilder()
+ * .setName(RuleSetName.of("[PROJECT]", "[LOCATION]", "[RULE_SET]").toString())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (RuleSetServiceClient ruleSetServiceClient = RuleSetServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * for (RuleSet element : ruleSetServiceClient.listRuleSets(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The parent, which owns this collection of document. Format:
+ * projects/{project_number}/locations/{location}.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListRuleSetsPagedResponse listRuleSets(LocationName parent) {
+ ListRuleSetsRequest request =
+ ListRuleSetsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listRuleSets(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists rulesets.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (RuleSetServiceClient ruleSetServiceClient = RuleSetServiceClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * for (RuleSet element : ruleSetServiceClient.listRuleSets(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The parent, which owns this collection of document. Format:
+ * projects/{project_number}/locations/{location}.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListRuleSetsPagedResponse listRuleSets(String parent) {
+ ListRuleSetsRequest request = ListRuleSetsRequest.newBuilder().setParent(parent).build();
+ return listRuleSets(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists rulesets.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (RuleSetServiceClient ruleSetServiceClient = RuleSetServiceClient.create()) {
+ * ListRuleSetsRequest request =
+ * ListRuleSetsRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * for (RuleSet element : ruleSetServiceClient.listRuleSets(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 ListRuleSetsPagedResponse listRuleSets(ListRuleSetsRequest request) {
+ return listRuleSetsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists rulesets.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (RuleSetServiceClient ruleSetServiceClient = RuleSetServiceClient.create()) {
+ * ListRuleSetsRequest request =
+ * ListRuleSetsRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (RuleSetServiceClient ruleSetServiceClient = RuleSetServiceClient.create()) {
+ * ListRuleSetsRequest request =
+ * ListRuleSetsRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * while (true) {
+ * ListRuleSetsResponse response = ruleSetServiceClient.listRuleSetsCallable().call(request);
+ * for (RuleSet element : response.getRuleSetsList()) {
+ * // 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 and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * RuleSetServiceSettings.Builder ruleSetServiceSettingsBuilder =
+ * RuleSetServiceSettings.newBuilder();
+ * ruleSetServiceSettingsBuilder
+ * .createRuleSetSettings()
+ * .setRetrySettings(
+ * ruleSetServiceSettingsBuilder.createRuleSetSettings().getRetrySettings().toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30))
+ * .build());
+ * RuleSetServiceSettings ruleSetServiceSettings = ruleSetServiceSettingsBuilder.build();
+ * }
+ */
+@Generated("by gapic-generator-java")
+public class RuleSetServiceSettings extends ClientSettings{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SynonymSetServiceClient synonymSetServiceClient = SynonymSetServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * SynonymSet synonymSet = SynonymSet.newBuilder().build();
+ * SynonymSet response = synonymSetServiceClient.createSynonymSet(parent, synonymSet);
+ * }
+ * }
+ *
+ *
+ *
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SynonymSetServiceSettings synonymSetServiceSettings =
+ * SynonymSetServiceSettings.newBuilder()
+ * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ * .build();
+ * SynonymSetServiceClient synonymSetServiceClient =
+ * SynonymSetServiceClient.create(synonymSetServiceSettings);
+ * }
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SynonymSetServiceSettings synonymSetServiceSettings =
+ * SynonymSetServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * SynonymSetServiceClient synonymSetServiceClient =
+ * SynonymSetServiceClient.create(synonymSetServiceSettings);
+ * }
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SynonymSetServiceSettings synonymSetServiceSettings =
+ * SynonymSetServiceSettings.newBuilder()
+ * .setTransportChannelProvider(
+ * SynonymSetServiceSettings.defaultHttpJsonTransportProviderBuilder().build())
+ * .build();
+ * SynonymSetServiceClient synonymSetServiceClient =
+ * SynonymSetServiceClient.create(synonymSetServiceSettings);
+ * }
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SynonymSetServiceClient synonymSetServiceClient = SynonymSetServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * SynonymSet synonymSet = SynonymSet.newBuilder().build();
+ * SynonymSet response = synonymSetServiceClient.createSynonymSet(parent, synonymSet);
+ * }
+ * }
+ *
+ * @param parent Required. The parent name. Format:
+ * projects/{project_number}/locations/{location}.
+ * @param synonymSet Required. The synonymSet to be created for a context
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final SynonymSet createSynonymSet(LocationName parent, SynonymSet synonymSet) {
+ CreateSynonymSetRequest request =
+ CreateSynonymSetRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setSynonymSet(synonymSet)
+ .build();
+ return createSynonymSet(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a SynonymSet for a single context. Throws an ALREADY_EXISTS exception if a synonymset
+ * already exists for the context.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SynonymSetServiceClient synonymSetServiceClient = SynonymSetServiceClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * SynonymSet synonymSet = SynonymSet.newBuilder().build();
+ * SynonymSet response = synonymSetServiceClient.createSynonymSet(parent, synonymSet);
+ * }
+ * }
+ *
+ * @param parent Required. The parent name. Format:
+ * projects/{project_number}/locations/{location}.
+ * @param synonymSet Required. The synonymSet to be created for a context
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final SynonymSet createSynonymSet(String parent, SynonymSet synonymSet) {
+ CreateSynonymSetRequest request =
+ CreateSynonymSetRequest.newBuilder().setParent(parent).setSynonymSet(synonymSet).build();
+ return createSynonymSet(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a SynonymSet for a single context. Throws an ALREADY_EXISTS exception if a synonymset
+ * already exists for the context.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SynonymSetServiceClient synonymSetServiceClient = SynonymSetServiceClient.create()) {
+ * CreateSynonymSetRequest request =
+ * CreateSynonymSetRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setSynonymSet(SynonymSet.newBuilder().build())
+ * .build();
+ * SynonymSet response = synonymSetServiceClient.createSynonymSet(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 SynonymSet createSynonymSet(CreateSynonymSetRequest request) {
+ return createSynonymSetCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a SynonymSet for a single context. Throws an ALREADY_EXISTS exception if a synonymset
+ * already exists for the context.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SynonymSetServiceClient synonymSetServiceClient = SynonymSetServiceClient.create()) {
+ * CreateSynonymSetRequest request =
+ * CreateSynonymSetRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setSynonymSet(SynonymSet.newBuilder().build())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SynonymSetServiceClient synonymSetServiceClient = SynonymSetServiceClient.create()) {
+ * SynonymSetName name = SynonymSetName.of("[PROJECT]", "[LOCATION]", "[CONTEXT]");
+ * SynonymSet response = synonymSetServiceClient.getSynonymSet(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the synonymSet to retrieve Format:
+ * projects/{project_number}/locations/{location}/synonymSets/{context}.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final SynonymSet getSynonymSet(SynonymSetName name) {
+ GetSynonymSetRequest request =
+ GetSynonymSetRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getSynonymSet(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets a SynonymSet for a particular context. Throws a NOT_FOUND exception if the Synonymset does
+ * not exist
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SynonymSetServiceClient synonymSetServiceClient = SynonymSetServiceClient.create()) {
+ * String name = SynonymSetName.of("[PROJECT]", "[LOCATION]", "[CONTEXT]").toString();
+ * SynonymSet response = synonymSetServiceClient.getSynonymSet(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the synonymSet to retrieve Format:
+ * projects/{project_number}/locations/{location}/synonymSets/{context}.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final SynonymSet getSynonymSet(String name) {
+ GetSynonymSetRequest request = GetSynonymSetRequest.newBuilder().setName(name).build();
+ return getSynonymSet(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets a SynonymSet for a particular context. Throws a NOT_FOUND exception if the Synonymset does
+ * not exist
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SynonymSetServiceClient synonymSetServiceClient = SynonymSetServiceClient.create()) {
+ * GetSynonymSetRequest request =
+ * GetSynonymSetRequest.newBuilder()
+ * .setName(SynonymSetName.of("[PROJECT]", "[LOCATION]", "[CONTEXT]").toString())
+ * .build();
+ * SynonymSet response = synonymSetServiceClient.getSynonymSet(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 SynonymSet getSynonymSet(GetSynonymSetRequest request) {
+ return getSynonymSetCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets a SynonymSet for a particular context. Throws a NOT_FOUND exception if the Synonymset does
+ * not exist
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SynonymSetServiceClient synonymSetServiceClient = SynonymSetServiceClient.create()) {
+ * GetSynonymSetRequest request =
+ * GetSynonymSetRequest.newBuilder()
+ * .setName(SynonymSetName.of("[PROJECT]", "[LOCATION]", "[CONTEXT]").toString())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SynonymSetServiceClient synonymSetServiceClient = SynonymSetServiceClient.create()) {
+ * SynonymSetName name = SynonymSetName.of("[PROJECT]", "[LOCATION]", "[CONTEXT]");
+ * SynonymSet synonymSet = SynonymSet.newBuilder().build();
+ * SynonymSet response = synonymSetServiceClient.updateSynonymSet(name, synonymSet);
+ * }
+ * }
+ *
+ * @param name Required. The name of the synonymSet to update Format:
+ * projects/{project_number}/locations/{location}/synonymSets/{context}.
+ * @param synonymSet Required. The synonymSet to be updated for the customer
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final SynonymSet updateSynonymSet(SynonymSetName name, SynonymSet synonymSet) {
+ UpdateSynonymSetRequest request =
+ UpdateSynonymSetRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .setSynonymSet(synonymSet)
+ .build();
+ return updateSynonymSet(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Remove the existing SynonymSet for the context and replaces it with a new one. Throws a
+ * NOT_FOUND exception if the SynonymSet is not found.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SynonymSetServiceClient synonymSetServiceClient = SynonymSetServiceClient.create()) {
+ * String name = SynonymSetName.of("[PROJECT]", "[LOCATION]", "[CONTEXT]").toString();
+ * SynonymSet synonymSet = SynonymSet.newBuilder().build();
+ * SynonymSet response = synonymSetServiceClient.updateSynonymSet(name, synonymSet);
+ * }
+ * }
+ *
+ * @param name Required. The name of the synonymSet to update Format:
+ * projects/{project_number}/locations/{location}/synonymSets/{context}.
+ * @param synonymSet Required. The synonymSet to be updated for the customer
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final SynonymSet updateSynonymSet(String name, SynonymSet synonymSet) {
+ UpdateSynonymSetRequest request =
+ UpdateSynonymSetRequest.newBuilder().setName(name).setSynonymSet(synonymSet).build();
+ return updateSynonymSet(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Remove the existing SynonymSet for the context and replaces it with a new one. Throws a
+ * NOT_FOUND exception if the SynonymSet is not found.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SynonymSetServiceClient synonymSetServiceClient = SynonymSetServiceClient.create()) {
+ * UpdateSynonymSetRequest request =
+ * UpdateSynonymSetRequest.newBuilder()
+ * .setName(SynonymSetName.of("[PROJECT]", "[LOCATION]", "[CONTEXT]").toString())
+ * .setSynonymSet(SynonymSet.newBuilder().build())
+ * .build();
+ * SynonymSet response = synonymSetServiceClient.updateSynonymSet(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 SynonymSet updateSynonymSet(UpdateSynonymSetRequest request) {
+ return updateSynonymSetCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Remove the existing SynonymSet for the context and replaces it with a new one. Throws a
+ * NOT_FOUND exception if the SynonymSet is not found.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SynonymSetServiceClient synonymSetServiceClient = SynonymSetServiceClient.create()) {
+ * UpdateSynonymSetRequest request =
+ * UpdateSynonymSetRequest.newBuilder()
+ * .setName(SynonymSetName.of("[PROJECT]", "[LOCATION]", "[CONTEXT]").toString())
+ * .setSynonymSet(SynonymSet.newBuilder().build())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SynonymSetServiceClient synonymSetServiceClient = SynonymSetServiceClient.create()) {
+ * SynonymSetName name = SynonymSetName.of("[PROJECT]", "[LOCATION]", "[CONTEXT]");
+ * synonymSetServiceClient.deleteSynonymSet(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the synonymSet to delete Format:
+ * projects/{project_number}/locations/{location}/synonymSets/{context}.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteSynonymSet(SynonymSetName name) {
+ DeleteSynonymSetRequest request =
+ DeleteSynonymSetRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ deleteSynonymSet(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a SynonymSet for a given context. Throws a NOT_FOUND exception if the SynonymSet is not
+ * found.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SynonymSetServiceClient synonymSetServiceClient = SynonymSetServiceClient.create()) {
+ * String name = SynonymSetName.of("[PROJECT]", "[LOCATION]", "[CONTEXT]").toString();
+ * synonymSetServiceClient.deleteSynonymSet(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the synonymSet to delete Format:
+ * projects/{project_number}/locations/{location}/synonymSets/{context}.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteSynonymSet(String name) {
+ DeleteSynonymSetRequest request = DeleteSynonymSetRequest.newBuilder().setName(name).build();
+ deleteSynonymSet(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a SynonymSet for a given context. Throws a NOT_FOUND exception if the SynonymSet is not
+ * found.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SynonymSetServiceClient synonymSetServiceClient = SynonymSetServiceClient.create()) {
+ * DeleteSynonymSetRequest request =
+ * DeleteSynonymSetRequest.newBuilder()
+ * .setName(SynonymSetName.of("[PROJECT]", "[LOCATION]", "[CONTEXT]").toString())
+ * .build();
+ * synonymSetServiceClient.deleteSynonymSet(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 deleteSynonymSet(DeleteSynonymSetRequest request) {
+ deleteSynonymSetCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a SynonymSet for a given context. Throws a NOT_FOUND exception if the SynonymSet is not
+ * found.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SynonymSetServiceClient synonymSetServiceClient = SynonymSetServiceClient.create()) {
+ * DeleteSynonymSetRequest request =
+ * DeleteSynonymSetRequest.newBuilder()
+ * .setName(SynonymSetName.of("[PROJECT]", "[LOCATION]", "[CONTEXT]").toString())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SynonymSetServiceClient synonymSetServiceClient = SynonymSetServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * for (SynonymSet element : synonymSetServiceClient.listSynonymSets(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The parent name. Format:
+ * projects/{project_number}/locations/{location}.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListSynonymSetsPagedResponse listSynonymSets(LocationName parent) {
+ ListSynonymSetsRequest request =
+ ListSynonymSetsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listSynonymSets(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns all SynonymSets (for all contexts) for the specified location.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SynonymSetServiceClient synonymSetServiceClient = SynonymSetServiceClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * for (SynonymSet element : synonymSetServiceClient.listSynonymSets(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The parent name. Format:
+ * projects/{project_number}/locations/{location}.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListSynonymSetsPagedResponse listSynonymSets(String parent) {
+ ListSynonymSetsRequest request = ListSynonymSetsRequest.newBuilder().setParent(parent).build();
+ return listSynonymSets(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns all SynonymSets (for all contexts) for the specified location.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SynonymSetServiceClient synonymSetServiceClient = SynonymSetServiceClient.create()) {
+ * ListSynonymSetsRequest request =
+ * ListSynonymSetsRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * for (SynonymSet element : synonymSetServiceClient.listSynonymSets(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 ListSynonymSetsPagedResponse listSynonymSets(ListSynonymSetsRequest request) {
+ return listSynonymSetsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns all SynonymSets (for all contexts) for the specified location.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SynonymSetServiceClient synonymSetServiceClient = SynonymSetServiceClient.create()) {
+ * ListSynonymSetsRequest request =
+ * ListSynonymSetsRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SynonymSetServiceClient synonymSetServiceClient = SynonymSetServiceClient.create()) {
+ * ListSynonymSetsRequest request =
+ * ListSynonymSetsRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * while (true) {
+ * ListSynonymSetsResponse response =
+ * synonymSetServiceClient.listSynonymSetsCallable().call(request);
+ * for (SynonymSet element : response.getSynonymSetsList()) {
+ * // 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 and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SynonymSetServiceSettings.Builder synonymSetServiceSettingsBuilder =
+ * SynonymSetServiceSettings.newBuilder();
+ * synonymSetServiceSettingsBuilder
+ * .createSynonymSetSettings()
+ * .setRetrySettings(
+ * synonymSetServiceSettingsBuilder
+ * .createSynonymSetSettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30))
+ * .build());
+ * SynonymSetServiceSettings synonymSetServiceSettings = synonymSetServiceSettingsBuilder.build();
+ * }
+ */
+@Generated("by gapic-generator-java")
+public class SynonymSetServiceSettings extends ClientSettings{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DocumentLinkServiceClient documentLinkServiceClient = DocumentLinkServiceClient.create()) {
+ * DocumentName parent =
+ * DocumentName.ofProjectLocationDocumentName("[PROJECT]", "[LOCATION]", "[DOCUMENT]");
+ * ListLinkedTargetsResponse response = documentLinkServiceClient.listLinkedTargets(parent);
+ * }
+ * }
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DocumentSchemaServiceClient documentSchemaServiceClient =
+ * DocumentSchemaServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * DocumentSchema documentSchema = DocumentSchema.newBuilder().build();
+ * DocumentSchema response =
+ * documentSchemaServiceClient.createDocumentSchema(parent, documentSchema);
+ * }
+ * }
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * Document document = Document.newBuilder().build();
+ * CreateDocumentResponse response = documentServiceClient.createDocument(parent, document);
+ * }
+ * }
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (RuleSetServiceClient ruleSetServiceClient = RuleSetServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * RuleSet ruleSet = RuleSet.newBuilder().build();
+ * RuleSet response = ruleSetServiceClient.createRuleSet(parent, ruleSet);
+ * }
+ * }
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SynonymSetServiceClient synonymSetServiceClient = SynonymSetServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * SynonymSet synonymSet = SynonymSet.newBuilder().build();
+ * SynonymSet response = synonymSetServiceClient.createSynonymSet(parent, synonymSet);
+ * }
+ * }
+ */
+@Generated("by gapic-generator-java")
+package com.google.cloud.contentwarehouse.v1;
+
+import javax.annotation.Generated;
diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/DocumentLinkServiceStub.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/DocumentLinkServiceStub.java
new file mode 100644
index 000000000000..47c99ee2bb7c
--- /dev/null
+++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/DocumentLinkServiceStub.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2022 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.cloud.contentwarehouse.v1.stub;
+
+import static com.google.cloud.contentwarehouse.v1.DocumentLinkServiceClient.ListLinkedSourcesPagedResponse;
+
+import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest;
+import com.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest;
+import com.google.cloud.contentwarehouse.v1.DocumentLink;
+import com.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest;
+import com.google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse;
+import com.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest;
+import com.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse;
+import com.google.protobuf.Empty;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * Base stub class for the DocumentLinkService service API.
+ *
+ *
+ *
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * DocumentLinkServiceStubSettings.Builder documentLinkServiceSettingsBuilder =
+ * DocumentLinkServiceStubSettings.newBuilder();
+ * documentLinkServiceSettingsBuilder
+ * .listLinkedTargetsSettings()
+ * .setRetrySettings(
+ * documentLinkServiceSettingsBuilder
+ * .listLinkedTargetsSettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30))
+ * .build());
+ * DocumentLinkServiceStubSettings documentLinkServiceSettings =
+ * documentLinkServiceSettingsBuilder.build();
+ * }
+ */
+@Generated("by gapic-generator-java")
+public class DocumentLinkServiceStubSettings extends StubSettings
+ *
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * DocumentSchemaServiceStubSettings.Builder documentSchemaServiceSettingsBuilder =
+ * DocumentSchemaServiceStubSettings.newBuilder();
+ * documentSchemaServiceSettingsBuilder
+ * .createDocumentSchemaSettings()
+ * .setRetrySettings(
+ * documentSchemaServiceSettingsBuilder
+ * .createDocumentSchemaSettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30))
+ * .build());
+ * DocumentSchemaServiceStubSettings documentSchemaServiceSettings =
+ * documentSchemaServiceSettingsBuilder.build();
+ * }
+ */
+@Generated("by gapic-generator-java")
+public class DocumentSchemaServiceStubSettings
+ extends StubSettings
+ *
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * DocumentServiceStubSettings.Builder documentServiceSettingsBuilder =
+ * DocumentServiceStubSettings.newBuilder();
+ * documentServiceSettingsBuilder
+ * .createDocumentSettings()
+ * .setRetrySettings(
+ * documentServiceSettingsBuilder.createDocumentSettings().getRetrySettings().toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30))
+ * .build());
+ * DocumentServiceStubSettings documentServiceSettings = documentServiceSettingsBuilder.build();
+ * }
+ */
+@Generated("by gapic-generator-java")
+public class DocumentServiceStubSettings extends StubSettings