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 + + com.google.cloud + google-cloud-contentwarehouse + 0.0.0 + +``` + +If you are using Gradle without BOM, add this to your dependencies: + +```Groovy +implementation 'com.google.cloud:google-cloud-contentwarehouse:0.0.0' +``` + +If you are using SBT, add this to your dependencies: + +```Scala +libraryDependencies += "com.google.cloud" % "google-cloud-contentwarehouse" % "0.0.0" +``` + +## Authentication + +See the [Authentication][authentication] section in the base directory's README. + +## Authorization + +The client application making API calls must be granted [authorization scopes][auth-scopes] required for the desired Document AI Warehouse APIs, and the authenticated principal must have the [IAM role(s)][predefined-iam-roles] required to access GCP resources using the Document AI Warehouse API calls. + +## Getting Started + +### Prerequisites + +You will need a [Google Cloud Platform Console][developer-console] project with the Document AI Warehouse [API enabled][enable-api]. +You will need to [enable billing][enable-billing] to use Google Document AI Warehouse. +[Follow these instructions][create-project] to get your project set up. You will also need to set up the local development environment by +[installing the Google Cloud SDK][cloud-sdk] and running the following commands in command line: +`gcloud auth login` and `gcloud config set project [YOUR PROJECT ID]`. + +### Installation and setup + +You'll need to obtain the `google-cloud-contentwarehouse` library. See the [Quickstart](#quickstart) section +to add `google-cloud-contentwarehouse` as a dependency in your code. + +## About Document AI Warehouse + + +[Document AI Warehouse][product-docs] Document AI Warehouse is an integrated cloud-native GCP platform to store, search, organize, govern and analyze documents and their structured metadata. + +See the [Document AI Warehouse client library docs][javadocs] to learn how to +use this Document AI Warehouse Client Library. + + + + + + +## Troubleshooting + +To get help, follow the instructions in the [shared Troubleshooting document][troubleshooting]. + +## Transport + +Document AI Warehouse uses gRPC for the transport layer. + +## Supported Java Versions + +Java 8 or above is required for using this client. + +Google's Java client libraries, +[Google Cloud Client Libraries][cloudlibs] +and +[Google Cloud API Libraries][apilibs], +follow the +[Oracle Java SE support roadmap][oracle] +(see the Oracle Java SE Product Releases section). + +### For new development + +In general, new feature development occurs with support for the lowest Java +LTS version covered by Oracle's Premier Support (which typically lasts 5 years +from initial General Availability). If the minimum required JVM for a given +library is changed, it is accompanied by a [semver][semver] major release. + +Java 11 and (in September 2021) Java 17 are the best choices for new +development. + +### Keeping production systems current + +Google tests its client libraries with all current LTS versions covered by +Oracle's Extended Support (which typically lasts 8 years from initial +General Availability). + +#### Legacy support + +Google's client libraries support legacy versions of Java runtimes with long +term stable libraries that don't receive feature updates on a best efforts basis +as it may not be possible to backport all patches. + +Google provides updates on a best efforts basis to apps that continue to use +Java 7, though apps might need to upgrade to current versions of the library +that supports their JVM. + +#### Where to find specific information + +The latest versions and the supported Java versions are identified on +the individual GitHub repository `github.com/GoogleAPIs/java-SERVICENAME` +and on [google-cloud-java][g-c-j]. + +## Versioning + + +This library follows [Semantic Versioning](http://semver.org/). + + +It is currently in major version zero (``0.y.z``), which means that anything may change at any time +and the public API should not be considered stable. + + +## Contributing + + +Contributions to this library are always welcome and highly encouraged. + +See [CONTRIBUTING][contributing] for more information how to get started. + +Please note that this project is released with a Contributor Code of Conduct. By participating in +this project you agree to abide by its terms. See [Code of Conduct][code-of-conduct] for more +information. + + +## License + +Apache 2.0 - See [LICENSE][license] for more information. + +## CI Status + +Java Version | Status +------------ | ------ +Java 8 | [![Kokoro CI][kokoro-badge-image-2]][kokoro-badge-link-2] +Java 8 OSX | [![Kokoro CI][kokoro-badge-image-3]][kokoro-badge-link-3] +Java 8 Windows | [![Kokoro CI][kokoro-badge-image-4]][kokoro-badge-link-4] +Java 11 | [![Kokoro CI][kokoro-badge-image-5]][kokoro-badge-link-5] + +Java is a registered trademark of Oracle and/or its affiliates. + +[product-docs]: https://cloud.google.com/document-warehouse/docs/overview +[javadocs]: https://cloud.google.com/java/docs/reference/google-cloud-contentwarehouse/latest/overview +[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-contentwarehouse/java7.svg +[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-contentwarehouse/java7.html +[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-contentwarehouse/java8.svg +[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-contentwarehouse/java8.html +[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-contentwarehouse/java8-osx.svg +[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-contentwarehouse/java8-osx.html +[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-contentwarehouse/java8-win.svg +[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-contentwarehouse/java8-win.html +[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-contentwarehouse/java11.svg +[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-contentwarehouse/java11.html +[stability-image]: https://img.shields.io/badge/stability-preview-yellow +[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-contentwarehouse.svg +[maven-version-link]: https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-contentwarehouse&core=gav +[authentication]: https://github.com/googleapis/google-cloud-java#authentication +[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes +[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles +[iam-policy]: https://cloud.google.com/iam/docs/overview#cloud-iam-policy +[developer-console]: https://console.developers.google.com/ +[create-project]: https://cloud.google.com/resource-manager/docs/creating-managing-projects +[cloud-sdk]: https://cloud.google.com/sdk/ +[troubleshooting]: https://github.com/googleapis/google-cloud-common/blob/main/troubleshooting/readme.md#troubleshooting +[contributing]: https://github.com/googleapis/java-contentwarehouse/blob/main/CONTRIBUTING.md +[code-of-conduct]: https://github.com/googleapis/java-contentwarehouse/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[license]: https://github.com/googleapis/java-contentwarehouse/blob/main/LICENSE +[enable-billing]: https://cloud.google.com/apis/docs/getting-started#enabling_billing +[enable-api]: https://console.cloud.google.com/flows/enableapi?apiid=contentwarehouse.googleapis.com +[libraries-bom]: https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google-Cloud-Platform-Libraries-BOM +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png + +[semver]: https://semver.org/ +[cloudlibs]: https://cloud.google.com/apis/docs/client-libraries-explained +[apilibs]: https://cloud.google.com/apis/docs/client-libraries-explained#google_api_client_libraries +[oracle]: https://www.oracle.com/java/technologies/java-se-support-roadmap.html +[g-c-j]: http://github.com/googleapis/google-cloud-java diff --git a/java-contentwarehouse/google-cloud-contentwarehouse-bom/pom.xml b/java-contentwarehouse/google-cloud-contentwarehouse-bom/pom.xml new file mode 100644 index 000000000000..c2defdc8da57 --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse-bom/pom.xml @@ -0,0 +1,44 @@ + + + 4.0.0 + com.google.cloud + google-cloud-contentwarehouse-bom + 0.0.1-SNAPSHOT + pom + + + com.google.cloud + google-cloud-pom-parent + 0.1.1-SNAPSHOT + ../../google-cloud-pom-parent/pom.xml + + + Google Document AI Warehouse BOM + + BOM for Document AI Warehouse + + + + true + + + + + + com.google.cloud + google-cloud-contentwarehouse + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-contentwarehouse-v1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-contentwarehouse-v1 + 0.0.1-SNAPSHOT + + + + diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/pom.xml b/java-contentwarehouse/google-cloud-contentwarehouse/pom.xml new file mode 100644 index 000000000000..27870d13a781 --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/pom.xml @@ -0,0 +1,113 @@ + + + 4.0.0 + com.google.cloud + google-cloud-contentwarehouse + 0.0.1-SNAPSHOT + jar + Google Document AI Warehouse + Document AI Warehouse Document AI Warehouse is an integrated cloud-native GCP platform to store, search, organize, govern and analyze documents and their structured metadata. + + com.google.cloud + google-cloud-contentwarehouse-parent + 0.0.1-SNAPSHOT + + + google-cloud-contentwarehouse + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.api + api-common + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + + com.google.api.grpc + proto-google-cloud-contentwarehouse-v1 + + + com.google.guava + guava + + + com.google.api + gax + + + com.google.api + gax-grpc + + + com.google.api + gax-httpjson + + + com.google.api.grpc + grpc-google-common-protos + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.api.grpc + grpc-google-iam-v1 + + + org.threeten + threetenbp + + + + + junit + junit + test + + + + com.google.api.grpc + grpc-google-cloud-contentwarehouse-v1 + test + + + + com.google.api + gax + testlib + test + + + com.google.api + gax-grpc + testlib + test + + + com.google.api + gax-httpjson + testlib + test + + + \ No newline at end of file diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentLinkServiceClient.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentLinkServiceClient.java new file mode 100644 index 000000000000..3f9bde20c1fb --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentLinkServiceClient.java @@ -0,0 +1,866 @@ +/* + * 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; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.contentwarehouse.v1.stub.DocumentLinkServiceStub; +import com.google.cloud.contentwarehouse.v1.stub.DocumentLinkServiceStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: This service lets you manage document-links. Document-Links are treated as + * sub-resources under source documents. + * + *

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: + * + *

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

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

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

This class can be customized by passing in a custom instance of 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 future =
+   *       documentLinkServiceClient.listLinkedTargetsCallable().futureCall(request);
+   *   // Do something.
+   *   ListLinkedTargetsResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + listLinkedTargetsCallable() { + return stub.listLinkedTargetsCallable(); + } + + // 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()) {
+   *   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 future =
+   *       documentLinkServiceClient.listLinkedSourcesPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (DocumentLink element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listLinkedSourcesPagedCallable() { + return stub.listLinkedSourcesPagedCallable(); + } + + // 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();
+   *   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 + listLinkedSourcesCallable() { + return stub.listLinkedSourcesCallable(); + } + + // 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()) {
+   *   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 future =
+   *       documentLinkServiceClient.createDocumentLinkCallable().futureCall(request);
+   *   // Do something.
+   *   DocumentLink response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createDocumentLinkCallable() { + return stub.createDocumentLinkCallable(); + } + + // 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()) {
+   *   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 future =
+   *       documentLinkServiceClient.deleteDocumentLinkCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteDocumentLinkCallable() { + return stub.deleteDocumentLinkCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListLinkedSourcesPagedResponse + extends AbstractPagedListResponse< + ListLinkedSourcesRequest, + ListLinkedSourcesResponse, + DocumentLink, + ListLinkedSourcesPage, + ListLinkedSourcesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLinkedSourcesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLinkedSourcesPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLinkedSourcesPagedResponse(ListLinkedSourcesPage page) { + super(page, ListLinkedSourcesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLinkedSourcesPage + extends AbstractPage< + ListLinkedSourcesRequest, + ListLinkedSourcesResponse, + DocumentLink, + ListLinkedSourcesPage> { + + private ListLinkedSourcesPage( + PageContext context, + ListLinkedSourcesResponse response) { + super(context, response); + } + + private static ListLinkedSourcesPage createEmptyPage() { + return new ListLinkedSourcesPage(null, null); + } + + @Override + protected ListLinkedSourcesPage createPage( + PageContext context, + ListLinkedSourcesResponse response) { + return new ListLinkedSourcesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLinkedSourcesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLinkedSourcesRequest, + ListLinkedSourcesResponse, + DocumentLink, + ListLinkedSourcesPage, + ListLinkedSourcesFixedSizeCollection> { + + private ListLinkedSourcesFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLinkedSourcesFixedSizeCollection createEmptyCollection() { + return new ListLinkedSourcesFixedSizeCollection(null, 0); + } + + @Override + protected ListLinkedSourcesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLinkedSourcesFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentLinkServiceSettings.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentLinkServiceSettings.java new file mode 100644 index 000000000000..5543c70d3ecf --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentLinkServiceSettings.java @@ -0,0 +1,249 @@ +/* + * 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; + +import static com.google.cloud.contentwarehouse.v1.DocumentLinkServiceClient.ListLinkedSourcesPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.contentwarehouse.v1.stub.DocumentLinkServiceStubSettings; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link DocumentLinkServiceClient}. + * + *

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

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

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

For example, to set the total timeout of 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 { + + /** Returns the object with the settings used for calls to listLinkedTargets. */ + public UnaryCallSettings + listLinkedTargetsSettings() { + return ((DocumentLinkServiceStubSettings) getStubSettings()).listLinkedTargetsSettings(); + } + + /** Returns the object with the settings used for calls to listLinkedSources. */ + public PagedCallSettings< + ListLinkedSourcesRequest, ListLinkedSourcesResponse, ListLinkedSourcesPagedResponse> + listLinkedSourcesSettings() { + return ((DocumentLinkServiceStubSettings) getStubSettings()).listLinkedSourcesSettings(); + } + + /** Returns the object with the settings used for calls to createDocumentLink. */ + public UnaryCallSettings createDocumentLinkSettings() { + return ((DocumentLinkServiceStubSettings) getStubSettings()).createDocumentLinkSettings(); + } + + /** Returns the object with the settings used for calls to deleteDocumentLink. */ + public UnaryCallSettings deleteDocumentLinkSettings() { + return ((DocumentLinkServiceStubSettings) getStubSettings()).deleteDocumentLinkSettings(); + } + + public static final DocumentLinkServiceSettings create(DocumentLinkServiceStubSettings stub) + throws IOException { + return new DocumentLinkServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return DocumentLinkServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return DocumentLinkServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DocumentLinkServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return DocumentLinkServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return DocumentLinkServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return DocumentLinkServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return DocumentLinkServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return DocumentLinkServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + @BetaApi + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected DocumentLinkServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for DocumentLinkServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(DocumentLinkServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(DocumentLinkServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(DocumentLinkServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(DocumentLinkServiceStubSettings.newBuilder()); + } + + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(DocumentLinkServiceStubSettings.newHttpJsonBuilder()); + } + + public DocumentLinkServiceStubSettings.Builder getStubSettingsBuilder() { + return ((DocumentLinkServiceStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to listLinkedTargets. */ + public UnaryCallSettings.Builder + listLinkedTargetsSettings() { + return getStubSettingsBuilder().listLinkedTargetsSettings(); + } + + /** Returns the builder for the settings used for calls to listLinkedSources. */ + public PagedCallSettings.Builder< + ListLinkedSourcesRequest, ListLinkedSourcesResponse, ListLinkedSourcesPagedResponse> + listLinkedSourcesSettings() { + return getStubSettingsBuilder().listLinkedSourcesSettings(); + } + + /** Returns the builder for the settings used for calls to createDocumentLink. */ + public UnaryCallSettings.Builder + createDocumentLinkSettings() { + return getStubSettingsBuilder().createDocumentLinkSettings(); + } + + /** Returns the builder for the settings used for calls to deleteDocumentLink. */ + public UnaryCallSettings.Builder + deleteDocumentLinkSettings() { + return getStubSettingsBuilder().deleteDocumentLinkSettings(); + } + + @Override + public DocumentLinkServiceSettings build() throws IOException { + return new DocumentLinkServiceSettings(this); + } + } +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentSchemaServiceClient.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentSchemaServiceClient.java new file mode 100644 index 000000000000..45f28516fe3e --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentSchemaServiceClient.java @@ -0,0 +1,999 @@ +/* + * 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; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.contentwarehouse.v1.stub.DocumentSchemaServiceStub; +import com.google.cloud.contentwarehouse.v1.stub.DocumentSchemaServiceStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: This service lets you manage document schema. + * + *

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 (DocumentSchemaServiceClient documentSchemaServiceClient =
+ *     DocumentSchemaServiceClient.create()) {
+ *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ *   DocumentSchema documentSchema = DocumentSchema.newBuilder().build();
+ *   DocumentSchema response =
+ *       documentSchemaServiceClient.createDocumentSchema(parent, documentSchema);
+ * }
+ * }
+ * + *

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: + * + *

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

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

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

This class can be customized by passing in a custom instance of DocumentSchemaServiceSettings + * 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
+ * DocumentSchemaServiceSettings documentSchemaServiceSettings =
+ *     DocumentSchemaServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * DocumentSchemaServiceClient documentSchemaServiceClient =
+ *     DocumentSchemaServiceClient.create(documentSchemaServiceSettings);
+ * }
+ * + *

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
+ * DocumentSchemaServiceSettings documentSchemaServiceSettings =
+ *     DocumentSchemaServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * DocumentSchemaServiceClient documentSchemaServiceClient =
+ *     DocumentSchemaServiceClient.create(documentSchemaServiceSettings);
+ * }
+ * + *

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
+ * DocumentSchemaServiceSettings documentSchemaServiceSettings =
+ *     DocumentSchemaServiceSettings.newBuilder()
+ *         .setTransportChannelProvider(
+ *             DocumentSchemaServiceSettings.defaultHttpJsonTransportProviderBuilder().build())
+ *         .build();
+ * DocumentSchemaServiceClient documentSchemaServiceClient =
+ *     DocumentSchemaServiceClient.create(documentSchemaServiceSettings);
+ * }
+ * + *

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: + * + *

{@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. + * + *

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 (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. + * + *

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 (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. + * + *

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 (DocumentSchemaServiceClient documentSchemaServiceClient =
+   *     DocumentSchemaServiceClient.create()) {
+   *   CreateDocumentSchemaRequest request =
+   *       CreateDocumentSchemaRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setDocumentSchema(DocumentSchema.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       documentSchemaServiceClient.createDocumentSchemaCallable().futureCall(request);
+   *   // Do something.
+   *   DocumentSchema response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + createDocumentSchemaCallable() { + return stub.createDocumentSchemaCallable(); + } + + // 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. + * + *

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 (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. + * + *

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 (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. + * + *

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 (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. + * + *

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 (DocumentSchemaServiceClient documentSchemaServiceClient =
+   *     DocumentSchemaServiceClient.create()) {
+   *   UpdateDocumentSchemaRequest request =
+   *       UpdateDocumentSchemaRequest.newBuilder()
+   *           .setName(
+   *               DocumentSchemaName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT_SCHEMA]").toString())
+   *           .setDocumentSchema(DocumentSchema.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       documentSchemaServiceClient.updateDocumentSchemaCallable().futureCall(request);
+   *   // Do something.
+   *   DocumentSchema response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + updateDocumentSchemaCallable() { + return stub.updateDocumentSchemaCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a document schema. Returns NOT_FOUND if the document schema does not exist. + * + *

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 (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. + * + *

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 (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. + * + *

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 (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. + * + *

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 (DocumentSchemaServiceClient documentSchemaServiceClient =
+   *     DocumentSchemaServiceClient.create()) {
+   *   GetDocumentSchemaRequest request =
+   *       GetDocumentSchemaRequest.newBuilder()
+   *           .setName(
+   *               DocumentSchemaName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT_SCHEMA]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       documentSchemaServiceClient.getDocumentSchemaCallable().futureCall(request);
+   *   // Do something.
+   *   DocumentSchema response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getDocumentSchemaCallable() { + return stub.getDocumentSchemaCallable(); + } + + // 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. + * + *

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 (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. + * + *

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 (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. + * + *

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 (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. + * + *

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 (DocumentSchemaServiceClient documentSchemaServiceClient =
+   *     DocumentSchemaServiceClient.create()) {
+   *   DeleteDocumentSchemaRequest request =
+   *       DeleteDocumentSchemaRequest.newBuilder()
+   *           .setName(
+   *               DocumentSchemaName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT_SCHEMA]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       documentSchemaServiceClient.deleteDocumentSchemaCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteDocumentSchemaCallable() { + return stub.deleteDocumentSchemaCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists document schemas. + * + *

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 (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. + * + *

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 (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. + * + *

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 (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. + * + *

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 (DocumentSchemaServiceClient documentSchemaServiceClient =
+   *     DocumentSchemaServiceClient.create()) {
+   *   ListDocumentSchemasRequest request =
+   *       ListDocumentSchemasRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       documentSchemaServiceClient.listDocumentSchemasPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (DocumentSchema element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listDocumentSchemasPagedCallable() { + return stub.listDocumentSchemasPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists document schemas. + * + *

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 (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 + listDocumentSchemasCallable() { + return stub.listDocumentSchemasCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListDocumentSchemasPagedResponse + extends AbstractPagedListResponse< + ListDocumentSchemasRequest, + ListDocumentSchemasResponse, + DocumentSchema, + ListDocumentSchemasPage, + ListDocumentSchemasFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListDocumentSchemasPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListDocumentSchemasPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListDocumentSchemasPagedResponse(ListDocumentSchemasPage page) { + super(page, ListDocumentSchemasFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListDocumentSchemasPage + extends AbstractPage< + ListDocumentSchemasRequest, + ListDocumentSchemasResponse, + DocumentSchema, + ListDocumentSchemasPage> { + + private ListDocumentSchemasPage( + PageContext + context, + ListDocumentSchemasResponse response) { + super(context, response); + } + + private static ListDocumentSchemasPage createEmptyPage() { + return new ListDocumentSchemasPage(null, null); + } + + @Override + protected ListDocumentSchemasPage createPage( + PageContext + context, + ListDocumentSchemasResponse response) { + return new ListDocumentSchemasPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListDocumentSchemasFixedSizeCollection + extends AbstractFixedSizeCollection< + ListDocumentSchemasRequest, + ListDocumentSchemasResponse, + DocumentSchema, + ListDocumentSchemasPage, + ListDocumentSchemasFixedSizeCollection> { + + private ListDocumentSchemasFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListDocumentSchemasFixedSizeCollection createEmptyCollection() { + return new ListDocumentSchemasFixedSizeCollection(null, 0); + } + + @Override + protected ListDocumentSchemasFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListDocumentSchemasFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentSchemaServiceSettings.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentSchemaServiceSettings.java new file mode 100644 index 000000000000..bef66257a33e --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentSchemaServiceSettings.java @@ -0,0 +1,264 @@ +/* + * 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; + +import static com.google.cloud.contentwarehouse.v1.DocumentSchemaServiceClient.ListDocumentSchemasPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.contentwarehouse.v1.stub.DocumentSchemaServiceStubSettings; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link DocumentSchemaServiceClient}. + * + *

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

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

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

For example, to set the total timeout of createDocumentSchema 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
+ * 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 { + + /** Returns the object with the settings used for calls to createDocumentSchema. */ + public UnaryCallSettings + createDocumentSchemaSettings() { + return ((DocumentSchemaServiceStubSettings) getStubSettings()).createDocumentSchemaSettings(); + } + + /** Returns the object with the settings used for calls to updateDocumentSchema. */ + public UnaryCallSettings + updateDocumentSchemaSettings() { + return ((DocumentSchemaServiceStubSettings) getStubSettings()).updateDocumentSchemaSettings(); + } + + /** Returns the object with the settings used for calls to getDocumentSchema. */ + public UnaryCallSettings getDocumentSchemaSettings() { + return ((DocumentSchemaServiceStubSettings) getStubSettings()).getDocumentSchemaSettings(); + } + + /** Returns the object with the settings used for calls to deleteDocumentSchema. */ + public UnaryCallSettings deleteDocumentSchemaSettings() { + return ((DocumentSchemaServiceStubSettings) getStubSettings()).deleteDocumentSchemaSettings(); + } + + /** Returns the object with the settings used for calls to listDocumentSchemas. */ + public PagedCallSettings< + ListDocumentSchemasRequest, ListDocumentSchemasResponse, ListDocumentSchemasPagedResponse> + listDocumentSchemasSettings() { + return ((DocumentSchemaServiceStubSettings) getStubSettings()).listDocumentSchemasSettings(); + } + + public static final DocumentSchemaServiceSettings create(DocumentSchemaServiceStubSettings stub) + throws IOException { + return new DocumentSchemaServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return DocumentSchemaServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return DocumentSchemaServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DocumentSchemaServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return DocumentSchemaServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return DocumentSchemaServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return DocumentSchemaServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return DocumentSchemaServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return DocumentSchemaServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + @BetaApi + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected DocumentSchemaServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for DocumentSchemaServiceSettings. */ + public static class Builder + extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(DocumentSchemaServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(DocumentSchemaServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(DocumentSchemaServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(DocumentSchemaServiceStubSettings.newBuilder()); + } + + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(DocumentSchemaServiceStubSettings.newHttpJsonBuilder()); + } + + public DocumentSchemaServiceStubSettings.Builder getStubSettingsBuilder() { + return ((DocumentSchemaServiceStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to createDocumentSchema. */ + public UnaryCallSettings.Builder + createDocumentSchemaSettings() { + return getStubSettingsBuilder().createDocumentSchemaSettings(); + } + + /** Returns the builder for the settings used for calls to updateDocumentSchema. */ + public UnaryCallSettings.Builder + updateDocumentSchemaSettings() { + return getStubSettingsBuilder().updateDocumentSchemaSettings(); + } + + /** Returns the builder for the settings used for calls to getDocumentSchema. */ + public UnaryCallSettings.Builder + getDocumentSchemaSettings() { + return getStubSettingsBuilder().getDocumentSchemaSettings(); + } + + /** Returns the builder for the settings used for calls to deleteDocumentSchema. */ + public UnaryCallSettings.Builder + deleteDocumentSchemaSettings() { + return getStubSettingsBuilder().deleteDocumentSchemaSettings(); + } + + /** Returns the builder for the settings used for calls to listDocumentSchemas. */ + public PagedCallSettings.Builder< + ListDocumentSchemasRequest, + ListDocumentSchemasResponse, + ListDocumentSchemasPagedResponse> + listDocumentSchemasSettings() { + return getStubSettingsBuilder().listDocumentSchemasSettings(); + } + + @Override + public DocumentSchemaServiceSettings build() throws IOException { + return new DocumentSchemaServiceSettings(this); + } + } +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentServiceClient.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentServiceClient.java new file mode 100644 index 000000000000..fe84868d3d6c --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentServiceClient.java @@ -0,0 +1,1215 @@ +/* + * 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; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.contentwarehouse.v1.stub.DocumentServiceStub; +import com.google.cloud.contentwarehouse.v1.stub.DocumentServiceStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.iam.v1.Policy; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: This service lets you manage document. + * + *

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 (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+ *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ *   Document document = Document.newBuilder().build();
+ *   CreateDocumentResponse response = documentServiceClient.createDocument(parent, document);
+ * }
+ * }
+ * + *

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: + * + *

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

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

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

This class can be customized by passing in a custom instance of DocumentServiceSettings 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
+ * DocumentServiceSettings documentServiceSettings =
+ *     DocumentServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * DocumentServiceClient documentServiceClient =
+ *     DocumentServiceClient.create(documentServiceSettings);
+ * }
+ * + *

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
+ * DocumentServiceSettings documentServiceSettings =
+ *     DocumentServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * DocumentServiceClient documentServiceClient =
+ *     DocumentServiceClient.create(documentServiceSettings);
+ * }
+ * + *

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
+ * DocumentServiceSettings documentServiceSettings =
+ *     DocumentServiceSettings.newBuilder()
+ *         .setTransportChannelProvider(
+ *             DocumentServiceSettings.defaultHttpJsonTransportProviderBuilder().build())
+ *         .build();
+ * DocumentServiceClient documentServiceClient =
+ *     DocumentServiceClient.create(documentServiceSettings);
+ * }
+ * + *

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: + * + *

{@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. + * + *

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 (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. + * + *

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 (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. + * + *

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 (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 future =
+   *       documentServiceClient.createDocumentCallable().futureCall(request);
+   *   // Do something.
+   *   CreateDocumentResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + createDocumentCallable() { + return stub.createDocumentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a document. Returns NOT_FOUND if the document does not exist. + * + *

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 (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. + * + *

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 (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. + * + *

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 (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. + * + *

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 (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+   *   GetDocumentRequest request =
+   *       GetDocumentRequest.newBuilder()
+   *           .setName(
+   *               DocumentName.ofProjectLocationDocumentName(
+   *                       "[PROJECT]", "[LOCATION]", "[DOCUMENT]")
+   *                   .toString())
+   *           .setRequestMetadata(RequestMetadata.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = documentServiceClient.getDocumentCallable().futureCall(request);
+   *   // Do something.
+   *   Document response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getDocumentCallable() { + return stub.getDocumentCallable(); + } + + // 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. + * + *

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 (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. + * + *

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 (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. + * + *

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 (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. + * + *

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 (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 future =
+   *       documentServiceClient.updateDocumentCallable().futureCall(request);
+   *   // Do something.
+   *   UpdateDocumentResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + updateDocumentCallable() { + return stub.updateDocumentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a document. Returns NOT_FOUND if the document does not exist. + * + *

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 (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. + * + *

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 (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. + * + *

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 (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. + * + *

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 (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+   *   DeleteDocumentRequest request =
+   *       DeleteDocumentRequest.newBuilder()
+   *           .setName(
+   *               DocumentName.ofProjectLocationDocumentName(
+   *                       "[PROJECT]", "[LOCATION]", "[DOCUMENT]")
+   *                   .toString())
+   *           .setRequestMetadata(RequestMetadata.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = documentServiceClient.deleteDocumentCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteDocumentCallable() { + return stub.deleteDocumentCallable(); + } + + // 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. + * + *

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 (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. + * + *

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 (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. + * + *

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 (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())
+   *           .setRequireTotalSize(true)
+   *           .setQaSizeLimit(142059404)
+   *           .build();
+   *   for (SearchDocumentsResponse.MatchingDocument element :
+   *       documentServiceClient.searchDocuments(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 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. + * + *

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 (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())
+   *           .setRequireTotalSize(true)
+   *           .setQaSizeLimit(142059404)
+   *           .build();
+   *   ApiFuture future =
+   *       documentServiceClient.searchDocumentsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (SearchDocumentsResponse.MatchingDocument element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + searchDocumentsPagedCallable() { + return stub.searchDocumentsPagedCallable(); + } + + // 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. + * + *

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 (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())
+   *           .setRequireTotalSize(true)
+   *           .setQaSizeLimit(142059404)
+   *           .build();
+   *   while (true) {
+   *     SearchDocumentsResponse response =
+   *         documentServiceClient.searchDocumentsCallable().call(request);
+   *     for (SearchDocumentsResponse.MatchingDocument element :
+   *         response.getMatchingDocumentsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + searchDocumentsCallable() { + return stub.searchDocumentsCallable(); + } + + // 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. + * + *

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 (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. + * + *

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 (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. + * + *

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 (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+   *   FetchAclRequest request =
+   *       FetchAclRequest.newBuilder()
+   *           .setResource("resource-341064690")
+   *           .setRequestMetadata(RequestMetadata.newBuilder().build())
+   *           .setProjectOwner(true)
+   *           .build();
+   *   ApiFuture future =
+   *       documentServiceClient.fetchAclCallable().futureCall(request);
+   *   // Do something.
+   *   FetchAclResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable fetchAclCallable() { + return stub.fetchAclCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy for a resource. Replaces any existing policy. + * + *

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 (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. + * + *

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 (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. + * + *

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 (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+   *   SetAclRequest request =
+   *       SetAclRequest.newBuilder()
+   *           .setResource("resource-341064690")
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .setRequestMetadata(RequestMetadata.newBuilder().build())
+   *           .setProjectOwner(true)
+   *           .build();
+   *   ApiFuture future = documentServiceClient.setAclCallable().futureCall(request);
+   *   // Do something.
+   *   SetAclResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable setAclCallable() { + return stub.setAclCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class SearchDocumentsPagedResponse + extends AbstractPagedListResponse< + SearchDocumentsRequest, + SearchDocumentsResponse, + SearchDocumentsResponse.MatchingDocument, + SearchDocumentsPage, + SearchDocumentsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext< + SearchDocumentsRequest, + SearchDocumentsResponse, + SearchDocumentsResponse.MatchingDocument> + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + SearchDocumentsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new SearchDocumentsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private SearchDocumentsPagedResponse(SearchDocumentsPage page) { + super(page, SearchDocumentsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class SearchDocumentsPage + extends AbstractPage< + SearchDocumentsRequest, + SearchDocumentsResponse, + SearchDocumentsResponse.MatchingDocument, + SearchDocumentsPage> { + + private SearchDocumentsPage( + PageContext< + SearchDocumentsRequest, + SearchDocumentsResponse, + SearchDocumentsResponse.MatchingDocument> + context, + SearchDocumentsResponse response) { + super(context, response); + } + + private static SearchDocumentsPage createEmptyPage() { + return new SearchDocumentsPage(null, null); + } + + @Override + protected SearchDocumentsPage createPage( + PageContext< + SearchDocumentsRequest, + SearchDocumentsResponse, + SearchDocumentsResponse.MatchingDocument> + context, + SearchDocumentsResponse response) { + return new SearchDocumentsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext< + SearchDocumentsRequest, + SearchDocumentsResponse, + SearchDocumentsResponse.MatchingDocument> + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class SearchDocumentsFixedSizeCollection + extends AbstractFixedSizeCollection< + SearchDocumentsRequest, + SearchDocumentsResponse, + SearchDocumentsResponse.MatchingDocument, + SearchDocumentsPage, + SearchDocumentsFixedSizeCollection> { + + private SearchDocumentsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static SearchDocumentsFixedSizeCollection createEmptyCollection() { + return new SearchDocumentsFixedSizeCollection(null, 0); + } + + @Override + protected SearchDocumentsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new SearchDocumentsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentServiceSettings.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentServiceSettings.java new file mode 100644 index 000000000000..e9621ab7ff4c --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentServiceSettings.java @@ -0,0 +1,273 @@ +/* + * 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; + +import static com.google.cloud.contentwarehouse.v1.DocumentServiceClient.SearchDocumentsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.contentwarehouse.v1.stub.DocumentServiceStubSettings; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link DocumentServiceClient}. + * + *

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

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

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

For example, to set the total timeout of 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
+ * 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 { + + /** Returns the object with the settings used for calls to createDocument. */ + public UnaryCallSettings createDocumentSettings() { + return ((DocumentServiceStubSettings) getStubSettings()).createDocumentSettings(); + } + + /** Returns the object with the settings used for calls to getDocument. */ + public UnaryCallSettings getDocumentSettings() { + return ((DocumentServiceStubSettings) getStubSettings()).getDocumentSettings(); + } + + /** Returns the object with the settings used for calls to updateDocument. */ + public UnaryCallSettings updateDocumentSettings() { + return ((DocumentServiceStubSettings) getStubSettings()).updateDocumentSettings(); + } + + /** Returns the object with the settings used for calls to deleteDocument. */ + public UnaryCallSettings deleteDocumentSettings() { + return ((DocumentServiceStubSettings) getStubSettings()).deleteDocumentSettings(); + } + + /** Returns the object with the settings used for calls to searchDocuments. */ + public PagedCallSettings< + SearchDocumentsRequest, SearchDocumentsResponse, SearchDocumentsPagedResponse> + searchDocumentsSettings() { + return ((DocumentServiceStubSettings) getStubSettings()).searchDocumentsSettings(); + } + + /** Returns the object with the settings used for calls to fetchAcl. */ + public UnaryCallSettings fetchAclSettings() { + return ((DocumentServiceStubSettings) getStubSettings()).fetchAclSettings(); + } + + /** Returns the object with the settings used for calls to setAcl. */ + public UnaryCallSettings setAclSettings() { + return ((DocumentServiceStubSettings) getStubSettings()).setAclSettings(); + } + + public static final DocumentServiceSettings create(DocumentServiceStubSettings stub) + throws IOException { + return new DocumentServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return DocumentServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return DocumentServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DocumentServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return DocumentServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return DocumentServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return DocumentServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return DocumentServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return DocumentServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + @BetaApi + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected DocumentServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for DocumentServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(DocumentServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(DocumentServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(DocumentServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(DocumentServiceStubSettings.newBuilder()); + } + + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(DocumentServiceStubSettings.newHttpJsonBuilder()); + } + + public DocumentServiceStubSettings.Builder getStubSettingsBuilder() { + return ((DocumentServiceStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to createDocument. */ + public UnaryCallSettings.Builder + createDocumentSettings() { + return getStubSettingsBuilder().createDocumentSettings(); + } + + /** Returns the builder for the settings used for calls to getDocument. */ + public UnaryCallSettings.Builder getDocumentSettings() { + return getStubSettingsBuilder().getDocumentSettings(); + } + + /** Returns the builder for the settings used for calls to updateDocument. */ + public UnaryCallSettings.Builder + updateDocumentSettings() { + return getStubSettingsBuilder().updateDocumentSettings(); + } + + /** Returns the builder for the settings used for calls to deleteDocument. */ + public UnaryCallSettings.Builder deleteDocumentSettings() { + return getStubSettingsBuilder().deleteDocumentSettings(); + } + + /** Returns the builder for the settings used for calls to searchDocuments. */ + public PagedCallSettings.Builder< + SearchDocumentsRequest, SearchDocumentsResponse, SearchDocumentsPagedResponse> + searchDocumentsSettings() { + return getStubSettingsBuilder().searchDocumentsSettings(); + } + + /** Returns the builder for the settings used for calls to fetchAcl. */ + public UnaryCallSettings.Builder fetchAclSettings() { + return getStubSettingsBuilder().fetchAclSettings(); + } + + /** Returns the builder for the settings used for calls to setAcl. */ + public UnaryCallSettings.Builder setAclSettings() { + return getStubSettingsBuilder().setAclSettings(); + } + + @Override + public DocumentServiceSettings build() throws IOException { + return new DocumentServiceSettings(this); + } + } +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/RuleSetServiceClient.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/RuleSetServiceClient.java new file mode 100644 index 000000000000..c008be657130 --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/RuleSetServiceClient.java @@ -0,0 +1,911 @@ +/* + * 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; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.contentwarehouse.v1.stub.RuleSetServiceStub; +import com.google.cloud.contentwarehouse.v1.stub.RuleSetServiceStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Service to manage customer specific RuleSets. + * + *

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 (RuleSetServiceClient ruleSetServiceClient = RuleSetServiceClient.create()) {
+ *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ *   RuleSet ruleSet = RuleSet.newBuilder().build();
+ *   RuleSet response = ruleSetServiceClient.createRuleSet(parent, ruleSet);
+ * }
+ * }
+ * + *

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: + * + *

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

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

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

This class can be customized by passing in a custom instance of RuleSetServiceSettings 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
+ * RuleSetServiceSettings ruleSetServiceSettings =
+ *     RuleSetServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * RuleSetServiceClient ruleSetServiceClient = RuleSetServiceClient.create(ruleSetServiceSettings);
+ * }
+ * + *

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
+ * RuleSetServiceSettings ruleSetServiceSettings =
+ *     RuleSetServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * RuleSetServiceClient ruleSetServiceClient = RuleSetServiceClient.create(ruleSetServiceSettings);
+ * }
+ * + *

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
+ * RuleSetServiceSettings ruleSetServiceSettings =
+ *     RuleSetServiceSettings.newBuilder()
+ *         .setTransportChannelProvider(
+ *             RuleSetServiceSettings.defaultHttpJsonTransportProviderBuilder().build())
+ *         .build();
+ * RuleSetServiceClient ruleSetServiceClient = RuleSetServiceClient.create(ruleSetServiceSettings);
+ * }
+ * + *

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: + * + *

{@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. + * + *

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 (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. + * + *

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 (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. + * + *

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 (RuleSetServiceClient ruleSetServiceClient = RuleSetServiceClient.create()) {
+   *   CreateRuleSetRequest request =
+   *       CreateRuleSetRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setRuleSet(RuleSet.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = ruleSetServiceClient.createRuleSetCallable().futureCall(request);
+   *   // Do something.
+   *   RuleSet response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createRuleSetCallable() { + return stub.createRuleSetCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a ruleset. Returns NOT_FOUND if the ruleset does not exist. + * + *

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 (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. + * + *

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 (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. + * + *

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 (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. + * + *

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 (RuleSetServiceClient ruleSetServiceClient = RuleSetServiceClient.create()) {
+   *   GetRuleSetRequest request =
+   *       GetRuleSetRequest.newBuilder()
+   *           .setName(RuleSetName.of("[PROJECT]", "[LOCATION]", "[RULE_SET]").toString())
+   *           .build();
+   *   ApiFuture future = ruleSetServiceClient.getRuleSetCallable().futureCall(request);
+   *   // Do something.
+   *   RuleSet response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getRuleSetCallable() { + return stub.getRuleSetCallable(); + } + + // 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. + * + *

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 (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. + * + *

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 (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. + * + *

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 (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. + * + *

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 (RuleSetServiceClient ruleSetServiceClient = RuleSetServiceClient.create()) {
+   *   UpdateRuleSetRequest request =
+   *       UpdateRuleSetRequest.newBuilder()
+   *           .setName(RuleSetName.of("[PROJECT]", "[LOCATION]", "[RULE_SET]").toString())
+   *           .setRuleSet(RuleSet.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = ruleSetServiceClient.updateRuleSetCallable().futureCall(request);
+   *   // Do something.
+   *   RuleSet response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateRuleSetCallable() { + return stub.updateRuleSetCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a ruleset. Returns NOT_FOUND if the document does not exist. + * + *

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 (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. + * + *

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 (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. + * + *

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 (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. + * + *

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 (RuleSetServiceClient ruleSetServiceClient = RuleSetServiceClient.create()) {
+   *   DeleteRuleSetRequest request =
+   *       DeleteRuleSetRequest.newBuilder()
+   *           .setName(RuleSetName.of("[PROJECT]", "[LOCATION]", "[RULE_SET]").toString())
+   *           .build();
+   *   ApiFuture future = ruleSetServiceClient.deleteRuleSetCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteRuleSetCallable() { + return stub.deleteRuleSetCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists rulesets. + * + *

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 (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. + * + *

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 (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. + * + *

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 (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. + * + *

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 (RuleSetServiceClient ruleSetServiceClient = RuleSetServiceClient.create()) {
+   *   ListRuleSetsRequest request =
+   *       ListRuleSetsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       ruleSetServiceClient.listRuleSetsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (RuleSet element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listRuleSetsPagedCallable() { + return stub.listRuleSetsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists rulesets. + * + *

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 (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 listRuleSetsCallable() { + return stub.listRuleSetsCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListRuleSetsPagedResponse + extends AbstractPagedListResponse< + ListRuleSetsRequest, + ListRuleSetsResponse, + RuleSet, + ListRuleSetsPage, + ListRuleSetsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListRuleSetsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListRuleSetsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListRuleSetsPagedResponse(ListRuleSetsPage page) { + super(page, ListRuleSetsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListRuleSetsPage + extends AbstractPage { + + private ListRuleSetsPage( + PageContext context, + ListRuleSetsResponse response) { + super(context, response); + } + + private static ListRuleSetsPage createEmptyPage() { + return new ListRuleSetsPage(null, null); + } + + @Override + protected ListRuleSetsPage createPage( + PageContext context, + ListRuleSetsResponse response) { + return new ListRuleSetsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListRuleSetsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListRuleSetsRequest, + ListRuleSetsResponse, + RuleSet, + ListRuleSetsPage, + ListRuleSetsFixedSizeCollection> { + + private ListRuleSetsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListRuleSetsFixedSizeCollection createEmptyCollection() { + return new ListRuleSetsFixedSizeCollection(null, 0); + } + + @Override + protected ListRuleSetsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListRuleSetsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/RuleSetServiceSettings.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/RuleSetServiceSettings.java new file mode 100644 index 000000000000..3d1ee0ff4539 --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/RuleSetServiceSettings.java @@ -0,0 +1,250 @@ +/* + * 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; + +import static com.google.cloud.contentwarehouse.v1.RuleSetServiceClient.ListRuleSetsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.contentwarehouse.v1.stub.RuleSetServiceStubSettings; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link RuleSetServiceClient}. + * + *

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

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

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

For example, to set the total timeout of createRuleSet 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
+ * 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 { + + /** Returns the object with the settings used for calls to createRuleSet. */ + public UnaryCallSettings createRuleSetSettings() { + return ((RuleSetServiceStubSettings) getStubSettings()).createRuleSetSettings(); + } + + /** Returns the object with the settings used for calls to getRuleSet. */ + public UnaryCallSettings getRuleSetSettings() { + return ((RuleSetServiceStubSettings) getStubSettings()).getRuleSetSettings(); + } + + /** Returns the object with the settings used for calls to updateRuleSet. */ + public UnaryCallSettings updateRuleSetSettings() { + return ((RuleSetServiceStubSettings) getStubSettings()).updateRuleSetSettings(); + } + + /** Returns the object with the settings used for calls to deleteRuleSet. */ + public UnaryCallSettings deleteRuleSetSettings() { + return ((RuleSetServiceStubSettings) getStubSettings()).deleteRuleSetSettings(); + } + + /** Returns the object with the settings used for calls to listRuleSets. */ + public PagedCallSettings + listRuleSetsSettings() { + return ((RuleSetServiceStubSettings) getStubSettings()).listRuleSetsSettings(); + } + + public static final RuleSetServiceSettings create(RuleSetServiceStubSettings stub) + throws IOException { + return new RuleSetServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return RuleSetServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return RuleSetServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return RuleSetServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return RuleSetServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return RuleSetServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return RuleSetServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return RuleSetServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return RuleSetServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + @BetaApi + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected RuleSetServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for RuleSetServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(RuleSetServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(RuleSetServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(RuleSetServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(RuleSetServiceStubSettings.newBuilder()); + } + + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(RuleSetServiceStubSettings.newHttpJsonBuilder()); + } + + public RuleSetServiceStubSettings.Builder getStubSettingsBuilder() { + return ((RuleSetServiceStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to createRuleSet. */ + public UnaryCallSettings.Builder createRuleSetSettings() { + return getStubSettingsBuilder().createRuleSetSettings(); + } + + /** Returns the builder for the settings used for calls to getRuleSet. */ + public UnaryCallSettings.Builder getRuleSetSettings() { + return getStubSettingsBuilder().getRuleSetSettings(); + } + + /** Returns the builder for the settings used for calls to updateRuleSet. */ + public UnaryCallSettings.Builder updateRuleSetSettings() { + return getStubSettingsBuilder().updateRuleSetSettings(); + } + + /** Returns the builder for the settings used for calls to deleteRuleSet. */ + public UnaryCallSettings.Builder deleteRuleSetSettings() { + return getStubSettingsBuilder().deleteRuleSetSettings(); + } + + /** Returns the builder for the settings used for calls to listRuleSets. */ + public PagedCallSettings.Builder< + ListRuleSetsRequest, ListRuleSetsResponse, ListRuleSetsPagedResponse> + listRuleSetsSettings() { + return getStubSettingsBuilder().listRuleSetsSettings(); + } + + @Override + public RuleSetServiceSettings build() throws IOException { + return new RuleSetServiceSettings(this); + } + } +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/SynonymSetServiceClient.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/SynonymSetServiceClient.java new file mode 100644 index 000000000000..3cd27ed185a7 --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/SynonymSetServiceClient.java @@ -0,0 +1,935 @@ +/* + * 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; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.contentwarehouse.v1.stub.SynonymSetServiceStub; +import com.google.cloud.contentwarehouse.v1.stub.SynonymSetServiceStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: A Service that manage/custom customer specified SynonymSets. + * + *

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 (SynonymSetServiceClient synonymSetServiceClient = SynonymSetServiceClient.create()) {
+ *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ *   SynonymSet synonymSet = SynonymSet.newBuilder().build();
+ *   SynonymSet response = synonymSetServiceClient.createSynonymSet(parent, synonymSet);
+ * }
+ * }
+ * + *

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: + * + *

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

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

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

This class can be customized by passing in a custom instance of SynonymSetServiceSettings 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
+ * SynonymSetServiceSettings synonymSetServiceSettings =
+ *     SynonymSetServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * SynonymSetServiceClient synonymSetServiceClient =
+ *     SynonymSetServiceClient.create(synonymSetServiceSettings);
+ * }
+ * + *

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
+ * SynonymSetServiceSettings synonymSetServiceSettings =
+ *     SynonymSetServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * SynonymSetServiceClient synonymSetServiceClient =
+ *     SynonymSetServiceClient.create(synonymSetServiceSettings);
+ * }
+ * + *

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
+ * SynonymSetServiceSettings synonymSetServiceSettings =
+ *     SynonymSetServiceSettings.newBuilder()
+ *         .setTransportChannelProvider(
+ *             SynonymSetServiceSettings.defaultHttpJsonTransportProviderBuilder().build())
+ *         .build();
+ * SynonymSetServiceClient synonymSetServiceClient =
+ *     SynonymSetServiceClient.create(synonymSetServiceSettings);
+ * }
+ * + *

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: + * + *

{@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. + * + *

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 (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. + * + *

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 (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. + * + *

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 (SynonymSetServiceClient synonymSetServiceClient = SynonymSetServiceClient.create()) {
+   *   CreateSynonymSetRequest request =
+   *       CreateSynonymSetRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setSynonymSet(SynonymSet.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       synonymSetServiceClient.createSynonymSetCallable().futureCall(request);
+   *   // Do something.
+   *   SynonymSet response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createSynonymSetCallable() { + return stub.createSynonymSetCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a SynonymSet for a particular context. Throws a NOT_FOUND exception if the Synonymset does + * not exist + * + *

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 (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 + * + *

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 (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 + * + *

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 (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 + * + *

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 (SynonymSetServiceClient synonymSetServiceClient = SynonymSetServiceClient.create()) {
+   *   GetSynonymSetRequest request =
+   *       GetSynonymSetRequest.newBuilder()
+   *           .setName(SynonymSetName.of("[PROJECT]", "[LOCATION]", "[CONTEXT]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       synonymSetServiceClient.getSynonymSetCallable().futureCall(request);
+   *   // Do something.
+   *   SynonymSet response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getSynonymSetCallable() { + return stub.getSynonymSetCallable(); + } + + // 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. + * + *

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 (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. + * + *

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 (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. + * + *

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 (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. + * + *

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 (SynonymSetServiceClient synonymSetServiceClient = SynonymSetServiceClient.create()) {
+   *   UpdateSynonymSetRequest request =
+   *       UpdateSynonymSetRequest.newBuilder()
+   *           .setName(SynonymSetName.of("[PROJECT]", "[LOCATION]", "[CONTEXT]").toString())
+   *           .setSynonymSet(SynonymSet.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       synonymSetServiceClient.updateSynonymSetCallable().futureCall(request);
+   *   // Do something.
+   *   SynonymSet response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateSynonymSetCallable() { + return stub.updateSynonymSetCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a SynonymSet for a given context. Throws a NOT_FOUND exception if the SynonymSet is not + * found. + * + *

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 (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. + * + *

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 (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. + * + *

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 (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. + * + *

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 (SynonymSetServiceClient synonymSetServiceClient = SynonymSetServiceClient.create()) {
+   *   DeleteSynonymSetRequest request =
+   *       DeleteSynonymSetRequest.newBuilder()
+   *           .setName(SynonymSetName.of("[PROJECT]", "[LOCATION]", "[CONTEXT]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       synonymSetServiceClient.deleteSynonymSetCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteSynonymSetCallable() { + return stub.deleteSynonymSetCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns all SynonymSets (for all contexts) for the specified location. + * + *

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 (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. + * + *

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 (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. + * + *

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 (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. + * + *

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 (SynonymSetServiceClient synonymSetServiceClient = SynonymSetServiceClient.create()) {
+   *   ListSynonymSetsRequest request =
+   *       ListSynonymSetsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       synonymSetServiceClient.listSynonymSetsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (SynonymSet element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listSynonymSetsPagedCallable() { + return stub.listSynonymSetsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns all SynonymSets (for all contexts) for the specified location. + * + *

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 (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 + listSynonymSetsCallable() { + return stub.listSynonymSetsCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListSynonymSetsPagedResponse + extends AbstractPagedListResponse< + ListSynonymSetsRequest, + ListSynonymSetsResponse, + SynonymSet, + ListSynonymSetsPage, + ListSynonymSetsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListSynonymSetsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListSynonymSetsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListSynonymSetsPagedResponse(ListSynonymSetsPage page) { + super(page, ListSynonymSetsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListSynonymSetsPage + extends AbstractPage< + ListSynonymSetsRequest, ListSynonymSetsResponse, SynonymSet, ListSynonymSetsPage> { + + private ListSynonymSetsPage( + PageContext context, + ListSynonymSetsResponse response) { + super(context, response); + } + + private static ListSynonymSetsPage createEmptyPage() { + return new ListSynonymSetsPage(null, null); + } + + @Override + protected ListSynonymSetsPage createPage( + PageContext context, + ListSynonymSetsResponse response) { + return new ListSynonymSetsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListSynonymSetsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListSynonymSetsRequest, + ListSynonymSetsResponse, + SynonymSet, + ListSynonymSetsPage, + ListSynonymSetsFixedSizeCollection> { + + private ListSynonymSetsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListSynonymSetsFixedSizeCollection createEmptyCollection() { + return new ListSynonymSetsFixedSizeCollection(null, 0); + } + + @Override + protected ListSynonymSetsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListSynonymSetsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/SynonymSetServiceSettings.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/SynonymSetServiceSettings.java new file mode 100644 index 000000000000..313df7c2031c --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/SynonymSetServiceSettings.java @@ -0,0 +1,256 @@ +/* + * 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; + +import static com.google.cloud.contentwarehouse.v1.SynonymSetServiceClient.ListSynonymSetsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.contentwarehouse.v1.stub.SynonymSetServiceStubSettings; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link SynonymSetServiceClient}. + * + *

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

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

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

For example, to set the total timeout of createSynonymSet 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
+ * 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 { + + /** Returns the object with the settings used for calls to createSynonymSet. */ + public UnaryCallSettings createSynonymSetSettings() { + return ((SynonymSetServiceStubSettings) getStubSettings()).createSynonymSetSettings(); + } + + /** Returns the object with the settings used for calls to getSynonymSet. */ + public UnaryCallSettings getSynonymSetSettings() { + return ((SynonymSetServiceStubSettings) getStubSettings()).getSynonymSetSettings(); + } + + /** Returns the object with the settings used for calls to updateSynonymSet. */ + public UnaryCallSettings updateSynonymSetSettings() { + return ((SynonymSetServiceStubSettings) getStubSettings()).updateSynonymSetSettings(); + } + + /** Returns the object with the settings used for calls to deleteSynonymSet. */ + public UnaryCallSettings deleteSynonymSetSettings() { + return ((SynonymSetServiceStubSettings) getStubSettings()).deleteSynonymSetSettings(); + } + + /** Returns the object with the settings used for calls to listSynonymSets. */ + public PagedCallSettings< + ListSynonymSetsRequest, ListSynonymSetsResponse, ListSynonymSetsPagedResponse> + listSynonymSetsSettings() { + return ((SynonymSetServiceStubSettings) getStubSettings()).listSynonymSetsSettings(); + } + + public static final SynonymSetServiceSettings create(SynonymSetServiceStubSettings stub) + throws IOException { + return new SynonymSetServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return SynonymSetServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return SynonymSetServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return SynonymSetServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return SynonymSetServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return SynonymSetServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return SynonymSetServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return SynonymSetServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SynonymSetServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + @BetaApi + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected SynonymSetServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for SynonymSetServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(SynonymSetServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(SynonymSetServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(SynonymSetServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(SynonymSetServiceStubSettings.newBuilder()); + } + + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(SynonymSetServiceStubSettings.newHttpJsonBuilder()); + } + + public SynonymSetServiceStubSettings.Builder getStubSettingsBuilder() { + return ((SynonymSetServiceStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to createSynonymSet. */ + public UnaryCallSettings.Builder + createSynonymSetSettings() { + return getStubSettingsBuilder().createSynonymSetSettings(); + } + + /** Returns the builder for the settings used for calls to getSynonymSet. */ + public UnaryCallSettings.Builder getSynonymSetSettings() { + return getStubSettingsBuilder().getSynonymSetSettings(); + } + + /** Returns the builder for the settings used for calls to updateSynonymSet. */ + public UnaryCallSettings.Builder + updateSynonymSetSettings() { + return getStubSettingsBuilder().updateSynonymSetSettings(); + } + + /** Returns the builder for the settings used for calls to deleteSynonymSet. */ + public UnaryCallSettings.Builder deleteSynonymSetSettings() { + return getStubSettingsBuilder().deleteSynonymSetSettings(); + } + + /** Returns the builder for the settings used for calls to listSynonymSets. */ + public PagedCallSettings.Builder< + ListSynonymSetsRequest, ListSynonymSetsResponse, ListSynonymSetsPagedResponse> + listSynonymSetsSettings() { + return getStubSettingsBuilder().listSynonymSetsSettings(); + } + + @Override + public SynonymSetServiceSettings build() throws IOException { + return new SynonymSetServiceSettings(this); + } + } +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/gapic_metadata.json b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/gapic_metadata.json new file mode 100644 index 000000000000..6a382ddcac41 --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/gapic_metadata.json @@ -0,0 +1,132 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.cloud.contentwarehouse.v1", + "libraryPackage": "com.google.cloud.contentwarehouse.v1", + "services": { + "DocumentLinkService": { + "clients": { + "grpc": { + "libraryClient": "DocumentLinkServiceClient", + "rpcs": { + "CreateDocumentLink": { + "methods": ["createDocumentLink", "createDocumentLink", "createDocumentLink", "createDocumentLinkCallable"] + }, + "DeleteDocumentLink": { + "methods": ["deleteDocumentLink", "deleteDocumentLink", "deleteDocumentLink", "deleteDocumentLinkCallable"] + }, + "ListLinkedSources": { + "methods": ["listLinkedSources", "listLinkedSources", "listLinkedSources", "listLinkedSourcesPagedCallable", "listLinkedSourcesCallable"] + }, + "ListLinkedTargets": { + "methods": ["listLinkedTargets", "listLinkedTargets", "listLinkedTargets", "listLinkedTargetsCallable"] + } + } + } + } + }, + "DocumentSchemaService": { + "clients": { + "grpc": { + "libraryClient": "DocumentSchemaServiceClient", + "rpcs": { + "CreateDocumentSchema": { + "methods": ["createDocumentSchema", "createDocumentSchema", "createDocumentSchema", "createDocumentSchemaCallable"] + }, + "DeleteDocumentSchema": { + "methods": ["deleteDocumentSchema", "deleteDocumentSchema", "deleteDocumentSchema", "deleteDocumentSchemaCallable"] + }, + "GetDocumentSchema": { + "methods": ["getDocumentSchema", "getDocumentSchema", "getDocumentSchema", "getDocumentSchemaCallable"] + }, + "ListDocumentSchemas": { + "methods": ["listDocumentSchemas", "listDocumentSchemas", "listDocumentSchemas", "listDocumentSchemasPagedCallable", "listDocumentSchemasCallable"] + }, + "UpdateDocumentSchema": { + "methods": ["updateDocumentSchema", "updateDocumentSchema", "updateDocumentSchema", "updateDocumentSchemaCallable"] + } + } + } + } + }, + "DocumentService": { + "clients": { + "grpc": { + "libraryClient": "DocumentServiceClient", + "rpcs": { + "CreateDocument": { + "methods": ["createDocument", "createDocument", "createDocument", "createDocumentCallable"] + }, + "DeleteDocument": { + "methods": ["deleteDocument", "deleteDocument", "deleteDocument", "deleteDocumentCallable"] + }, + "FetchAcl": { + "methods": ["fetchAcl", "fetchAcl", "fetchAclCallable"] + }, + "GetDocument": { + "methods": ["getDocument", "getDocument", "getDocument", "getDocumentCallable"] + }, + "SearchDocuments": { + "methods": ["searchDocuments", "searchDocuments", "searchDocuments", "searchDocumentsPagedCallable", "searchDocumentsCallable"] + }, + "SetAcl": { + "methods": ["setAcl", "setAcl", "setAclCallable"] + }, + "UpdateDocument": { + "methods": ["updateDocument", "updateDocument", "updateDocument", "updateDocumentCallable"] + } + } + } + } + }, + "RuleSetService": { + "clients": { + "grpc": { + "libraryClient": "RuleSetServiceClient", + "rpcs": { + "CreateRuleSet": { + "methods": ["createRuleSet", "createRuleSet", "createRuleSet", "createRuleSetCallable"] + }, + "DeleteRuleSet": { + "methods": ["deleteRuleSet", "deleteRuleSet", "deleteRuleSet", "deleteRuleSetCallable"] + }, + "GetRuleSet": { + "methods": ["getRuleSet", "getRuleSet", "getRuleSet", "getRuleSetCallable"] + }, + "ListRuleSets": { + "methods": ["listRuleSets", "listRuleSets", "listRuleSets", "listRuleSetsPagedCallable", "listRuleSetsCallable"] + }, + "UpdateRuleSet": { + "methods": ["updateRuleSet", "updateRuleSet", "updateRuleSet", "updateRuleSetCallable"] + } + } + } + } + }, + "SynonymSetService": { + "clients": { + "grpc": { + "libraryClient": "SynonymSetServiceClient", + "rpcs": { + "CreateSynonymSet": { + "methods": ["createSynonymSet", "createSynonymSet", "createSynonymSet", "createSynonymSetCallable"] + }, + "DeleteSynonymSet": { + "methods": ["deleteSynonymSet", "deleteSynonymSet", "deleteSynonymSet", "deleteSynonymSetCallable"] + }, + "GetSynonymSet": { + "methods": ["getSynonymSet", "getSynonymSet", "getSynonymSet", "getSynonymSetCallable"] + }, + "ListSynonymSets": { + "methods": ["listSynonymSets", "listSynonymSets", "listSynonymSets", "listSynonymSetsPagedCallable", "listSynonymSetsCallable"] + }, + "UpdateSynonymSet": { + "methods": ["updateSynonymSet", "updateSynonymSet", "updateSynonymSet", "updateSynonymSetCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/package-info.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/package-info.java new file mode 100644 index 000000000000..e1c0105cd3ee --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/package-info.java @@ -0,0 +1,123 @@ +/* + * 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. + */ + +/** + * A client to contentwarehouse API + * + *

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: + * + *

{@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);
+ * }
+ * }
+ * + *

======================= DocumentSchemaServiceClient ======================= + * + *

Service Description: This service lets you manage document schema. + * + *

Sample for DocumentSchemaServiceClient: + * + *

{@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);
+ * }
+ * }
+ * + *

======================= DocumentServiceClient ======================= + * + *

Service Description: This service lets you manage document. + * + *

Sample for DocumentServiceClient: + * + *

{@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);
+ * }
+ * }
+ * + *

======================= RuleSetServiceClient ======================= + * + *

Service Description: Service to manage customer specific RuleSets. + * + *

Sample for RuleSetServiceClient: + * + *

{@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);
+ * }
+ * }
+ * + *

======================= SynonymSetServiceClient ======================= + * + *

Service Description: A Service that manage/custom customer specified SynonymSets. + * + *

Sample for SynonymSetServiceClient: + * + *

{@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. + * + *

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 + listLinkedTargetsCallable() { + throw new UnsupportedOperationException("Not implemented: listLinkedTargetsCallable()"); + } + + public UnaryCallable + listLinkedSourcesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLinkedSourcesPagedCallable()"); + } + + public UnaryCallable + listLinkedSourcesCallable() { + throw new UnsupportedOperationException("Not implemented: listLinkedSourcesCallable()"); + } + + public UnaryCallable createDocumentLinkCallable() { + throw new UnsupportedOperationException("Not implemented: createDocumentLinkCallable()"); + } + + public UnaryCallable deleteDocumentLinkCallable() { + throw new UnsupportedOperationException("Not implemented: deleteDocumentLinkCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/DocumentLinkServiceStubSettings.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/DocumentLinkServiceStubSettings.java new file mode 100644 index 000000000000..8204bd316593 --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/DocumentLinkServiceStubSettings.java @@ -0,0 +1,485 @@ +/* + * 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.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.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.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link DocumentLinkServiceStub}. + * + *

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

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

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

For example, to set the total timeout of 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
+ * 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 { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final UnaryCallSettings + listLinkedTargetsSettings; + private final PagedCallSettings< + ListLinkedSourcesRequest, ListLinkedSourcesResponse, ListLinkedSourcesPagedResponse> + listLinkedSourcesSettings; + private final UnaryCallSettings + createDocumentLinkSettings; + private final UnaryCallSettings deleteDocumentLinkSettings; + + private static final PagedListDescriptor< + ListLinkedSourcesRequest, ListLinkedSourcesResponse, DocumentLink> + LIST_LINKED_SOURCES_PAGE_STR_DESC = + new PagedListDescriptor< + ListLinkedSourcesRequest, ListLinkedSourcesResponse, DocumentLink>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLinkedSourcesRequest injectToken( + ListLinkedSourcesRequest payload, String token) { + return ListLinkedSourcesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLinkedSourcesRequest injectPageSize( + ListLinkedSourcesRequest payload, int pageSize) { + return ListLinkedSourcesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLinkedSourcesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLinkedSourcesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLinkedSourcesResponse payload) { + return payload.getDocumentLinksList() == null + ? ImmutableList.of() + : payload.getDocumentLinksList(); + } + }; + + private static final PagedListResponseFactory< + ListLinkedSourcesRequest, ListLinkedSourcesResponse, ListLinkedSourcesPagedResponse> + LIST_LINKED_SOURCES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLinkedSourcesRequest, + ListLinkedSourcesResponse, + ListLinkedSourcesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLinkedSourcesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, LIST_LINKED_SOURCES_PAGE_STR_DESC, request, context); + return ListLinkedSourcesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to listLinkedTargets. */ + public UnaryCallSettings + listLinkedTargetsSettings() { + return listLinkedTargetsSettings; + } + + /** Returns the object with the settings used for calls to listLinkedSources. */ + public PagedCallSettings< + ListLinkedSourcesRequest, ListLinkedSourcesResponse, ListLinkedSourcesPagedResponse> + listLinkedSourcesSettings() { + return listLinkedSourcesSettings; + } + + /** Returns the object with the settings used for calls to createDocumentLink. */ + public UnaryCallSettings createDocumentLinkSettings() { + return createDocumentLinkSettings; + } + + /** Returns the object with the settings used for calls to deleteDocumentLink. */ + public UnaryCallSettings deleteDocumentLinkSettings() { + return deleteDocumentLinkSettings; + } + + public DocumentLinkServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcDocumentLinkServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonDocumentLinkServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "contentwarehouse.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "contentwarehouse.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(DocumentLinkServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(DocumentLinkServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return DocumentLinkServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected DocumentLinkServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listLinkedTargetsSettings = settingsBuilder.listLinkedTargetsSettings().build(); + listLinkedSourcesSettings = settingsBuilder.listLinkedSourcesSettings().build(); + createDocumentLinkSettings = settingsBuilder.createDocumentLinkSettings().build(); + deleteDocumentLinkSettings = settingsBuilder.deleteDocumentLinkSettings().build(); + } + + /** Builder for DocumentLinkServiceStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder + listLinkedTargetsSettings; + private final PagedCallSettings.Builder< + ListLinkedSourcesRequest, ListLinkedSourcesResponse, ListLinkedSourcesPagedResponse> + listLinkedSourcesSettings; + private final UnaryCallSettings.Builder + createDocumentLinkSettings; + private final UnaryCallSettings.Builder + deleteDocumentLinkSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "no_retry_2_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(180000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(180000L)) + .setTotalTimeout(Duration.ofMillis(180000L)) + .build(); + definitions.put("no_retry_2_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + listLinkedTargetsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listLinkedSourcesSettings = PagedCallSettings.newBuilder(LIST_LINKED_SOURCES_PAGE_STR_FACT); + createDocumentLinkSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteDocumentLinkSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listLinkedTargetsSettings, + listLinkedSourcesSettings, + createDocumentLinkSettings, + deleteDocumentLinkSettings); + initDefaults(this); + } + + protected Builder(DocumentLinkServiceStubSettings settings) { + super(settings); + + listLinkedTargetsSettings = settings.listLinkedTargetsSettings.toBuilder(); + listLinkedSourcesSettings = settings.listLinkedSourcesSettings.toBuilder(); + createDocumentLinkSettings = settings.createDocumentLinkSettings.toBuilder(); + deleteDocumentLinkSettings = settings.deleteDocumentLinkSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listLinkedTargetsSettings, + listLinkedSourcesSettings, + createDocumentLinkSettings, + deleteDocumentLinkSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .listLinkedTargetsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_2_params")); + + builder + .listLinkedSourcesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_2_params")); + + builder + .createDocumentLinkSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_2_params")); + + builder + .deleteDocumentLinkSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_2_params")); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to listLinkedTargets. */ + public UnaryCallSettings.Builder + listLinkedTargetsSettings() { + return listLinkedTargetsSettings; + } + + /** Returns the builder for the settings used for calls to listLinkedSources. */ + public PagedCallSettings.Builder< + ListLinkedSourcesRequest, ListLinkedSourcesResponse, ListLinkedSourcesPagedResponse> + listLinkedSourcesSettings() { + return listLinkedSourcesSettings; + } + + /** Returns the builder for the settings used for calls to createDocumentLink. */ + public UnaryCallSettings.Builder + createDocumentLinkSettings() { + return createDocumentLinkSettings; + } + + /** Returns the builder for the settings used for calls to deleteDocumentLink. */ + public UnaryCallSettings.Builder + deleteDocumentLinkSettings() { + return deleteDocumentLinkSettings; + } + + @Override + public DocumentLinkServiceStubSettings build() throws IOException { + return new DocumentLinkServiceStubSettings(this); + } + } +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/DocumentSchemaServiceStub.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/DocumentSchemaServiceStub.java new file mode 100644 index 000000000000..814257f404bb --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/DocumentSchemaServiceStub.java @@ -0,0 +1,70 @@ +/* + * 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.DocumentSchemaServiceClient.ListDocumentSchemasPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest; +import com.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest; +import com.google.cloud.contentwarehouse.v1.DocumentSchema; +import com.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest; +import com.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest; +import com.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse; +import com.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the DocumentSchemaService service API. + * + *

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 createDocumentSchemaCallable() { + throw new UnsupportedOperationException("Not implemented: createDocumentSchemaCallable()"); + } + + public UnaryCallable updateDocumentSchemaCallable() { + throw new UnsupportedOperationException("Not implemented: updateDocumentSchemaCallable()"); + } + + public UnaryCallable getDocumentSchemaCallable() { + throw new UnsupportedOperationException("Not implemented: getDocumentSchemaCallable()"); + } + + public UnaryCallable deleteDocumentSchemaCallable() { + throw new UnsupportedOperationException("Not implemented: deleteDocumentSchemaCallable()"); + } + + public UnaryCallable + listDocumentSchemasPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listDocumentSchemasPagedCallable()"); + } + + public UnaryCallable + listDocumentSchemasCallable() { + throw new UnsupportedOperationException("Not implemented: listDocumentSchemasCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/DocumentSchemaServiceStubSettings.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/DocumentSchemaServiceStubSettings.java new file mode 100644 index 000000000000..cef9f4ccabb1 --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/DocumentSchemaServiceStubSettings.java @@ -0,0 +1,531 @@ +/* + * 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.DocumentSchemaServiceClient.ListDocumentSchemasPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest; +import com.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest; +import com.google.cloud.contentwarehouse.v1.DocumentSchema; +import com.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest; +import com.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest; +import com.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse; +import com.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link DocumentSchemaServiceStub}. + * + *

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

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

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

For example, to set the total timeout of createDocumentSchema 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
+ * 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 { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final UnaryCallSettings + createDocumentSchemaSettings; + private final UnaryCallSettings + updateDocumentSchemaSettings; + private final UnaryCallSettings + getDocumentSchemaSettings; + private final UnaryCallSettings deleteDocumentSchemaSettings; + private final PagedCallSettings< + ListDocumentSchemasRequest, ListDocumentSchemasResponse, ListDocumentSchemasPagedResponse> + listDocumentSchemasSettings; + + private static final PagedListDescriptor< + ListDocumentSchemasRequest, ListDocumentSchemasResponse, DocumentSchema> + LIST_DOCUMENT_SCHEMAS_PAGE_STR_DESC = + new PagedListDescriptor< + ListDocumentSchemasRequest, ListDocumentSchemasResponse, DocumentSchema>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListDocumentSchemasRequest injectToken( + ListDocumentSchemasRequest payload, String token) { + return ListDocumentSchemasRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListDocumentSchemasRequest injectPageSize( + ListDocumentSchemasRequest payload, int pageSize) { + return ListDocumentSchemasRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListDocumentSchemasRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListDocumentSchemasResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListDocumentSchemasResponse payload) { + return payload.getDocumentSchemasList() == null + ? ImmutableList.of() + : payload.getDocumentSchemasList(); + } + }; + + private static final PagedListResponseFactory< + ListDocumentSchemasRequest, ListDocumentSchemasResponse, ListDocumentSchemasPagedResponse> + LIST_DOCUMENT_SCHEMAS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListDocumentSchemasRequest, + ListDocumentSchemasResponse, + ListDocumentSchemasPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListDocumentSchemasRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, LIST_DOCUMENT_SCHEMAS_PAGE_STR_DESC, request, context); + return ListDocumentSchemasPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to createDocumentSchema. */ + public UnaryCallSettings + createDocumentSchemaSettings() { + return createDocumentSchemaSettings; + } + + /** Returns the object with the settings used for calls to updateDocumentSchema. */ + public UnaryCallSettings + updateDocumentSchemaSettings() { + return updateDocumentSchemaSettings; + } + + /** Returns the object with the settings used for calls to getDocumentSchema. */ + public UnaryCallSettings getDocumentSchemaSettings() { + return getDocumentSchemaSettings; + } + + /** Returns the object with the settings used for calls to deleteDocumentSchema. */ + public UnaryCallSettings deleteDocumentSchemaSettings() { + return deleteDocumentSchemaSettings; + } + + /** Returns the object with the settings used for calls to listDocumentSchemas. */ + public PagedCallSettings< + ListDocumentSchemasRequest, ListDocumentSchemasResponse, ListDocumentSchemasPagedResponse> + listDocumentSchemasSettings() { + return listDocumentSchemasSettings; + } + + public DocumentSchemaServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcDocumentSchemaServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonDocumentSchemaServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "contentwarehouse.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "contentwarehouse.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(DocumentSchemaServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(DocumentSchemaServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return DocumentSchemaServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected DocumentSchemaServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createDocumentSchemaSettings = settingsBuilder.createDocumentSchemaSettings().build(); + updateDocumentSchemaSettings = settingsBuilder.updateDocumentSchemaSettings().build(); + getDocumentSchemaSettings = settingsBuilder.getDocumentSchemaSettings().build(); + deleteDocumentSchemaSettings = settingsBuilder.deleteDocumentSchemaSettings().build(); + listDocumentSchemasSettings = settingsBuilder.listDocumentSchemasSettings().build(); + } + + /** Builder for DocumentSchemaServiceStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder + createDocumentSchemaSettings; + private final UnaryCallSettings.Builder + updateDocumentSchemaSettings; + private final UnaryCallSettings.Builder + getDocumentSchemaSettings; + private final UnaryCallSettings.Builder + deleteDocumentSchemaSettings; + private final PagedCallSettings.Builder< + ListDocumentSchemasRequest, + ListDocumentSchemasResponse, + ListDocumentSchemasPagedResponse> + listDocumentSchemasSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("no_retry_1_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(10000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + createDocumentSchemaSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateDocumentSchemaSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getDocumentSchemaSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteDocumentSchemaSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listDocumentSchemasSettings = + PagedCallSettings.newBuilder(LIST_DOCUMENT_SCHEMAS_PAGE_STR_FACT); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createDocumentSchemaSettings, + updateDocumentSchemaSettings, + getDocumentSchemaSettings, + deleteDocumentSchemaSettings, + listDocumentSchemasSettings); + initDefaults(this); + } + + protected Builder(DocumentSchemaServiceStubSettings settings) { + super(settings); + + createDocumentSchemaSettings = settings.createDocumentSchemaSettings.toBuilder(); + updateDocumentSchemaSettings = settings.updateDocumentSchemaSettings.toBuilder(); + getDocumentSchemaSettings = settings.getDocumentSchemaSettings.toBuilder(); + deleteDocumentSchemaSettings = settings.deleteDocumentSchemaSettings.toBuilder(); + listDocumentSchemasSettings = settings.listDocumentSchemasSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createDocumentSchemaSettings, + updateDocumentSchemaSettings, + getDocumentSchemaSettings, + deleteDocumentSchemaSettings, + listDocumentSchemasSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .createDocumentSchemaSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .updateDocumentSchemaSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .getDocumentSchemaSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .deleteDocumentSchemaSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .listDocumentSchemasSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to createDocumentSchema. */ + public UnaryCallSettings.Builder + createDocumentSchemaSettings() { + return createDocumentSchemaSettings; + } + + /** Returns the builder for the settings used for calls to updateDocumentSchema. */ + public UnaryCallSettings.Builder + updateDocumentSchemaSettings() { + return updateDocumentSchemaSettings; + } + + /** Returns the builder for the settings used for calls to getDocumentSchema. */ + public UnaryCallSettings.Builder + getDocumentSchemaSettings() { + return getDocumentSchemaSettings; + } + + /** Returns the builder for the settings used for calls to deleteDocumentSchema. */ + public UnaryCallSettings.Builder + deleteDocumentSchemaSettings() { + return deleteDocumentSchemaSettings; + } + + /** Returns the builder for the settings used for calls to listDocumentSchemas. */ + public PagedCallSettings.Builder< + ListDocumentSchemasRequest, + ListDocumentSchemasResponse, + ListDocumentSchemasPagedResponse> + listDocumentSchemasSettings() { + return listDocumentSchemasSettings; + } + + @Override + public DocumentSchemaServiceStubSettings build() throws IOException { + return new DocumentSchemaServiceStubSettings(this); + } + } +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/DocumentServiceStub.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/DocumentServiceStub.java new file mode 100644 index 000000000000..1162baad140e --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/DocumentServiceStub.java @@ -0,0 +1,83 @@ +/* + * 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.DocumentServiceClient.SearchDocumentsPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.contentwarehouse.v1.CreateDocumentRequest; +import com.google.cloud.contentwarehouse.v1.CreateDocumentResponse; +import com.google.cloud.contentwarehouse.v1.DeleteDocumentRequest; +import com.google.cloud.contentwarehouse.v1.Document; +import com.google.cloud.contentwarehouse.v1.FetchAclRequest; +import com.google.cloud.contentwarehouse.v1.FetchAclResponse; +import com.google.cloud.contentwarehouse.v1.GetDocumentRequest; +import com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest; +import com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse; +import com.google.cloud.contentwarehouse.v1.SetAclRequest; +import com.google.cloud.contentwarehouse.v1.SetAclResponse; +import com.google.cloud.contentwarehouse.v1.UpdateDocumentRequest; +import com.google.cloud.contentwarehouse.v1.UpdateDocumentResponse; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the DocumentService service API. + * + *

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 createDocumentCallable() { + throw new UnsupportedOperationException("Not implemented: createDocumentCallable()"); + } + + public UnaryCallable getDocumentCallable() { + throw new UnsupportedOperationException("Not implemented: getDocumentCallable()"); + } + + public UnaryCallable updateDocumentCallable() { + throw new UnsupportedOperationException("Not implemented: updateDocumentCallable()"); + } + + public UnaryCallable deleteDocumentCallable() { + throw new UnsupportedOperationException("Not implemented: deleteDocumentCallable()"); + } + + public UnaryCallable + searchDocumentsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: searchDocumentsPagedCallable()"); + } + + public UnaryCallable searchDocumentsCallable() { + throw new UnsupportedOperationException("Not implemented: searchDocumentsCallable()"); + } + + public UnaryCallable fetchAclCallable() { + throw new UnsupportedOperationException("Not implemented: fetchAclCallable()"); + } + + public UnaryCallable setAclCallable() { + throw new UnsupportedOperationException("Not implemented: setAclCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/DocumentServiceStubSettings.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/DocumentServiceStubSettings.java new file mode 100644 index 000000000000..d93565ddc97b --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/DocumentServiceStubSettings.java @@ -0,0 +1,577 @@ +/* + * 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.DocumentServiceClient.SearchDocumentsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.contentwarehouse.v1.CreateDocumentRequest; +import com.google.cloud.contentwarehouse.v1.CreateDocumentResponse; +import com.google.cloud.contentwarehouse.v1.DeleteDocumentRequest; +import com.google.cloud.contentwarehouse.v1.Document; +import com.google.cloud.contentwarehouse.v1.FetchAclRequest; +import com.google.cloud.contentwarehouse.v1.FetchAclResponse; +import com.google.cloud.contentwarehouse.v1.GetDocumentRequest; +import com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest; +import com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse; +import com.google.cloud.contentwarehouse.v1.SetAclRequest; +import com.google.cloud.contentwarehouse.v1.SetAclResponse; +import com.google.cloud.contentwarehouse.v1.UpdateDocumentRequest; +import com.google.cloud.contentwarehouse.v1.UpdateDocumentResponse; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link DocumentServiceStub}. + * + *

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

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

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

For example, to set the total timeout of 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
+ * 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 { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final UnaryCallSettings + createDocumentSettings; + private final UnaryCallSettings getDocumentSettings; + private final UnaryCallSettings + updateDocumentSettings; + private final UnaryCallSettings deleteDocumentSettings; + private final PagedCallSettings< + SearchDocumentsRequest, SearchDocumentsResponse, SearchDocumentsPagedResponse> + searchDocumentsSettings; + private final UnaryCallSettings fetchAclSettings; + private final UnaryCallSettings setAclSettings; + + private static final PagedListDescriptor< + SearchDocumentsRequest, SearchDocumentsResponse, SearchDocumentsResponse.MatchingDocument> + SEARCH_DOCUMENTS_PAGE_STR_DESC = + new PagedListDescriptor< + SearchDocumentsRequest, + SearchDocumentsResponse, + SearchDocumentsResponse.MatchingDocument>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public SearchDocumentsRequest injectToken( + SearchDocumentsRequest payload, String token) { + return SearchDocumentsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public SearchDocumentsRequest injectPageSize( + SearchDocumentsRequest payload, int pageSize) { + return SearchDocumentsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(SearchDocumentsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(SearchDocumentsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + SearchDocumentsResponse payload) { + return payload.getMatchingDocumentsList() == null + ? ImmutableList.of() + : payload.getMatchingDocumentsList(); + } + }; + + private static final PagedListResponseFactory< + SearchDocumentsRequest, SearchDocumentsResponse, SearchDocumentsPagedResponse> + SEARCH_DOCUMENTS_PAGE_STR_FACT = + new PagedListResponseFactory< + SearchDocumentsRequest, SearchDocumentsResponse, SearchDocumentsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + SearchDocumentsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + SearchDocumentsRequest, + SearchDocumentsResponse, + SearchDocumentsResponse.MatchingDocument> + pageContext = + PageContext.create( + callable, SEARCH_DOCUMENTS_PAGE_STR_DESC, request, context); + return SearchDocumentsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to createDocument. */ + public UnaryCallSettings createDocumentSettings() { + return createDocumentSettings; + } + + /** Returns the object with the settings used for calls to getDocument. */ + public UnaryCallSettings getDocumentSettings() { + return getDocumentSettings; + } + + /** Returns the object with the settings used for calls to updateDocument. */ + public UnaryCallSettings updateDocumentSettings() { + return updateDocumentSettings; + } + + /** Returns the object with the settings used for calls to deleteDocument. */ + public UnaryCallSettings deleteDocumentSettings() { + return deleteDocumentSettings; + } + + /** Returns the object with the settings used for calls to searchDocuments. */ + public PagedCallSettings< + SearchDocumentsRequest, SearchDocumentsResponse, SearchDocumentsPagedResponse> + searchDocumentsSettings() { + return searchDocumentsSettings; + } + + /** Returns the object with the settings used for calls to fetchAcl. */ + public UnaryCallSettings fetchAclSettings() { + return fetchAclSettings; + } + + /** Returns the object with the settings used for calls to setAcl. */ + public UnaryCallSettings setAclSettings() { + return setAclSettings; + } + + public DocumentServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcDocumentServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonDocumentServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "contentwarehouse.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "contentwarehouse.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(DocumentServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(DocumentServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return DocumentServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected DocumentServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createDocumentSettings = settingsBuilder.createDocumentSettings().build(); + getDocumentSettings = settingsBuilder.getDocumentSettings().build(); + updateDocumentSettings = settingsBuilder.updateDocumentSettings().build(); + deleteDocumentSettings = settingsBuilder.deleteDocumentSettings().build(); + searchDocumentsSettings = settingsBuilder.searchDocumentsSettings().build(); + fetchAclSettings = settingsBuilder.fetchAclSettings().build(); + setAclSettings = settingsBuilder.setAclSettings().build(); + } + + /** Builder for DocumentServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder + createDocumentSettings; + private final UnaryCallSettings.Builder getDocumentSettings; + private final UnaryCallSettings.Builder + updateDocumentSettings; + private final UnaryCallSettings.Builder deleteDocumentSettings; + private final PagedCallSettings.Builder< + SearchDocumentsRequest, SearchDocumentsResponse, SearchDocumentsPagedResponse> + searchDocumentsSettings; + private final UnaryCallSettings.Builder fetchAclSettings; + private final UnaryCallSettings.Builder setAclSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "no_retry_2_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put( + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(180000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(180000L)) + .setTotalTimeout(Duration.ofMillis(180000L)) + .build(); + definitions.put("no_retry_2_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(10000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("no_retry_1_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + createDocumentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getDocumentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateDocumentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteDocumentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + searchDocumentsSettings = PagedCallSettings.newBuilder(SEARCH_DOCUMENTS_PAGE_STR_FACT); + fetchAclSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setAclSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createDocumentSettings, + getDocumentSettings, + updateDocumentSettings, + deleteDocumentSettings, + searchDocumentsSettings, + fetchAclSettings, + setAclSettings); + initDefaults(this); + } + + protected Builder(DocumentServiceStubSettings settings) { + super(settings); + + createDocumentSettings = settings.createDocumentSettings.toBuilder(); + getDocumentSettings = settings.getDocumentSettings.toBuilder(); + updateDocumentSettings = settings.updateDocumentSettings.toBuilder(); + deleteDocumentSettings = settings.deleteDocumentSettings.toBuilder(); + searchDocumentsSettings = settings.searchDocumentsSettings.toBuilder(); + fetchAclSettings = settings.fetchAclSettings.toBuilder(); + setAclSettings = settings.setAclSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createDocumentSettings, + getDocumentSettings, + updateDocumentSettings, + deleteDocumentSettings, + searchDocumentsSettings, + fetchAclSettings, + setAclSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .createDocumentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_2_params")); + + builder + .getDocumentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .updateDocumentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_2_params")); + + builder + .deleteDocumentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .searchDocumentsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_2_params")); + + builder + .fetchAclSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .setAclSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to createDocument. */ + public UnaryCallSettings.Builder + createDocumentSettings() { + return createDocumentSettings; + } + + /** Returns the builder for the settings used for calls to getDocument. */ + public UnaryCallSettings.Builder getDocumentSettings() { + return getDocumentSettings; + } + + /** Returns the builder for the settings used for calls to updateDocument. */ + public UnaryCallSettings.Builder + updateDocumentSettings() { + return updateDocumentSettings; + } + + /** Returns the builder for the settings used for calls to deleteDocument. */ + public UnaryCallSettings.Builder deleteDocumentSettings() { + return deleteDocumentSettings; + } + + /** Returns the builder for the settings used for calls to searchDocuments. */ + public PagedCallSettings.Builder< + SearchDocumentsRequest, SearchDocumentsResponse, SearchDocumentsPagedResponse> + searchDocumentsSettings() { + return searchDocumentsSettings; + } + + /** Returns the builder for the settings used for calls to fetchAcl. */ + public UnaryCallSettings.Builder fetchAclSettings() { + return fetchAclSettings; + } + + /** Returns the builder for the settings used for calls to setAcl. */ + public UnaryCallSettings.Builder setAclSettings() { + return setAclSettings; + } + + @Override + public DocumentServiceStubSettings build() throws IOException { + return new DocumentServiceStubSettings(this); + } + } +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/GrpcDocumentLinkServiceCallableFactory.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/GrpcDocumentLinkServiceCallableFactory.java new file mode 100644 index 000000000000..a7a81600f331 --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/GrpcDocumentLinkServiceCallableFactory.java @@ -0,0 +1,113 @@ +/* + * 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 com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the DocumentLinkService service API. + * + *

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

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcDocumentLinkServiceStub extends DocumentLinkServiceStub { + private static final MethodDescriptor + listLinkedTargetsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.contentwarehouse.v1.DocumentLinkService/ListLinkedTargets") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLinkedTargetsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLinkedTargetsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listLinkedSourcesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.contentwarehouse.v1.DocumentLinkService/ListLinkedSources") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLinkedSourcesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLinkedSourcesResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createDocumentLinkMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.contentwarehouse.v1.DocumentLinkService/CreateDocumentLink") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateDocumentLinkRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(DocumentLink.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteDocumentLinkMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.contentwarehouse.v1.DocumentLinkService/DeleteDocumentLink") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteDocumentLinkRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private final UnaryCallable + listLinkedTargetsCallable; + private final UnaryCallable + listLinkedSourcesCallable; + private final UnaryCallable + listLinkedSourcesPagedCallable; + private final UnaryCallable createDocumentLinkCallable; + private final UnaryCallable deleteDocumentLinkCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcDocumentLinkServiceStub create(DocumentLinkServiceStubSettings settings) + throws IOException { + return new GrpcDocumentLinkServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcDocumentLinkServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcDocumentLinkServiceStub( + DocumentLinkServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcDocumentLinkServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcDocumentLinkServiceStub( + DocumentLinkServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcDocumentLinkServiceStub, 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 GrpcDocumentLinkServiceStub( + DocumentLinkServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcDocumentLinkServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcDocumentLinkServiceStub, 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 GrpcDocumentLinkServiceStub( + DocumentLinkServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings + listLinkedTargetsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLinkedTargetsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings + listLinkedSourcesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLinkedSourcesMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings createDocumentLinkTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createDocumentLinkMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings deleteDocumentLinkTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteDocumentLinkMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + + this.listLinkedTargetsCallable = + callableFactory.createUnaryCallable( + listLinkedTargetsTransportSettings, + settings.listLinkedTargetsSettings(), + clientContext); + this.listLinkedSourcesCallable = + callableFactory.createUnaryCallable( + listLinkedSourcesTransportSettings, + settings.listLinkedSourcesSettings(), + clientContext); + this.listLinkedSourcesPagedCallable = + callableFactory.createPagedCallable( + listLinkedSourcesTransportSettings, + settings.listLinkedSourcesSettings(), + clientContext); + this.createDocumentLinkCallable = + callableFactory.createUnaryCallable( + createDocumentLinkTransportSettings, + settings.createDocumentLinkSettings(), + clientContext); + this.deleteDocumentLinkCallable = + callableFactory.createUnaryCallable( + deleteDocumentLinkTransportSettings, + settings.deleteDocumentLinkSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable + listLinkedTargetsCallable() { + return listLinkedTargetsCallable; + } + + @Override + public UnaryCallable + listLinkedSourcesCallable() { + return listLinkedSourcesCallable; + } + + @Override + public UnaryCallable + listLinkedSourcesPagedCallable() { + return listLinkedSourcesPagedCallable; + } + + @Override + public UnaryCallable createDocumentLinkCallable() { + return createDocumentLinkCallable; + } + + @Override + public UnaryCallable deleteDocumentLinkCallable() { + return deleteDocumentLinkCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/GrpcDocumentSchemaServiceCallableFactory.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/GrpcDocumentSchemaServiceCallableFactory.java new file mode 100644 index 000000000000..223ae23d4aa5 --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/GrpcDocumentSchemaServiceCallableFactory.java @@ -0,0 +1,113 @@ +/* + * 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 com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the DocumentSchemaService service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcDocumentSchemaServiceCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/GrpcDocumentSchemaServiceStub.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/GrpcDocumentSchemaServiceStub.java new file mode 100644 index 000000000000..7c892e56e803 --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/GrpcDocumentSchemaServiceStub.java @@ -0,0 +1,322 @@ +/* + * 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.DocumentSchemaServiceClient.ListDocumentSchemasPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest; +import com.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest; +import com.google.cloud.contentwarehouse.v1.DocumentSchema; +import com.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest; +import com.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest; +import com.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse; +import com.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the DocumentSchemaService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcDocumentSchemaServiceStub extends DocumentSchemaServiceStub { + private static final MethodDescriptor + createDocumentSchemaMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.contentwarehouse.v1.DocumentSchemaService/CreateDocumentSchema") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateDocumentSchemaRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(DocumentSchema.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateDocumentSchemaMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.contentwarehouse.v1.DocumentSchemaService/UpdateDocumentSchema") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateDocumentSchemaRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(DocumentSchema.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getDocumentSchemaMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.contentwarehouse.v1.DocumentSchemaService/GetDocumentSchema") + .setRequestMarshaller( + ProtoUtils.marshaller(GetDocumentSchemaRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(DocumentSchema.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteDocumentSchemaMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.contentwarehouse.v1.DocumentSchemaService/DeleteDocumentSchema") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteDocumentSchemaRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listDocumentSchemasMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.contentwarehouse.v1.DocumentSchemaService/ListDocumentSchemas") + .setRequestMarshaller( + ProtoUtils.marshaller(ListDocumentSchemasRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListDocumentSchemasResponse.getDefaultInstance())) + .build(); + + private final UnaryCallable + createDocumentSchemaCallable; + private final UnaryCallable + updateDocumentSchemaCallable; + private final UnaryCallable getDocumentSchemaCallable; + private final UnaryCallable deleteDocumentSchemaCallable; + private final UnaryCallable + listDocumentSchemasCallable; + private final UnaryCallable + listDocumentSchemasPagedCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcDocumentSchemaServiceStub create( + DocumentSchemaServiceStubSettings settings) throws IOException { + return new GrpcDocumentSchemaServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcDocumentSchemaServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcDocumentSchemaServiceStub( + DocumentSchemaServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcDocumentSchemaServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcDocumentSchemaServiceStub( + DocumentSchemaServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcDocumentSchemaServiceStub, 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 GrpcDocumentSchemaServiceStub( + DocumentSchemaServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcDocumentSchemaServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcDocumentSchemaServiceStub, 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 GrpcDocumentSchemaServiceStub( + DocumentSchemaServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings + createDocumentSchemaTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createDocumentSchemaMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings + updateDocumentSchemaTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateDocumentSchemaMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings getDocumentSchemaTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getDocumentSchemaMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings deleteDocumentSchemaTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteDocumentSchemaMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + listDocumentSchemasTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listDocumentSchemasMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + + this.createDocumentSchemaCallable = + callableFactory.createUnaryCallable( + createDocumentSchemaTransportSettings, + settings.createDocumentSchemaSettings(), + clientContext); + this.updateDocumentSchemaCallable = + callableFactory.createUnaryCallable( + updateDocumentSchemaTransportSettings, + settings.updateDocumentSchemaSettings(), + clientContext); + this.getDocumentSchemaCallable = + callableFactory.createUnaryCallable( + getDocumentSchemaTransportSettings, + settings.getDocumentSchemaSettings(), + clientContext); + this.deleteDocumentSchemaCallable = + callableFactory.createUnaryCallable( + deleteDocumentSchemaTransportSettings, + settings.deleteDocumentSchemaSettings(), + clientContext); + this.listDocumentSchemasCallable = + callableFactory.createUnaryCallable( + listDocumentSchemasTransportSettings, + settings.listDocumentSchemasSettings(), + clientContext); + this.listDocumentSchemasPagedCallable = + callableFactory.createPagedCallable( + listDocumentSchemasTransportSettings, + settings.listDocumentSchemasSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable createDocumentSchemaCallable() { + return createDocumentSchemaCallable; + } + + @Override + public UnaryCallable updateDocumentSchemaCallable() { + return updateDocumentSchemaCallable; + } + + @Override + public UnaryCallable getDocumentSchemaCallable() { + return getDocumentSchemaCallable; + } + + @Override + public UnaryCallable deleteDocumentSchemaCallable() { + return deleteDocumentSchemaCallable; + } + + @Override + public UnaryCallable + listDocumentSchemasCallable() { + return listDocumentSchemasCallable; + } + + @Override + public UnaryCallable + listDocumentSchemasPagedCallable() { + return listDocumentSchemasPagedCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/GrpcDocumentServiceCallableFactory.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/GrpcDocumentServiceCallableFactory.java new file mode 100644 index 000000000000..4998dcd6de73 --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/GrpcDocumentServiceCallableFactory.java @@ -0,0 +1,113 @@ +/* + * 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 com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the DocumentService service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcDocumentServiceCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/GrpcDocumentServiceStub.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/GrpcDocumentServiceStub.java new file mode 100644 index 000000000000..3acf74248912 --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/GrpcDocumentServiceStub.java @@ -0,0 +1,363 @@ +/* + * 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.DocumentServiceClient.SearchDocumentsPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.contentwarehouse.v1.CreateDocumentRequest; +import com.google.cloud.contentwarehouse.v1.CreateDocumentResponse; +import com.google.cloud.contentwarehouse.v1.DeleteDocumentRequest; +import com.google.cloud.contentwarehouse.v1.Document; +import com.google.cloud.contentwarehouse.v1.FetchAclRequest; +import com.google.cloud.contentwarehouse.v1.FetchAclResponse; +import com.google.cloud.contentwarehouse.v1.GetDocumentRequest; +import com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest; +import com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse; +import com.google.cloud.contentwarehouse.v1.SetAclRequest; +import com.google.cloud.contentwarehouse.v1.SetAclResponse; +import com.google.cloud.contentwarehouse.v1.UpdateDocumentRequest; +import com.google.cloud.contentwarehouse.v1.UpdateDocumentResponse; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the DocumentService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcDocumentServiceStub extends DocumentServiceStub { + private static final MethodDescriptor + createDocumentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.contentwarehouse.v1.DocumentService/CreateDocument") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateDocumentRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(CreateDocumentResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getDocumentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.contentwarehouse.v1.DocumentService/GetDocument") + .setRequestMarshaller(ProtoUtils.marshaller(GetDocumentRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Document.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateDocumentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.contentwarehouse.v1.DocumentService/UpdateDocument") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateDocumentRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(UpdateDocumentResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteDocumentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.contentwarehouse.v1.DocumentService/DeleteDocument") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteDocumentRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + searchDocumentsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.contentwarehouse.v1.DocumentService/SearchDocuments") + .setRequestMarshaller( + ProtoUtils.marshaller(SearchDocumentsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(SearchDocumentsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + fetchAclMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.contentwarehouse.v1.DocumentService/FetchAcl") + .setRequestMarshaller(ProtoUtils.marshaller(FetchAclRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(FetchAclResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor setAclMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.contentwarehouse.v1.DocumentService/SetAcl") + .setRequestMarshaller(ProtoUtils.marshaller(SetAclRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(SetAclResponse.getDefaultInstance())) + .build(); + + private final UnaryCallable createDocumentCallable; + private final UnaryCallable getDocumentCallable; + private final UnaryCallable updateDocumentCallable; + private final UnaryCallable deleteDocumentCallable; + private final UnaryCallable + searchDocumentsCallable; + private final UnaryCallable + searchDocumentsPagedCallable; + private final UnaryCallable fetchAclCallable; + private final UnaryCallable setAclCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcDocumentServiceStub create(DocumentServiceStubSettings settings) + throws IOException { + return new GrpcDocumentServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcDocumentServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcDocumentServiceStub( + DocumentServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcDocumentServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcDocumentServiceStub( + DocumentServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcDocumentServiceStub, 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 GrpcDocumentServiceStub( + DocumentServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcDocumentServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcDocumentServiceStub, 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 GrpcDocumentServiceStub( + DocumentServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings + createDocumentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createDocumentMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings getDocumentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getDocumentMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + updateDocumentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateDocumentMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings deleteDocumentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteDocumentMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + searchDocumentsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(searchDocumentsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings fetchAclTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(fetchAclMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + }) + .build(); + GrpcCallSettings setAclTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setAclMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + }) + .build(); + + this.createDocumentCallable = + callableFactory.createUnaryCallable( + createDocumentTransportSettings, settings.createDocumentSettings(), clientContext); + this.getDocumentCallable = + callableFactory.createUnaryCallable( + getDocumentTransportSettings, settings.getDocumentSettings(), clientContext); + this.updateDocumentCallable = + callableFactory.createUnaryCallable( + updateDocumentTransportSettings, settings.updateDocumentSettings(), clientContext); + this.deleteDocumentCallable = + callableFactory.createUnaryCallable( + deleteDocumentTransportSettings, settings.deleteDocumentSettings(), clientContext); + this.searchDocumentsCallable = + callableFactory.createUnaryCallable( + searchDocumentsTransportSettings, settings.searchDocumentsSettings(), clientContext); + this.searchDocumentsPagedCallable = + callableFactory.createPagedCallable( + searchDocumentsTransportSettings, settings.searchDocumentsSettings(), clientContext); + this.fetchAclCallable = + callableFactory.createUnaryCallable( + fetchAclTransportSettings, settings.fetchAclSettings(), clientContext); + this.setAclCallable = + callableFactory.createUnaryCallable( + setAclTransportSettings, settings.setAclSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable createDocumentCallable() { + return createDocumentCallable; + } + + @Override + public UnaryCallable getDocumentCallable() { + return getDocumentCallable; + } + + @Override + public UnaryCallable updateDocumentCallable() { + return updateDocumentCallable; + } + + @Override + public UnaryCallable deleteDocumentCallable() { + return deleteDocumentCallable; + } + + @Override + public UnaryCallable searchDocumentsCallable() { + return searchDocumentsCallable; + } + + @Override + public UnaryCallable + searchDocumentsPagedCallable() { + return searchDocumentsPagedCallable; + } + + @Override + public UnaryCallable fetchAclCallable() { + return fetchAclCallable; + } + + @Override + public UnaryCallable setAclCallable() { + return setAclCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/GrpcRuleSetServiceCallableFactory.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/GrpcRuleSetServiceCallableFactory.java new file mode 100644 index 000000000000..36286098cdc8 --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/GrpcRuleSetServiceCallableFactory.java @@ -0,0 +1,113 @@ +/* + * 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 com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the RuleSetService service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcRuleSetServiceCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/GrpcRuleSetServiceStub.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/GrpcRuleSetServiceStub.java new file mode 100644 index 000000000000..ab748d4c6576 --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/GrpcRuleSetServiceStub.java @@ -0,0 +1,292 @@ +/* + * 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.RuleSetServiceClient.ListRuleSetsPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.contentwarehouse.v1.CreateRuleSetRequest; +import com.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest; +import com.google.cloud.contentwarehouse.v1.GetRuleSetRequest; +import com.google.cloud.contentwarehouse.v1.ListRuleSetsRequest; +import com.google.cloud.contentwarehouse.v1.ListRuleSetsResponse; +import com.google.cloud.contentwarehouse.v1.RuleSet; +import com.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the RuleSetService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcRuleSetServiceStub extends RuleSetServiceStub { + private static final MethodDescriptor + createRuleSetMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.contentwarehouse.v1.RuleSetService/CreateRuleSet") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateRuleSetRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(RuleSet.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getRuleSetMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.contentwarehouse.v1.RuleSetService/GetRuleSet") + .setRequestMarshaller(ProtoUtils.marshaller(GetRuleSetRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(RuleSet.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateRuleSetMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.contentwarehouse.v1.RuleSetService/UpdateRuleSet") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateRuleSetRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(RuleSet.getDefaultInstance())) + .build(); + + private static final MethodDescriptor deleteRuleSetMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.contentwarehouse.v1.RuleSetService/DeleteRuleSet") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteRuleSetRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listRuleSetsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.contentwarehouse.v1.RuleSetService/ListRuleSets") + .setRequestMarshaller(ProtoUtils.marshaller(ListRuleSetsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListRuleSetsResponse.getDefaultInstance())) + .build(); + + private final UnaryCallable createRuleSetCallable; + private final UnaryCallable getRuleSetCallable; + private final UnaryCallable updateRuleSetCallable; + private final UnaryCallable deleteRuleSetCallable; + private final UnaryCallable listRuleSetsCallable; + private final UnaryCallable + listRuleSetsPagedCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcRuleSetServiceStub create(RuleSetServiceStubSettings settings) + throws IOException { + return new GrpcRuleSetServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcRuleSetServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcRuleSetServiceStub( + RuleSetServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcRuleSetServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcRuleSetServiceStub( + RuleSetServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcRuleSetServiceStub, 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 GrpcRuleSetServiceStub(RuleSetServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcRuleSetServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcRuleSetServiceStub, 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 GrpcRuleSetServiceStub( + RuleSetServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings createRuleSetTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createRuleSetMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings getRuleSetTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getRuleSetMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings updateRuleSetTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateRuleSetMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings deleteRuleSetTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteRuleSetMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings listRuleSetsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listRuleSetsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + + this.createRuleSetCallable = + callableFactory.createUnaryCallable( + createRuleSetTransportSettings, settings.createRuleSetSettings(), clientContext); + this.getRuleSetCallable = + callableFactory.createUnaryCallable( + getRuleSetTransportSettings, settings.getRuleSetSettings(), clientContext); + this.updateRuleSetCallable = + callableFactory.createUnaryCallable( + updateRuleSetTransportSettings, settings.updateRuleSetSettings(), clientContext); + this.deleteRuleSetCallable = + callableFactory.createUnaryCallable( + deleteRuleSetTransportSettings, settings.deleteRuleSetSettings(), clientContext); + this.listRuleSetsCallable = + callableFactory.createUnaryCallable( + listRuleSetsTransportSettings, settings.listRuleSetsSettings(), clientContext); + this.listRuleSetsPagedCallable = + callableFactory.createPagedCallable( + listRuleSetsTransportSettings, settings.listRuleSetsSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable createRuleSetCallable() { + return createRuleSetCallable; + } + + @Override + public UnaryCallable getRuleSetCallable() { + return getRuleSetCallable; + } + + @Override + public UnaryCallable updateRuleSetCallable() { + return updateRuleSetCallable; + } + + @Override + public UnaryCallable deleteRuleSetCallable() { + return deleteRuleSetCallable; + } + + @Override + public UnaryCallable listRuleSetsCallable() { + return listRuleSetsCallable; + } + + @Override + public UnaryCallable listRuleSetsPagedCallable() { + return listRuleSetsPagedCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/GrpcSynonymSetServiceCallableFactory.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/GrpcSynonymSetServiceCallableFactory.java new file mode 100644 index 000000000000..99ba04138c25 --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/GrpcSynonymSetServiceCallableFactory.java @@ -0,0 +1,113 @@ +/* + * 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 com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the SynonymSetService service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcSynonymSetServiceCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/GrpcSynonymSetServiceStub.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/GrpcSynonymSetServiceStub.java new file mode 100644 index 000000000000..52a65adfe2b8 --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/GrpcSynonymSetServiceStub.java @@ -0,0 +1,304 @@ +/* + * 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.SynonymSetServiceClient.ListSynonymSetsPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest; +import com.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest; +import com.google.cloud.contentwarehouse.v1.GetSynonymSetRequest; +import com.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest; +import com.google.cloud.contentwarehouse.v1.ListSynonymSetsResponse; +import com.google.cloud.contentwarehouse.v1.SynonymSet; +import com.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the SynonymSetService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcSynonymSetServiceStub extends SynonymSetServiceStub { + private static final MethodDescriptor + createSynonymSetMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.contentwarehouse.v1.SynonymSetService/CreateSynonymSet") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateSynonymSetRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(SynonymSet.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getSynonymSetMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.contentwarehouse.v1.SynonymSetService/GetSynonymSet") + .setRequestMarshaller( + ProtoUtils.marshaller(GetSynonymSetRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(SynonymSet.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateSynonymSetMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.contentwarehouse.v1.SynonymSetService/UpdateSynonymSet") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateSynonymSetRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(SynonymSet.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteSynonymSetMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.contentwarehouse.v1.SynonymSetService/DeleteSynonymSet") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteSynonymSetRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listSynonymSetsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.contentwarehouse.v1.SynonymSetService/ListSynonymSets") + .setRequestMarshaller( + ProtoUtils.marshaller(ListSynonymSetsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListSynonymSetsResponse.getDefaultInstance())) + .build(); + + private final UnaryCallable createSynonymSetCallable; + private final UnaryCallable getSynonymSetCallable; + private final UnaryCallable updateSynonymSetCallable; + private final UnaryCallable deleteSynonymSetCallable; + private final UnaryCallable + listSynonymSetsCallable; + private final UnaryCallable + listSynonymSetsPagedCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcSynonymSetServiceStub create(SynonymSetServiceStubSettings settings) + throws IOException { + return new GrpcSynonymSetServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcSynonymSetServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcSynonymSetServiceStub( + SynonymSetServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcSynonymSetServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcSynonymSetServiceStub( + SynonymSetServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcSynonymSetServiceStub, 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 GrpcSynonymSetServiceStub( + SynonymSetServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcSynonymSetServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcSynonymSetServiceStub, 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 GrpcSynonymSetServiceStub( + SynonymSetServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings createSynonymSetTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createSynonymSetMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings getSynonymSetTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getSynonymSetMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings updateSynonymSetTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateSynonymSetMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings deleteSynonymSetTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteSynonymSetMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + listSynonymSetsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listSynonymSetsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + + this.createSynonymSetCallable = + callableFactory.createUnaryCallable( + createSynonymSetTransportSettings, settings.createSynonymSetSettings(), clientContext); + this.getSynonymSetCallable = + callableFactory.createUnaryCallable( + getSynonymSetTransportSettings, settings.getSynonymSetSettings(), clientContext); + this.updateSynonymSetCallable = + callableFactory.createUnaryCallable( + updateSynonymSetTransportSettings, settings.updateSynonymSetSettings(), clientContext); + this.deleteSynonymSetCallable = + callableFactory.createUnaryCallable( + deleteSynonymSetTransportSettings, settings.deleteSynonymSetSettings(), clientContext); + this.listSynonymSetsCallable = + callableFactory.createUnaryCallable( + listSynonymSetsTransportSettings, settings.listSynonymSetsSettings(), clientContext); + this.listSynonymSetsPagedCallable = + callableFactory.createPagedCallable( + listSynonymSetsTransportSettings, settings.listSynonymSetsSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable createSynonymSetCallable() { + return createSynonymSetCallable; + } + + @Override + public UnaryCallable getSynonymSetCallable() { + return getSynonymSetCallable; + } + + @Override + public UnaryCallable updateSynonymSetCallable() { + return updateSynonymSetCallable; + } + + @Override + public UnaryCallable deleteSynonymSetCallable() { + return deleteSynonymSetCallable; + } + + @Override + public UnaryCallable listSynonymSetsCallable() { + return listSynonymSetsCallable; + } + + @Override + public UnaryCallable + listSynonymSetsPagedCallable() { + return listSynonymSetsPagedCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/HttpJsonDocumentLinkServiceCallableFactory.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/HttpJsonDocumentLinkServiceCallableFactory.java new file mode 100644 index 000000000000..e08cffea397a --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/HttpJsonDocumentLinkServiceCallableFactory.java @@ -0,0 +1,105 @@ +/* + * 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 com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the DocumentLinkService service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonDocumentLinkServiceCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/HttpJsonDocumentLinkServiceStub.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/HttpJsonDocumentLinkServiceStub.java new file mode 100644 index 000000000000..e4264425094c --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/HttpJsonDocumentLinkServiceStub.java @@ -0,0 +1,389 @@ +/* + * 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.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +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 com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the DocumentLinkService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonDocumentLinkServiceStub extends DocumentLinkServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + listLinkedTargetsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.contentwarehouse.v1.DocumentLinkService/ListLinkedTargets") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*/documents/*}/linkedTargets", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearParent().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLinkedTargetsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listLinkedSourcesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.contentwarehouse.v1.DocumentLinkService/ListLinkedSources") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*/documents/*}/linkedSources", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearParent().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLinkedSourcesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createDocumentLinkMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.contentwarehouse.v1.DocumentLinkService/CreateDocumentLink") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*/documents/*}/documentLinks", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearParent().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(DocumentLink.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteDocumentLinkMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.contentwarehouse.v1.DocumentLinkService/DeleteDocumentLink") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/documents/*/documentLinks/*}:delete", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable + listLinkedTargetsCallable; + private final UnaryCallable + listLinkedSourcesCallable; + private final UnaryCallable + listLinkedSourcesPagedCallable; + private final UnaryCallable createDocumentLinkCallable; + private final UnaryCallable deleteDocumentLinkCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonDocumentLinkServiceStub create( + DocumentLinkServiceStubSettings settings) throws IOException { + return new HttpJsonDocumentLinkServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonDocumentLinkServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonDocumentLinkServiceStub( + DocumentLinkServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonDocumentLinkServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonDocumentLinkServiceStub( + DocumentLinkServiceStubSettings.newHttpJsonBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of HttpJsonDocumentLinkServiceStub, 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 HttpJsonDocumentLinkServiceStub( + DocumentLinkServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonDocumentLinkServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonDocumentLinkServiceStub, 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 HttpJsonDocumentLinkServiceStub( + DocumentLinkServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings + listLinkedTargetsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLinkedTargetsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listLinkedSourcesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLinkedSourcesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + createDocumentLinkTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createDocumentLinkMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteDocumentLinkTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteDocumentLinkMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + + this.listLinkedTargetsCallable = + callableFactory.createUnaryCallable( + listLinkedTargetsTransportSettings, + settings.listLinkedTargetsSettings(), + clientContext); + this.listLinkedSourcesCallable = + callableFactory.createUnaryCallable( + listLinkedSourcesTransportSettings, + settings.listLinkedSourcesSettings(), + clientContext); + this.listLinkedSourcesPagedCallable = + callableFactory.createPagedCallable( + listLinkedSourcesTransportSettings, + settings.listLinkedSourcesSettings(), + clientContext); + this.createDocumentLinkCallable = + callableFactory.createUnaryCallable( + createDocumentLinkTransportSettings, + settings.createDocumentLinkSettings(), + clientContext); + this.deleteDocumentLinkCallable = + callableFactory.createUnaryCallable( + deleteDocumentLinkTransportSettings, + settings.deleteDocumentLinkSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(listLinkedTargetsMethodDescriptor); + methodDescriptors.add(listLinkedSourcesMethodDescriptor); + methodDescriptors.add(createDocumentLinkMethodDescriptor); + methodDescriptors.add(deleteDocumentLinkMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable + listLinkedTargetsCallable() { + return listLinkedTargetsCallable; + } + + @Override + public UnaryCallable + listLinkedSourcesCallable() { + return listLinkedSourcesCallable; + } + + @Override + public UnaryCallable + listLinkedSourcesPagedCallable() { + return listLinkedSourcesPagedCallable; + } + + @Override + public UnaryCallable createDocumentLinkCallable() { + return createDocumentLinkCallable; + } + + @Override + public UnaryCallable deleteDocumentLinkCallable() { + return deleteDocumentLinkCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/HttpJsonDocumentSchemaServiceCallableFactory.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/HttpJsonDocumentSchemaServiceCallableFactory.java new file mode 100644 index 000000000000..0f9cd8da528b --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/HttpJsonDocumentSchemaServiceCallableFactory.java @@ -0,0 +1,105 @@ +/* + * 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 com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the DocumentSchemaService service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonDocumentSchemaServiceCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/HttpJsonDocumentSchemaServiceStub.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/HttpJsonDocumentSchemaServiceStub.java new file mode 100644 index 000000000000..f963081e4756 --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/HttpJsonDocumentSchemaServiceStub.java @@ -0,0 +1,438 @@ +/* + * 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.DocumentSchemaServiceClient.ListDocumentSchemasPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest; +import com.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest; +import com.google.cloud.contentwarehouse.v1.DocumentSchema; +import com.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest; +import com.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest; +import com.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse; +import com.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the DocumentSchemaService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonDocumentSchemaServiceStub extends DocumentSchemaServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + createDocumentSchemaMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.contentwarehouse.v1.DocumentSchemaService/CreateDocumentSchema") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/documentSchemas", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("documentSchema", request.getDocumentSchema(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(DocumentSchema.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + updateDocumentSchemaMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.contentwarehouse.v1.DocumentSchemaService/UpdateDocumentSchema") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/documentSchemas/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(DocumentSchema.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getDocumentSchemaMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.contentwarehouse.v1.DocumentSchemaService/GetDocumentSchema") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/documentSchemas/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(DocumentSchema.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteDocumentSchemaMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.contentwarehouse.v1.DocumentSchemaService/DeleteDocumentSchema") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/documentSchemas/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listDocumentSchemasMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.contentwarehouse.v1.DocumentSchemaService/ListDocumentSchemas") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/documentSchemas", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListDocumentSchemasResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable + createDocumentSchemaCallable; + private final UnaryCallable + updateDocumentSchemaCallable; + private final UnaryCallable getDocumentSchemaCallable; + private final UnaryCallable deleteDocumentSchemaCallable; + private final UnaryCallable + listDocumentSchemasCallable; + private final UnaryCallable + listDocumentSchemasPagedCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonDocumentSchemaServiceStub create( + DocumentSchemaServiceStubSettings settings) throws IOException { + return new HttpJsonDocumentSchemaServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonDocumentSchemaServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonDocumentSchemaServiceStub( + DocumentSchemaServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonDocumentSchemaServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonDocumentSchemaServiceStub( + DocumentSchemaServiceStubSettings.newHttpJsonBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of HttpJsonDocumentSchemaServiceStub, 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 HttpJsonDocumentSchemaServiceStub( + DocumentSchemaServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonDocumentSchemaServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonDocumentSchemaServiceStub, 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 HttpJsonDocumentSchemaServiceStub( + DocumentSchemaServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings + createDocumentSchemaTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createDocumentSchemaMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + updateDocumentSchemaTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateDocumentSchemaMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + getDocumentSchemaTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getDocumentSchemaMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteDocumentSchemaTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteDocumentSchemaMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listDocumentSchemasTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(listDocumentSchemasMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + + this.createDocumentSchemaCallable = + callableFactory.createUnaryCallable( + createDocumentSchemaTransportSettings, + settings.createDocumentSchemaSettings(), + clientContext); + this.updateDocumentSchemaCallable = + callableFactory.createUnaryCallable( + updateDocumentSchemaTransportSettings, + settings.updateDocumentSchemaSettings(), + clientContext); + this.getDocumentSchemaCallable = + callableFactory.createUnaryCallable( + getDocumentSchemaTransportSettings, + settings.getDocumentSchemaSettings(), + clientContext); + this.deleteDocumentSchemaCallable = + callableFactory.createUnaryCallable( + deleteDocumentSchemaTransportSettings, + settings.deleteDocumentSchemaSettings(), + clientContext); + this.listDocumentSchemasCallable = + callableFactory.createUnaryCallable( + listDocumentSchemasTransportSettings, + settings.listDocumentSchemasSettings(), + clientContext); + this.listDocumentSchemasPagedCallable = + callableFactory.createPagedCallable( + listDocumentSchemasTransportSettings, + settings.listDocumentSchemasSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(createDocumentSchemaMethodDescriptor); + methodDescriptors.add(updateDocumentSchemaMethodDescriptor); + methodDescriptors.add(getDocumentSchemaMethodDescriptor); + methodDescriptors.add(deleteDocumentSchemaMethodDescriptor); + methodDescriptors.add(listDocumentSchemasMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable createDocumentSchemaCallable() { + return createDocumentSchemaCallable; + } + + @Override + public UnaryCallable updateDocumentSchemaCallable() { + return updateDocumentSchemaCallable; + } + + @Override + public UnaryCallable getDocumentSchemaCallable() { + return getDocumentSchemaCallable; + } + + @Override + public UnaryCallable deleteDocumentSchemaCallable() { + return deleteDocumentSchemaCallable; + } + + @Override + public UnaryCallable + listDocumentSchemasCallable() { + return listDocumentSchemasCallable; + } + + @Override + public UnaryCallable + listDocumentSchemasPagedCallable() { + return listDocumentSchemasPagedCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/HttpJsonDocumentServiceCallableFactory.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/HttpJsonDocumentServiceCallableFactory.java new file mode 100644 index 000000000000..e3b06095fd67 --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/HttpJsonDocumentServiceCallableFactory.java @@ -0,0 +1,105 @@ +/* + * 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 com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the DocumentService service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonDocumentServiceCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/HttpJsonDocumentServiceStub.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/HttpJsonDocumentServiceStub.java new file mode 100644 index 000000000000..fa6546164e24 --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/HttpJsonDocumentServiceStub.java @@ -0,0 +1,536 @@ +/* + * 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.DocumentServiceClient.SearchDocumentsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.contentwarehouse.v1.CreateDocumentRequest; +import com.google.cloud.contentwarehouse.v1.CreateDocumentResponse; +import com.google.cloud.contentwarehouse.v1.DeleteDocumentRequest; +import com.google.cloud.contentwarehouse.v1.Document; +import com.google.cloud.contentwarehouse.v1.FetchAclRequest; +import com.google.cloud.contentwarehouse.v1.FetchAclResponse; +import com.google.cloud.contentwarehouse.v1.GetDocumentRequest; +import com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest; +import com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse; +import com.google.cloud.contentwarehouse.v1.SetAclRequest; +import com.google.cloud.contentwarehouse.v1.SetAclResponse; +import com.google.cloud.contentwarehouse.v1.UpdateDocumentRequest; +import com.google.cloud.contentwarehouse.v1.UpdateDocumentResponse; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the DocumentService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonDocumentServiceStub extends DocumentServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + createDocumentMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.contentwarehouse.v1.DocumentService/CreateDocument") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/documents", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearParent().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(CreateDocumentResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getDocumentMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.contentwarehouse.v1.DocumentService/GetDocument") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/documents/*}:get", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setAdditionalPaths( + "/v1/{name=projects/*/locations/*/documents/referenceId/*}:get") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Document.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + updateDocumentMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.contentwarehouse.v1.DocumentService/UpdateDocument") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/documents/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setAdditionalPaths( + "/v1/{name=projects/*/locations/*/documents/referenceId/*}") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(UpdateDocumentResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteDocumentMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.contentwarehouse.v1.DocumentService/DeleteDocument") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/documents/*}:delete", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setAdditionalPaths( + "/v1/{name=projects/*/locations/*/documents/referenceId/*}:delete") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + searchDocumentsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.contentwarehouse.v1.DocumentService/SearchDocuments") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/documents:search", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearParent().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(SearchDocumentsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + fetchAclMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.contentwarehouse.v1.DocumentService/FetchAcl") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{resource=projects/*/locations/*/documents/*}:fetchAcl", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths("/v1/{resource=projects/*}:fetchAcl") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(FetchAclResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor setAclMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.contentwarehouse.v1.DocumentService/SetAcl") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{resource=projects/*/locations/*/documents/*}:setAcl", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths("/v1/{resource=projects/*}:setAcl") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(SetAclResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable createDocumentCallable; + private final UnaryCallable getDocumentCallable; + private final UnaryCallable updateDocumentCallable; + private final UnaryCallable deleteDocumentCallable; + private final UnaryCallable + searchDocumentsCallable; + private final UnaryCallable + searchDocumentsPagedCallable; + private final UnaryCallable fetchAclCallable; + private final UnaryCallable setAclCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonDocumentServiceStub create(DocumentServiceStubSettings settings) + throws IOException { + return new HttpJsonDocumentServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonDocumentServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonDocumentServiceStub( + DocumentServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonDocumentServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonDocumentServiceStub( + DocumentServiceStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonDocumentServiceStub, 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 HttpJsonDocumentServiceStub( + DocumentServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonDocumentServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonDocumentServiceStub, 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 HttpJsonDocumentServiceStub( + DocumentServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings + createDocumentTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createDocumentMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getDocumentTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getDocumentMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + updateDocumentTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateDocumentMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteDocumentTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteDocumentMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + searchDocumentsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(searchDocumentsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings fetchAclTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(fetchAclMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings setAclTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setAclMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + + this.createDocumentCallable = + callableFactory.createUnaryCallable( + createDocumentTransportSettings, settings.createDocumentSettings(), clientContext); + this.getDocumentCallable = + callableFactory.createUnaryCallable( + getDocumentTransportSettings, settings.getDocumentSettings(), clientContext); + this.updateDocumentCallable = + callableFactory.createUnaryCallable( + updateDocumentTransportSettings, settings.updateDocumentSettings(), clientContext); + this.deleteDocumentCallable = + callableFactory.createUnaryCallable( + deleteDocumentTransportSettings, settings.deleteDocumentSettings(), clientContext); + this.searchDocumentsCallable = + callableFactory.createUnaryCallable( + searchDocumentsTransportSettings, settings.searchDocumentsSettings(), clientContext); + this.searchDocumentsPagedCallable = + callableFactory.createPagedCallable( + searchDocumentsTransportSettings, settings.searchDocumentsSettings(), clientContext); + this.fetchAclCallable = + callableFactory.createUnaryCallable( + fetchAclTransportSettings, settings.fetchAclSettings(), clientContext); + this.setAclCallable = + callableFactory.createUnaryCallable( + setAclTransportSettings, settings.setAclSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(createDocumentMethodDescriptor); + methodDescriptors.add(getDocumentMethodDescriptor); + methodDescriptors.add(updateDocumentMethodDescriptor); + methodDescriptors.add(deleteDocumentMethodDescriptor); + methodDescriptors.add(searchDocumentsMethodDescriptor); + methodDescriptors.add(fetchAclMethodDescriptor); + methodDescriptors.add(setAclMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable createDocumentCallable() { + return createDocumentCallable; + } + + @Override + public UnaryCallable getDocumentCallable() { + return getDocumentCallable; + } + + @Override + public UnaryCallable updateDocumentCallable() { + return updateDocumentCallable; + } + + @Override + public UnaryCallable deleteDocumentCallable() { + return deleteDocumentCallable; + } + + @Override + public UnaryCallable searchDocumentsCallable() { + return searchDocumentsCallable; + } + + @Override + public UnaryCallable + searchDocumentsPagedCallable() { + return searchDocumentsPagedCallable; + } + + @Override + public UnaryCallable fetchAclCallable() { + return fetchAclCallable; + } + + @Override + public UnaryCallable setAclCallable() { + return setAclCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/HttpJsonRuleSetServiceCallableFactory.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/HttpJsonRuleSetServiceCallableFactory.java new file mode 100644 index 000000000000..7a2951d99f95 --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/HttpJsonRuleSetServiceCallableFactory.java @@ -0,0 +1,105 @@ +/* + * 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 com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the RuleSetService service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonRuleSetServiceCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/HttpJsonRuleSetServiceStub.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/HttpJsonRuleSetServiceStub.java new file mode 100644 index 000000000000..b46e384a01fd --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/HttpJsonRuleSetServiceStub.java @@ -0,0 +1,408 @@ +/* + * 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.RuleSetServiceClient.ListRuleSetsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.contentwarehouse.v1.CreateRuleSetRequest; +import com.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest; +import com.google.cloud.contentwarehouse.v1.GetRuleSetRequest; +import com.google.cloud.contentwarehouse.v1.ListRuleSetsRequest; +import com.google.cloud.contentwarehouse.v1.ListRuleSetsResponse; +import com.google.cloud.contentwarehouse.v1.RuleSet; +import com.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the RuleSetService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonRuleSetServiceStub extends RuleSetServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + createRuleSetMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.contentwarehouse.v1.RuleSetService/CreateRuleSet") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/ruleSets", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("ruleSet", request.getRuleSet(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(RuleSet.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getRuleSetMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.contentwarehouse.v1.RuleSetService/GetRuleSet") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/ruleSets/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(RuleSet.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + updateRuleSetMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.contentwarehouse.v1.RuleSetService/UpdateRuleSet") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/ruleSets/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(RuleSet.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteRuleSetMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.contentwarehouse.v1.RuleSetService/DeleteRuleSet") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/ruleSets/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listRuleSetsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.contentwarehouse.v1.RuleSetService/ListRuleSets") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/ruleSets", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListRuleSetsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable createRuleSetCallable; + private final UnaryCallable getRuleSetCallable; + private final UnaryCallable updateRuleSetCallable; + private final UnaryCallable deleteRuleSetCallable; + private final UnaryCallable listRuleSetsCallable; + private final UnaryCallable + listRuleSetsPagedCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonRuleSetServiceStub create(RuleSetServiceStubSettings settings) + throws IOException { + return new HttpJsonRuleSetServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonRuleSetServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonRuleSetServiceStub( + RuleSetServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonRuleSetServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonRuleSetServiceStub( + RuleSetServiceStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonRuleSetServiceStub, 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 HttpJsonRuleSetServiceStub( + RuleSetServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonRuleSetServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonRuleSetServiceStub, 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 HttpJsonRuleSetServiceStub( + RuleSetServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings createRuleSetTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createRuleSetMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getRuleSetTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getRuleSetMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings updateRuleSetTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateRuleSetMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteRuleSetTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteRuleSetMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings listRuleSetsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listRuleSetsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + + this.createRuleSetCallable = + callableFactory.createUnaryCallable( + createRuleSetTransportSettings, settings.createRuleSetSettings(), clientContext); + this.getRuleSetCallable = + callableFactory.createUnaryCallable( + getRuleSetTransportSettings, settings.getRuleSetSettings(), clientContext); + this.updateRuleSetCallable = + callableFactory.createUnaryCallable( + updateRuleSetTransportSettings, settings.updateRuleSetSettings(), clientContext); + this.deleteRuleSetCallable = + callableFactory.createUnaryCallable( + deleteRuleSetTransportSettings, settings.deleteRuleSetSettings(), clientContext); + this.listRuleSetsCallable = + callableFactory.createUnaryCallable( + listRuleSetsTransportSettings, settings.listRuleSetsSettings(), clientContext); + this.listRuleSetsPagedCallable = + callableFactory.createPagedCallable( + listRuleSetsTransportSettings, settings.listRuleSetsSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(createRuleSetMethodDescriptor); + methodDescriptors.add(getRuleSetMethodDescriptor); + methodDescriptors.add(updateRuleSetMethodDescriptor); + methodDescriptors.add(deleteRuleSetMethodDescriptor); + methodDescriptors.add(listRuleSetsMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable createRuleSetCallable() { + return createRuleSetCallable; + } + + @Override + public UnaryCallable getRuleSetCallable() { + return getRuleSetCallable; + } + + @Override + public UnaryCallable updateRuleSetCallable() { + return updateRuleSetCallable; + } + + @Override + public UnaryCallable deleteRuleSetCallable() { + return deleteRuleSetCallable; + } + + @Override + public UnaryCallable listRuleSetsCallable() { + return listRuleSetsCallable; + } + + @Override + public UnaryCallable listRuleSetsPagedCallable() { + return listRuleSetsPagedCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/HttpJsonSynonymSetServiceCallableFactory.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/HttpJsonSynonymSetServiceCallableFactory.java new file mode 100644 index 000000000000..aa81f2648e04 --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/HttpJsonSynonymSetServiceCallableFactory.java @@ -0,0 +1,105 @@ +/* + * 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 com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the SynonymSetService service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonSynonymSetServiceCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/HttpJsonSynonymSetServiceStub.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/HttpJsonSynonymSetServiceStub.java new file mode 100644 index 000000000000..ea3ca937eac2 --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/HttpJsonSynonymSetServiceStub.java @@ -0,0 +1,416 @@ +/* + * 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.SynonymSetServiceClient.ListSynonymSetsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest; +import com.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest; +import com.google.cloud.contentwarehouse.v1.GetSynonymSetRequest; +import com.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest; +import com.google.cloud.contentwarehouse.v1.ListSynonymSetsResponse; +import com.google.cloud.contentwarehouse.v1.SynonymSet; +import com.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the SynonymSetService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonSynonymSetServiceStub extends SynonymSetServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + createSynonymSetMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.contentwarehouse.v1.SynonymSetService/CreateSynonymSet") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/synonymSets", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("synonymSet", request.getSynonymSet(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(SynonymSet.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getSynonymSetMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.contentwarehouse.v1.SynonymSetService/GetSynonymSet") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/synonymSets/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(SynonymSet.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + updateSynonymSetMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.contentwarehouse.v1.SynonymSetService/UpdateSynonymSet") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/synonymSets/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("synonymSet", request.getSynonymSet(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(SynonymSet.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteSynonymSetMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.contentwarehouse.v1.SynonymSetService/DeleteSynonymSet") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/synonymSets/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listSynonymSetsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.contentwarehouse.v1.SynonymSetService/ListSynonymSets") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/synonymSets", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListSynonymSetsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable createSynonymSetCallable; + private final UnaryCallable getSynonymSetCallable; + private final UnaryCallable updateSynonymSetCallable; + private final UnaryCallable deleteSynonymSetCallable; + private final UnaryCallable + listSynonymSetsCallable; + private final UnaryCallable + listSynonymSetsPagedCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonSynonymSetServiceStub create(SynonymSetServiceStubSettings settings) + throws IOException { + return new HttpJsonSynonymSetServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonSynonymSetServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonSynonymSetServiceStub( + SynonymSetServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonSynonymSetServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonSynonymSetServiceStub( + SynonymSetServiceStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonSynonymSetServiceStub, 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 HttpJsonSynonymSetServiceStub( + SynonymSetServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonSynonymSetServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonSynonymSetServiceStub, 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 HttpJsonSynonymSetServiceStub( + SynonymSetServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings createSynonymSetTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createSynonymSetMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getSynonymSetTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getSynonymSetMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings updateSynonymSetTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateSynonymSetMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteSynonymSetTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteSynonymSetMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listSynonymSetsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listSynonymSetsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + + this.createSynonymSetCallable = + callableFactory.createUnaryCallable( + createSynonymSetTransportSettings, settings.createSynonymSetSettings(), clientContext); + this.getSynonymSetCallable = + callableFactory.createUnaryCallable( + getSynonymSetTransportSettings, settings.getSynonymSetSettings(), clientContext); + this.updateSynonymSetCallable = + callableFactory.createUnaryCallable( + updateSynonymSetTransportSettings, settings.updateSynonymSetSettings(), clientContext); + this.deleteSynonymSetCallable = + callableFactory.createUnaryCallable( + deleteSynonymSetTransportSettings, settings.deleteSynonymSetSettings(), clientContext); + this.listSynonymSetsCallable = + callableFactory.createUnaryCallable( + listSynonymSetsTransportSettings, settings.listSynonymSetsSettings(), clientContext); + this.listSynonymSetsPagedCallable = + callableFactory.createPagedCallable( + listSynonymSetsTransportSettings, settings.listSynonymSetsSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(createSynonymSetMethodDescriptor); + methodDescriptors.add(getSynonymSetMethodDescriptor); + methodDescriptors.add(updateSynonymSetMethodDescriptor); + methodDescriptors.add(deleteSynonymSetMethodDescriptor); + methodDescriptors.add(listSynonymSetsMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable createSynonymSetCallable() { + return createSynonymSetCallable; + } + + @Override + public UnaryCallable getSynonymSetCallable() { + return getSynonymSetCallable; + } + + @Override + public UnaryCallable updateSynonymSetCallable() { + return updateSynonymSetCallable; + } + + @Override + public UnaryCallable deleteSynonymSetCallable() { + return deleteSynonymSetCallable; + } + + @Override + public UnaryCallable listSynonymSetsCallable() { + return listSynonymSetsCallable; + } + + @Override + public UnaryCallable + listSynonymSetsPagedCallable() { + return listSynonymSetsPagedCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/RuleSetServiceStub.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/RuleSetServiceStub.java new file mode 100644 index 000000000000..2355002c77bf --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/RuleSetServiceStub.java @@ -0,0 +1,68 @@ +/* + * 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.RuleSetServiceClient.ListRuleSetsPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.contentwarehouse.v1.CreateRuleSetRequest; +import com.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest; +import com.google.cloud.contentwarehouse.v1.GetRuleSetRequest; +import com.google.cloud.contentwarehouse.v1.ListRuleSetsRequest; +import com.google.cloud.contentwarehouse.v1.ListRuleSetsResponse; +import com.google.cloud.contentwarehouse.v1.RuleSet; +import com.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the RuleSetService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class RuleSetServiceStub implements BackgroundResource { + + public UnaryCallable createRuleSetCallable() { + throw new UnsupportedOperationException("Not implemented: createRuleSetCallable()"); + } + + public UnaryCallable getRuleSetCallable() { + throw new UnsupportedOperationException("Not implemented: getRuleSetCallable()"); + } + + public UnaryCallable updateRuleSetCallable() { + throw new UnsupportedOperationException("Not implemented: updateRuleSetCallable()"); + } + + public UnaryCallable deleteRuleSetCallable() { + throw new UnsupportedOperationException("Not implemented: deleteRuleSetCallable()"); + } + + public UnaryCallable listRuleSetsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listRuleSetsPagedCallable()"); + } + + public UnaryCallable listRuleSetsCallable() { + throw new UnsupportedOperationException("Not implemented: listRuleSetsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/RuleSetServiceStubSettings.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/RuleSetServiceStubSettings.java new file mode 100644 index 000000000000..45ca9d7577f4 --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/RuleSetServiceStubSettings.java @@ -0,0 +1,498 @@ +/* + * 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.RuleSetServiceClient.ListRuleSetsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.contentwarehouse.v1.CreateRuleSetRequest; +import com.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest; +import com.google.cloud.contentwarehouse.v1.GetRuleSetRequest; +import com.google.cloud.contentwarehouse.v1.ListRuleSetsRequest; +import com.google.cloud.contentwarehouse.v1.ListRuleSetsResponse; +import com.google.cloud.contentwarehouse.v1.RuleSet; +import com.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link RuleSetServiceStub}. + * + *

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

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

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

For example, to set the total timeout of createRuleSet 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
+ * RuleSetServiceStubSettings.Builder ruleSetServiceSettingsBuilder =
+ *     RuleSetServiceStubSettings.newBuilder();
+ * ruleSetServiceSettingsBuilder
+ *     .createRuleSetSettings()
+ *     .setRetrySettings(
+ *         ruleSetServiceSettingsBuilder.createRuleSetSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * RuleSetServiceStubSettings ruleSetServiceSettings = ruleSetServiceSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class RuleSetServiceStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final UnaryCallSettings createRuleSetSettings; + private final UnaryCallSettings getRuleSetSettings; + private final UnaryCallSettings updateRuleSetSettings; + private final UnaryCallSettings deleteRuleSetSettings; + private final PagedCallSettings< + ListRuleSetsRequest, ListRuleSetsResponse, ListRuleSetsPagedResponse> + listRuleSetsSettings; + + private static final PagedListDescriptor + LIST_RULE_SETS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListRuleSetsRequest injectToken(ListRuleSetsRequest payload, String token) { + return ListRuleSetsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListRuleSetsRequest injectPageSize(ListRuleSetsRequest payload, int pageSize) { + return ListRuleSetsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListRuleSetsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListRuleSetsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListRuleSetsResponse payload) { + return payload.getRuleSetsList() == null + ? ImmutableList.of() + : payload.getRuleSetsList(); + } + }; + + private static final PagedListResponseFactory< + ListRuleSetsRequest, ListRuleSetsResponse, ListRuleSetsPagedResponse> + LIST_RULE_SETS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListRuleSetsRequest, ListRuleSetsResponse, ListRuleSetsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListRuleSetsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_RULE_SETS_PAGE_STR_DESC, request, context); + return ListRuleSetsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to createRuleSet. */ + public UnaryCallSettings createRuleSetSettings() { + return createRuleSetSettings; + } + + /** Returns the object with the settings used for calls to getRuleSet. */ + public UnaryCallSettings getRuleSetSettings() { + return getRuleSetSettings; + } + + /** Returns the object with the settings used for calls to updateRuleSet. */ + public UnaryCallSettings updateRuleSetSettings() { + return updateRuleSetSettings; + } + + /** Returns the object with the settings used for calls to deleteRuleSet. */ + public UnaryCallSettings deleteRuleSetSettings() { + return deleteRuleSetSettings; + } + + /** Returns the object with the settings used for calls to listRuleSets. */ + public PagedCallSettings + listRuleSetsSettings() { + return listRuleSetsSettings; + } + + public RuleSetServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcRuleSetServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonRuleSetServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "contentwarehouse.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "contentwarehouse.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(RuleSetServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(RuleSetServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return RuleSetServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected RuleSetServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createRuleSetSettings = settingsBuilder.createRuleSetSettings().build(); + getRuleSetSettings = settingsBuilder.getRuleSetSettings().build(); + updateRuleSetSettings = settingsBuilder.updateRuleSetSettings().build(); + deleteRuleSetSettings = settingsBuilder.deleteRuleSetSettings().build(); + listRuleSetsSettings = settingsBuilder.listRuleSetsSettings().build(); + } + + /** Builder for RuleSetServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder createRuleSetSettings; + private final UnaryCallSettings.Builder getRuleSetSettings; + private final UnaryCallSettings.Builder updateRuleSetSettings; + private final UnaryCallSettings.Builder deleteRuleSetSettings; + private final PagedCallSettings.Builder< + ListRuleSetsRequest, ListRuleSetsResponse, ListRuleSetsPagedResponse> + listRuleSetsSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("no_retry_1_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(10000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + createRuleSetSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getRuleSetSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateRuleSetSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteRuleSetSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listRuleSetsSettings = PagedCallSettings.newBuilder(LIST_RULE_SETS_PAGE_STR_FACT); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createRuleSetSettings, + getRuleSetSettings, + updateRuleSetSettings, + deleteRuleSetSettings, + listRuleSetsSettings); + initDefaults(this); + } + + protected Builder(RuleSetServiceStubSettings settings) { + super(settings); + + createRuleSetSettings = settings.createRuleSetSettings.toBuilder(); + getRuleSetSettings = settings.getRuleSetSettings.toBuilder(); + updateRuleSetSettings = settings.updateRuleSetSettings.toBuilder(); + deleteRuleSetSettings = settings.deleteRuleSetSettings.toBuilder(); + listRuleSetsSettings = settings.listRuleSetsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createRuleSetSettings, + getRuleSetSettings, + updateRuleSetSettings, + deleteRuleSetSettings, + listRuleSetsSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .createRuleSetSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .getRuleSetSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .updateRuleSetSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .deleteRuleSetSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .listRuleSetsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to createRuleSet. */ + public UnaryCallSettings.Builder createRuleSetSettings() { + return createRuleSetSettings; + } + + /** Returns the builder for the settings used for calls to getRuleSet. */ + public UnaryCallSettings.Builder getRuleSetSettings() { + return getRuleSetSettings; + } + + /** Returns the builder for the settings used for calls to updateRuleSet. */ + public UnaryCallSettings.Builder updateRuleSetSettings() { + return updateRuleSetSettings; + } + + /** Returns the builder for the settings used for calls to deleteRuleSet. */ + public UnaryCallSettings.Builder deleteRuleSetSettings() { + return deleteRuleSetSettings; + } + + /** Returns the builder for the settings used for calls to listRuleSets. */ + public PagedCallSettings.Builder< + ListRuleSetsRequest, ListRuleSetsResponse, ListRuleSetsPagedResponse> + listRuleSetsSettings() { + return listRuleSetsSettings; + } + + @Override + public RuleSetServiceStubSettings build() throws IOException { + return new RuleSetServiceStubSettings(this); + } + } +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/SynonymSetServiceStub.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/SynonymSetServiceStub.java new file mode 100644 index 000000000000..9bd492fb5f3e --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/SynonymSetServiceStub.java @@ -0,0 +1,69 @@ +/* + * 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.SynonymSetServiceClient.ListSynonymSetsPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest; +import com.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest; +import com.google.cloud.contentwarehouse.v1.GetSynonymSetRequest; +import com.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest; +import com.google.cloud.contentwarehouse.v1.ListSynonymSetsResponse; +import com.google.cloud.contentwarehouse.v1.SynonymSet; +import com.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the SynonymSetService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class SynonymSetServiceStub implements BackgroundResource { + + public UnaryCallable createSynonymSetCallable() { + throw new UnsupportedOperationException("Not implemented: createSynonymSetCallable()"); + } + + public UnaryCallable getSynonymSetCallable() { + throw new UnsupportedOperationException("Not implemented: getSynonymSetCallable()"); + } + + public UnaryCallable updateSynonymSetCallable() { + throw new UnsupportedOperationException("Not implemented: updateSynonymSetCallable()"); + } + + public UnaryCallable deleteSynonymSetCallable() { + throw new UnsupportedOperationException("Not implemented: deleteSynonymSetCallable()"); + } + + public UnaryCallable + listSynonymSetsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listSynonymSetsPagedCallable()"); + } + + public UnaryCallable listSynonymSetsCallable() { + throw new UnsupportedOperationException("Not implemented: listSynonymSetsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/SynonymSetServiceStubSettings.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/SynonymSetServiceStubSettings.java new file mode 100644 index 000000000000..1c218cd3c93f --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/main/java/com/google/cloud/contentwarehouse/v1/stub/SynonymSetServiceStubSettings.java @@ -0,0 +1,511 @@ +/* + * 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.SynonymSetServiceClient.ListSynonymSetsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest; +import com.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest; +import com.google.cloud.contentwarehouse.v1.GetSynonymSetRequest; +import com.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest; +import com.google.cloud.contentwarehouse.v1.ListSynonymSetsResponse; +import com.google.cloud.contentwarehouse.v1.SynonymSet; +import com.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link SynonymSetServiceStub}. + * + *

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

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

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

For example, to set the total timeout of createSynonymSet 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
+ * SynonymSetServiceStubSettings.Builder synonymSetServiceSettingsBuilder =
+ *     SynonymSetServiceStubSettings.newBuilder();
+ * synonymSetServiceSettingsBuilder
+ *     .createSynonymSetSettings()
+ *     .setRetrySettings(
+ *         synonymSetServiceSettingsBuilder
+ *             .createSynonymSetSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * SynonymSetServiceStubSettings synonymSetServiceSettings =
+ *     synonymSetServiceSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class SynonymSetServiceStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final UnaryCallSettings createSynonymSetSettings; + private final UnaryCallSettings getSynonymSetSettings; + private final UnaryCallSettings updateSynonymSetSettings; + private final UnaryCallSettings deleteSynonymSetSettings; + private final PagedCallSettings< + ListSynonymSetsRequest, ListSynonymSetsResponse, ListSynonymSetsPagedResponse> + listSynonymSetsSettings; + + private static final PagedListDescriptor< + ListSynonymSetsRequest, ListSynonymSetsResponse, SynonymSet> + LIST_SYNONYM_SETS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListSynonymSetsRequest injectToken( + ListSynonymSetsRequest payload, String token) { + return ListSynonymSetsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListSynonymSetsRequest injectPageSize( + ListSynonymSetsRequest payload, int pageSize) { + return ListSynonymSetsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListSynonymSetsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListSynonymSetsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListSynonymSetsResponse payload) { + return payload.getSynonymSetsList() == null + ? ImmutableList.of() + : payload.getSynonymSetsList(); + } + }; + + private static final PagedListResponseFactory< + ListSynonymSetsRequest, ListSynonymSetsResponse, ListSynonymSetsPagedResponse> + LIST_SYNONYM_SETS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListSynonymSetsRequest, ListSynonymSetsResponse, ListSynonymSetsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListSynonymSetsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_SYNONYM_SETS_PAGE_STR_DESC, request, context); + return ListSynonymSetsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to createSynonymSet. */ + public UnaryCallSettings createSynonymSetSettings() { + return createSynonymSetSettings; + } + + /** Returns the object with the settings used for calls to getSynonymSet. */ + public UnaryCallSettings getSynonymSetSettings() { + return getSynonymSetSettings; + } + + /** Returns the object with the settings used for calls to updateSynonymSet. */ + public UnaryCallSettings updateSynonymSetSettings() { + return updateSynonymSetSettings; + } + + /** Returns the object with the settings used for calls to deleteSynonymSet. */ + public UnaryCallSettings deleteSynonymSetSettings() { + return deleteSynonymSetSettings; + } + + /** Returns the object with the settings used for calls to listSynonymSets. */ + public PagedCallSettings< + ListSynonymSetsRequest, ListSynonymSetsResponse, ListSynonymSetsPagedResponse> + listSynonymSetsSettings() { + return listSynonymSetsSettings; + } + + public SynonymSetServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcSynonymSetServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonSynonymSetServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "contentwarehouse.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "contentwarehouse.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SynonymSetServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SynonymSetServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SynonymSetServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected SynonymSetServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createSynonymSetSettings = settingsBuilder.createSynonymSetSettings().build(); + getSynonymSetSettings = settingsBuilder.getSynonymSetSettings().build(); + updateSynonymSetSettings = settingsBuilder.updateSynonymSetSettings().build(); + deleteSynonymSetSettings = settingsBuilder.deleteSynonymSetSettings().build(); + listSynonymSetsSettings = settingsBuilder.listSynonymSetsSettings().build(); + } + + /** Builder for SynonymSetServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder + createSynonymSetSettings; + private final UnaryCallSettings.Builder getSynonymSetSettings; + private final UnaryCallSettings.Builder + updateSynonymSetSettings; + private final UnaryCallSettings.Builder + deleteSynonymSetSettings; + private final PagedCallSettings.Builder< + ListSynonymSetsRequest, ListSynonymSetsResponse, ListSynonymSetsPagedResponse> + listSynonymSetsSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("no_retry_1_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(10000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + createSynonymSetSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getSynonymSetSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateSynonymSetSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteSynonymSetSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listSynonymSetsSettings = PagedCallSettings.newBuilder(LIST_SYNONYM_SETS_PAGE_STR_FACT); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createSynonymSetSettings, + getSynonymSetSettings, + updateSynonymSetSettings, + deleteSynonymSetSettings, + listSynonymSetsSettings); + initDefaults(this); + } + + protected Builder(SynonymSetServiceStubSettings settings) { + super(settings); + + createSynonymSetSettings = settings.createSynonymSetSettings.toBuilder(); + getSynonymSetSettings = settings.getSynonymSetSettings.toBuilder(); + updateSynonymSetSettings = settings.updateSynonymSetSettings.toBuilder(); + deleteSynonymSetSettings = settings.deleteSynonymSetSettings.toBuilder(); + listSynonymSetsSettings = settings.listSynonymSetsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createSynonymSetSettings, + getSynonymSetSettings, + updateSynonymSetSettings, + deleteSynonymSetSettings, + listSynonymSetsSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .createSynonymSetSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .getSynonymSetSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .updateSynonymSetSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .deleteSynonymSetSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .listSynonymSetsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to createSynonymSet. */ + public UnaryCallSettings.Builder + createSynonymSetSettings() { + return createSynonymSetSettings; + } + + /** Returns the builder for the settings used for calls to getSynonymSet. */ + public UnaryCallSettings.Builder getSynonymSetSettings() { + return getSynonymSetSettings; + } + + /** Returns the builder for the settings used for calls to updateSynonymSet. */ + public UnaryCallSettings.Builder + updateSynonymSetSettings() { + return updateSynonymSetSettings; + } + + /** Returns the builder for the settings used for calls to deleteSynonymSet. */ + public UnaryCallSettings.Builder deleteSynonymSetSettings() { + return deleteSynonymSetSettings; + } + + /** Returns the builder for the settings used for calls to listSynonymSets. */ + public PagedCallSettings.Builder< + ListSynonymSetsRequest, ListSynonymSetsResponse, ListSynonymSetsPagedResponse> + listSynonymSetsSettings() { + return listSynonymSetsSettings; + } + + @Override + public SynonymSetServiceStubSettings build() throws IOException { + return new SynonymSetServiceStubSettings(this); + } + } +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/DocumentLinkServiceClientHttpJsonTest.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/DocumentLinkServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..42e6edd8ec91 --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/DocumentLinkServiceClientHttpJsonTest.java @@ -0,0 +1,466 @@ +/* + * 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; + +import static com.google.cloud.contentwarehouse.v1.DocumentLinkServiceClient.ListLinkedSourcesPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.contentwarehouse.v1.stub.HttpJsonDocumentLinkServiceStub; +import com.google.common.collect.Lists; +import com.google.protobuf.Empty; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class DocumentLinkServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static DocumentLinkServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonDocumentLinkServiceStub.getMethodDescriptors(), + DocumentLinkServiceSettings.getDefaultEndpoint()); + DocumentLinkServiceSettings settings = + DocumentLinkServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + DocumentLinkServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = DocumentLinkServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void listLinkedTargetsTest() throws Exception { + ListLinkedTargetsResponse expectedResponse = + ListLinkedTargetsResponse.newBuilder() + .addAllDocumentLinks(new ArrayList()) + .setNextPageToken("nextPageToken-1386094857") + .build(); + mockService.addResponse(expectedResponse); + + DocumentName parent = + DocumentName.ofProjectLocationDocumentName("[PROJECT]", "[LOCATION]", "[DOCUMENT]"); + + ListLinkedTargetsResponse actualResponse = client.listLinkedTargets(parent); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLinkedTargetsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + DocumentName parent = + DocumentName.ofProjectLocationDocumentName("[PROJECT]", "[LOCATION]", "[DOCUMENT]"); + client.listLinkedTargets(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLinkedTargetsTest2() throws Exception { + ListLinkedTargetsResponse expectedResponse = + ListLinkedTargetsResponse.newBuilder() + .addAllDocumentLinks(new ArrayList()) + .setNextPageToken("nextPageToken-1386094857") + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-6989/locations/location-6989/documents/document-6989"; + + ListLinkedTargetsResponse actualResponse = client.listLinkedTargets(parent); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLinkedTargetsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-6989/locations/location-6989/documents/document-6989"; + client.listLinkedTargets(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLinkedSourcesTest() throws Exception { + DocumentLink responsesElement = DocumentLink.newBuilder().build(); + ListLinkedSourcesResponse expectedResponse = + ListLinkedSourcesResponse.newBuilder() + .setNextPageToken("") + .addAllDocumentLinks(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + DocumentName parent = + DocumentName.ofProjectLocationDocumentName("[PROJECT]", "[LOCATION]", "[DOCUMENT]"); + + ListLinkedSourcesPagedResponse pagedListResponse = client.listLinkedSources(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getDocumentLinksList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLinkedSourcesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + DocumentName parent = + DocumentName.ofProjectLocationDocumentName("[PROJECT]", "[LOCATION]", "[DOCUMENT]"); + client.listLinkedSources(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLinkedSourcesTest2() throws Exception { + DocumentLink responsesElement = DocumentLink.newBuilder().build(); + ListLinkedSourcesResponse expectedResponse = + ListLinkedSourcesResponse.newBuilder() + .setNextPageToken("") + .addAllDocumentLinks(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-6989/locations/location-6989/documents/document-6989"; + + ListLinkedSourcesPagedResponse pagedListResponse = client.listLinkedSources(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getDocumentLinksList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLinkedSourcesExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-6989/locations/location-6989/documents/document-6989"; + client.listLinkedSources(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createDocumentLinkTest() throws Exception { + DocumentLink expectedResponse = + DocumentLink.newBuilder() + .setName( + DocumentLinkName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT]", "[DOCUMENT_LINK]") + .toString()) + .setSourceDocumentReference(DocumentReference.newBuilder().build()) + .setTargetDocumentReference(DocumentReference.newBuilder().build()) + .setDescription("description-1724546052") + .setUpdateTime(Timestamp.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + DocumentName parent = + DocumentName.ofProjectLocationDocumentName("[PROJECT]", "[LOCATION]", "[DOCUMENT]"); + DocumentLink documentLink = DocumentLink.newBuilder().build(); + + DocumentLink actualResponse = client.createDocumentLink(parent, documentLink); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createDocumentLinkExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + DocumentName parent = + DocumentName.ofProjectLocationDocumentName("[PROJECT]", "[LOCATION]", "[DOCUMENT]"); + DocumentLink documentLink = DocumentLink.newBuilder().build(); + client.createDocumentLink(parent, documentLink); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createDocumentLinkTest2() throws Exception { + DocumentLink expectedResponse = + DocumentLink.newBuilder() + .setName( + DocumentLinkName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT]", "[DOCUMENT_LINK]") + .toString()) + .setSourceDocumentReference(DocumentReference.newBuilder().build()) + .setTargetDocumentReference(DocumentReference.newBuilder().build()) + .setDescription("description-1724546052") + .setUpdateTime(Timestamp.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-6989/locations/location-6989/documents/document-6989"; + DocumentLink documentLink = DocumentLink.newBuilder().build(); + + DocumentLink actualResponse = client.createDocumentLink(parent, documentLink); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createDocumentLinkExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-6989/locations/location-6989/documents/document-6989"; + DocumentLink documentLink = DocumentLink.newBuilder().build(); + client.createDocumentLink(parent, documentLink); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteDocumentLinkTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + DocumentLinkName name = + DocumentLinkName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT]", "[DOCUMENT_LINK]"); + + client.deleteDocumentLink(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteDocumentLinkExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + DocumentLinkName name = + DocumentLinkName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT]", "[DOCUMENT_LINK]"); + client.deleteDocumentLink(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteDocumentLinkTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-4440/locations/location-4440/documents/document-4440/documentLinks/documentLink-4440"; + + client.deleteDocumentLink(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteDocumentLinkExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-4440/locations/location-4440/documents/document-4440/documentLinks/documentLink-4440"; + client.deleteDocumentLink(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/DocumentLinkServiceClientTest.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/DocumentLinkServiceClientTest.java new file mode 100644 index 000000000000..524fd41d507c --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/DocumentLinkServiceClientTest.java @@ -0,0 +1,421 @@ +/* + * 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; + +import static com.google.cloud.contentwarehouse.v1.DocumentLinkServiceClient.ListLinkedSourcesPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.common.collect.Lists; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class DocumentLinkServiceClientTest { + private static MockDocumentLinkService mockDocumentLinkService; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private DocumentLinkServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockDocumentLinkService = new MockDocumentLinkService(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockDocumentLinkService)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + DocumentLinkServiceSettings settings = + DocumentLinkServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = DocumentLinkServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void listLinkedTargetsTest() throws Exception { + ListLinkedTargetsResponse expectedResponse = + ListLinkedTargetsResponse.newBuilder() + .addAllDocumentLinks(new ArrayList()) + .setNextPageToken("nextPageToken-1386094857") + .build(); + mockDocumentLinkService.addResponse(expectedResponse); + + DocumentName parent = + DocumentName.ofProjectLocationDocumentName("[PROJECT]", "[LOCATION]", "[DOCUMENT]"); + + ListLinkedTargetsResponse actualResponse = client.listLinkedTargets(parent); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentLinkService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLinkedTargetsRequest actualRequest = ((ListLinkedTargetsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLinkedTargetsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentLinkService.addException(exception); + + try { + DocumentName parent = + DocumentName.ofProjectLocationDocumentName("[PROJECT]", "[LOCATION]", "[DOCUMENT]"); + client.listLinkedTargets(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLinkedTargetsTest2() throws Exception { + ListLinkedTargetsResponse expectedResponse = + ListLinkedTargetsResponse.newBuilder() + .addAllDocumentLinks(new ArrayList()) + .setNextPageToken("nextPageToken-1386094857") + .build(); + mockDocumentLinkService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListLinkedTargetsResponse actualResponse = client.listLinkedTargets(parent); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentLinkService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLinkedTargetsRequest actualRequest = ((ListLinkedTargetsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLinkedTargetsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentLinkService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listLinkedTargets(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLinkedSourcesTest() throws Exception { + DocumentLink responsesElement = DocumentLink.newBuilder().build(); + ListLinkedSourcesResponse expectedResponse = + ListLinkedSourcesResponse.newBuilder() + .setNextPageToken("") + .addAllDocumentLinks(Arrays.asList(responsesElement)) + .build(); + mockDocumentLinkService.addResponse(expectedResponse); + + DocumentName parent = + DocumentName.ofProjectLocationDocumentName("[PROJECT]", "[LOCATION]", "[DOCUMENT]"); + + ListLinkedSourcesPagedResponse pagedListResponse = client.listLinkedSources(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getDocumentLinksList().get(0), resources.get(0)); + + List actualRequests = mockDocumentLinkService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLinkedSourcesRequest actualRequest = ((ListLinkedSourcesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLinkedSourcesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentLinkService.addException(exception); + + try { + DocumentName parent = + DocumentName.ofProjectLocationDocumentName("[PROJECT]", "[LOCATION]", "[DOCUMENT]"); + client.listLinkedSources(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLinkedSourcesTest2() throws Exception { + DocumentLink responsesElement = DocumentLink.newBuilder().build(); + ListLinkedSourcesResponse expectedResponse = + ListLinkedSourcesResponse.newBuilder() + .setNextPageToken("") + .addAllDocumentLinks(Arrays.asList(responsesElement)) + .build(); + mockDocumentLinkService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListLinkedSourcesPagedResponse pagedListResponse = client.listLinkedSources(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getDocumentLinksList().get(0), resources.get(0)); + + List actualRequests = mockDocumentLinkService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLinkedSourcesRequest actualRequest = ((ListLinkedSourcesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLinkedSourcesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentLinkService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listLinkedSources(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createDocumentLinkTest() throws Exception { + DocumentLink expectedResponse = + DocumentLink.newBuilder() + .setName( + DocumentLinkName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT]", "[DOCUMENT_LINK]") + .toString()) + .setSourceDocumentReference(DocumentReference.newBuilder().build()) + .setTargetDocumentReference(DocumentReference.newBuilder().build()) + .setDescription("description-1724546052") + .setUpdateTime(Timestamp.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .build(); + mockDocumentLinkService.addResponse(expectedResponse); + + DocumentName parent = + DocumentName.ofProjectLocationDocumentName("[PROJECT]", "[LOCATION]", "[DOCUMENT]"); + DocumentLink documentLink = DocumentLink.newBuilder().build(); + + DocumentLink actualResponse = client.createDocumentLink(parent, documentLink); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentLinkService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateDocumentLinkRequest actualRequest = ((CreateDocumentLinkRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(documentLink, actualRequest.getDocumentLink()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createDocumentLinkExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentLinkService.addException(exception); + + try { + DocumentName parent = + DocumentName.ofProjectLocationDocumentName("[PROJECT]", "[LOCATION]", "[DOCUMENT]"); + DocumentLink documentLink = DocumentLink.newBuilder().build(); + client.createDocumentLink(parent, documentLink); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createDocumentLinkTest2() throws Exception { + DocumentLink expectedResponse = + DocumentLink.newBuilder() + .setName( + DocumentLinkName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT]", "[DOCUMENT_LINK]") + .toString()) + .setSourceDocumentReference(DocumentReference.newBuilder().build()) + .setTargetDocumentReference(DocumentReference.newBuilder().build()) + .setDescription("description-1724546052") + .setUpdateTime(Timestamp.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .build(); + mockDocumentLinkService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + DocumentLink documentLink = DocumentLink.newBuilder().build(); + + DocumentLink actualResponse = client.createDocumentLink(parent, documentLink); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentLinkService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateDocumentLinkRequest actualRequest = ((CreateDocumentLinkRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(documentLink, actualRequest.getDocumentLink()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createDocumentLinkExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentLinkService.addException(exception); + + try { + String parent = "parent-995424086"; + DocumentLink documentLink = DocumentLink.newBuilder().build(); + client.createDocumentLink(parent, documentLink); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteDocumentLinkTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockDocumentLinkService.addResponse(expectedResponse); + + DocumentLinkName name = + DocumentLinkName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT]", "[DOCUMENT_LINK]"); + + client.deleteDocumentLink(name); + + List actualRequests = mockDocumentLinkService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteDocumentLinkRequest actualRequest = ((DeleteDocumentLinkRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteDocumentLinkExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentLinkService.addException(exception); + + try { + DocumentLinkName name = + DocumentLinkName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT]", "[DOCUMENT_LINK]"); + client.deleteDocumentLink(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteDocumentLinkTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockDocumentLinkService.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteDocumentLink(name); + + List actualRequests = mockDocumentLinkService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteDocumentLinkRequest actualRequest = ((DeleteDocumentLinkRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteDocumentLinkExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentLinkService.addException(exception); + + try { + String name = "name3373707"; + client.deleteDocumentLink(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/DocumentSchemaServiceClientHttpJsonTest.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/DocumentSchemaServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..924bfc3190c6 --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/DocumentSchemaServiceClientHttpJsonTest.java @@ -0,0 +1,580 @@ +/* + * 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; + +import static com.google.cloud.contentwarehouse.v1.DocumentSchemaServiceClient.ListDocumentSchemasPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.contentwarehouse.v1.stub.HttpJsonDocumentSchemaServiceStub; +import com.google.common.collect.Lists; +import com.google.protobuf.Empty; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class DocumentSchemaServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static DocumentSchemaServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonDocumentSchemaServiceStub.getMethodDescriptors(), + DocumentSchemaServiceSettings.getDefaultEndpoint()); + DocumentSchemaServiceSettings settings = + DocumentSchemaServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + DocumentSchemaServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = DocumentSchemaServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void createDocumentSchemaTest() throws Exception { + DocumentSchema expectedResponse = + DocumentSchema.newBuilder() + .setName( + DocumentSchemaName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT_SCHEMA]").toString()) + .setDisplayName("displayName1714148973") + .addAllPropertyDefinitions(new ArrayList()) + .setDocumentIsFolder(true) + .setUpdateTime(Timestamp.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setDescription("description-1724546052") + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + DocumentSchema documentSchema = DocumentSchema.newBuilder().build(); + + DocumentSchema actualResponse = client.createDocumentSchema(parent, documentSchema); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createDocumentSchemaExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + DocumentSchema documentSchema = DocumentSchema.newBuilder().build(); + client.createDocumentSchema(parent, documentSchema); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createDocumentSchemaTest2() throws Exception { + DocumentSchema expectedResponse = + DocumentSchema.newBuilder() + .setName( + DocumentSchemaName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT_SCHEMA]").toString()) + .setDisplayName("displayName1714148973") + .addAllPropertyDefinitions(new ArrayList()) + .setDocumentIsFolder(true) + .setUpdateTime(Timestamp.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setDescription("description-1724546052") + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + DocumentSchema documentSchema = DocumentSchema.newBuilder().build(); + + DocumentSchema actualResponse = client.createDocumentSchema(parent, documentSchema); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createDocumentSchemaExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + DocumentSchema documentSchema = DocumentSchema.newBuilder().build(); + client.createDocumentSchema(parent, documentSchema); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateDocumentSchemaTest() throws Exception { + DocumentSchema expectedResponse = + DocumentSchema.newBuilder() + .setName( + DocumentSchemaName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT_SCHEMA]").toString()) + .setDisplayName("displayName1714148973") + .addAllPropertyDefinitions(new ArrayList()) + .setDocumentIsFolder(true) + .setUpdateTime(Timestamp.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setDescription("description-1724546052") + .build(); + mockService.addResponse(expectedResponse); + + DocumentSchemaName name = DocumentSchemaName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT_SCHEMA]"); + DocumentSchema documentSchema = DocumentSchema.newBuilder().build(); + + DocumentSchema actualResponse = client.updateDocumentSchema(name, documentSchema); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateDocumentSchemaExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + DocumentSchemaName name = + DocumentSchemaName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT_SCHEMA]"); + DocumentSchema documentSchema = DocumentSchema.newBuilder().build(); + client.updateDocumentSchema(name, documentSchema); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateDocumentSchemaTest2() throws Exception { + DocumentSchema expectedResponse = + DocumentSchema.newBuilder() + .setName( + DocumentSchemaName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT_SCHEMA]").toString()) + .setDisplayName("displayName1714148973") + .addAllPropertyDefinitions(new ArrayList()) + .setDocumentIsFolder(true) + .setUpdateTime(Timestamp.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setDescription("description-1724546052") + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-275/locations/location-275/documentSchemas/documentSchema-275"; + DocumentSchema documentSchema = DocumentSchema.newBuilder().build(); + + DocumentSchema actualResponse = client.updateDocumentSchema(name, documentSchema); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateDocumentSchemaExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-275/locations/location-275/documentSchemas/documentSchema-275"; + DocumentSchema documentSchema = DocumentSchema.newBuilder().build(); + client.updateDocumentSchema(name, documentSchema); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getDocumentSchemaTest() throws Exception { + DocumentSchema expectedResponse = + DocumentSchema.newBuilder() + .setName( + DocumentSchemaName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT_SCHEMA]").toString()) + .setDisplayName("displayName1714148973") + .addAllPropertyDefinitions(new ArrayList()) + .setDocumentIsFolder(true) + .setUpdateTime(Timestamp.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setDescription("description-1724546052") + .build(); + mockService.addResponse(expectedResponse); + + DocumentSchemaName name = DocumentSchemaName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT_SCHEMA]"); + + DocumentSchema actualResponse = client.getDocumentSchema(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getDocumentSchemaExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + DocumentSchemaName name = + DocumentSchemaName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT_SCHEMA]"); + client.getDocumentSchema(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getDocumentSchemaTest2() throws Exception { + DocumentSchema expectedResponse = + DocumentSchema.newBuilder() + .setName( + DocumentSchemaName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT_SCHEMA]").toString()) + .setDisplayName("displayName1714148973") + .addAllPropertyDefinitions(new ArrayList()) + .setDocumentIsFolder(true) + .setUpdateTime(Timestamp.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setDescription("description-1724546052") + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-275/locations/location-275/documentSchemas/documentSchema-275"; + + DocumentSchema actualResponse = client.getDocumentSchema(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getDocumentSchemaExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-275/locations/location-275/documentSchemas/documentSchema-275"; + client.getDocumentSchema(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteDocumentSchemaTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + DocumentSchemaName name = DocumentSchemaName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT_SCHEMA]"); + + client.deleteDocumentSchema(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteDocumentSchemaExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + DocumentSchemaName name = + DocumentSchemaName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT_SCHEMA]"); + client.deleteDocumentSchema(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteDocumentSchemaTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-275/locations/location-275/documentSchemas/documentSchema-275"; + + client.deleteDocumentSchema(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteDocumentSchemaExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-275/locations/location-275/documentSchemas/documentSchema-275"; + client.deleteDocumentSchema(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listDocumentSchemasTest() throws Exception { + DocumentSchema responsesElement = DocumentSchema.newBuilder().build(); + ListDocumentSchemasResponse expectedResponse = + ListDocumentSchemasResponse.newBuilder() + .setNextPageToken("") + .addAllDocumentSchemas(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListDocumentSchemasPagedResponse pagedListResponse = client.listDocumentSchemas(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getDocumentSchemasList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listDocumentSchemasExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listDocumentSchemas(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listDocumentSchemasTest2() throws Exception { + DocumentSchema responsesElement = DocumentSchema.newBuilder().build(); + ListDocumentSchemasResponse expectedResponse = + ListDocumentSchemasResponse.newBuilder() + .setNextPageToken("") + .addAllDocumentSchemas(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListDocumentSchemasPagedResponse pagedListResponse = client.listDocumentSchemas(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getDocumentSchemasList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listDocumentSchemasExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + client.listDocumentSchemas(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/DocumentSchemaServiceClientTest.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/DocumentSchemaServiceClientTest.java new file mode 100644 index 000000000000..301baf4d50ba --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/DocumentSchemaServiceClientTest.java @@ -0,0 +1,531 @@ +/* + * 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; + +import static com.google.cloud.contentwarehouse.v1.DocumentSchemaServiceClient.ListDocumentSchemasPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.common.collect.Lists; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class DocumentSchemaServiceClientTest { + private static MockDocumentSchemaService mockDocumentSchemaService; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private DocumentSchemaServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockDocumentSchemaService = new MockDocumentSchemaService(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockDocumentSchemaService)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + DocumentSchemaServiceSettings settings = + DocumentSchemaServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = DocumentSchemaServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void createDocumentSchemaTest() throws Exception { + DocumentSchema expectedResponse = + DocumentSchema.newBuilder() + .setName( + DocumentSchemaName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT_SCHEMA]").toString()) + .setDisplayName("displayName1714148973") + .addAllPropertyDefinitions(new ArrayList()) + .setDocumentIsFolder(true) + .setUpdateTime(Timestamp.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setDescription("description-1724546052") + .build(); + mockDocumentSchemaService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + DocumentSchema documentSchema = DocumentSchema.newBuilder().build(); + + DocumentSchema actualResponse = client.createDocumentSchema(parent, documentSchema); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentSchemaService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateDocumentSchemaRequest actualRequest = + ((CreateDocumentSchemaRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(documentSchema, actualRequest.getDocumentSchema()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createDocumentSchemaExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentSchemaService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + DocumentSchema documentSchema = DocumentSchema.newBuilder().build(); + client.createDocumentSchema(parent, documentSchema); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createDocumentSchemaTest2() throws Exception { + DocumentSchema expectedResponse = + DocumentSchema.newBuilder() + .setName( + DocumentSchemaName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT_SCHEMA]").toString()) + .setDisplayName("displayName1714148973") + .addAllPropertyDefinitions(new ArrayList()) + .setDocumentIsFolder(true) + .setUpdateTime(Timestamp.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setDescription("description-1724546052") + .build(); + mockDocumentSchemaService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + DocumentSchema documentSchema = DocumentSchema.newBuilder().build(); + + DocumentSchema actualResponse = client.createDocumentSchema(parent, documentSchema); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentSchemaService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateDocumentSchemaRequest actualRequest = + ((CreateDocumentSchemaRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(documentSchema, actualRequest.getDocumentSchema()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createDocumentSchemaExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentSchemaService.addException(exception); + + try { + String parent = "parent-995424086"; + DocumentSchema documentSchema = DocumentSchema.newBuilder().build(); + client.createDocumentSchema(parent, documentSchema); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateDocumentSchemaTest() throws Exception { + DocumentSchema expectedResponse = + DocumentSchema.newBuilder() + .setName( + DocumentSchemaName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT_SCHEMA]").toString()) + .setDisplayName("displayName1714148973") + .addAllPropertyDefinitions(new ArrayList()) + .setDocumentIsFolder(true) + .setUpdateTime(Timestamp.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setDescription("description-1724546052") + .build(); + mockDocumentSchemaService.addResponse(expectedResponse); + + DocumentSchemaName name = DocumentSchemaName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT_SCHEMA]"); + DocumentSchema documentSchema = DocumentSchema.newBuilder().build(); + + DocumentSchema actualResponse = client.updateDocumentSchema(name, documentSchema); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentSchemaService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateDocumentSchemaRequest actualRequest = + ((UpdateDocumentSchemaRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertEquals(documentSchema, actualRequest.getDocumentSchema()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateDocumentSchemaExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentSchemaService.addException(exception); + + try { + DocumentSchemaName name = + DocumentSchemaName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT_SCHEMA]"); + DocumentSchema documentSchema = DocumentSchema.newBuilder().build(); + client.updateDocumentSchema(name, documentSchema); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateDocumentSchemaTest2() throws Exception { + DocumentSchema expectedResponse = + DocumentSchema.newBuilder() + .setName( + DocumentSchemaName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT_SCHEMA]").toString()) + .setDisplayName("displayName1714148973") + .addAllPropertyDefinitions(new ArrayList()) + .setDocumentIsFolder(true) + .setUpdateTime(Timestamp.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setDescription("description-1724546052") + .build(); + mockDocumentSchemaService.addResponse(expectedResponse); + + String name = "name3373707"; + DocumentSchema documentSchema = DocumentSchema.newBuilder().build(); + + DocumentSchema actualResponse = client.updateDocumentSchema(name, documentSchema); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentSchemaService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateDocumentSchemaRequest actualRequest = + ((UpdateDocumentSchemaRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(documentSchema, actualRequest.getDocumentSchema()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateDocumentSchemaExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentSchemaService.addException(exception); + + try { + String name = "name3373707"; + DocumentSchema documentSchema = DocumentSchema.newBuilder().build(); + client.updateDocumentSchema(name, documentSchema); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getDocumentSchemaTest() throws Exception { + DocumentSchema expectedResponse = + DocumentSchema.newBuilder() + .setName( + DocumentSchemaName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT_SCHEMA]").toString()) + .setDisplayName("displayName1714148973") + .addAllPropertyDefinitions(new ArrayList()) + .setDocumentIsFolder(true) + .setUpdateTime(Timestamp.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setDescription("description-1724546052") + .build(); + mockDocumentSchemaService.addResponse(expectedResponse); + + DocumentSchemaName name = DocumentSchemaName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT_SCHEMA]"); + + DocumentSchema actualResponse = client.getDocumentSchema(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentSchemaService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetDocumentSchemaRequest actualRequest = ((GetDocumentSchemaRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getDocumentSchemaExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentSchemaService.addException(exception); + + try { + DocumentSchemaName name = + DocumentSchemaName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT_SCHEMA]"); + client.getDocumentSchema(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getDocumentSchemaTest2() throws Exception { + DocumentSchema expectedResponse = + DocumentSchema.newBuilder() + .setName( + DocumentSchemaName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT_SCHEMA]").toString()) + .setDisplayName("displayName1714148973") + .addAllPropertyDefinitions(new ArrayList()) + .setDocumentIsFolder(true) + .setUpdateTime(Timestamp.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setDescription("description-1724546052") + .build(); + mockDocumentSchemaService.addResponse(expectedResponse); + + String name = "name3373707"; + + DocumentSchema actualResponse = client.getDocumentSchema(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentSchemaService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetDocumentSchemaRequest actualRequest = ((GetDocumentSchemaRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getDocumentSchemaExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentSchemaService.addException(exception); + + try { + String name = "name3373707"; + client.getDocumentSchema(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteDocumentSchemaTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockDocumentSchemaService.addResponse(expectedResponse); + + DocumentSchemaName name = DocumentSchemaName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT_SCHEMA]"); + + client.deleteDocumentSchema(name); + + List actualRequests = mockDocumentSchemaService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteDocumentSchemaRequest actualRequest = + ((DeleteDocumentSchemaRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteDocumentSchemaExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentSchemaService.addException(exception); + + try { + DocumentSchemaName name = + DocumentSchemaName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT_SCHEMA]"); + client.deleteDocumentSchema(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteDocumentSchemaTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockDocumentSchemaService.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteDocumentSchema(name); + + List actualRequests = mockDocumentSchemaService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteDocumentSchemaRequest actualRequest = + ((DeleteDocumentSchemaRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteDocumentSchemaExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentSchemaService.addException(exception); + + try { + String name = "name3373707"; + client.deleteDocumentSchema(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listDocumentSchemasTest() throws Exception { + DocumentSchema responsesElement = DocumentSchema.newBuilder().build(); + ListDocumentSchemasResponse expectedResponse = + ListDocumentSchemasResponse.newBuilder() + .setNextPageToken("") + .addAllDocumentSchemas(Arrays.asList(responsesElement)) + .build(); + mockDocumentSchemaService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListDocumentSchemasPagedResponse pagedListResponse = client.listDocumentSchemas(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getDocumentSchemasList().get(0), resources.get(0)); + + List actualRequests = mockDocumentSchemaService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListDocumentSchemasRequest actualRequest = ((ListDocumentSchemasRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listDocumentSchemasExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentSchemaService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listDocumentSchemas(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listDocumentSchemasTest2() throws Exception { + DocumentSchema responsesElement = DocumentSchema.newBuilder().build(); + ListDocumentSchemasResponse expectedResponse = + ListDocumentSchemasResponse.newBuilder() + .setNextPageToken("") + .addAllDocumentSchemas(Arrays.asList(responsesElement)) + .build(); + mockDocumentSchemaService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListDocumentSchemasPagedResponse pagedListResponse = client.listDocumentSchemas(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getDocumentSchemasList().get(0), resources.get(0)); + + List actualRequests = mockDocumentSchemaService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListDocumentSchemasRequest actualRequest = ((ListDocumentSchemasRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listDocumentSchemasExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentSchemaService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listDocumentSchemas(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/DocumentServiceClientHttpJsonTest.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/DocumentServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..b585573bda65 --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/DocumentServiceClientHttpJsonTest.java @@ -0,0 +1,677 @@ +/* + * 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; + +import static com.google.cloud.contentwarehouse.v1.DocumentServiceClient.SearchDocumentsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.contentwarehouse.v1.stub.HttpJsonDocumentServiceStub; +import com.google.common.collect.Lists; +import com.google.iam.v1.Policy; +import com.google.protobuf.Empty; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class DocumentServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static DocumentServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonDocumentServiceStub.getMethodDescriptors(), + DocumentServiceSettings.getDefaultEndpoint()); + DocumentServiceSettings settings = + DocumentServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + DocumentServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = DocumentServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void createDocumentTest() throws Exception { + CreateDocumentResponse expectedResponse = + CreateDocumentResponse.newBuilder() + .setDocument(Document.newBuilder().build()) + .setRuleEngineOutput(RuleEngineOutput.newBuilder().build()) + .setMetadata(ResponseMetadata.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Document document = Document.newBuilder().build(); + + CreateDocumentResponse actualResponse = client.createDocument(parent, document); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createDocumentExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Document document = Document.newBuilder().build(); + client.createDocument(parent, document); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createDocumentTest2() throws Exception { + CreateDocumentResponse expectedResponse = + CreateDocumentResponse.newBuilder() + .setDocument(Document.newBuilder().build()) + .setRuleEngineOutput(RuleEngineOutput.newBuilder().build()) + .setMetadata(ResponseMetadata.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + Document document = Document.newBuilder().build(); + + CreateDocumentResponse actualResponse = client.createDocument(parent, document); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createDocumentExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + Document document = Document.newBuilder().build(); + client.createDocument(parent, document); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getDocumentTest() throws Exception { + Document expectedResponse = + Document.newBuilder() + .setName( + DocumentName.ofProjectLocationDocumentName("[PROJECT]", "[LOCATION]", "[DOCUMENT]") + .toString()) + .setReferenceId("referenceId-16211514") + .setDisplayName("displayName1714148973") + .setTitle("title110371416") + .setDisplayUri("displayUri-914528950") + .setDocumentSchemaName( + DocumentSchemaName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT_SCHEMA]").toString()) + .setStructuredContentUri("structuredContentUri-1039251868") + .addAllProperties(new ArrayList()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setRawDocumentFileType(RawDocumentFileType.forNumber(0)) + .setAsyncEnabled(true) + .setTextExtractionDisabled(true) + .setCreator("creator1028554796") + .setUpdater("updater-234430263") + .build(); + mockService.addResponse(expectedResponse); + + DocumentName name = + DocumentName.ofProjectLocationDocumentName("[PROJECT]", "[LOCATION]", "[DOCUMENT]"); + + Document actualResponse = client.getDocument(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getDocumentExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + DocumentName name = + DocumentName.ofProjectLocationDocumentName("[PROJECT]", "[LOCATION]", "[DOCUMENT]"); + client.getDocument(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getDocumentTest2() throws Exception { + Document expectedResponse = + Document.newBuilder() + .setName( + DocumentName.ofProjectLocationDocumentName("[PROJECT]", "[LOCATION]", "[DOCUMENT]") + .toString()) + .setReferenceId("referenceId-16211514") + .setDisplayName("displayName1714148973") + .setTitle("title110371416") + .setDisplayUri("displayUri-914528950") + .setDocumentSchemaName( + DocumentSchemaName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT_SCHEMA]").toString()) + .setStructuredContentUri("structuredContentUri-1039251868") + .addAllProperties(new ArrayList()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setRawDocumentFileType(RawDocumentFileType.forNumber(0)) + .setAsyncEnabled(true) + .setTextExtractionDisabled(true) + .setCreator("creator1028554796") + .setUpdater("updater-234430263") + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-5698/locations/location-5698/documents/document-5698"; + + Document actualResponse = client.getDocument(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getDocumentExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-5698/locations/location-5698/documents/document-5698"; + client.getDocument(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateDocumentTest() throws Exception { + UpdateDocumentResponse expectedResponse = + UpdateDocumentResponse.newBuilder() + .setDocument(Document.newBuilder().build()) + .setRuleEngineOutput(RuleEngineOutput.newBuilder().build()) + .setMetadata(ResponseMetadata.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + DocumentName name = + DocumentName.ofProjectLocationDocumentName("[PROJECT]", "[LOCATION]", "[DOCUMENT]"); + Document document = Document.newBuilder().build(); + + UpdateDocumentResponse actualResponse = client.updateDocument(name, document); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateDocumentExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + DocumentName name = + DocumentName.ofProjectLocationDocumentName("[PROJECT]", "[LOCATION]", "[DOCUMENT]"); + Document document = Document.newBuilder().build(); + client.updateDocument(name, document); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateDocumentTest2() throws Exception { + UpdateDocumentResponse expectedResponse = + UpdateDocumentResponse.newBuilder() + .setDocument(Document.newBuilder().build()) + .setRuleEngineOutput(RuleEngineOutput.newBuilder().build()) + .setMetadata(ResponseMetadata.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-5698/locations/location-5698/documents/document-5698"; + Document document = Document.newBuilder().build(); + + UpdateDocumentResponse actualResponse = client.updateDocument(name, document); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateDocumentExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-5698/locations/location-5698/documents/document-5698"; + Document document = Document.newBuilder().build(); + client.updateDocument(name, document); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteDocumentTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + DocumentName name = + DocumentName.ofProjectLocationDocumentName("[PROJECT]", "[LOCATION]", "[DOCUMENT]"); + + client.deleteDocument(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteDocumentExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + DocumentName name = + DocumentName.ofProjectLocationDocumentName("[PROJECT]", "[LOCATION]", "[DOCUMENT]"); + client.deleteDocument(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteDocumentTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-5698/locations/location-5698/documents/document-5698"; + + client.deleteDocument(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteDocumentExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-5698/locations/location-5698/documents/document-5698"; + client.deleteDocument(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void searchDocumentsTest() throws Exception { + SearchDocumentsResponse.MatchingDocument responsesElement = + SearchDocumentsResponse.MatchingDocument.newBuilder().build(); + SearchDocumentsResponse expectedResponse = + SearchDocumentsResponse.newBuilder() + .setNextPageToken("") + .addAllMatchingDocuments(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + SearchDocumentsPagedResponse pagedListResponse = client.searchDocuments(parent); + + List resources = + Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getMatchingDocumentsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void searchDocumentsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.searchDocuments(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void searchDocumentsTest2() throws Exception { + SearchDocumentsResponse.MatchingDocument responsesElement = + SearchDocumentsResponse.MatchingDocument.newBuilder().build(); + SearchDocumentsResponse expectedResponse = + SearchDocumentsResponse.newBuilder() + .setNextPageToken("") + .addAllMatchingDocuments(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + SearchDocumentsPagedResponse pagedListResponse = client.searchDocuments(parent); + + List resources = + Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getMatchingDocumentsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void searchDocumentsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + client.searchDocuments(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void fetchAclTest() throws Exception { + FetchAclResponse expectedResponse = + FetchAclResponse.newBuilder() + .setPolicy(Policy.newBuilder().build()) + .setMetadata(ResponseMetadata.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String resource = "projects/project-5313/locations/location-5313/documents/document-5313"; + + FetchAclResponse actualResponse = client.fetchAcl(resource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void fetchAclExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String resource = "projects/project-5313/locations/location-5313/documents/document-5313"; + client.fetchAcl(resource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setAclTest() throws Exception { + SetAclResponse expectedResponse = + SetAclResponse.newBuilder() + .setPolicy(Policy.newBuilder().build()) + .setMetadata(ResponseMetadata.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String resource = "projects/project-5313/locations/location-5313/documents/document-5313"; + Policy policy = Policy.newBuilder().build(); + + SetAclResponse actualResponse = client.setAcl(resource, policy); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void setAclExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String resource = "projects/project-5313/locations/location-5313/documents/document-5313"; + Policy policy = Policy.newBuilder().build(); + client.setAcl(resource, policy); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/DocumentServiceClientTest.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/DocumentServiceClientTest.java new file mode 100644 index 000000000000..8f8b9d495583 --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/DocumentServiceClientTest.java @@ -0,0 +1,613 @@ +/* + * 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; + +import static com.google.cloud.contentwarehouse.v1.DocumentServiceClient.SearchDocumentsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.common.collect.Lists; +import com.google.iam.v1.Policy; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class DocumentServiceClientTest { + private static MockDocumentService mockDocumentService; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private DocumentServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockDocumentService = new MockDocumentService(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockDocumentService)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + DocumentServiceSettings settings = + DocumentServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = DocumentServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void createDocumentTest() throws Exception { + CreateDocumentResponse expectedResponse = + CreateDocumentResponse.newBuilder() + .setDocument(Document.newBuilder().build()) + .setRuleEngineOutput(RuleEngineOutput.newBuilder().build()) + .setMetadata(ResponseMetadata.newBuilder().build()) + .build(); + mockDocumentService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Document document = Document.newBuilder().build(); + + CreateDocumentResponse actualResponse = client.createDocument(parent, document); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateDocumentRequest actualRequest = ((CreateDocumentRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(document, actualRequest.getDocument()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createDocumentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Document document = Document.newBuilder().build(); + client.createDocument(parent, document); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createDocumentTest2() throws Exception { + CreateDocumentResponse expectedResponse = + CreateDocumentResponse.newBuilder() + .setDocument(Document.newBuilder().build()) + .setRuleEngineOutput(RuleEngineOutput.newBuilder().build()) + .setMetadata(ResponseMetadata.newBuilder().build()) + .build(); + mockDocumentService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + Document document = Document.newBuilder().build(); + + CreateDocumentResponse actualResponse = client.createDocument(parent, document); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateDocumentRequest actualRequest = ((CreateDocumentRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(document, actualRequest.getDocument()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createDocumentExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentService.addException(exception); + + try { + String parent = "parent-995424086"; + Document document = Document.newBuilder().build(); + client.createDocument(parent, document); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getDocumentTest() throws Exception { + Document expectedResponse = + Document.newBuilder() + .setName( + DocumentName.ofProjectLocationDocumentName("[PROJECT]", "[LOCATION]", "[DOCUMENT]") + .toString()) + .setReferenceId("referenceId-16211514") + .setDisplayName("displayName1714148973") + .setTitle("title110371416") + .setDisplayUri("displayUri-914528950") + .setDocumentSchemaName( + DocumentSchemaName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT_SCHEMA]").toString()) + .setStructuredContentUri("structuredContentUri-1039251868") + .addAllProperties(new ArrayList()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setRawDocumentFileType(RawDocumentFileType.forNumber(0)) + .setAsyncEnabled(true) + .setTextExtractionDisabled(true) + .setCreator("creator1028554796") + .setUpdater("updater-234430263") + .build(); + mockDocumentService.addResponse(expectedResponse); + + DocumentName name = + DocumentName.ofProjectLocationDocumentName("[PROJECT]", "[LOCATION]", "[DOCUMENT]"); + + Document actualResponse = client.getDocument(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetDocumentRequest actualRequest = ((GetDocumentRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getDocumentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentService.addException(exception); + + try { + DocumentName name = + DocumentName.ofProjectLocationDocumentName("[PROJECT]", "[LOCATION]", "[DOCUMENT]"); + client.getDocument(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getDocumentTest2() throws Exception { + Document expectedResponse = + Document.newBuilder() + .setName( + DocumentName.ofProjectLocationDocumentName("[PROJECT]", "[LOCATION]", "[DOCUMENT]") + .toString()) + .setReferenceId("referenceId-16211514") + .setDisplayName("displayName1714148973") + .setTitle("title110371416") + .setDisplayUri("displayUri-914528950") + .setDocumentSchemaName( + DocumentSchemaName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT_SCHEMA]").toString()) + .setStructuredContentUri("structuredContentUri-1039251868") + .addAllProperties(new ArrayList()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setRawDocumentFileType(RawDocumentFileType.forNumber(0)) + .setAsyncEnabled(true) + .setTextExtractionDisabled(true) + .setCreator("creator1028554796") + .setUpdater("updater-234430263") + .build(); + mockDocumentService.addResponse(expectedResponse); + + String name = "name3373707"; + + Document actualResponse = client.getDocument(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetDocumentRequest actualRequest = ((GetDocumentRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getDocumentExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentService.addException(exception); + + try { + String name = "name3373707"; + client.getDocument(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateDocumentTest() throws Exception { + UpdateDocumentResponse expectedResponse = + UpdateDocumentResponse.newBuilder() + .setDocument(Document.newBuilder().build()) + .setRuleEngineOutput(RuleEngineOutput.newBuilder().build()) + .setMetadata(ResponseMetadata.newBuilder().build()) + .build(); + mockDocumentService.addResponse(expectedResponse); + + DocumentName name = + DocumentName.ofProjectLocationDocumentName("[PROJECT]", "[LOCATION]", "[DOCUMENT]"); + Document document = Document.newBuilder().build(); + + UpdateDocumentResponse actualResponse = client.updateDocument(name, document); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateDocumentRequest actualRequest = ((UpdateDocumentRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertEquals(document, actualRequest.getDocument()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateDocumentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentService.addException(exception); + + try { + DocumentName name = + DocumentName.ofProjectLocationDocumentName("[PROJECT]", "[LOCATION]", "[DOCUMENT]"); + Document document = Document.newBuilder().build(); + client.updateDocument(name, document); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateDocumentTest2() throws Exception { + UpdateDocumentResponse expectedResponse = + UpdateDocumentResponse.newBuilder() + .setDocument(Document.newBuilder().build()) + .setRuleEngineOutput(RuleEngineOutput.newBuilder().build()) + .setMetadata(ResponseMetadata.newBuilder().build()) + .build(); + mockDocumentService.addResponse(expectedResponse); + + String name = "name3373707"; + Document document = Document.newBuilder().build(); + + UpdateDocumentResponse actualResponse = client.updateDocument(name, document); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateDocumentRequest actualRequest = ((UpdateDocumentRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(document, actualRequest.getDocument()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateDocumentExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentService.addException(exception); + + try { + String name = "name3373707"; + Document document = Document.newBuilder().build(); + client.updateDocument(name, document); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteDocumentTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockDocumentService.addResponse(expectedResponse); + + DocumentName name = + DocumentName.ofProjectLocationDocumentName("[PROJECT]", "[LOCATION]", "[DOCUMENT]"); + + client.deleteDocument(name); + + List actualRequests = mockDocumentService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteDocumentRequest actualRequest = ((DeleteDocumentRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteDocumentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentService.addException(exception); + + try { + DocumentName name = + DocumentName.ofProjectLocationDocumentName("[PROJECT]", "[LOCATION]", "[DOCUMENT]"); + client.deleteDocument(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteDocumentTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockDocumentService.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteDocument(name); + + List actualRequests = mockDocumentService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteDocumentRequest actualRequest = ((DeleteDocumentRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteDocumentExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentService.addException(exception); + + try { + String name = "name3373707"; + client.deleteDocument(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void searchDocumentsTest() throws Exception { + SearchDocumentsResponse.MatchingDocument responsesElement = + SearchDocumentsResponse.MatchingDocument.newBuilder().build(); + SearchDocumentsResponse expectedResponse = + SearchDocumentsResponse.newBuilder() + .setNextPageToken("") + .addAllMatchingDocuments(Arrays.asList(responsesElement)) + .build(); + mockDocumentService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + SearchDocumentsPagedResponse pagedListResponse = client.searchDocuments(parent); + + List resources = + Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getMatchingDocumentsList().get(0), resources.get(0)); + + List actualRequests = mockDocumentService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SearchDocumentsRequest actualRequest = ((SearchDocumentsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void searchDocumentsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.searchDocuments(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void searchDocumentsTest2() throws Exception { + SearchDocumentsResponse.MatchingDocument responsesElement = + SearchDocumentsResponse.MatchingDocument.newBuilder().build(); + SearchDocumentsResponse expectedResponse = + SearchDocumentsResponse.newBuilder() + .setNextPageToken("") + .addAllMatchingDocuments(Arrays.asList(responsesElement)) + .build(); + mockDocumentService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + SearchDocumentsPagedResponse pagedListResponse = client.searchDocuments(parent); + + List resources = + Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getMatchingDocumentsList().get(0), resources.get(0)); + + List actualRequests = mockDocumentService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SearchDocumentsRequest actualRequest = ((SearchDocumentsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void searchDocumentsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentService.addException(exception); + + try { + String parent = "parent-995424086"; + client.searchDocuments(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void fetchAclTest() throws Exception { + FetchAclResponse expectedResponse = + FetchAclResponse.newBuilder() + .setPolicy(Policy.newBuilder().build()) + .setMetadata(ResponseMetadata.newBuilder().build()) + .build(); + mockDocumentService.addResponse(expectedResponse); + + String resource = "resource-341064690"; + + FetchAclResponse actualResponse = client.fetchAcl(resource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + FetchAclRequest actualRequest = ((FetchAclRequest) actualRequests.get(0)); + + Assert.assertEquals(resource, actualRequest.getResource()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void fetchAclExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentService.addException(exception); + + try { + String resource = "resource-341064690"; + client.fetchAcl(resource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setAclTest() throws Exception { + SetAclResponse expectedResponse = + SetAclResponse.newBuilder() + .setPolicy(Policy.newBuilder().build()) + .setMetadata(ResponseMetadata.newBuilder().build()) + .build(); + mockDocumentService.addResponse(expectedResponse); + + String resource = "resource-341064690"; + Policy policy = Policy.newBuilder().build(); + + SetAclResponse actualResponse = client.setAcl(resource, policy); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetAclRequest actualRequest = ((SetAclRequest) actualRequests.get(0)); + + Assert.assertEquals(resource, actualRequest.getResource()); + Assert.assertEquals(policy, actualRequest.getPolicy()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setAclExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentService.addException(exception); + + try { + String resource = "resource-341064690"; + Policy policy = Policy.newBuilder().build(); + client.setAcl(resource, policy); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/MockDocumentLinkService.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/MockDocumentLinkService.java new file mode 100644 index 000000000000..4db87a5a94ad --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/MockDocumentLinkService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.contentwarehouse.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockDocumentLinkService implements MockGrpcService { + private final MockDocumentLinkServiceImpl serviceImpl; + + public MockDocumentLinkService() { + serviceImpl = new MockDocumentLinkServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/MockDocumentLinkServiceImpl.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/MockDocumentLinkServiceImpl.java new file mode 100644 index 000000000000..108fd3872777 --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/MockDocumentLinkServiceImpl.java @@ -0,0 +1,147 @@ +/* + * 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; + +import com.google.api.core.BetaApi; +import com.google.cloud.contentwarehouse.v1.DocumentLinkServiceGrpc.DocumentLinkServiceImplBase; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockDocumentLinkServiceImpl extends DocumentLinkServiceImplBase { + private List requests; + private Queue responses; + + public MockDocumentLinkServiceImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void listLinkedTargets( + ListLinkedTargetsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListLinkedTargetsResponse) { + requests.add(request); + responseObserver.onNext(((ListLinkedTargetsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListLinkedTargets, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListLinkedTargetsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listLinkedSources( + ListLinkedSourcesRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListLinkedSourcesResponse) { + requests.add(request); + responseObserver.onNext(((ListLinkedSourcesResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListLinkedSources, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListLinkedSourcesResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createDocumentLink( + CreateDocumentLinkRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof DocumentLink) { + requests.add(request); + responseObserver.onNext(((DocumentLink) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateDocumentLink, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + DocumentLink.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteDocumentLink( + DeleteDocumentLinkRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteDocumentLink, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/MockDocumentSchemaService.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/MockDocumentSchemaService.java new file mode 100644 index 000000000000..bd8697cac0d4 --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/MockDocumentSchemaService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.contentwarehouse.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockDocumentSchemaService implements MockGrpcService { + private final MockDocumentSchemaServiceImpl serviceImpl; + + public MockDocumentSchemaService() { + serviceImpl = new MockDocumentSchemaServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/MockDocumentSchemaServiceImpl.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/MockDocumentSchemaServiceImpl.java new file mode 100644 index 000000000000..adeb081ede11 --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/MockDocumentSchemaServiceImpl.java @@ -0,0 +1,167 @@ +/* + * 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; + +import com.google.api.core.BetaApi; +import com.google.cloud.contentwarehouse.v1.DocumentSchemaServiceGrpc.DocumentSchemaServiceImplBase; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockDocumentSchemaServiceImpl extends DocumentSchemaServiceImplBase { + private List requests; + private Queue responses; + + public MockDocumentSchemaServiceImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void createDocumentSchema( + CreateDocumentSchemaRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof DocumentSchema) { + requests.add(request); + responseObserver.onNext(((DocumentSchema) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateDocumentSchema, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + DocumentSchema.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateDocumentSchema( + UpdateDocumentSchemaRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof DocumentSchema) { + requests.add(request); + responseObserver.onNext(((DocumentSchema) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateDocumentSchema, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + DocumentSchema.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getDocumentSchema( + GetDocumentSchemaRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof DocumentSchema) { + requests.add(request); + responseObserver.onNext(((DocumentSchema) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetDocumentSchema, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + DocumentSchema.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteDocumentSchema( + DeleteDocumentSchemaRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteDocumentSchema, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listDocumentSchemas( + ListDocumentSchemasRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListDocumentSchemasResponse) { + requests.add(request); + responseObserver.onNext(((ListDocumentSchemasResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListDocumentSchemas, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListDocumentSchemasResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/MockDocumentService.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/MockDocumentService.java new file mode 100644 index 000000000000..5565bd91093f --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/MockDocumentService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.contentwarehouse.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockDocumentService implements MockGrpcService { + private final MockDocumentServiceImpl serviceImpl; + + public MockDocumentService() { + serviceImpl = new MockDocumentServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/MockDocumentServiceImpl.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/MockDocumentServiceImpl.java new file mode 100644 index 000000000000..07cd167d5434 --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/MockDocumentServiceImpl.java @@ -0,0 +1,205 @@ +/* + * 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; + +import com.google.api.core.BetaApi; +import com.google.cloud.contentwarehouse.v1.DocumentServiceGrpc.DocumentServiceImplBase; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockDocumentServiceImpl extends DocumentServiceImplBase { + private List requests; + private Queue responses; + + public MockDocumentServiceImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void createDocument( + CreateDocumentRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof CreateDocumentResponse) { + requests.add(request); + responseObserver.onNext(((CreateDocumentResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateDocument, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + CreateDocumentResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getDocument(GetDocumentRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Document) { + requests.add(request); + responseObserver.onNext(((Document) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetDocument, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Document.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateDocument( + UpdateDocumentRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof UpdateDocumentResponse) { + requests.add(request); + responseObserver.onNext(((UpdateDocumentResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateDocument, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + UpdateDocumentResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteDocument( + DeleteDocumentRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteDocument, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void searchDocuments( + SearchDocumentsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof SearchDocumentsResponse) { + requests.add(request); + responseObserver.onNext(((SearchDocumentsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method SearchDocuments, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + SearchDocumentsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void fetchAcl(FetchAclRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof FetchAclResponse) { + requests.add(request); + responseObserver.onNext(((FetchAclResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method FetchAcl, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + FetchAclResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void setAcl(SetAclRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof SetAclResponse) { + requests.add(request); + responseObserver.onNext(((SetAclResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method SetAcl, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + SetAclResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/MockRuleSetService.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/MockRuleSetService.java new file mode 100644 index 000000000000..9c59575ae573 --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/MockRuleSetService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.contentwarehouse.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockRuleSetService implements MockGrpcService { + private final MockRuleSetServiceImpl serviceImpl; + + public MockRuleSetService() { + serviceImpl = new MockRuleSetServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/MockRuleSetServiceImpl.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/MockRuleSetServiceImpl.java new file mode 100644 index 000000000000..47651c7d6b23 --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/MockRuleSetServiceImpl.java @@ -0,0 +1,164 @@ +/* + * 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; + +import com.google.api.core.BetaApi; +import com.google.cloud.contentwarehouse.v1.RuleSetServiceGrpc.RuleSetServiceImplBase; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockRuleSetServiceImpl extends RuleSetServiceImplBase { + private List requests; + private Queue responses; + + public MockRuleSetServiceImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void createRuleSet( + CreateRuleSetRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof RuleSet) { + requests.add(request); + responseObserver.onNext(((RuleSet) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateRuleSet, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + RuleSet.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getRuleSet(GetRuleSetRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof RuleSet) { + requests.add(request); + responseObserver.onNext(((RuleSet) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetRuleSet, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + RuleSet.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateRuleSet( + UpdateRuleSetRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof RuleSet) { + requests.add(request); + responseObserver.onNext(((RuleSet) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateRuleSet, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + RuleSet.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteRuleSet(DeleteRuleSetRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteRuleSet, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listRuleSets( + ListRuleSetsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListRuleSetsResponse) { + requests.add(request); + responseObserver.onNext(((ListRuleSetsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListRuleSets, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListRuleSetsResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/MockSynonymSetService.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/MockSynonymSetService.java new file mode 100644 index 000000000000..a09236178720 --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/MockSynonymSetService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.contentwarehouse.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSynonymSetService implements MockGrpcService { + private final MockSynonymSetServiceImpl serviceImpl; + + public MockSynonymSetService() { + serviceImpl = new MockSynonymSetServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/MockSynonymSetServiceImpl.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/MockSynonymSetServiceImpl.java new file mode 100644 index 000000000000..659442d7c12c --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/MockSynonymSetServiceImpl.java @@ -0,0 +1,166 @@ +/* + * 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; + +import com.google.api.core.BetaApi; +import com.google.cloud.contentwarehouse.v1.SynonymSetServiceGrpc.SynonymSetServiceImplBase; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSynonymSetServiceImpl extends SynonymSetServiceImplBase { + private List requests; + private Queue responses; + + public MockSynonymSetServiceImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void createSynonymSet( + CreateSynonymSetRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof SynonymSet) { + requests.add(request); + responseObserver.onNext(((SynonymSet) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateSynonymSet, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + SynonymSet.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getSynonymSet( + GetSynonymSetRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof SynonymSet) { + requests.add(request); + responseObserver.onNext(((SynonymSet) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetSynonymSet, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + SynonymSet.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateSynonymSet( + UpdateSynonymSetRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof SynonymSet) { + requests.add(request); + responseObserver.onNext(((SynonymSet) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateSynonymSet, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + SynonymSet.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteSynonymSet( + DeleteSynonymSetRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteSynonymSet, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listSynonymSets( + ListSynonymSetsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListSynonymSetsResponse) { + requests.add(request); + responseObserver.onNext(((ListSynonymSetsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListSynonymSets, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListSynonymSetsResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/RuleSetServiceClientHttpJsonTest.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/RuleSetServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..11deea2ec294 --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/RuleSetServiceClientHttpJsonTest.java @@ -0,0 +1,549 @@ +/* + * 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; + +import static com.google.cloud.contentwarehouse.v1.RuleSetServiceClient.ListRuleSetsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.contentwarehouse.v1.stub.HttpJsonRuleSetServiceStub; +import com.google.common.collect.Lists; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class RuleSetServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static RuleSetServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonRuleSetServiceStub.getMethodDescriptors(), + RuleSetServiceSettings.getDefaultEndpoint()); + RuleSetServiceSettings settings = + RuleSetServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + RuleSetServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = RuleSetServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void createRuleSetTest() throws Exception { + RuleSet expectedResponse = + RuleSet.newBuilder() + .setName(RuleSetName.of("[PROJECT]", "[LOCATION]", "[RULE_SET]").toString()) + .setDescription("description-1724546052") + .setSource("source-896505829") + .addAllRules(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + RuleSet ruleSet = RuleSet.newBuilder().build(); + + RuleSet actualResponse = client.createRuleSet(parent, ruleSet); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createRuleSetExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + RuleSet ruleSet = RuleSet.newBuilder().build(); + client.createRuleSet(parent, ruleSet); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createRuleSetTest2() throws Exception { + RuleSet expectedResponse = + RuleSet.newBuilder() + .setName(RuleSetName.of("[PROJECT]", "[LOCATION]", "[RULE_SET]").toString()) + .setDescription("description-1724546052") + .setSource("source-896505829") + .addAllRules(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + RuleSet ruleSet = RuleSet.newBuilder().build(); + + RuleSet actualResponse = client.createRuleSet(parent, ruleSet); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createRuleSetExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + RuleSet ruleSet = RuleSet.newBuilder().build(); + client.createRuleSet(parent, ruleSet); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getRuleSetTest() throws Exception { + RuleSet expectedResponse = + RuleSet.newBuilder() + .setName(RuleSetName.of("[PROJECT]", "[LOCATION]", "[RULE_SET]").toString()) + .setDescription("description-1724546052") + .setSource("source-896505829") + .addAllRules(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + RuleSetName name = RuleSetName.of("[PROJECT]", "[LOCATION]", "[RULE_SET]"); + + RuleSet actualResponse = client.getRuleSet(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getRuleSetExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RuleSetName name = RuleSetName.of("[PROJECT]", "[LOCATION]", "[RULE_SET]"); + client.getRuleSet(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getRuleSetTest2() throws Exception { + RuleSet expectedResponse = + RuleSet.newBuilder() + .setName(RuleSetName.of("[PROJECT]", "[LOCATION]", "[RULE_SET]").toString()) + .setDescription("description-1724546052") + .setSource("source-896505829") + .addAllRules(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-2899/locations/location-2899/ruleSets/ruleSet-2899"; + + RuleSet actualResponse = client.getRuleSet(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getRuleSetExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-2899/locations/location-2899/ruleSets/ruleSet-2899"; + client.getRuleSet(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateRuleSetTest() throws Exception { + RuleSet expectedResponse = + RuleSet.newBuilder() + .setName(RuleSetName.of("[PROJECT]", "[LOCATION]", "[RULE_SET]").toString()) + .setDescription("description-1724546052") + .setSource("source-896505829") + .addAllRules(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + RuleSetName name = RuleSetName.of("[PROJECT]", "[LOCATION]", "[RULE_SET]"); + RuleSet ruleSet = RuleSet.newBuilder().build(); + + RuleSet actualResponse = client.updateRuleSet(name, ruleSet); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateRuleSetExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RuleSetName name = RuleSetName.of("[PROJECT]", "[LOCATION]", "[RULE_SET]"); + RuleSet ruleSet = RuleSet.newBuilder().build(); + client.updateRuleSet(name, ruleSet); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateRuleSetTest2() throws Exception { + RuleSet expectedResponse = + RuleSet.newBuilder() + .setName(RuleSetName.of("[PROJECT]", "[LOCATION]", "[RULE_SET]").toString()) + .setDescription("description-1724546052") + .setSource("source-896505829") + .addAllRules(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-2899/locations/location-2899/ruleSets/ruleSet-2899"; + RuleSet ruleSet = RuleSet.newBuilder().build(); + + RuleSet actualResponse = client.updateRuleSet(name, ruleSet); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateRuleSetExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-2899/locations/location-2899/ruleSets/ruleSet-2899"; + RuleSet ruleSet = RuleSet.newBuilder().build(); + client.updateRuleSet(name, ruleSet); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteRuleSetTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + RuleSetName name = RuleSetName.of("[PROJECT]", "[LOCATION]", "[RULE_SET]"); + + client.deleteRuleSet(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteRuleSetExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RuleSetName name = RuleSetName.of("[PROJECT]", "[LOCATION]", "[RULE_SET]"); + client.deleteRuleSet(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteRuleSetTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-2899/locations/location-2899/ruleSets/ruleSet-2899"; + + client.deleteRuleSet(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteRuleSetExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-2899/locations/location-2899/ruleSets/ruleSet-2899"; + client.deleteRuleSet(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listRuleSetsTest() throws Exception { + RuleSet responsesElement = RuleSet.newBuilder().build(); + ListRuleSetsResponse expectedResponse = + ListRuleSetsResponse.newBuilder() + .setNextPageToken("") + .addAllRuleSets(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListRuleSetsPagedResponse pagedListResponse = client.listRuleSets(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getRuleSetsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listRuleSetsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listRuleSets(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listRuleSetsTest2() throws Exception { + RuleSet responsesElement = RuleSet.newBuilder().build(); + ListRuleSetsResponse expectedResponse = + ListRuleSetsResponse.newBuilder() + .setNextPageToken("") + .addAllRuleSets(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListRuleSetsPagedResponse pagedListResponse = client.listRuleSets(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getRuleSetsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listRuleSetsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + client.listRuleSets(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/RuleSetServiceClientTest.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/RuleSetServiceClientTest.java new file mode 100644 index 000000000000..24592690b0bc --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/RuleSetServiceClientTest.java @@ -0,0 +1,496 @@ +/* + * 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; + +import static com.google.cloud.contentwarehouse.v1.RuleSetServiceClient.ListRuleSetsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.common.collect.Lists; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class RuleSetServiceClientTest { + private static MockRuleSetService mockRuleSetService; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private RuleSetServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockRuleSetService = new MockRuleSetService(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockRuleSetService)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + RuleSetServiceSettings settings = + RuleSetServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = RuleSetServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void createRuleSetTest() throws Exception { + RuleSet expectedResponse = + RuleSet.newBuilder() + .setName(RuleSetName.of("[PROJECT]", "[LOCATION]", "[RULE_SET]").toString()) + .setDescription("description-1724546052") + .setSource("source-896505829") + .addAllRules(new ArrayList()) + .build(); + mockRuleSetService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + RuleSet ruleSet = RuleSet.newBuilder().build(); + + RuleSet actualResponse = client.createRuleSet(parent, ruleSet); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRuleSetService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateRuleSetRequest actualRequest = ((CreateRuleSetRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(ruleSet, actualRequest.getRuleSet()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createRuleSetExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRuleSetService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + RuleSet ruleSet = RuleSet.newBuilder().build(); + client.createRuleSet(parent, ruleSet); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createRuleSetTest2() throws Exception { + RuleSet expectedResponse = + RuleSet.newBuilder() + .setName(RuleSetName.of("[PROJECT]", "[LOCATION]", "[RULE_SET]").toString()) + .setDescription("description-1724546052") + .setSource("source-896505829") + .addAllRules(new ArrayList()) + .build(); + mockRuleSetService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + RuleSet ruleSet = RuleSet.newBuilder().build(); + + RuleSet actualResponse = client.createRuleSet(parent, ruleSet); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRuleSetService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateRuleSetRequest actualRequest = ((CreateRuleSetRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(ruleSet, actualRequest.getRuleSet()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createRuleSetExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRuleSetService.addException(exception); + + try { + String parent = "parent-995424086"; + RuleSet ruleSet = RuleSet.newBuilder().build(); + client.createRuleSet(parent, ruleSet); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getRuleSetTest() throws Exception { + RuleSet expectedResponse = + RuleSet.newBuilder() + .setName(RuleSetName.of("[PROJECT]", "[LOCATION]", "[RULE_SET]").toString()) + .setDescription("description-1724546052") + .setSource("source-896505829") + .addAllRules(new ArrayList()) + .build(); + mockRuleSetService.addResponse(expectedResponse); + + RuleSetName name = RuleSetName.of("[PROJECT]", "[LOCATION]", "[RULE_SET]"); + + RuleSet actualResponse = client.getRuleSet(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRuleSetService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetRuleSetRequest actualRequest = ((GetRuleSetRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getRuleSetExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRuleSetService.addException(exception); + + try { + RuleSetName name = RuleSetName.of("[PROJECT]", "[LOCATION]", "[RULE_SET]"); + client.getRuleSet(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getRuleSetTest2() throws Exception { + RuleSet expectedResponse = + RuleSet.newBuilder() + .setName(RuleSetName.of("[PROJECT]", "[LOCATION]", "[RULE_SET]").toString()) + .setDescription("description-1724546052") + .setSource("source-896505829") + .addAllRules(new ArrayList()) + .build(); + mockRuleSetService.addResponse(expectedResponse); + + String name = "name3373707"; + + RuleSet actualResponse = client.getRuleSet(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRuleSetService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetRuleSetRequest actualRequest = ((GetRuleSetRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getRuleSetExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRuleSetService.addException(exception); + + try { + String name = "name3373707"; + client.getRuleSet(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateRuleSetTest() throws Exception { + RuleSet expectedResponse = + RuleSet.newBuilder() + .setName(RuleSetName.of("[PROJECT]", "[LOCATION]", "[RULE_SET]").toString()) + .setDescription("description-1724546052") + .setSource("source-896505829") + .addAllRules(new ArrayList()) + .build(); + mockRuleSetService.addResponse(expectedResponse); + + RuleSetName name = RuleSetName.of("[PROJECT]", "[LOCATION]", "[RULE_SET]"); + RuleSet ruleSet = RuleSet.newBuilder().build(); + + RuleSet actualResponse = client.updateRuleSet(name, ruleSet); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRuleSetService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateRuleSetRequest actualRequest = ((UpdateRuleSetRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertEquals(ruleSet, actualRequest.getRuleSet()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateRuleSetExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRuleSetService.addException(exception); + + try { + RuleSetName name = RuleSetName.of("[PROJECT]", "[LOCATION]", "[RULE_SET]"); + RuleSet ruleSet = RuleSet.newBuilder().build(); + client.updateRuleSet(name, ruleSet); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateRuleSetTest2() throws Exception { + RuleSet expectedResponse = + RuleSet.newBuilder() + .setName(RuleSetName.of("[PROJECT]", "[LOCATION]", "[RULE_SET]").toString()) + .setDescription("description-1724546052") + .setSource("source-896505829") + .addAllRules(new ArrayList()) + .build(); + mockRuleSetService.addResponse(expectedResponse); + + String name = "name3373707"; + RuleSet ruleSet = RuleSet.newBuilder().build(); + + RuleSet actualResponse = client.updateRuleSet(name, ruleSet); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRuleSetService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateRuleSetRequest actualRequest = ((UpdateRuleSetRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(ruleSet, actualRequest.getRuleSet()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateRuleSetExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRuleSetService.addException(exception); + + try { + String name = "name3373707"; + RuleSet ruleSet = RuleSet.newBuilder().build(); + client.updateRuleSet(name, ruleSet); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteRuleSetTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockRuleSetService.addResponse(expectedResponse); + + RuleSetName name = RuleSetName.of("[PROJECT]", "[LOCATION]", "[RULE_SET]"); + + client.deleteRuleSet(name); + + List actualRequests = mockRuleSetService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteRuleSetRequest actualRequest = ((DeleteRuleSetRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteRuleSetExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRuleSetService.addException(exception); + + try { + RuleSetName name = RuleSetName.of("[PROJECT]", "[LOCATION]", "[RULE_SET]"); + client.deleteRuleSet(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteRuleSetTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockRuleSetService.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteRuleSet(name); + + List actualRequests = mockRuleSetService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteRuleSetRequest actualRequest = ((DeleteRuleSetRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteRuleSetExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRuleSetService.addException(exception); + + try { + String name = "name3373707"; + client.deleteRuleSet(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listRuleSetsTest() throws Exception { + RuleSet responsesElement = RuleSet.newBuilder().build(); + ListRuleSetsResponse expectedResponse = + ListRuleSetsResponse.newBuilder() + .setNextPageToken("") + .addAllRuleSets(Arrays.asList(responsesElement)) + .build(); + mockRuleSetService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListRuleSetsPagedResponse pagedListResponse = client.listRuleSets(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getRuleSetsList().get(0), resources.get(0)); + + List actualRequests = mockRuleSetService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListRuleSetsRequest actualRequest = ((ListRuleSetsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listRuleSetsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRuleSetService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listRuleSets(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listRuleSetsTest2() throws Exception { + RuleSet responsesElement = RuleSet.newBuilder().build(); + ListRuleSetsResponse expectedResponse = + ListRuleSetsResponse.newBuilder() + .setNextPageToken("") + .addAllRuleSets(Arrays.asList(responsesElement)) + .build(); + mockRuleSetService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListRuleSetsPagedResponse pagedListResponse = client.listRuleSets(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getRuleSetsList().get(0), resources.get(0)); + + List actualRequests = mockRuleSetService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListRuleSetsRequest actualRequest = ((ListRuleSetsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listRuleSetsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRuleSetService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listRuleSets(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/SynonymSetServiceClientHttpJsonTest.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/SynonymSetServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..c00fcee4360e --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/SynonymSetServiceClientHttpJsonTest.java @@ -0,0 +1,543 @@ +/* + * 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; + +import static com.google.cloud.contentwarehouse.v1.SynonymSetServiceClient.ListSynonymSetsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.contentwarehouse.v1.stub.HttpJsonSynonymSetServiceStub; +import com.google.common.collect.Lists; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class SynonymSetServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static SynonymSetServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonSynonymSetServiceStub.getMethodDescriptors(), + SynonymSetServiceSettings.getDefaultEndpoint()); + SynonymSetServiceSettings settings = + SynonymSetServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + SynonymSetServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SynonymSetServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void createSynonymSetTest() throws Exception { + SynonymSet expectedResponse = + SynonymSet.newBuilder() + .setName(SynonymSetName.of("[PROJECT]", "[LOCATION]", "[CONTEXT]").toString()) + .setContext("context951530927") + .addAllSynonyms(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + SynonymSet synonymSet = SynonymSet.newBuilder().build(); + + SynonymSet actualResponse = client.createSynonymSet(parent, synonymSet); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createSynonymSetExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + SynonymSet synonymSet = SynonymSet.newBuilder().build(); + client.createSynonymSet(parent, synonymSet); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createSynonymSetTest2() throws Exception { + SynonymSet expectedResponse = + SynonymSet.newBuilder() + .setName(SynonymSetName.of("[PROJECT]", "[LOCATION]", "[CONTEXT]").toString()) + .setContext("context951530927") + .addAllSynonyms(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + SynonymSet synonymSet = SynonymSet.newBuilder().build(); + + SynonymSet actualResponse = client.createSynonymSet(parent, synonymSet); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createSynonymSetExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + SynonymSet synonymSet = SynonymSet.newBuilder().build(); + client.createSynonymSet(parent, synonymSet); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSynonymSetTest() throws Exception { + SynonymSet expectedResponse = + SynonymSet.newBuilder() + .setName(SynonymSetName.of("[PROJECT]", "[LOCATION]", "[CONTEXT]").toString()) + .setContext("context951530927") + .addAllSynonyms(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + SynonymSetName name = SynonymSetName.of("[PROJECT]", "[LOCATION]", "[CONTEXT]"); + + SynonymSet actualResponse = client.getSynonymSet(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getSynonymSetExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SynonymSetName name = SynonymSetName.of("[PROJECT]", "[LOCATION]", "[CONTEXT]"); + client.getSynonymSet(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSynonymSetTest2() throws Exception { + SynonymSet expectedResponse = + SynonymSet.newBuilder() + .setName(SynonymSetName.of("[PROJECT]", "[LOCATION]", "[CONTEXT]").toString()) + .setContext("context951530927") + .addAllSynonyms(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-5186/locations/location-5186/synonymSets/synonymSet-5186"; + + SynonymSet actualResponse = client.getSynonymSet(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getSynonymSetExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-5186/locations/location-5186/synonymSets/synonymSet-5186"; + client.getSynonymSet(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateSynonymSetTest() throws Exception { + SynonymSet expectedResponse = + SynonymSet.newBuilder() + .setName(SynonymSetName.of("[PROJECT]", "[LOCATION]", "[CONTEXT]").toString()) + .setContext("context951530927") + .addAllSynonyms(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + SynonymSetName name = SynonymSetName.of("[PROJECT]", "[LOCATION]", "[CONTEXT]"); + SynonymSet synonymSet = SynonymSet.newBuilder().build(); + + SynonymSet actualResponse = client.updateSynonymSet(name, synonymSet); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateSynonymSetExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SynonymSetName name = SynonymSetName.of("[PROJECT]", "[LOCATION]", "[CONTEXT]"); + SynonymSet synonymSet = SynonymSet.newBuilder().build(); + client.updateSynonymSet(name, synonymSet); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateSynonymSetTest2() throws Exception { + SynonymSet expectedResponse = + SynonymSet.newBuilder() + .setName(SynonymSetName.of("[PROJECT]", "[LOCATION]", "[CONTEXT]").toString()) + .setContext("context951530927") + .addAllSynonyms(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-5186/locations/location-5186/synonymSets/synonymSet-5186"; + SynonymSet synonymSet = SynonymSet.newBuilder().build(); + + SynonymSet actualResponse = client.updateSynonymSet(name, synonymSet); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateSynonymSetExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-5186/locations/location-5186/synonymSets/synonymSet-5186"; + SynonymSet synonymSet = SynonymSet.newBuilder().build(); + client.updateSynonymSet(name, synonymSet); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteSynonymSetTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + SynonymSetName name = SynonymSetName.of("[PROJECT]", "[LOCATION]", "[CONTEXT]"); + + client.deleteSynonymSet(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteSynonymSetExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SynonymSetName name = SynonymSetName.of("[PROJECT]", "[LOCATION]", "[CONTEXT]"); + client.deleteSynonymSet(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteSynonymSetTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-5186/locations/location-5186/synonymSets/synonymSet-5186"; + + client.deleteSynonymSet(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteSynonymSetExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-5186/locations/location-5186/synonymSets/synonymSet-5186"; + client.deleteSynonymSet(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSynonymSetsTest() throws Exception { + SynonymSet responsesElement = SynonymSet.newBuilder().build(); + ListSynonymSetsResponse expectedResponse = + ListSynonymSetsResponse.newBuilder() + .setNextPageToken("") + .addAllSynonymSets(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListSynonymSetsPagedResponse pagedListResponse = client.listSynonymSets(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSynonymSetsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listSynonymSetsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listSynonymSets(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSynonymSetsTest2() throws Exception { + SynonymSet responsesElement = SynonymSet.newBuilder().build(); + ListSynonymSetsResponse expectedResponse = + ListSynonymSetsResponse.newBuilder() + .setNextPageToken("") + .addAllSynonymSets(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListSynonymSetsPagedResponse pagedListResponse = client.listSynonymSets(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSynonymSetsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listSynonymSetsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + client.listSynonymSets(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/SynonymSetServiceClientTest.java b/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/SynonymSetServiceClientTest.java new file mode 100644 index 000000000000..b1183a8adfb9 --- /dev/null +++ b/java-contentwarehouse/google-cloud-contentwarehouse/src/test/java/com/google/cloud/contentwarehouse/v1/SynonymSetServiceClientTest.java @@ -0,0 +1,490 @@ +/* + * 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; + +import static com.google.cloud.contentwarehouse.v1.SynonymSetServiceClient.ListSynonymSetsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.common.collect.Lists; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class SynonymSetServiceClientTest { + private static MockServiceHelper mockServiceHelper; + private static MockSynonymSetService mockSynonymSetService; + private LocalChannelProvider channelProvider; + private SynonymSetServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockSynonymSetService = new MockSynonymSetService(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockSynonymSetService)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + SynonymSetServiceSettings settings = + SynonymSetServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SynonymSetServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void createSynonymSetTest() throws Exception { + SynonymSet expectedResponse = + SynonymSet.newBuilder() + .setName(SynonymSetName.of("[PROJECT]", "[LOCATION]", "[CONTEXT]").toString()) + .setContext("context951530927") + .addAllSynonyms(new ArrayList()) + .build(); + mockSynonymSetService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + SynonymSet synonymSet = SynonymSet.newBuilder().build(); + + SynonymSet actualResponse = client.createSynonymSet(parent, synonymSet); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSynonymSetService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateSynonymSetRequest actualRequest = ((CreateSynonymSetRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(synonymSet, actualRequest.getSynonymSet()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createSynonymSetExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSynonymSetService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + SynonymSet synonymSet = SynonymSet.newBuilder().build(); + client.createSynonymSet(parent, synonymSet); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createSynonymSetTest2() throws Exception { + SynonymSet expectedResponse = + SynonymSet.newBuilder() + .setName(SynonymSetName.of("[PROJECT]", "[LOCATION]", "[CONTEXT]").toString()) + .setContext("context951530927") + .addAllSynonyms(new ArrayList()) + .build(); + mockSynonymSetService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + SynonymSet synonymSet = SynonymSet.newBuilder().build(); + + SynonymSet actualResponse = client.createSynonymSet(parent, synonymSet); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSynonymSetService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateSynonymSetRequest actualRequest = ((CreateSynonymSetRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(synonymSet, actualRequest.getSynonymSet()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createSynonymSetExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSynonymSetService.addException(exception); + + try { + String parent = "parent-995424086"; + SynonymSet synonymSet = SynonymSet.newBuilder().build(); + client.createSynonymSet(parent, synonymSet); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSynonymSetTest() throws Exception { + SynonymSet expectedResponse = + SynonymSet.newBuilder() + .setName(SynonymSetName.of("[PROJECT]", "[LOCATION]", "[CONTEXT]").toString()) + .setContext("context951530927") + .addAllSynonyms(new ArrayList()) + .build(); + mockSynonymSetService.addResponse(expectedResponse); + + SynonymSetName name = SynonymSetName.of("[PROJECT]", "[LOCATION]", "[CONTEXT]"); + + SynonymSet actualResponse = client.getSynonymSet(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSynonymSetService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetSynonymSetRequest actualRequest = ((GetSynonymSetRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getSynonymSetExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSynonymSetService.addException(exception); + + try { + SynonymSetName name = SynonymSetName.of("[PROJECT]", "[LOCATION]", "[CONTEXT]"); + client.getSynonymSet(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSynonymSetTest2() throws Exception { + SynonymSet expectedResponse = + SynonymSet.newBuilder() + .setName(SynonymSetName.of("[PROJECT]", "[LOCATION]", "[CONTEXT]").toString()) + .setContext("context951530927") + .addAllSynonyms(new ArrayList()) + .build(); + mockSynonymSetService.addResponse(expectedResponse); + + String name = "name3373707"; + + SynonymSet actualResponse = client.getSynonymSet(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSynonymSetService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetSynonymSetRequest actualRequest = ((GetSynonymSetRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getSynonymSetExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSynonymSetService.addException(exception); + + try { + String name = "name3373707"; + client.getSynonymSet(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateSynonymSetTest() throws Exception { + SynonymSet expectedResponse = + SynonymSet.newBuilder() + .setName(SynonymSetName.of("[PROJECT]", "[LOCATION]", "[CONTEXT]").toString()) + .setContext("context951530927") + .addAllSynonyms(new ArrayList()) + .build(); + mockSynonymSetService.addResponse(expectedResponse); + + SynonymSetName name = SynonymSetName.of("[PROJECT]", "[LOCATION]", "[CONTEXT]"); + SynonymSet synonymSet = SynonymSet.newBuilder().build(); + + SynonymSet actualResponse = client.updateSynonymSet(name, synonymSet); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSynonymSetService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateSynonymSetRequest actualRequest = ((UpdateSynonymSetRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertEquals(synonymSet, actualRequest.getSynonymSet()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateSynonymSetExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSynonymSetService.addException(exception); + + try { + SynonymSetName name = SynonymSetName.of("[PROJECT]", "[LOCATION]", "[CONTEXT]"); + SynonymSet synonymSet = SynonymSet.newBuilder().build(); + client.updateSynonymSet(name, synonymSet); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateSynonymSetTest2() throws Exception { + SynonymSet expectedResponse = + SynonymSet.newBuilder() + .setName(SynonymSetName.of("[PROJECT]", "[LOCATION]", "[CONTEXT]").toString()) + .setContext("context951530927") + .addAllSynonyms(new ArrayList()) + .build(); + mockSynonymSetService.addResponse(expectedResponse); + + String name = "name3373707"; + SynonymSet synonymSet = SynonymSet.newBuilder().build(); + + SynonymSet actualResponse = client.updateSynonymSet(name, synonymSet); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSynonymSetService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateSynonymSetRequest actualRequest = ((UpdateSynonymSetRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(synonymSet, actualRequest.getSynonymSet()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateSynonymSetExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSynonymSetService.addException(exception); + + try { + String name = "name3373707"; + SynonymSet synonymSet = SynonymSet.newBuilder().build(); + client.updateSynonymSet(name, synonymSet); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteSynonymSetTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockSynonymSetService.addResponse(expectedResponse); + + SynonymSetName name = SynonymSetName.of("[PROJECT]", "[LOCATION]", "[CONTEXT]"); + + client.deleteSynonymSet(name); + + List actualRequests = mockSynonymSetService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteSynonymSetRequest actualRequest = ((DeleteSynonymSetRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteSynonymSetExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSynonymSetService.addException(exception); + + try { + SynonymSetName name = SynonymSetName.of("[PROJECT]", "[LOCATION]", "[CONTEXT]"); + client.deleteSynonymSet(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteSynonymSetTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockSynonymSetService.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteSynonymSet(name); + + List actualRequests = mockSynonymSetService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteSynonymSetRequest actualRequest = ((DeleteSynonymSetRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteSynonymSetExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSynonymSetService.addException(exception); + + try { + String name = "name3373707"; + client.deleteSynonymSet(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSynonymSetsTest() throws Exception { + SynonymSet responsesElement = SynonymSet.newBuilder().build(); + ListSynonymSetsResponse expectedResponse = + ListSynonymSetsResponse.newBuilder() + .setNextPageToken("") + .addAllSynonymSets(Arrays.asList(responsesElement)) + .build(); + mockSynonymSetService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListSynonymSetsPagedResponse pagedListResponse = client.listSynonymSets(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSynonymSetsList().get(0), resources.get(0)); + + List actualRequests = mockSynonymSetService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListSynonymSetsRequest actualRequest = ((ListSynonymSetsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listSynonymSetsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSynonymSetService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listSynonymSets(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSynonymSetsTest2() throws Exception { + SynonymSet responsesElement = SynonymSet.newBuilder().build(); + ListSynonymSetsResponse expectedResponse = + ListSynonymSetsResponse.newBuilder() + .setNextPageToken("") + .addAllSynonymSets(Arrays.asList(responsesElement)) + .build(); + mockSynonymSetService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListSynonymSetsPagedResponse pagedListResponse = client.listSynonymSets(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSynonymSetsList().get(0), resources.get(0)); + + List actualRequests = mockSynonymSetService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListSynonymSetsRequest actualRequest = ((ListSynonymSetsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listSynonymSetsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSynonymSetService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listSynonymSets(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-contentwarehouse/grpc-google-cloud-contentwarehouse-v1/pom.xml b/java-contentwarehouse/grpc-google-cloud-contentwarehouse-v1/pom.xml new file mode 100644 index 000000000000..7e47b83e53ff --- /dev/null +++ b/java-contentwarehouse/grpc-google-cloud-contentwarehouse-v1/pom.xml @@ -0,0 +1,45 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-contentwarehouse-v1 + 0.0.1-SNAPSHOT + grpc-google-cloud-contentwarehouse-v1 + GRPC library for google-cloud-contentwarehouse + + com.google.cloud + google-cloud-contentwarehouse-parent + 0.0.1-SNAPSHOT + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-cloud-contentwarehouse-v1 + + + com.google.guava + guava + + + diff --git a/java-contentwarehouse/grpc-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentLinkServiceGrpc.java b/java-contentwarehouse/grpc-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentLinkServiceGrpc.java new file mode 100644 index 000000000000..da565dec4003 --- /dev/null +++ b/java-contentwarehouse/grpc-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentLinkServiceGrpc.java @@ -0,0 +1,734 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.contentwarehouse.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * This service lets you manage document-links.
+ * Document-Links are treated as sub-resources under source documents.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/contentwarehouse/v1/document_link_service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class DocumentLinkServiceGrpc { + + private DocumentLinkServiceGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.contentwarehouse.v1.DocumentLinkService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest, + com.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse> + getListLinkedTargetsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListLinkedTargets", + requestType = com.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest.class, + responseType = com.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest, + com.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse> + getListLinkedTargetsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest, + com.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse> + getListLinkedTargetsMethod; + if ((getListLinkedTargetsMethod = DocumentLinkServiceGrpc.getListLinkedTargetsMethod) == null) { + synchronized (DocumentLinkServiceGrpc.class) { + if ((getListLinkedTargetsMethod = DocumentLinkServiceGrpc.getListLinkedTargetsMethod) + == null) { + DocumentLinkServiceGrpc.getListLinkedTargetsMethod = + getListLinkedTargetsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListLinkedTargets")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new DocumentLinkServiceMethodDescriptorSupplier("ListLinkedTargets")) + .build(); + } + } + } + return getListLinkedTargetsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest, + com.google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse> + getListLinkedSourcesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListLinkedSources", + requestType = com.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest.class, + responseType = com.google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest, + com.google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse> + getListLinkedSourcesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest, + com.google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse> + getListLinkedSourcesMethod; + if ((getListLinkedSourcesMethod = DocumentLinkServiceGrpc.getListLinkedSourcesMethod) == null) { + synchronized (DocumentLinkServiceGrpc.class) { + if ((getListLinkedSourcesMethod = DocumentLinkServiceGrpc.getListLinkedSourcesMethod) + == null) { + DocumentLinkServiceGrpc.getListLinkedSourcesMethod = + getListLinkedSourcesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListLinkedSources")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new DocumentLinkServiceMethodDescriptorSupplier("ListLinkedSources")) + .build(); + } + } + } + return getListLinkedSourcesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest, + com.google.cloud.contentwarehouse.v1.DocumentLink> + getCreateDocumentLinkMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateDocumentLink", + requestType = com.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest.class, + responseType = com.google.cloud.contentwarehouse.v1.DocumentLink.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest, + com.google.cloud.contentwarehouse.v1.DocumentLink> + getCreateDocumentLinkMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest, + com.google.cloud.contentwarehouse.v1.DocumentLink> + getCreateDocumentLinkMethod; + if ((getCreateDocumentLinkMethod = DocumentLinkServiceGrpc.getCreateDocumentLinkMethod) + == null) { + synchronized (DocumentLinkServiceGrpc.class) { + if ((getCreateDocumentLinkMethod = DocumentLinkServiceGrpc.getCreateDocumentLinkMethod) + == null) { + DocumentLinkServiceGrpc.getCreateDocumentLinkMethod = + getCreateDocumentLinkMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateDocumentLink")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.contentwarehouse.v1.DocumentLink + .getDefaultInstance())) + .setSchemaDescriptor( + new DocumentLinkServiceMethodDescriptorSupplier("CreateDocumentLink")) + .build(); + } + } + } + return getCreateDocumentLinkMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest, com.google.protobuf.Empty> + getDeleteDocumentLinkMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteDocumentLink", + requestType = com.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest, com.google.protobuf.Empty> + getDeleteDocumentLinkMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest, + com.google.protobuf.Empty> + getDeleteDocumentLinkMethod; + if ((getDeleteDocumentLinkMethod = DocumentLinkServiceGrpc.getDeleteDocumentLinkMethod) + == null) { + synchronized (DocumentLinkServiceGrpc.class) { + if ((getDeleteDocumentLinkMethod = DocumentLinkServiceGrpc.getDeleteDocumentLinkMethod) + == null) { + DocumentLinkServiceGrpc.getDeleteDocumentLinkMethod = + getDeleteDocumentLinkMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteDocumentLink")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentLinkServiceMethodDescriptorSupplier("DeleteDocumentLink")) + .build(); + } + } + } + return getDeleteDocumentLinkMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static DocumentLinkServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public DocumentLinkServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentLinkServiceStub(channel, callOptions); + } + }; + return DocumentLinkServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static DocumentLinkServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public DocumentLinkServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentLinkServiceBlockingStub(channel, callOptions); + } + }; + return DocumentLinkServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static DocumentLinkServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public DocumentLinkServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentLinkServiceFutureStub(channel, callOptions); + } + }; + return DocumentLinkServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * This service lets you manage document-links.
+   * Document-Links are treated as sub-resources under source documents.
+   * 
+ */ + public abstract static class DocumentLinkServiceImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Return all target document-links from the document.
+     * 
+ */ + public void listLinkedTargets( + com.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListLinkedTargetsMethod(), responseObserver); + } + + /** + * + * + *
+     * Return all source document-links from the document.
+     * 
+ */ + public void listLinkedSources( + com.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListLinkedSourcesMethod(), responseObserver); + } + + /** + * + * + *
+     * Create a link between a source document and a target document.
+     * 
+ */ + public void createDocumentLink( + com.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateDocumentLinkMethod(), responseObserver); + } + + /** + * + * + *
+     * Remove the link between the source and target documents.
+     * 
+ */ + public void deleteDocumentLink( + com.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteDocumentLinkMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListLinkedTargetsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest, + com.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse>( + this, METHODID_LIST_LINKED_TARGETS))) + .addMethod( + getListLinkedSourcesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest, + com.google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse>( + this, METHODID_LIST_LINKED_SOURCES))) + .addMethod( + getCreateDocumentLinkMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest, + com.google.cloud.contentwarehouse.v1.DocumentLink>( + this, METHODID_CREATE_DOCUMENT_LINK))) + .addMethod( + getDeleteDocumentLinkMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest, + com.google.protobuf.Empty>(this, METHODID_DELETE_DOCUMENT_LINK))) + .build(); + } + } + + /** + * + * + *
+   * This service lets you manage document-links.
+   * Document-Links are treated as sub-resources under source documents.
+   * 
+ */ + public static final class DocumentLinkServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private DocumentLinkServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected DocumentLinkServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentLinkServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Return all target document-links from the document.
+     * 
+ */ + public void listLinkedTargets( + com.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListLinkedTargetsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Return all source document-links from the document.
+     * 
+ */ + public void listLinkedSources( + com.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListLinkedSourcesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Create a link between a source document and a target document.
+     * 
+ */ + public void createDocumentLink( + com.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateDocumentLinkMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Remove the link between the source and target documents.
+     * 
+ */ + public void deleteDocumentLink( + com.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteDocumentLinkMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * This service lets you manage document-links.
+   * Document-Links are treated as sub-resources under source documents.
+   * 
+ */ + public static final class DocumentLinkServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private DocumentLinkServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected DocumentLinkServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentLinkServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Return all target document-links from the document.
+     * 
+ */ + public com.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse listLinkedTargets( + com.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListLinkedTargetsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Return all source document-links from the document.
+     * 
+ */ + public com.google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse listLinkedSources( + com.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListLinkedSourcesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Create a link between a source document and a target document.
+     * 
+ */ + public com.google.cloud.contentwarehouse.v1.DocumentLink createDocumentLink( + com.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateDocumentLinkMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Remove the link between the source and target documents.
+     * 
+ */ + public com.google.protobuf.Empty deleteDocumentLink( + com.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteDocumentLinkMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * This service lets you manage document-links.
+   * Document-Links are treated as sub-resources under source documents.
+   * 
+ */ + public static final class DocumentLinkServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private DocumentLinkServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected DocumentLinkServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentLinkServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Return all target document-links from the document.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse> + listLinkedTargets(com.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListLinkedTargetsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Return all source document-links from the document.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse> + listLinkedSources(com.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListLinkedSourcesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Create a link between a source document and a target document.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.contentwarehouse.v1.DocumentLink> + createDocumentLink(com.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateDocumentLinkMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Remove the link between the source and target documents.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteDocumentLink(com.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteDocumentLinkMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_LINKED_TARGETS = 0; + private static final int METHODID_LIST_LINKED_SOURCES = 1; + private static final int METHODID_CREATE_DOCUMENT_LINK = 2; + private static final int METHODID_DELETE_DOCUMENT_LINK = 3; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final DocumentLinkServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(DocumentLinkServiceImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_LIST_LINKED_TARGETS: + serviceImpl.listLinkedTargets( + (com.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse>) + responseObserver); + break; + case METHODID_LIST_LINKED_SOURCES: + serviceImpl.listLinkedSources( + (com.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse>) + responseObserver); + break; + case METHODID_CREATE_DOCUMENT_LINK: + serviceImpl.createDocumentLink( + (com.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_DOCUMENT_LINK: + serviceImpl.deleteDocumentLink( + (com.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private abstract static class DocumentLinkServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + DocumentLinkServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentLinkServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("DocumentLinkService"); + } + } + + private static final class DocumentLinkServiceFileDescriptorSupplier + extends DocumentLinkServiceBaseDescriptorSupplier { + DocumentLinkServiceFileDescriptorSupplier() {} + } + + private static final class DocumentLinkServiceMethodDescriptorSupplier + extends DocumentLinkServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + DocumentLinkServiceMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (DocumentLinkServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new DocumentLinkServiceFileDescriptorSupplier()) + .addMethod(getListLinkedTargetsMethod()) + .addMethod(getListLinkedSourcesMethod()) + .addMethod(getCreateDocumentLinkMethod()) + .addMethod(getDeleteDocumentLinkMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-contentwarehouse/grpc-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentSchemaServiceGrpc.java b/java-contentwarehouse/grpc-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentSchemaServiceGrpc.java new file mode 100644 index 000000000000..a0304fa8b90c --- /dev/null +++ b/java-contentwarehouse/grpc-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentSchemaServiceGrpc.java @@ -0,0 +1,901 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.contentwarehouse.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * This service lets you manage document schema.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/contentwarehouse/v1/document_schema_service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class DocumentSchemaServiceGrpc { + + private DocumentSchemaServiceGrpc() {} + + public static final String SERVICE_NAME = + "google.cloud.contentwarehouse.v1.DocumentSchemaService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest, + com.google.cloud.contentwarehouse.v1.DocumentSchema> + getCreateDocumentSchemaMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateDocumentSchema", + requestType = com.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest.class, + responseType = com.google.cloud.contentwarehouse.v1.DocumentSchema.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest, + com.google.cloud.contentwarehouse.v1.DocumentSchema> + getCreateDocumentSchemaMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest, + com.google.cloud.contentwarehouse.v1.DocumentSchema> + getCreateDocumentSchemaMethod; + if ((getCreateDocumentSchemaMethod = DocumentSchemaServiceGrpc.getCreateDocumentSchemaMethod) + == null) { + synchronized (DocumentSchemaServiceGrpc.class) { + if ((getCreateDocumentSchemaMethod = + DocumentSchemaServiceGrpc.getCreateDocumentSchemaMethod) + == null) { + DocumentSchemaServiceGrpc.getCreateDocumentSchemaMethod = + getCreateDocumentSchemaMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "CreateDocumentSchema")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.contentwarehouse.v1.DocumentSchema + .getDefaultInstance())) + .setSchemaDescriptor( + new DocumentSchemaServiceMethodDescriptorSupplier("CreateDocumentSchema")) + .build(); + } + } + } + return getCreateDocumentSchemaMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest, + com.google.cloud.contentwarehouse.v1.DocumentSchema> + getUpdateDocumentSchemaMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateDocumentSchema", + requestType = com.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest.class, + responseType = com.google.cloud.contentwarehouse.v1.DocumentSchema.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest, + com.google.cloud.contentwarehouse.v1.DocumentSchema> + getUpdateDocumentSchemaMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest, + com.google.cloud.contentwarehouse.v1.DocumentSchema> + getUpdateDocumentSchemaMethod; + if ((getUpdateDocumentSchemaMethod = DocumentSchemaServiceGrpc.getUpdateDocumentSchemaMethod) + == null) { + synchronized (DocumentSchemaServiceGrpc.class) { + if ((getUpdateDocumentSchemaMethod = + DocumentSchemaServiceGrpc.getUpdateDocumentSchemaMethod) + == null) { + DocumentSchemaServiceGrpc.getUpdateDocumentSchemaMethod = + getUpdateDocumentSchemaMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "UpdateDocumentSchema")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.contentwarehouse.v1.DocumentSchema + .getDefaultInstance())) + .setSchemaDescriptor( + new DocumentSchemaServiceMethodDescriptorSupplier("UpdateDocumentSchema")) + .build(); + } + } + } + return getUpdateDocumentSchemaMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest, + com.google.cloud.contentwarehouse.v1.DocumentSchema> + getGetDocumentSchemaMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetDocumentSchema", + requestType = com.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest.class, + responseType = com.google.cloud.contentwarehouse.v1.DocumentSchema.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest, + com.google.cloud.contentwarehouse.v1.DocumentSchema> + getGetDocumentSchemaMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest, + com.google.cloud.contentwarehouse.v1.DocumentSchema> + getGetDocumentSchemaMethod; + if ((getGetDocumentSchemaMethod = DocumentSchemaServiceGrpc.getGetDocumentSchemaMethod) + == null) { + synchronized (DocumentSchemaServiceGrpc.class) { + if ((getGetDocumentSchemaMethod = DocumentSchemaServiceGrpc.getGetDocumentSchemaMethod) + == null) { + DocumentSchemaServiceGrpc.getGetDocumentSchemaMethod = + getGetDocumentSchemaMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetDocumentSchema")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.contentwarehouse.v1.DocumentSchema + .getDefaultInstance())) + .setSchemaDescriptor( + new DocumentSchemaServiceMethodDescriptorSupplier("GetDocumentSchema")) + .build(); + } + } + } + return getGetDocumentSchemaMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest, + com.google.protobuf.Empty> + getDeleteDocumentSchemaMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteDocumentSchema", + requestType = com.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest, + com.google.protobuf.Empty> + getDeleteDocumentSchemaMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest, + com.google.protobuf.Empty> + getDeleteDocumentSchemaMethod; + if ((getDeleteDocumentSchemaMethod = DocumentSchemaServiceGrpc.getDeleteDocumentSchemaMethod) + == null) { + synchronized (DocumentSchemaServiceGrpc.class) { + if ((getDeleteDocumentSchemaMethod = + DocumentSchemaServiceGrpc.getDeleteDocumentSchemaMethod) + == null) { + DocumentSchemaServiceGrpc.getDeleteDocumentSchemaMethod = + getDeleteDocumentSchemaMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "DeleteDocumentSchema")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentSchemaServiceMethodDescriptorSupplier("DeleteDocumentSchema")) + .build(); + } + } + } + return getDeleteDocumentSchemaMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest, + com.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse> + getListDocumentSchemasMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListDocumentSchemas", + requestType = com.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest.class, + responseType = com.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest, + com.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse> + getListDocumentSchemasMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest, + com.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse> + getListDocumentSchemasMethod; + if ((getListDocumentSchemasMethod = DocumentSchemaServiceGrpc.getListDocumentSchemasMethod) + == null) { + synchronized (DocumentSchemaServiceGrpc.class) { + if ((getListDocumentSchemasMethod = DocumentSchemaServiceGrpc.getListDocumentSchemasMethod) + == null) { + DocumentSchemaServiceGrpc.getListDocumentSchemasMethod = + getListDocumentSchemasMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListDocumentSchemas")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new DocumentSchemaServiceMethodDescriptorSupplier("ListDocumentSchemas")) + .build(); + } + } + } + return getListDocumentSchemasMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static DocumentSchemaServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public DocumentSchemaServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentSchemaServiceStub(channel, callOptions); + } + }; + return DocumentSchemaServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static DocumentSchemaServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public DocumentSchemaServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentSchemaServiceBlockingStub(channel, callOptions); + } + }; + return DocumentSchemaServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static DocumentSchemaServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public DocumentSchemaServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentSchemaServiceFutureStub(channel, callOptions); + } + }; + return DocumentSchemaServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * This service lets you manage document schema.
+   * 
+ */ + public abstract static class DocumentSchemaServiceImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Creates a document schema.
+     * 
+ */ + public void createDocumentSchema( + com.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateDocumentSchemaMethod(), responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void updateDocumentSchema( + com.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateDocumentSchemaMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets a document schema. Returns NOT_FOUND if the document schema does not
+     * exist.
+     * 
+ */ + public void getDocumentSchema( + com.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetDocumentSchemaMethod(), responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void deleteDocumentSchema( + com.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteDocumentSchemaMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists document schemas.
+     * 
+ */ + public void listDocumentSchemas( + com.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListDocumentSchemasMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateDocumentSchemaMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest, + com.google.cloud.contentwarehouse.v1.DocumentSchema>( + this, METHODID_CREATE_DOCUMENT_SCHEMA))) + .addMethod( + getUpdateDocumentSchemaMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest, + com.google.cloud.contentwarehouse.v1.DocumentSchema>( + this, METHODID_UPDATE_DOCUMENT_SCHEMA))) + .addMethod( + getGetDocumentSchemaMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest, + com.google.cloud.contentwarehouse.v1.DocumentSchema>( + this, METHODID_GET_DOCUMENT_SCHEMA))) + .addMethod( + getDeleteDocumentSchemaMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest, + com.google.protobuf.Empty>(this, METHODID_DELETE_DOCUMENT_SCHEMA))) + .addMethod( + getListDocumentSchemasMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest, + com.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse>( + this, METHODID_LIST_DOCUMENT_SCHEMAS))) + .build(); + } + } + + /** + * + * + *
+   * This service lets you manage document schema.
+   * 
+ */ + public static final class DocumentSchemaServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private DocumentSchemaServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected DocumentSchemaServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentSchemaServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a document schema.
+     * 
+ */ + public void createDocumentSchema( + com.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateDocumentSchemaMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void updateDocumentSchema( + com.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateDocumentSchemaMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets a document schema. Returns NOT_FOUND if the document schema does not
+     * exist.
+     * 
+ */ + public void getDocumentSchema( + com.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetDocumentSchemaMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void deleteDocumentSchema( + com.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteDocumentSchemaMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists document schemas.
+     * 
+ */ + public void listDocumentSchemas( + com.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListDocumentSchemasMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * This service lets you manage document schema.
+   * 
+ */ + public static final class DocumentSchemaServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private DocumentSchemaServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected DocumentSchemaServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentSchemaServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a document schema.
+     * 
+ */ + public com.google.cloud.contentwarehouse.v1.DocumentSchema createDocumentSchema( + com.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateDocumentSchemaMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.cloud.contentwarehouse.v1.DocumentSchema updateDocumentSchema( + com.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateDocumentSchemaMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a document schema. Returns NOT_FOUND if the document schema does not
+     * exist.
+     * 
+ */ + public com.google.cloud.contentwarehouse.v1.DocumentSchema getDocumentSchema( + com.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetDocumentSchemaMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.protobuf.Empty deleteDocumentSchema( + com.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteDocumentSchemaMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists document schemas.
+     * 
+ */ + public com.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse listDocumentSchemas( + com.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListDocumentSchemasMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * This service lets you manage document schema.
+   * 
+ */ + public static final class DocumentSchemaServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private DocumentSchemaServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected DocumentSchemaServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentSchemaServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a document schema.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.contentwarehouse.v1.DocumentSchema> + createDocumentSchema( + com.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateDocumentSchemaMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.contentwarehouse.v1.DocumentSchema> + updateDocumentSchema( + com.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateDocumentSchemaMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets a document schema. Returns NOT_FOUND if the document schema does not
+     * exist.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.contentwarehouse.v1.DocumentSchema> + getDocumentSchema(com.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetDocumentSchemaMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteDocumentSchema( + com.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteDocumentSchemaMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists document schemas.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse> + listDocumentSchemas( + com.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListDocumentSchemasMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_DOCUMENT_SCHEMA = 0; + private static final int METHODID_UPDATE_DOCUMENT_SCHEMA = 1; + private static final int METHODID_GET_DOCUMENT_SCHEMA = 2; + private static final int METHODID_DELETE_DOCUMENT_SCHEMA = 3; + private static final int METHODID_LIST_DOCUMENT_SCHEMAS = 4; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final DocumentSchemaServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(DocumentSchemaServiceImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_CREATE_DOCUMENT_SCHEMA: + serviceImpl.createDocumentSchema( + (com.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_DOCUMENT_SCHEMA: + serviceImpl.updateDocumentSchema( + (com.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_DOCUMENT_SCHEMA: + serviceImpl.getDocumentSchema( + (com.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_DOCUMENT_SCHEMA: + serviceImpl.deleteDocumentSchema( + (com.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_DOCUMENT_SCHEMAS: + serviceImpl.listDocumentSchemas( + (com.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse>) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private abstract static class DocumentSchemaServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + DocumentSchemaServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("DocumentSchemaService"); + } + } + + private static final class DocumentSchemaServiceFileDescriptorSupplier + extends DocumentSchemaServiceBaseDescriptorSupplier { + DocumentSchemaServiceFileDescriptorSupplier() {} + } + + private static final class DocumentSchemaServiceMethodDescriptorSupplier + extends DocumentSchemaServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + DocumentSchemaServiceMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (DocumentSchemaServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new DocumentSchemaServiceFileDescriptorSupplier()) + .addMethod(getCreateDocumentSchemaMethod()) + .addMethod(getUpdateDocumentSchemaMethod()) + .addMethod(getGetDocumentSchemaMethod()) + .addMethod(getDeleteDocumentSchemaMethod()) + .addMethod(getListDocumentSchemasMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-contentwarehouse/grpc-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentServiceGrpc.java b/java-contentwarehouse/grpc-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentServiceGrpc.java new file mode 100644 index 000000000000..35dcc5cef6d5 --- /dev/null +++ b/java-contentwarehouse/grpc-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentServiceGrpc.java @@ -0,0 +1,1096 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.contentwarehouse.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * This service lets you manage document.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/contentwarehouse/v1/document_service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class DocumentServiceGrpc { + + private DocumentServiceGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.contentwarehouse.v1.DocumentService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.CreateDocumentRequest, + com.google.cloud.contentwarehouse.v1.CreateDocumentResponse> + getCreateDocumentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateDocument", + requestType = com.google.cloud.contentwarehouse.v1.CreateDocumentRequest.class, + responseType = com.google.cloud.contentwarehouse.v1.CreateDocumentResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.CreateDocumentRequest, + com.google.cloud.contentwarehouse.v1.CreateDocumentResponse> + getCreateDocumentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.CreateDocumentRequest, + com.google.cloud.contentwarehouse.v1.CreateDocumentResponse> + getCreateDocumentMethod; + if ((getCreateDocumentMethod = DocumentServiceGrpc.getCreateDocumentMethod) == null) { + synchronized (DocumentServiceGrpc.class) { + if ((getCreateDocumentMethod = DocumentServiceGrpc.getCreateDocumentMethod) == null) { + DocumentServiceGrpc.getCreateDocumentMethod = + getCreateDocumentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateDocument")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.contentwarehouse.v1.CreateDocumentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.contentwarehouse.v1.CreateDocumentResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new DocumentServiceMethodDescriptorSupplier("CreateDocument")) + .build(); + } + } + } + return getCreateDocumentMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.GetDocumentRequest, + com.google.cloud.contentwarehouse.v1.Document> + getGetDocumentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetDocument", + requestType = com.google.cloud.contentwarehouse.v1.GetDocumentRequest.class, + responseType = com.google.cloud.contentwarehouse.v1.Document.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.GetDocumentRequest, + com.google.cloud.contentwarehouse.v1.Document> + getGetDocumentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.GetDocumentRequest, + com.google.cloud.contentwarehouse.v1.Document> + getGetDocumentMethod; + if ((getGetDocumentMethod = DocumentServiceGrpc.getGetDocumentMethod) == null) { + synchronized (DocumentServiceGrpc.class) { + if ((getGetDocumentMethod = DocumentServiceGrpc.getGetDocumentMethod) == null) { + DocumentServiceGrpc.getGetDocumentMethod = + getGetDocumentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetDocument")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.contentwarehouse.v1.GetDocumentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.contentwarehouse.v1.Document.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentServiceMethodDescriptorSupplier("GetDocument")) + .build(); + } + } + } + return getGetDocumentMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.UpdateDocumentRequest, + com.google.cloud.contentwarehouse.v1.UpdateDocumentResponse> + getUpdateDocumentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateDocument", + requestType = com.google.cloud.contentwarehouse.v1.UpdateDocumentRequest.class, + responseType = com.google.cloud.contentwarehouse.v1.UpdateDocumentResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.UpdateDocumentRequest, + com.google.cloud.contentwarehouse.v1.UpdateDocumentResponse> + getUpdateDocumentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.UpdateDocumentRequest, + com.google.cloud.contentwarehouse.v1.UpdateDocumentResponse> + getUpdateDocumentMethod; + if ((getUpdateDocumentMethod = DocumentServiceGrpc.getUpdateDocumentMethod) == null) { + synchronized (DocumentServiceGrpc.class) { + if ((getUpdateDocumentMethod = DocumentServiceGrpc.getUpdateDocumentMethod) == null) { + DocumentServiceGrpc.getUpdateDocumentMethod = + getUpdateDocumentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateDocument")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.contentwarehouse.v1.UpdateDocumentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.contentwarehouse.v1.UpdateDocumentResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new DocumentServiceMethodDescriptorSupplier("UpdateDocument")) + .build(); + } + } + } + return getUpdateDocumentMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.DeleteDocumentRequest, com.google.protobuf.Empty> + getDeleteDocumentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteDocument", + requestType = com.google.cloud.contentwarehouse.v1.DeleteDocumentRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.DeleteDocumentRequest, com.google.protobuf.Empty> + getDeleteDocumentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.DeleteDocumentRequest, com.google.protobuf.Empty> + getDeleteDocumentMethod; + if ((getDeleteDocumentMethod = DocumentServiceGrpc.getDeleteDocumentMethod) == null) { + synchronized (DocumentServiceGrpc.class) { + if ((getDeleteDocumentMethod = DocumentServiceGrpc.getDeleteDocumentMethod) == null) { + DocumentServiceGrpc.getDeleteDocumentMethod = + getDeleteDocumentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteDocument")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.contentwarehouse.v1.DeleteDocumentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentServiceMethodDescriptorSupplier("DeleteDocument")) + .build(); + } + } + } + return getDeleteDocumentMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest, + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse> + getSearchDocumentsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SearchDocuments", + requestType = com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest.class, + responseType = com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest, + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse> + getSearchDocumentsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest, + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse> + getSearchDocumentsMethod; + if ((getSearchDocumentsMethod = DocumentServiceGrpc.getSearchDocumentsMethod) == null) { + synchronized (DocumentServiceGrpc.class) { + if ((getSearchDocumentsMethod = DocumentServiceGrpc.getSearchDocumentsMethod) == null) { + DocumentServiceGrpc.getSearchDocumentsMethod = + getSearchDocumentsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SearchDocuments")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new DocumentServiceMethodDescriptorSupplier("SearchDocuments")) + .build(); + } + } + } + return getSearchDocumentsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.FetchAclRequest, + com.google.cloud.contentwarehouse.v1.FetchAclResponse> + getFetchAclMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "FetchAcl", + requestType = com.google.cloud.contentwarehouse.v1.FetchAclRequest.class, + responseType = com.google.cloud.contentwarehouse.v1.FetchAclResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.FetchAclRequest, + com.google.cloud.contentwarehouse.v1.FetchAclResponse> + getFetchAclMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.FetchAclRequest, + com.google.cloud.contentwarehouse.v1.FetchAclResponse> + getFetchAclMethod; + if ((getFetchAclMethod = DocumentServiceGrpc.getFetchAclMethod) == null) { + synchronized (DocumentServiceGrpc.class) { + if ((getFetchAclMethod = DocumentServiceGrpc.getFetchAclMethod) == null) { + DocumentServiceGrpc.getFetchAclMethod = + getFetchAclMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "FetchAcl")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.contentwarehouse.v1.FetchAclRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.contentwarehouse.v1.FetchAclResponse + .getDefaultInstance())) + .setSchemaDescriptor(new DocumentServiceMethodDescriptorSupplier("FetchAcl")) + .build(); + } + } + } + return getFetchAclMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.SetAclRequest, + com.google.cloud.contentwarehouse.v1.SetAclResponse> + getSetAclMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SetAcl", + requestType = com.google.cloud.contentwarehouse.v1.SetAclRequest.class, + responseType = com.google.cloud.contentwarehouse.v1.SetAclResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.SetAclRequest, + com.google.cloud.contentwarehouse.v1.SetAclResponse> + getSetAclMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.SetAclRequest, + com.google.cloud.contentwarehouse.v1.SetAclResponse> + getSetAclMethod; + if ((getSetAclMethod = DocumentServiceGrpc.getSetAclMethod) == null) { + synchronized (DocumentServiceGrpc.class) { + if ((getSetAclMethod = DocumentServiceGrpc.getSetAclMethod) == null) { + DocumentServiceGrpc.getSetAclMethod = + getSetAclMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SetAcl")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.contentwarehouse.v1.SetAclRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.contentwarehouse.v1.SetAclResponse + .getDefaultInstance())) + .setSchemaDescriptor(new DocumentServiceMethodDescriptorSupplier("SetAcl")) + .build(); + } + } + } + return getSetAclMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static DocumentServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public DocumentServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentServiceStub(channel, callOptions); + } + }; + return DocumentServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static DocumentServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public DocumentServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentServiceBlockingStub(channel, callOptions); + } + }; + return DocumentServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static DocumentServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public DocumentServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentServiceFutureStub(channel, callOptions); + } + }; + return DocumentServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * This service lets you manage document.
+   * 
+ */ + public abstract static class DocumentServiceImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Creates a document.
+     * 
+ */ + public void createDocument( + com.google.cloud.contentwarehouse.v1.CreateDocumentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateDocumentMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets a document. Returns NOT_FOUND if the document does not exist.
+     * 
+ */ + public void getDocument( + com.google.cloud.contentwarehouse.v1.GetDocumentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetDocumentMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates a document. Returns INVALID_ARGUMENT if the name of the document
+     * is non-empty and does not equal the existing name.
+     * 
+ */ + public void updateDocument( + com.google.cloud.contentwarehouse.v1.UpdateDocumentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateDocumentMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a document. Returns NOT_FOUND if the document does not exist.
+     * 
+ */ + public void deleteDocument( + com.google.cloud.contentwarehouse.v1.DeleteDocumentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteDocumentMethod(), responseObserver); + } + + /** + * + * + *
+     * Searches for documents using provided [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest].
+     * This call only returns documents that the caller has permission to search
+     * against.
+     * 
+ */ + public void searchDocuments( + com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getSearchDocumentsMethod(), responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void fetchAcl( + com.google.cloud.contentwarehouse.v1.FetchAclRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getFetchAclMethod(), responseObserver); + } + + /** + * + * + *
+     * Sets the access control policy for a resource. Replaces any existing
+     * policy.
+     * 
+ */ + public void setAcl( + com.google.cloud.contentwarehouse.v1.SetAclRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSetAclMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateDocumentMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.contentwarehouse.v1.CreateDocumentRequest, + com.google.cloud.contentwarehouse.v1.CreateDocumentResponse>( + this, METHODID_CREATE_DOCUMENT))) + .addMethod( + getGetDocumentMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.contentwarehouse.v1.GetDocumentRequest, + com.google.cloud.contentwarehouse.v1.Document>(this, METHODID_GET_DOCUMENT))) + .addMethod( + getUpdateDocumentMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.contentwarehouse.v1.UpdateDocumentRequest, + com.google.cloud.contentwarehouse.v1.UpdateDocumentResponse>( + this, METHODID_UPDATE_DOCUMENT))) + .addMethod( + getDeleteDocumentMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.contentwarehouse.v1.DeleteDocumentRequest, + com.google.protobuf.Empty>(this, METHODID_DELETE_DOCUMENT))) + .addMethod( + getSearchDocumentsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest, + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse>( + this, METHODID_SEARCH_DOCUMENTS))) + .addMethod( + getFetchAclMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.contentwarehouse.v1.FetchAclRequest, + com.google.cloud.contentwarehouse.v1.FetchAclResponse>( + this, METHODID_FETCH_ACL))) + .addMethod( + getSetAclMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.contentwarehouse.v1.SetAclRequest, + com.google.cloud.contentwarehouse.v1.SetAclResponse>(this, METHODID_SET_ACL))) + .build(); + } + } + + /** + * + * + *
+   * This service lets you manage document.
+   * 
+ */ + public static final class DocumentServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private DocumentServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected DocumentServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a document.
+     * 
+ */ + public void createDocument( + com.google.cloud.contentwarehouse.v1.CreateDocumentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateDocumentMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets a document. Returns NOT_FOUND if the document does not exist.
+     * 
+ */ + public void getDocument( + com.google.cloud.contentwarehouse.v1.GetDocumentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetDocumentMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates a document. Returns INVALID_ARGUMENT if the name of the document
+     * is non-empty and does not equal the existing name.
+     * 
+ */ + public void updateDocument( + com.google.cloud.contentwarehouse.v1.UpdateDocumentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateDocumentMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a document. Returns NOT_FOUND if the document does not exist.
+     * 
+ */ + public void deleteDocument( + com.google.cloud.contentwarehouse.v1.DeleteDocumentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteDocumentMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Searches for documents using provided [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest].
+     * This call only returns documents that the caller has permission to search
+     * against.
+     * 
+ */ + public void searchDocuments( + com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSearchDocumentsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void fetchAcl( + com.google.cloud.contentwarehouse.v1.FetchAclRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getFetchAclMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Sets the access control policy for a resource. Replaces any existing
+     * policy.
+     * 
+ */ + public void setAcl( + com.google.cloud.contentwarehouse.v1.SetAclRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSetAclMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + * + * + *
+   * This service lets you manage document.
+   * 
+ */ + public static final class DocumentServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private DocumentServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected DocumentServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a document.
+     * 
+ */ + public com.google.cloud.contentwarehouse.v1.CreateDocumentResponse createDocument( + com.google.cloud.contentwarehouse.v1.CreateDocumentRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateDocumentMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a document. Returns NOT_FOUND if the document does not exist.
+     * 
+ */ + public com.google.cloud.contentwarehouse.v1.Document getDocument( + com.google.cloud.contentwarehouse.v1.GetDocumentRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetDocumentMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a document. Returns INVALID_ARGUMENT if the name of the document
+     * is non-empty and does not equal the existing name.
+     * 
+ */ + public com.google.cloud.contentwarehouse.v1.UpdateDocumentResponse updateDocument( + com.google.cloud.contentwarehouse.v1.UpdateDocumentRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateDocumentMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a document. Returns NOT_FOUND if the document does not exist.
+     * 
+ */ + public com.google.protobuf.Empty deleteDocument( + com.google.cloud.contentwarehouse.v1.DeleteDocumentRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteDocumentMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Searches for documents using provided [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest].
+     * This call only returns documents that the caller has permission to search
+     * against.
+     * 
+ */ + public com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse searchDocuments( + com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSearchDocumentsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.cloud.contentwarehouse.v1.FetchAclResponse fetchAcl( + com.google.cloud.contentwarehouse.v1.FetchAclRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getFetchAclMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Sets the access control policy for a resource. Replaces any existing
+     * policy.
+     * 
+ */ + public com.google.cloud.contentwarehouse.v1.SetAclResponse setAcl( + com.google.cloud.contentwarehouse.v1.SetAclRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSetAclMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * This service lets you manage document.
+   * 
+ */ + public static final class DocumentServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private DocumentServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected DocumentServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a document.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.contentwarehouse.v1.CreateDocumentResponse> + createDocument(com.google.cloud.contentwarehouse.v1.CreateDocumentRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateDocumentMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets a document. Returns NOT_FOUND if the document does not exist.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.contentwarehouse.v1.Document> + getDocument(com.google.cloud.contentwarehouse.v1.GetDocumentRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetDocumentMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates a document. Returns INVALID_ARGUMENT if the name of the document
+     * is non-empty and does not equal the existing name.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.contentwarehouse.v1.UpdateDocumentResponse> + updateDocument(com.google.cloud.contentwarehouse.v1.UpdateDocumentRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateDocumentMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a document. Returns NOT_FOUND if the document does not exist.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteDocument(com.google.cloud.contentwarehouse.v1.DeleteDocumentRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteDocumentMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Searches for documents using provided [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest].
+     * This call only returns documents that the caller has permission to search
+     * against.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse> + searchDocuments(com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSearchDocumentsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.contentwarehouse.v1.FetchAclResponse> + fetchAcl(com.google.cloud.contentwarehouse.v1.FetchAclRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getFetchAclMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Sets the access control policy for a resource. Replaces any existing
+     * policy.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.contentwarehouse.v1.SetAclResponse> + setAcl(com.google.cloud.contentwarehouse.v1.SetAclRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSetAclMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_DOCUMENT = 0; + private static final int METHODID_GET_DOCUMENT = 1; + private static final int METHODID_UPDATE_DOCUMENT = 2; + private static final int METHODID_DELETE_DOCUMENT = 3; + private static final int METHODID_SEARCH_DOCUMENTS = 4; + private static final int METHODID_FETCH_ACL = 5; + private static final int METHODID_SET_ACL = 6; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final DocumentServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(DocumentServiceImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_CREATE_DOCUMENT: + serviceImpl.createDocument( + (com.google.cloud.contentwarehouse.v1.CreateDocumentRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.contentwarehouse.v1.CreateDocumentResponse>) + responseObserver); + break; + case METHODID_GET_DOCUMENT: + serviceImpl.getDocument( + (com.google.cloud.contentwarehouse.v1.GetDocumentRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_DOCUMENT: + serviceImpl.updateDocument( + (com.google.cloud.contentwarehouse.v1.UpdateDocumentRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.contentwarehouse.v1.UpdateDocumentResponse>) + responseObserver); + break; + case METHODID_DELETE_DOCUMENT: + serviceImpl.deleteDocument( + (com.google.cloud.contentwarehouse.v1.DeleteDocumentRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_SEARCH_DOCUMENTS: + serviceImpl.searchDocuments( + (com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse>) + responseObserver); + break; + case METHODID_FETCH_ACL: + serviceImpl.fetchAcl( + (com.google.cloud.contentwarehouse.v1.FetchAclRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_SET_ACL: + serviceImpl.setAcl( + (com.google.cloud.contentwarehouse.v1.SetAclRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private abstract static class DocumentServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + DocumentServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("DocumentService"); + } + } + + private static final class DocumentServiceFileDescriptorSupplier + extends DocumentServiceBaseDescriptorSupplier { + DocumentServiceFileDescriptorSupplier() {} + } + + private static final class DocumentServiceMethodDescriptorSupplier + extends DocumentServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + DocumentServiceMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (DocumentServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new DocumentServiceFileDescriptorSupplier()) + .addMethod(getCreateDocumentMethod()) + .addMethod(getGetDocumentMethod()) + .addMethod(getUpdateDocumentMethod()) + .addMethod(getDeleteDocumentMethod()) + .addMethod(getSearchDocumentsMethod()) + .addMethod(getFetchAclMethod()) + .addMethod(getSetAclMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-contentwarehouse/grpc-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/RuleSetServiceGrpc.java b/java-contentwarehouse/grpc-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/RuleSetServiceGrpc.java new file mode 100644 index 000000000000..07e5441a24b5 --- /dev/null +++ b/java-contentwarehouse/grpc-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/RuleSetServiceGrpc.java @@ -0,0 +1,835 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.contentwarehouse.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service to manage customer specific RuleSets.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/contentwarehouse/v1/ruleset_service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class RuleSetServiceGrpc { + + private RuleSetServiceGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.contentwarehouse.v1.RuleSetService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.CreateRuleSetRequest, + com.google.cloud.contentwarehouse.v1.RuleSet> + getCreateRuleSetMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateRuleSet", + requestType = com.google.cloud.contentwarehouse.v1.CreateRuleSetRequest.class, + responseType = com.google.cloud.contentwarehouse.v1.RuleSet.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.CreateRuleSetRequest, + com.google.cloud.contentwarehouse.v1.RuleSet> + getCreateRuleSetMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.CreateRuleSetRequest, + com.google.cloud.contentwarehouse.v1.RuleSet> + getCreateRuleSetMethod; + if ((getCreateRuleSetMethod = RuleSetServiceGrpc.getCreateRuleSetMethod) == null) { + synchronized (RuleSetServiceGrpc.class) { + if ((getCreateRuleSetMethod = RuleSetServiceGrpc.getCreateRuleSetMethod) == null) { + RuleSetServiceGrpc.getCreateRuleSetMethod = + getCreateRuleSetMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateRuleSet")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.contentwarehouse.v1.CreateRuleSetRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.contentwarehouse.v1.RuleSet.getDefaultInstance())) + .setSchemaDescriptor( + new RuleSetServiceMethodDescriptorSupplier("CreateRuleSet")) + .build(); + } + } + } + return getCreateRuleSetMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.GetRuleSetRequest, + com.google.cloud.contentwarehouse.v1.RuleSet> + getGetRuleSetMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetRuleSet", + requestType = com.google.cloud.contentwarehouse.v1.GetRuleSetRequest.class, + responseType = com.google.cloud.contentwarehouse.v1.RuleSet.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.GetRuleSetRequest, + com.google.cloud.contentwarehouse.v1.RuleSet> + getGetRuleSetMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.GetRuleSetRequest, + com.google.cloud.contentwarehouse.v1.RuleSet> + getGetRuleSetMethod; + if ((getGetRuleSetMethod = RuleSetServiceGrpc.getGetRuleSetMethod) == null) { + synchronized (RuleSetServiceGrpc.class) { + if ((getGetRuleSetMethod = RuleSetServiceGrpc.getGetRuleSetMethod) == null) { + RuleSetServiceGrpc.getGetRuleSetMethod = + getGetRuleSetMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetRuleSet")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.contentwarehouse.v1.GetRuleSetRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.contentwarehouse.v1.RuleSet.getDefaultInstance())) + .setSchemaDescriptor(new RuleSetServiceMethodDescriptorSupplier("GetRuleSet")) + .build(); + } + } + } + return getGetRuleSetMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest, + com.google.cloud.contentwarehouse.v1.RuleSet> + getUpdateRuleSetMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateRuleSet", + requestType = com.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest.class, + responseType = com.google.cloud.contentwarehouse.v1.RuleSet.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest, + com.google.cloud.contentwarehouse.v1.RuleSet> + getUpdateRuleSetMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest, + com.google.cloud.contentwarehouse.v1.RuleSet> + getUpdateRuleSetMethod; + if ((getUpdateRuleSetMethod = RuleSetServiceGrpc.getUpdateRuleSetMethod) == null) { + synchronized (RuleSetServiceGrpc.class) { + if ((getUpdateRuleSetMethod = RuleSetServiceGrpc.getUpdateRuleSetMethod) == null) { + RuleSetServiceGrpc.getUpdateRuleSetMethod = + getUpdateRuleSetMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateRuleSet")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.contentwarehouse.v1.RuleSet.getDefaultInstance())) + .setSchemaDescriptor( + new RuleSetServiceMethodDescriptorSupplier("UpdateRuleSet")) + .build(); + } + } + } + return getUpdateRuleSetMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest, com.google.protobuf.Empty> + getDeleteRuleSetMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteRuleSet", + requestType = com.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest, com.google.protobuf.Empty> + getDeleteRuleSetMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest, com.google.protobuf.Empty> + getDeleteRuleSetMethod; + if ((getDeleteRuleSetMethod = RuleSetServiceGrpc.getDeleteRuleSetMethod) == null) { + synchronized (RuleSetServiceGrpc.class) { + if ((getDeleteRuleSetMethod = RuleSetServiceGrpc.getDeleteRuleSetMethod) == null) { + RuleSetServiceGrpc.getDeleteRuleSetMethod = + getDeleteRuleSetMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteRuleSet")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new RuleSetServiceMethodDescriptorSupplier("DeleteRuleSet")) + .build(); + } + } + } + return getDeleteRuleSetMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.ListRuleSetsRequest, + com.google.cloud.contentwarehouse.v1.ListRuleSetsResponse> + getListRuleSetsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListRuleSets", + requestType = com.google.cloud.contentwarehouse.v1.ListRuleSetsRequest.class, + responseType = com.google.cloud.contentwarehouse.v1.ListRuleSetsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.ListRuleSetsRequest, + com.google.cloud.contentwarehouse.v1.ListRuleSetsResponse> + getListRuleSetsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.ListRuleSetsRequest, + com.google.cloud.contentwarehouse.v1.ListRuleSetsResponse> + getListRuleSetsMethod; + if ((getListRuleSetsMethod = RuleSetServiceGrpc.getListRuleSetsMethod) == null) { + synchronized (RuleSetServiceGrpc.class) { + if ((getListRuleSetsMethod = RuleSetServiceGrpc.getListRuleSetsMethod) == null) { + RuleSetServiceGrpc.getListRuleSetsMethod = + getListRuleSetsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListRuleSets")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.contentwarehouse.v1.ListRuleSetsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.contentwarehouse.v1.ListRuleSetsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new RuleSetServiceMethodDescriptorSupplier("ListRuleSets")) + .build(); + } + } + } + return getListRuleSetsMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static RuleSetServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public RuleSetServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RuleSetServiceStub(channel, callOptions); + } + }; + return RuleSetServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static RuleSetServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public RuleSetServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RuleSetServiceBlockingStub(channel, callOptions); + } + }; + return RuleSetServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static RuleSetServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public RuleSetServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RuleSetServiceFutureStub(channel, callOptions); + } + }; + return RuleSetServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service to manage customer specific RuleSets.
+   * 
+ */ + public abstract static class RuleSetServiceImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Creates a ruleset.
+     * 
+ */ + public void createRuleSet( + com.google.cloud.contentwarehouse.v1.CreateRuleSetRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateRuleSetMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets a ruleset. Returns NOT_FOUND if the ruleset does not exist.
+     * 
+ */ + public void getRuleSet( + com.google.cloud.contentwarehouse.v1.GetRuleSetRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetRuleSetMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates a ruleset. Returns INVALID_ARGUMENT if the name of the ruleset
+     * is non-empty and does not equal the existing name.
+     * 
+ */ + public void updateRuleSet( + com.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateRuleSetMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a ruleset. Returns NOT_FOUND if the document does not exist.
+     * 
+ */ + public void deleteRuleSet( + com.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteRuleSetMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists rulesets.
+     * 
+ */ + public void listRuleSets( + com.google.cloud.contentwarehouse.v1.ListRuleSetsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListRuleSetsMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateRuleSetMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.contentwarehouse.v1.CreateRuleSetRequest, + com.google.cloud.contentwarehouse.v1.RuleSet>( + this, METHODID_CREATE_RULE_SET))) + .addMethod( + getGetRuleSetMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.contentwarehouse.v1.GetRuleSetRequest, + com.google.cloud.contentwarehouse.v1.RuleSet>(this, METHODID_GET_RULE_SET))) + .addMethod( + getUpdateRuleSetMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest, + com.google.cloud.contentwarehouse.v1.RuleSet>( + this, METHODID_UPDATE_RULE_SET))) + .addMethod( + getDeleteRuleSetMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest, + com.google.protobuf.Empty>(this, METHODID_DELETE_RULE_SET))) + .addMethod( + getListRuleSetsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.contentwarehouse.v1.ListRuleSetsRequest, + com.google.cloud.contentwarehouse.v1.ListRuleSetsResponse>( + this, METHODID_LIST_RULE_SETS))) + .build(); + } + } + + /** + * + * + *
+   * Service to manage customer specific RuleSets.
+   * 
+ */ + public static final class RuleSetServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private RuleSetServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected RuleSetServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RuleSetServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a ruleset.
+     * 
+ */ + public void createRuleSet( + com.google.cloud.contentwarehouse.v1.CreateRuleSetRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateRuleSetMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets a ruleset. Returns NOT_FOUND if the ruleset does not exist.
+     * 
+ */ + public void getRuleSet( + com.google.cloud.contentwarehouse.v1.GetRuleSetRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetRuleSetMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Updates a ruleset. Returns INVALID_ARGUMENT if the name of the ruleset
+     * is non-empty and does not equal the existing name.
+     * 
+ */ + public void updateRuleSet( + com.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateRuleSetMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a ruleset. Returns NOT_FOUND if the document does not exist.
+     * 
+ */ + public void deleteRuleSet( + com.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteRuleSetMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists rulesets.
+     * 
+ */ + public void listRuleSets( + com.google.cloud.contentwarehouse.v1.ListRuleSetsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListRuleSetsMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Service to manage customer specific RuleSets.
+   * 
+ */ + public static final class RuleSetServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private RuleSetServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected RuleSetServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RuleSetServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a ruleset.
+     * 
+ */ + public com.google.cloud.contentwarehouse.v1.RuleSet createRuleSet( + com.google.cloud.contentwarehouse.v1.CreateRuleSetRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateRuleSetMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a ruleset. Returns NOT_FOUND if the ruleset does not exist.
+     * 
+ */ + public com.google.cloud.contentwarehouse.v1.RuleSet getRuleSet( + com.google.cloud.contentwarehouse.v1.GetRuleSetRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetRuleSetMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a ruleset. Returns INVALID_ARGUMENT if the name of the ruleset
+     * is non-empty and does not equal the existing name.
+     * 
+ */ + public com.google.cloud.contentwarehouse.v1.RuleSet updateRuleSet( + com.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateRuleSetMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a ruleset. Returns NOT_FOUND if the document does not exist.
+     * 
+ */ + public com.google.protobuf.Empty deleteRuleSet( + com.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteRuleSetMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists rulesets.
+     * 
+ */ + public com.google.cloud.contentwarehouse.v1.ListRuleSetsResponse listRuleSets( + com.google.cloud.contentwarehouse.v1.ListRuleSetsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListRuleSetsMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Service to manage customer specific RuleSets.
+   * 
+ */ + public static final class RuleSetServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private RuleSetServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected RuleSetServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RuleSetServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a ruleset.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.contentwarehouse.v1.RuleSet> + createRuleSet(com.google.cloud.contentwarehouse.v1.CreateRuleSetRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateRuleSetMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets a ruleset. Returns NOT_FOUND if the ruleset does not exist.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.contentwarehouse.v1.RuleSet> + getRuleSet(com.google.cloud.contentwarehouse.v1.GetRuleSetRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetRuleSetMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates a ruleset. Returns INVALID_ARGUMENT if the name of the ruleset
+     * is non-empty and does not equal the existing name.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.contentwarehouse.v1.RuleSet> + updateRuleSet(com.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateRuleSetMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a ruleset. Returns NOT_FOUND if the document does not exist.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteRuleSet(com.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteRuleSetMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists rulesets.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.contentwarehouse.v1.ListRuleSetsResponse> + listRuleSets(com.google.cloud.contentwarehouse.v1.ListRuleSetsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListRuleSetsMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_RULE_SET = 0; + private static final int METHODID_GET_RULE_SET = 1; + private static final int METHODID_UPDATE_RULE_SET = 2; + private static final int METHODID_DELETE_RULE_SET = 3; + private static final int METHODID_LIST_RULE_SETS = 4; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final RuleSetServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(RuleSetServiceImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_CREATE_RULE_SET: + serviceImpl.createRuleSet( + (com.google.cloud.contentwarehouse.v1.CreateRuleSetRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_RULE_SET: + serviceImpl.getRuleSet( + (com.google.cloud.contentwarehouse.v1.GetRuleSetRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_RULE_SET: + serviceImpl.updateRuleSet( + (com.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_RULE_SET: + serviceImpl.deleteRuleSet( + (com.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_RULE_SETS: + serviceImpl.listRuleSets( + (com.google.cloud.contentwarehouse.v1.ListRuleSetsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.contentwarehouse.v1.ListRuleSetsResponse>) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private abstract static class RuleSetServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + RuleSetServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.contentwarehouse.v1.RuleSetServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("RuleSetService"); + } + } + + private static final class RuleSetServiceFileDescriptorSupplier + extends RuleSetServiceBaseDescriptorSupplier { + RuleSetServiceFileDescriptorSupplier() {} + } + + private static final class RuleSetServiceMethodDescriptorSupplier + extends RuleSetServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + RuleSetServiceMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (RuleSetServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new RuleSetServiceFileDescriptorSupplier()) + .addMethod(getCreateRuleSetMethod()) + .addMethod(getGetRuleSetMethod()) + .addMethod(getUpdateRuleSetMethod()) + .addMethod(getDeleteRuleSetMethod()) + .addMethod(getListRuleSetsMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-contentwarehouse/grpc-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/SynonymSetServiceGrpc.java b/java-contentwarehouse/grpc-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/SynonymSetServiceGrpc.java new file mode 100644 index 000000000000..f4c91637c842 --- /dev/null +++ b/java-contentwarehouse/grpc-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/SynonymSetServiceGrpc.java @@ -0,0 +1,866 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.contentwarehouse.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * A Service that manage/custom customer specified SynonymSets.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/contentwarehouse/v1/synonymset_service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class SynonymSetServiceGrpc { + + private SynonymSetServiceGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.contentwarehouse.v1.SynonymSetService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest, + com.google.cloud.contentwarehouse.v1.SynonymSet> + getCreateSynonymSetMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateSynonymSet", + requestType = com.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest.class, + responseType = com.google.cloud.contentwarehouse.v1.SynonymSet.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest, + com.google.cloud.contentwarehouse.v1.SynonymSet> + getCreateSynonymSetMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest, + com.google.cloud.contentwarehouse.v1.SynonymSet> + getCreateSynonymSetMethod; + if ((getCreateSynonymSetMethod = SynonymSetServiceGrpc.getCreateSynonymSetMethod) == null) { + synchronized (SynonymSetServiceGrpc.class) { + if ((getCreateSynonymSetMethod = SynonymSetServiceGrpc.getCreateSynonymSetMethod) == null) { + SynonymSetServiceGrpc.getCreateSynonymSetMethod = + getCreateSynonymSetMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateSynonymSet")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.contentwarehouse.v1.SynonymSet.getDefaultInstance())) + .setSchemaDescriptor( + new SynonymSetServiceMethodDescriptorSupplier("CreateSynonymSet")) + .build(); + } + } + } + return getCreateSynonymSetMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.GetSynonymSetRequest, + com.google.cloud.contentwarehouse.v1.SynonymSet> + getGetSynonymSetMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetSynonymSet", + requestType = com.google.cloud.contentwarehouse.v1.GetSynonymSetRequest.class, + responseType = com.google.cloud.contentwarehouse.v1.SynonymSet.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.GetSynonymSetRequest, + com.google.cloud.contentwarehouse.v1.SynonymSet> + getGetSynonymSetMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.GetSynonymSetRequest, + com.google.cloud.contentwarehouse.v1.SynonymSet> + getGetSynonymSetMethod; + if ((getGetSynonymSetMethod = SynonymSetServiceGrpc.getGetSynonymSetMethod) == null) { + synchronized (SynonymSetServiceGrpc.class) { + if ((getGetSynonymSetMethod = SynonymSetServiceGrpc.getGetSynonymSetMethod) == null) { + SynonymSetServiceGrpc.getGetSynonymSetMethod = + getGetSynonymSetMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetSynonymSet")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.contentwarehouse.v1.GetSynonymSetRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.contentwarehouse.v1.SynonymSet.getDefaultInstance())) + .setSchemaDescriptor( + new SynonymSetServiceMethodDescriptorSupplier("GetSynonymSet")) + .build(); + } + } + } + return getGetSynonymSetMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest, + com.google.cloud.contentwarehouse.v1.SynonymSet> + getUpdateSynonymSetMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateSynonymSet", + requestType = com.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest.class, + responseType = com.google.cloud.contentwarehouse.v1.SynonymSet.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest, + com.google.cloud.contentwarehouse.v1.SynonymSet> + getUpdateSynonymSetMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest, + com.google.cloud.contentwarehouse.v1.SynonymSet> + getUpdateSynonymSetMethod; + if ((getUpdateSynonymSetMethod = SynonymSetServiceGrpc.getUpdateSynonymSetMethod) == null) { + synchronized (SynonymSetServiceGrpc.class) { + if ((getUpdateSynonymSetMethod = SynonymSetServiceGrpc.getUpdateSynonymSetMethod) == null) { + SynonymSetServiceGrpc.getUpdateSynonymSetMethod = + getUpdateSynonymSetMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateSynonymSet")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.contentwarehouse.v1.SynonymSet.getDefaultInstance())) + .setSchemaDescriptor( + new SynonymSetServiceMethodDescriptorSupplier("UpdateSynonymSet")) + .build(); + } + } + } + return getUpdateSynonymSetMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest, com.google.protobuf.Empty> + getDeleteSynonymSetMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteSynonymSet", + requestType = com.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest, com.google.protobuf.Empty> + getDeleteSynonymSetMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest, com.google.protobuf.Empty> + getDeleteSynonymSetMethod; + if ((getDeleteSynonymSetMethod = SynonymSetServiceGrpc.getDeleteSynonymSetMethod) == null) { + synchronized (SynonymSetServiceGrpc.class) { + if ((getDeleteSynonymSetMethod = SynonymSetServiceGrpc.getDeleteSynonymSetMethod) == null) { + SynonymSetServiceGrpc.getDeleteSynonymSetMethod = + getDeleteSynonymSetMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteSynonymSet")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new SynonymSetServiceMethodDescriptorSupplier("DeleteSynonymSet")) + .build(); + } + } + } + return getDeleteSynonymSetMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest, + com.google.cloud.contentwarehouse.v1.ListSynonymSetsResponse> + getListSynonymSetsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListSynonymSets", + requestType = com.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest.class, + responseType = com.google.cloud.contentwarehouse.v1.ListSynonymSetsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest, + com.google.cloud.contentwarehouse.v1.ListSynonymSetsResponse> + getListSynonymSetsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest, + com.google.cloud.contentwarehouse.v1.ListSynonymSetsResponse> + getListSynonymSetsMethod; + if ((getListSynonymSetsMethod = SynonymSetServiceGrpc.getListSynonymSetsMethod) == null) { + synchronized (SynonymSetServiceGrpc.class) { + if ((getListSynonymSetsMethod = SynonymSetServiceGrpc.getListSynonymSetsMethod) == null) { + SynonymSetServiceGrpc.getListSynonymSetsMethod = + getListSynonymSetsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListSynonymSets")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.contentwarehouse.v1.ListSynonymSetsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new SynonymSetServiceMethodDescriptorSupplier("ListSynonymSets")) + .build(); + } + } + } + return getListSynonymSetsMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static SynonymSetServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SynonymSetServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SynonymSetServiceStub(channel, callOptions); + } + }; + return SynonymSetServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static SynonymSetServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SynonymSetServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SynonymSetServiceBlockingStub(channel, callOptions); + } + }; + return SynonymSetServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static SynonymSetServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SynonymSetServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SynonymSetServiceFutureStub(channel, callOptions); + } + }; + return SynonymSetServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * A Service that manage/custom customer specified SynonymSets.
+   * 
+ */ + public abstract static class SynonymSetServiceImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Creates a SynonymSet for a single context.
+     * Throws an ALREADY_EXISTS exception if a synonymset already exists
+     * for the context.
+     * 
+ */ + public void createSynonymSet( + com.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateSynonymSetMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets a SynonymSet for a particular context.
+     * Throws a NOT_FOUND exception if the Synonymset
+     * does not exist
+     * 
+ */ + public void getSynonymSet( + com.google.cloud.contentwarehouse.v1.GetSynonymSetRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetSynonymSetMethod(), responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void updateSynonymSet( + com.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateSynonymSetMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a SynonymSet for a given context.
+     * Throws a NOT_FOUND exception if the SynonymSet is not found.
+     * 
+ */ + public void deleteSynonymSet( + com.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteSynonymSetMethod(), responseObserver); + } + + /** + * + * + *
+     * Returns all SynonymSets (for all contexts) for the specified location.
+     * 
+ */ + public void listSynonymSets( + com.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListSynonymSetsMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateSynonymSetMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest, + com.google.cloud.contentwarehouse.v1.SynonymSet>( + this, METHODID_CREATE_SYNONYM_SET))) + .addMethod( + getGetSynonymSetMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.contentwarehouse.v1.GetSynonymSetRequest, + com.google.cloud.contentwarehouse.v1.SynonymSet>( + this, METHODID_GET_SYNONYM_SET))) + .addMethod( + getUpdateSynonymSetMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest, + com.google.cloud.contentwarehouse.v1.SynonymSet>( + this, METHODID_UPDATE_SYNONYM_SET))) + .addMethod( + getDeleteSynonymSetMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest, + com.google.protobuf.Empty>(this, METHODID_DELETE_SYNONYM_SET))) + .addMethod( + getListSynonymSetsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest, + com.google.cloud.contentwarehouse.v1.ListSynonymSetsResponse>( + this, METHODID_LIST_SYNONYM_SETS))) + .build(); + } + } + + /** + * + * + *
+   * A Service that manage/custom customer specified SynonymSets.
+   * 
+ */ + public static final class SynonymSetServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private SynonymSetServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SynonymSetServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SynonymSetServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a SynonymSet for a single context.
+     * Throws an ALREADY_EXISTS exception if a synonymset already exists
+     * for the context.
+     * 
+ */ + public void createSynonymSet( + com.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateSynonymSetMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets a SynonymSet for a particular context.
+     * Throws a NOT_FOUND exception if the Synonymset
+     * does not exist
+     * 
+ */ + public void getSynonymSet( + com.google.cloud.contentwarehouse.v1.GetSynonymSetRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetSynonymSetMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void updateSynonymSet( + com.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateSynonymSetMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a SynonymSet for a given context.
+     * Throws a NOT_FOUND exception if the SynonymSet is not found.
+     * 
+ */ + public void deleteSynonymSet( + com.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteSynonymSetMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Returns all SynonymSets (for all contexts) for the specified location.
+     * 
+ */ + public void listSynonymSets( + com.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListSynonymSetsMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * A Service that manage/custom customer specified SynonymSets.
+   * 
+ */ + public static final class SynonymSetServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private SynonymSetServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SynonymSetServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SynonymSetServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a SynonymSet for a single context.
+     * Throws an ALREADY_EXISTS exception if a synonymset already exists
+     * for the context.
+     * 
+ */ + public com.google.cloud.contentwarehouse.v1.SynonymSet createSynonymSet( + com.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateSynonymSetMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a SynonymSet for a particular context.
+     * Throws a NOT_FOUND exception if the Synonymset
+     * does not exist
+     * 
+ */ + public com.google.cloud.contentwarehouse.v1.SynonymSet getSynonymSet( + com.google.cloud.contentwarehouse.v1.GetSynonymSetRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetSynonymSetMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.cloud.contentwarehouse.v1.SynonymSet updateSynonymSet( + com.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateSynonymSetMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a SynonymSet for a given context.
+     * Throws a NOT_FOUND exception if the SynonymSet is not found.
+     * 
+ */ + public com.google.protobuf.Empty deleteSynonymSet( + com.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteSynonymSetMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Returns all SynonymSets (for all contexts) for the specified location.
+     * 
+ */ + public com.google.cloud.contentwarehouse.v1.ListSynonymSetsResponse listSynonymSets( + com.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListSynonymSetsMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * A Service that manage/custom customer specified SynonymSets.
+   * 
+ */ + public static final class SynonymSetServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private SynonymSetServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SynonymSetServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SynonymSetServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a SynonymSet for a single context.
+     * Throws an ALREADY_EXISTS exception if a synonymset already exists
+     * for the context.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.contentwarehouse.v1.SynonymSet> + createSynonymSet(com.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateSynonymSetMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets a SynonymSet for a particular context.
+     * Throws a NOT_FOUND exception if the Synonymset
+     * does not exist
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.contentwarehouse.v1.SynonymSet> + getSynonymSet(com.google.cloud.contentwarehouse.v1.GetSynonymSetRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetSynonymSetMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.contentwarehouse.v1.SynonymSet> + updateSynonymSet(com.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateSynonymSetMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a SynonymSet for a given context.
+     * Throws a NOT_FOUND exception if the SynonymSet is not found.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteSynonymSet(com.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteSynonymSetMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Returns all SynonymSets (for all contexts) for the specified location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.contentwarehouse.v1.ListSynonymSetsResponse> + listSynonymSets(com.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListSynonymSetsMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_SYNONYM_SET = 0; + private static final int METHODID_GET_SYNONYM_SET = 1; + private static final int METHODID_UPDATE_SYNONYM_SET = 2; + private static final int METHODID_DELETE_SYNONYM_SET = 3; + private static final int METHODID_LIST_SYNONYM_SETS = 4; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final SynonymSetServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(SynonymSetServiceImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_CREATE_SYNONYM_SET: + serviceImpl.createSynonymSet( + (com.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_SYNONYM_SET: + serviceImpl.getSynonymSet( + (com.google.cloud.contentwarehouse.v1.GetSynonymSetRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_SYNONYM_SET: + serviceImpl.updateSynonymSet( + (com.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_SYNONYM_SET: + serviceImpl.deleteSynonymSet( + (com.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_SYNONYM_SETS: + serviceImpl.listSynonymSets( + (com.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.contentwarehouse.v1.ListSynonymSetsResponse>) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private abstract static class SynonymSetServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + SynonymSetServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.contentwarehouse.v1.SynonymSetServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("SynonymSetService"); + } + } + + private static final class SynonymSetServiceFileDescriptorSupplier + extends SynonymSetServiceBaseDescriptorSupplier { + SynonymSetServiceFileDescriptorSupplier() {} + } + + private static final class SynonymSetServiceMethodDescriptorSupplier + extends SynonymSetServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + SynonymSetServiceMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (SynonymSetServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new SynonymSetServiceFileDescriptorSupplier()) + .addMethod(getCreateSynonymSetMethod()) + .addMethod(getGetSynonymSetMethod()) + .addMethod(getUpdateSynonymSetMethod()) + .addMethod(getDeleteSynonymSetMethod()) + .addMethod(getListSynonymSetsMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-contentwarehouse/owlbot.py b/java-contentwarehouse/owlbot.py new file mode 100644 index 000000000000..7a77cf5ee557 --- /dev/null +++ b/java-contentwarehouse/owlbot.py @@ -0,0 +1,35 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import synthtool as s +from synthtool.languages import java + + +for library in s.get_staging_dirs(): + # put any special-case replacements here + s.move(library) + +s.remove_staging_dirs() +java.common_templates(excludes=[ + ".github/*", + ".kokoro/*", + "samples/*", + "CODE_OF_CONDUCT.md", + "CONTRIBUTING.md", + "LICENSE", + "SECURITY.md", + "java.header", + "license-checks.xml", + "renovate.json" +]) \ No newline at end of file diff --git a/java-contentwarehouse/pom.xml b/java-contentwarehouse/pom.xml new file mode 100644 index 000000000000..81ad68fa7def --- /dev/null +++ b/java-contentwarehouse/pom.xml @@ -0,0 +1,61 @@ + + + 4.0.0 + com.google.cloud + google-cloud-contentwarehouse-parent + pom + 0.0.1-SNAPSHOT + Google Document AI Warehouse Parent + + Java idiomatic client for Google Cloud Platform services. + + + + com.google.cloud + google-cloud-jar-parent + 0.1.1-SNAPSHOT + ../google-cloud-jar-parent/pom.xml + + + + UTF-8 + UTF-8 + github + google-cloud-contentwarehouse-parent + + + + + + com.google.cloud + google-cloud-contentwarehouse + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-contentwarehouse-v1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-contentwarehouse-v1 + 0.0.1-SNAPSHOT + + + + + + + com.google.cloud + google-cloud-document-ai + 2.8.1-SNAPSHOT + + + + + google-cloud-contentwarehouse + grpc-google-cloud-contentwarehouse-v1 + proto-google-cloud-contentwarehouse-v1 + google-cloud-contentwarehouse-bom + + diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/clirr-ignored-differences.xml b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/clirr-ignored-differences.xml new file mode 100644 index 000000000000..495c85ec2804 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/cloud/contentwarehouse/v1/*OrBuilder + * get*(*) + + + 7012 + com/google/cloud/contentwarehouse/v1/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/contentwarehouse/v1/*OrBuilder + boolean has*(*) + + diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/pom.xml b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/pom.xml new file mode 100644 index 000000000000..aff7b681faf7 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/pom.xml @@ -0,0 +1,37 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-contentwarehouse-v1 + 0.0.1-SNAPSHOT + proto-google-cloud-contentwarehouse-v1 + Proto library for google-cloud-contentwarehouse + + com.google.cloud + google-cloud-contentwarehouse-parent + 0.0.1-SNAPSHOT + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.api + api-common + + + com.google.guava + guava + + + diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/AccessControlAction.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/AccessControlAction.java new file mode 100644 index 000000000000..277c438bf06c --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/AccessControlAction.java @@ -0,0 +1,1054 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/rule_engine.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Represents the action responsible for access control list management
+ * operations.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.AccessControlAction} + */ +public final class AccessControlAction extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.AccessControlAction) + AccessControlActionOrBuilder { + private static final long serialVersionUID = 0L; + // Use AccessControlAction.newBuilder() to construct. + private AccessControlAction(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AccessControlAction() { + operationType_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AccessControlAction(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_AccessControlAction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_AccessControlAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.AccessControlAction.class, + com.google.cloud.contentwarehouse.v1.AccessControlAction.Builder.class); + } + + /** + * + * + *
+   * Type of ACL modification operation.
+   * 
+ * + * Protobuf enum {@code google.cloud.contentwarehouse.v1.AccessControlAction.OperationType} + */ + public enum OperationType implements com.google.protobuf.ProtocolMessageEnum { + /** UNKNOWN = 0; */ + UNKNOWN(0), + /** + * + * + *
+     * Adds newly given policy bindings in the existing bindings list.
+     * 
+ * + * ADD_POLICY_BINDING = 1; + */ + ADD_POLICY_BINDING(1), + /** + * + * + *
+     * Removes newly given policy bindings from the existing bindings list.
+     * 
+ * + * REMOVE_POLICY_BINDING = 2; + */ + REMOVE_POLICY_BINDING(2), + /** + * + * + *
+     * Replaces existing policy bindings with the given policy binding list
+     * 
+ * + * REPLACE_POLICY_BINDING = 3; + */ + REPLACE_POLICY_BINDING(3), + UNRECOGNIZED(-1), + ; + + /** UNKNOWN = 0; */ + public static final int UNKNOWN_VALUE = 0; + /** + * + * + *
+     * Adds newly given policy bindings in the existing bindings list.
+     * 
+ * + * ADD_POLICY_BINDING = 1; + */ + public static final int ADD_POLICY_BINDING_VALUE = 1; + /** + * + * + *
+     * Removes newly given policy bindings from the existing bindings list.
+     * 
+ * + * REMOVE_POLICY_BINDING = 2; + */ + public static final int REMOVE_POLICY_BINDING_VALUE = 2; + /** + * + * + *
+     * Replaces existing policy bindings with the given policy binding list
+     * 
+ * + * REPLACE_POLICY_BINDING = 3; + */ + public static final int REPLACE_POLICY_BINDING_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OperationType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static OperationType forNumber(int value) { + switch (value) { + case 0: + return UNKNOWN; + case 1: + return ADD_POLICY_BINDING; + case 2: + return REMOVE_POLICY_BINDING; + case 3: + return REPLACE_POLICY_BINDING; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public OperationType findValueByNumber(int number) { + return OperationType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.AccessControlAction.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final OperationType[] VALUES = values(); + + public static OperationType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private OperationType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.contentwarehouse.v1.AccessControlAction.OperationType) + } + + public static final int OPERATION_TYPE_FIELD_NUMBER = 1; + private int operationType_; + /** + * + * + *
+   * Identifies the type of operation.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.AccessControlAction.OperationType operation_type = 1; + * + * + * @return The enum numeric value on the wire for operationType. + */ + @java.lang.Override + public int getOperationTypeValue() { + return operationType_; + } + /** + * + * + *
+   * Identifies the type of operation.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.AccessControlAction.OperationType operation_type = 1; + * + * + * @return The operationType. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.AccessControlAction.OperationType getOperationType() { + @SuppressWarnings("deprecation") + com.google.cloud.contentwarehouse.v1.AccessControlAction.OperationType result = + com.google.cloud.contentwarehouse.v1.AccessControlAction.OperationType.valueOf( + operationType_); + return result == null + ? com.google.cloud.contentwarehouse.v1.AccessControlAction.OperationType.UNRECOGNIZED + : result; + } + + public static final int POLICY_FIELD_NUMBER = 2; + private com.google.iam.v1.Policy policy_; + /** + * + * + *
+   * Represents the new policy from which bindings are added, removed or
+   * replaced based on the type of the operation. the policy is limited to a few
+   * 10s of KB.
+   * 
+ * + * .google.iam.v1.Policy policy = 2; + * + * @return Whether the policy field is set. + */ + @java.lang.Override + public boolean hasPolicy() { + return policy_ != null; + } + /** + * + * + *
+   * Represents the new policy from which bindings are added, removed or
+   * replaced based on the type of the operation. the policy is limited to a few
+   * 10s of KB.
+   * 
+ * + * .google.iam.v1.Policy policy = 2; + * + * @return The policy. + */ + @java.lang.Override + public com.google.iam.v1.Policy getPolicy() { + return policy_ == null ? com.google.iam.v1.Policy.getDefaultInstance() : policy_; + } + /** + * + * + *
+   * Represents the new policy from which bindings are added, removed or
+   * replaced based on the type of the operation. the policy is limited to a few
+   * 10s of KB.
+   * 
+ * + * .google.iam.v1.Policy policy = 2; + */ + @java.lang.Override + public com.google.iam.v1.PolicyOrBuilder getPolicyOrBuilder() { + return getPolicy(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (operationType_ + != com.google.cloud.contentwarehouse.v1.AccessControlAction.OperationType.UNKNOWN + .getNumber()) { + output.writeEnum(1, operationType_); + } + if (policy_ != null) { + output.writeMessage(2, getPolicy()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (operationType_ + != com.google.cloud.contentwarehouse.v1.AccessControlAction.OperationType.UNKNOWN + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, operationType_); + } + if (policy_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getPolicy()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.AccessControlAction)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.AccessControlAction other = + (com.google.cloud.contentwarehouse.v1.AccessControlAction) obj; + + if (operationType_ != other.operationType_) return false; + if (hasPolicy() != other.hasPolicy()) return false; + if (hasPolicy()) { + if (!getPolicy().equals(other.getPolicy())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + OPERATION_TYPE_FIELD_NUMBER; + hash = (53 * hash) + operationType_; + if (hasPolicy()) { + hash = (37 * hash) + POLICY_FIELD_NUMBER; + hash = (53 * hash) + getPolicy().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.AccessControlAction parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.AccessControlAction parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.AccessControlAction parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.AccessControlAction parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.AccessControlAction parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.AccessControlAction parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.AccessControlAction parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.AccessControlAction parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.AccessControlAction parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.AccessControlAction parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.AccessControlAction parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.AccessControlAction parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.AccessControlAction prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Represents the action responsible for access control list management
+   * operations.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.AccessControlAction} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.AccessControlAction) + com.google.cloud.contentwarehouse.v1.AccessControlActionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_AccessControlAction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_AccessControlAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.AccessControlAction.class, + com.google.cloud.contentwarehouse.v1.AccessControlAction.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.AccessControlAction.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + operationType_ = 0; + + if (policyBuilder_ == null) { + policy_ = null; + } else { + policy_ = null; + policyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_AccessControlAction_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.AccessControlAction getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.AccessControlAction.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.AccessControlAction build() { + com.google.cloud.contentwarehouse.v1.AccessControlAction result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.AccessControlAction buildPartial() { + com.google.cloud.contentwarehouse.v1.AccessControlAction result = + new com.google.cloud.contentwarehouse.v1.AccessControlAction(this); + result.operationType_ = operationType_; + if (policyBuilder_ == null) { + result.policy_ = policy_; + } else { + result.policy_ = policyBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.AccessControlAction) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.AccessControlAction) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.AccessControlAction other) { + if (other == com.google.cloud.contentwarehouse.v1.AccessControlAction.getDefaultInstance()) + return this; + if (other.operationType_ != 0) { + setOperationTypeValue(other.getOperationTypeValue()); + } + if (other.hasPolicy()) { + mergePolicy(other.getPolicy()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + operationType_ = input.readEnum(); + + break; + } // case 8 + case 18: + { + input.readMessage(getPolicyFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int operationType_ = 0; + /** + * + * + *
+     * Identifies the type of operation.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.AccessControlAction.OperationType operation_type = 1; + * + * + * @return The enum numeric value on the wire for operationType. + */ + @java.lang.Override + public int getOperationTypeValue() { + return operationType_; + } + /** + * + * + *
+     * Identifies the type of operation.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.AccessControlAction.OperationType operation_type = 1; + * + * + * @param value The enum numeric value on the wire for operationType to set. + * @return This builder for chaining. + */ + public Builder setOperationTypeValue(int value) { + + operationType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Identifies the type of operation.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.AccessControlAction.OperationType operation_type = 1; + * + * + * @return The operationType. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.AccessControlAction.OperationType + getOperationType() { + @SuppressWarnings("deprecation") + com.google.cloud.contentwarehouse.v1.AccessControlAction.OperationType result = + com.google.cloud.contentwarehouse.v1.AccessControlAction.OperationType.valueOf( + operationType_); + return result == null + ? com.google.cloud.contentwarehouse.v1.AccessControlAction.OperationType.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Identifies the type of operation.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.AccessControlAction.OperationType operation_type = 1; + * + * + * @param value The operationType to set. + * @return This builder for chaining. + */ + public Builder setOperationType( + com.google.cloud.contentwarehouse.v1.AccessControlAction.OperationType value) { + if (value == null) { + throw new NullPointerException(); + } + + operationType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Identifies the type of operation.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.AccessControlAction.OperationType operation_type = 1; + * + * + * @return This builder for chaining. + */ + public Builder clearOperationType() { + + operationType_ = 0; + onChanged(); + return this; + } + + private com.google.iam.v1.Policy policy_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.iam.v1.Policy, + com.google.iam.v1.Policy.Builder, + com.google.iam.v1.PolicyOrBuilder> + policyBuilder_; + /** + * + * + *
+     * Represents the new policy from which bindings are added, removed or
+     * replaced based on the type of the operation. the policy is limited to a few
+     * 10s of KB.
+     * 
+ * + * .google.iam.v1.Policy policy = 2; + * + * @return Whether the policy field is set. + */ + public boolean hasPolicy() { + return policyBuilder_ != null || policy_ != null; + } + /** + * + * + *
+     * Represents the new policy from which bindings are added, removed or
+     * replaced based on the type of the operation. the policy is limited to a few
+     * 10s of KB.
+     * 
+ * + * .google.iam.v1.Policy policy = 2; + * + * @return The policy. + */ + public com.google.iam.v1.Policy getPolicy() { + if (policyBuilder_ == null) { + return policy_ == null ? com.google.iam.v1.Policy.getDefaultInstance() : policy_; + } else { + return policyBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Represents the new policy from which bindings are added, removed or
+     * replaced based on the type of the operation. the policy is limited to a few
+     * 10s of KB.
+     * 
+ * + * .google.iam.v1.Policy policy = 2; + */ + public Builder setPolicy(com.google.iam.v1.Policy value) { + if (policyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + policy_ = value; + onChanged(); + } else { + policyBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Represents the new policy from which bindings are added, removed or
+     * replaced based on the type of the operation. the policy is limited to a few
+     * 10s of KB.
+     * 
+ * + * .google.iam.v1.Policy policy = 2; + */ + public Builder setPolicy(com.google.iam.v1.Policy.Builder builderForValue) { + if (policyBuilder_ == null) { + policy_ = builderForValue.build(); + onChanged(); + } else { + policyBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Represents the new policy from which bindings are added, removed or
+     * replaced based on the type of the operation. the policy is limited to a few
+     * 10s of KB.
+     * 
+ * + * .google.iam.v1.Policy policy = 2; + */ + public Builder mergePolicy(com.google.iam.v1.Policy value) { + if (policyBuilder_ == null) { + if (policy_ != null) { + policy_ = com.google.iam.v1.Policy.newBuilder(policy_).mergeFrom(value).buildPartial(); + } else { + policy_ = value; + } + onChanged(); + } else { + policyBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Represents the new policy from which bindings are added, removed or
+     * replaced based on the type of the operation. the policy is limited to a few
+     * 10s of KB.
+     * 
+ * + * .google.iam.v1.Policy policy = 2; + */ + public Builder clearPolicy() { + if (policyBuilder_ == null) { + policy_ = null; + onChanged(); + } else { + policy_ = null; + policyBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Represents the new policy from which bindings are added, removed or
+     * replaced based on the type of the operation. the policy is limited to a few
+     * 10s of KB.
+     * 
+ * + * .google.iam.v1.Policy policy = 2; + */ + public com.google.iam.v1.Policy.Builder getPolicyBuilder() { + + onChanged(); + return getPolicyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Represents the new policy from which bindings are added, removed or
+     * replaced based on the type of the operation. the policy is limited to a few
+     * 10s of KB.
+     * 
+ * + * .google.iam.v1.Policy policy = 2; + */ + public com.google.iam.v1.PolicyOrBuilder getPolicyOrBuilder() { + if (policyBuilder_ != null) { + return policyBuilder_.getMessageOrBuilder(); + } else { + return policy_ == null ? com.google.iam.v1.Policy.getDefaultInstance() : policy_; + } + } + /** + * + * + *
+     * Represents the new policy from which bindings are added, removed or
+     * replaced based on the type of the operation. the policy is limited to a few
+     * 10s of KB.
+     * 
+ * + * .google.iam.v1.Policy policy = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.iam.v1.Policy, + com.google.iam.v1.Policy.Builder, + com.google.iam.v1.PolicyOrBuilder> + getPolicyFieldBuilder() { + if (policyBuilder_ == null) { + policyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.iam.v1.Policy, + com.google.iam.v1.Policy.Builder, + com.google.iam.v1.PolicyOrBuilder>(getPolicy(), getParentForChildren(), isClean()); + policy_ = null; + } + return policyBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.AccessControlAction) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.AccessControlAction) + private static final com.google.cloud.contentwarehouse.v1.AccessControlAction DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.AccessControlAction(); + } + + public static com.google.cloud.contentwarehouse.v1.AccessControlAction getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AccessControlAction parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.AccessControlAction getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/AccessControlActionOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/AccessControlActionOrBuilder.java new file mode 100644 index 000000000000..3c634e06dc44 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/AccessControlActionOrBuilder.java @@ -0,0 +1,93 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/rule_engine.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface AccessControlActionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.AccessControlAction) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Identifies the type of operation.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.AccessControlAction.OperationType operation_type = 1; + * + * + * @return The enum numeric value on the wire for operationType. + */ + int getOperationTypeValue(); + /** + * + * + *
+   * Identifies the type of operation.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.AccessControlAction.OperationType operation_type = 1; + * + * + * @return The operationType. + */ + com.google.cloud.contentwarehouse.v1.AccessControlAction.OperationType getOperationType(); + + /** + * + * + *
+   * Represents the new policy from which bindings are added, removed or
+   * replaced based on the type of the operation. the policy is limited to a few
+   * 10s of KB.
+   * 
+ * + * .google.iam.v1.Policy policy = 2; + * + * @return Whether the policy field is set. + */ + boolean hasPolicy(); + /** + * + * + *
+   * Represents the new policy from which bindings are added, removed or
+   * replaced based on the type of the operation. the policy is limited to a few
+   * 10s of KB.
+   * 
+ * + * .google.iam.v1.Policy policy = 2; + * + * @return The policy. + */ + com.google.iam.v1.Policy getPolicy(); + /** + * + * + *
+   * Represents the new policy from which bindings are added, removed or
+   * replaced based on the type of the operation. the policy is limited to a few
+   * 10s of KB.
+   * 
+ * + * .google.iam.v1.Policy policy = 2; + */ + com.google.iam.v1.PolicyOrBuilder getPolicyOrBuilder(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/AccessControlMode.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/AccessControlMode.java new file mode 100644 index 000000000000..c6054296dee2 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/AccessControlMode.java @@ -0,0 +1,200 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/common.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Access Control Mode.
+ * 
+ * + * Protobuf enum {@code google.cloud.contentwarehouse.v1.AccessControlMode} + */ +public enum AccessControlMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * This value is required by protobuf best practices
+   * 
+ * + * ACL_MODE_UNKNOWN = 0; + */ + ACL_MODE_UNKNOWN(0), + /** + * + * + *
+   * Universal Access: No document level access control.
+   * 
+ * + * ACL_MODE_UNIVERSAL_ACCESS = 1; + */ + ACL_MODE_UNIVERSAL_ACCESS(1), + /** + * + * + *
+   * Document level access control with customer own Identity Service.
+   * 
+ * + * ACL_MODE_DOCUMENT_LEVEL_ACCESS_CONTROL_BYOID = 2; + */ + ACL_MODE_DOCUMENT_LEVEL_ACCESS_CONTROL_BYOID(2), + /** + * + * + *
+   * Document level access control using Google Cloud Identity.
+   * 
+ * + * ACL_MODE_DOCUMENT_LEVEL_ACCESS_CONTROL_GCI = 3; + */ + ACL_MODE_DOCUMENT_LEVEL_ACCESS_CONTROL_GCI(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * This value is required by protobuf best practices
+   * 
+ * + * ACL_MODE_UNKNOWN = 0; + */ + public static final int ACL_MODE_UNKNOWN_VALUE = 0; + /** + * + * + *
+   * Universal Access: No document level access control.
+   * 
+ * + * ACL_MODE_UNIVERSAL_ACCESS = 1; + */ + public static final int ACL_MODE_UNIVERSAL_ACCESS_VALUE = 1; + /** + * + * + *
+   * Document level access control with customer own Identity Service.
+   * 
+ * + * ACL_MODE_DOCUMENT_LEVEL_ACCESS_CONTROL_BYOID = 2; + */ + public static final int ACL_MODE_DOCUMENT_LEVEL_ACCESS_CONTROL_BYOID_VALUE = 2; + /** + * + * + *
+   * Document level access control using Google Cloud Identity.
+   * 
+ * + * ACL_MODE_DOCUMENT_LEVEL_ACCESS_CONTROL_GCI = 3; + */ + public static final int ACL_MODE_DOCUMENT_LEVEL_ACCESS_CONTROL_GCI_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static AccessControlMode valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static AccessControlMode forNumber(int value) { + switch (value) { + case 0: + return ACL_MODE_UNKNOWN; + case 1: + return ACL_MODE_UNIVERSAL_ACCESS; + case 2: + return ACL_MODE_DOCUMENT_LEVEL_ACCESS_CONTROL_BYOID; + case 3: + return ACL_MODE_DOCUMENT_LEVEL_ACCESS_CONTROL_GCI; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public AccessControlMode findValueByNumber(int number) { + return AccessControlMode.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.CommonProto.getDescriptor().getEnumTypes().get(2); + } + + private static final AccessControlMode[] VALUES = values(); + + public static AccessControlMode valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private AccessControlMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.contentwarehouse.v1.AccessControlMode) +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/Action.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/Action.java new file mode 100644 index 000000000000..dbbe228c6b5f --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/Action.java @@ -0,0 +1,2843 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/rule_engine.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Represents the action triggered by Rule Engine when the rule is true.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.Action} + */ +public final class Action extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.Action) + ActionOrBuilder { + private static final long serialVersionUID = 0L; + // Use Action.newBuilder() to construct. + private Action(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Action() { + actionId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Action(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_Action_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_Action_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.Action.class, + com.google.cloud.contentwarehouse.v1.Action.Builder.class); + } + + private int actionCase_ = 0; + private java.lang.Object action_; + + public enum ActionCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + ACCESS_CONTROL(2), + DATA_VALIDATION(3), + DATA_UPDATE(4), + ADD_TO_FOLDER(5), + PUBLISH_TO_PUB_SUB(6), + REMOVE_FROM_FOLDER_ACTION(9), + DELETE_DOCUMENT_ACTION(10), + ACTION_NOT_SET(0); + private final int value; + + private ActionCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ActionCase valueOf(int value) { + return forNumber(value); + } + + public static ActionCase forNumber(int value) { + switch (value) { + case 2: + return ACCESS_CONTROL; + case 3: + return DATA_VALIDATION; + case 4: + return DATA_UPDATE; + case 5: + return ADD_TO_FOLDER; + case 6: + return PUBLISH_TO_PUB_SUB; + case 9: + return REMOVE_FROM_FOLDER_ACTION; + case 10: + return DELETE_DOCUMENT_ACTION; + case 0: + return ACTION_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ActionCase getActionCase() { + return ActionCase.forNumber(actionCase_); + } + + public static final int ACTION_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object actionId_; + /** + * + * + *
+   * ID of the action. Managed internally.
+   * 
+ * + * string action_id = 1; + * + * @return The actionId. + */ + @java.lang.Override + public java.lang.String getActionId() { + java.lang.Object ref = actionId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + actionId_ = s; + return s; + } + } + /** + * + * + *
+   * ID of the action. Managed internally.
+   * 
+ * + * string action_id = 1; + * + * @return The bytes for actionId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getActionIdBytes() { + java.lang.Object ref = actionId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + actionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ACCESS_CONTROL_FIELD_NUMBER = 2; + /** + * + * + *
+   * Action triggering access control operations.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.AccessControlAction access_control = 2; + * + * @return Whether the accessControl field is set. + */ + @java.lang.Override + public boolean hasAccessControl() { + return actionCase_ == 2; + } + /** + * + * + *
+   * Action triggering access control operations.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.AccessControlAction access_control = 2; + * + * @return The accessControl. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.AccessControlAction getAccessControl() { + if (actionCase_ == 2) { + return (com.google.cloud.contentwarehouse.v1.AccessControlAction) action_; + } + return com.google.cloud.contentwarehouse.v1.AccessControlAction.getDefaultInstance(); + } + /** + * + * + *
+   * Action triggering access control operations.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.AccessControlAction access_control = 2; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.AccessControlActionOrBuilder + getAccessControlOrBuilder() { + if (actionCase_ == 2) { + return (com.google.cloud.contentwarehouse.v1.AccessControlAction) action_; + } + return com.google.cloud.contentwarehouse.v1.AccessControlAction.getDefaultInstance(); + } + + public static final int DATA_VALIDATION_FIELD_NUMBER = 3; + /** + * + * + *
+   * Action triggering data validation operations.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.DataValidationAction data_validation = 3; + * + * @return Whether the dataValidation field is set. + */ + @java.lang.Override + public boolean hasDataValidation() { + return actionCase_ == 3; + } + /** + * + * + *
+   * Action triggering data validation operations.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.DataValidationAction data_validation = 3; + * + * @return The dataValidation. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DataValidationAction getDataValidation() { + if (actionCase_ == 3) { + return (com.google.cloud.contentwarehouse.v1.DataValidationAction) action_; + } + return com.google.cloud.contentwarehouse.v1.DataValidationAction.getDefaultInstance(); + } + /** + * + * + *
+   * Action triggering data validation operations.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.DataValidationAction data_validation = 3; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DataValidationActionOrBuilder + getDataValidationOrBuilder() { + if (actionCase_ == 3) { + return (com.google.cloud.contentwarehouse.v1.DataValidationAction) action_; + } + return com.google.cloud.contentwarehouse.v1.DataValidationAction.getDefaultInstance(); + } + + public static final int DATA_UPDATE_FIELD_NUMBER = 4; + /** + * + * + *
+   * Action triggering data update operations.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.DataUpdateAction data_update = 4; + * + * @return Whether the dataUpdate field is set. + */ + @java.lang.Override + public boolean hasDataUpdate() { + return actionCase_ == 4; + } + /** + * + * + *
+   * Action triggering data update operations.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.DataUpdateAction data_update = 4; + * + * @return The dataUpdate. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DataUpdateAction getDataUpdate() { + if (actionCase_ == 4) { + return (com.google.cloud.contentwarehouse.v1.DataUpdateAction) action_; + } + return com.google.cloud.contentwarehouse.v1.DataUpdateAction.getDefaultInstance(); + } + /** + * + * + *
+   * Action triggering data update operations.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.DataUpdateAction data_update = 4; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DataUpdateActionOrBuilder getDataUpdateOrBuilder() { + if (actionCase_ == 4) { + return (com.google.cloud.contentwarehouse.v1.DataUpdateAction) action_; + } + return com.google.cloud.contentwarehouse.v1.DataUpdateAction.getDefaultInstance(); + } + + public static final int ADD_TO_FOLDER_FIELD_NUMBER = 5; + /** + * + * + *
+   * Action triggering create document link operation.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.AddToFolderAction add_to_folder = 5; + * + * @return Whether the addToFolder field is set. + */ + @java.lang.Override + public boolean hasAddToFolder() { + return actionCase_ == 5; + } + /** + * + * + *
+   * Action triggering create document link operation.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.AddToFolderAction add_to_folder = 5; + * + * @return The addToFolder. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.AddToFolderAction getAddToFolder() { + if (actionCase_ == 5) { + return (com.google.cloud.contentwarehouse.v1.AddToFolderAction) action_; + } + return com.google.cloud.contentwarehouse.v1.AddToFolderAction.getDefaultInstance(); + } + /** + * + * + *
+   * Action triggering create document link operation.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.AddToFolderAction add_to_folder = 5; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.AddToFolderActionOrBuilder getAddToFolderOrBuilder() { + if (actionCase_ == 5) { + return (com.google.cloud.contentwarehouse.v1.AddToFolderAction) action_; + } + return com.google.cloud.contentwarehouse.v1.AddToFolderAction.getDefaultInstance(); + } + + public static final int PUBLISH_TO_PUB_SUB_FIELD_NUMBER = 6; + /** + * + * + *
+   * Action publish to Pub/Sub operation.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.PublishAction publish_to_pub_sub = 6; + * + * @return Whether the publishToPubSub field is set. + */ + @java.lang.Override + public boolean hasPublishToPubSub() { + return actionCase_ == 6; + } + /** + * + * + *
+   * Action publish to Pub/Sub operation.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.PublishAction publish_to_pub_sub = 6; + * + * @return The publishToPubSub. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.PublishAction getPublishToPubSub() { + if (actionCase_ == 6) { + return (com.google.cloud.contentwarehouse.v1.PublishAction) action_; + } + return com.google.cloud.contentwarehouse.v1.PublishAction.getDefaultInstance(); + } + /** + * + * + *
+   * Action publish to Pub/Sub operation.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.PublishAction publish_to_pub_sub = 6; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.PublishActionOrBuilder getPublishToPubSubOrBuilder() { + if (actionCase_ == 6) { + return (com.google.cloud.contentwarehouse.v1.PublishAction) action_; + } + return com.google.cloud.contentwarehouse.v1.PublishAction.getDefaultInstance(); + } + + public static final int REMOVE_FROM_FOLDER_ACTION_FIELD_NUMBER = 9; + /** + * + * + *
+   * Action removing a document from a folder.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RemoveFromFolderAction remove_from_folder_action = 9; + * + * + * @return Whether the removeFromFolderAction field is set. + */ + @java.lang.Override + public boolean hasRemoveFromFolderAction() { + return actionCase_ == 9; + } + /** + * + * + *
+   * Action removing a document from a folder.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RemoveFromFolderAction remove_from_folder_action = 9; + * + * + * @return The removeFromFolderAction. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction getRemoveFromFolderAction() { + if (actionCase_ == 9) { + return (com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction) action_; + } + return com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction.getDefaultInstance(); + } + /** + * + * + *
+   * Action removing a document from a folder.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RemoveFromFolderAction remove_from_folder_action = 9; + * + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RemoveFromFolderActionOrBuilder + getRemoveFromFolderActionOrBuilder() { + if (actionCase_ == 9) { + return (com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction) action_; + } + return com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction.getDefaultInstance(); + } + + public static final int DELETE_DOCUMENT_ACTION_FIELD_NUMBER = 10; + /** + * + * + *
+   * Action deleting the document.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.DeleteDocumentAction delete_document_action = 10; + * + * + * @return Whether the deleteDocumentAction field is set. + */ + @java.lang.Override + public boolean hasDeleteDocumentAction() { + return actionCase_ == 10; + } + /** + * + * + *
+   * Action deleting the document.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.DeleteDocumentAction delete_document_action = 10; + * + * + * @return The deleteDocumentAction. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DeleteDocumentAction getDeleteDocumentAction() { + if (actionCase_ == 10) { + return (com.google.cloud.contentwarehouse.v1.DeleteDocumentAction) action_; + } + return com.google.cloud.contentwarehouse.v1.DeleteDocumentAction.getDefaultInstance(); + } + /** + * + * + *
+   * Action deleting the document.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.DeleteDocumentAction delete_document_action = 10; + * + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DeleteDocumentActionOrBuilder + getDeleteDocumentActionOrBuilder() { + if (actionCase_ == 10) { + return (com.google.cloud.contentwarehouse.v1.DeleteDocumentAction) action_; + } + return com.google.cloud.contentwarehouse.v1.DeleteDocumentAction.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(actionId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, actionId_); + } + if (actionCase_ == 2) { + output.writeMessage(2, (com.google.cloud.contentwarehouse.v1.AccessControlAction) action_); + } + if (actionCase_ == 3) { + output.writeMessage(3, (com.google.cloud.contentwarehouse.v1.DataValidationAction) action_); + } + if (actionCase_ == 4) { + output.writeMessage(4, (com.google.cloud.contentwarehouse.v1.DataUpdateAction) action_); + } + if (actionCase_ == 5) { + output.writeMessage(5, (com.google.cloud.contentwarehouse.v1.AddToFolderAction) action_); + } + if (actionCase_ == 6) { + output.writeMessage(6, (com.google.cloud.contentwarehouse.v1.PublishAction) action_); + } + if (actionCase_ == 9) { + output.writeMessage(9, (com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction) action_); + } + if (actionCase_ == 10) { + output.writeMessage(10, (com.google.cloud.contentwarehouse.v1.DeleteDocumentAction) action_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(actionId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, actionId_); + } + if (actionCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.cloud.contentwarehouse.v1.AccessControlAction) action_); + } + if (actionCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.cloud.contentwarehouse.v1.DataValidationAction) action_); + } + if (actionCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.cloud.contentwarehouse.v1.DataUpdateAction) action_); + } + if (actionCase_ == 5) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, (com.google.cloud.contentwarehouse.v1.AddToFolderAction) action_); + } + if (actionCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, (com.google.cloud.contentwarehouse.v1.PublishAction) action_); + } + if (actionCase_ == 9) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 9, (com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction) action_); + } + if (actionCase_ == 10) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 10, (com.google.cloud.contentwarehouse.v1.DeleteDocumentAction) action_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.Action)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.Action other = + (com.google.cloud.contentwarehouse.v1.Action) obj; + + if (!getActionId().equals(other.getActionId())) return false; + if (!getActionCase().equals(other.getActionCase())) return false; + switch (actionCase_) { + case 2: + if (!getAccessControl().equals(other.getAccessControl())) return false; + break; + case 3: + if (!getDataValidation().equals(other.getDataValidation())) return false; + break; + case 4: + if (!getDataUpdate().equals(other.getDataUpdate())) return false; + break; + case 5: + if (!getAddToFolder().equals(other.getAddToFolder())) return false; + break; + case 6: + if (!getPublishToPubSub().equals(other.getPublishToPubSub())) return false; + break; + case 9: + if (!getRemoveFromFolderAction().equals(other.getRemoveFromFolderAction())) return false; + break; + case 10: + if (!getDeleteDocumentAction().equals(other.getDeleteDocumentAction())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ACTION_ID_FIELD_NUMBER; + hash = (53 * hash) + getActionId().hashCode(); + switch (actionCase_) { + case 2: + hash = (37 * hash) + ACCESS_CONTROL_FIELD_NUMBER; + hash = (53 * hash) + getAccessControl().hashCode(); + break; + case 3: + hash = (37 * hash) + DATA_VALIDATION_FIELD_NUMBER; + hash = (53 * hash) + getDataValidation().hashCode(); + break; + case 4: + hash = (37 * hash) + DATA_UPDATE_FIELD_NUMBER; + hash = (53 * hash) + getDataUpdate().hashCode(); + break; + case 5: + hash = (37 * hash) + ADD_TO_FOLDER_FIELD_NUMBER; + hash = (53 * hash) + getAddToFolder().hashCode(); + break; + case 6: + hash = (37 * hash) + PUBLISH_TO_PUB_SUB_FIELD_NUMBER; + hash = (53 * hash) + getPublishToPubSub().hashCode(); + break; + case 9: + hash = (37 * hash) + REMOVE_FROM_FOLDER_ACTION_FIELD_NUMBER; + hash = (53 * hash) + getRemoveFromFolderAction().hashCode(); + break; + case 10: + hash = (37 * hash) + DELETE_DOCUMENT_ACTION_FIELD_NUMBER; + hash = (53 * hash) + getDeleteDocumentAction().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.Action parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.Action parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.Action parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.Action parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.Action parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.Action parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.Action parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.Action parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.Action parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.Action parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.Action parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.Action parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.contentwarehouse.v1.Action prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Represents the action triggered by Rule Engine when the rule is true.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.Action} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.Action) + com.google.cloud.contentwarehouse.v1.ActionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_Action_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_Action_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.Action.class, + com.google.cloud.contentwarehouse.v1.Action.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.Action.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + actionId_ = ""; + + if (accessControlBuilder_ != null) { + accessControlBuilder_.clear(); + } + if (dataValidationBuilder_ != null) { + dataValidationBuilder_.clear(); + } + if (dataUpdateBuilder_ != null) { + dataUpdateBuilder_.clear(); + } + if (addToFolderBuilder_ != null) { + addToFolderBuilder_.clear(); + } + if (publishToPubSubBuilder_ != null) { + publishToPubSubBuilder_.clear(); + } + if (removeFromFolderActionBuilder_ != null) { + removeFromFolderActionBuilder_.clear(); + } + if (deleteDocumentActionBuilder_ != null) { + deleteDocumentActionBuilder_.clear(); + } + actionCase_ = 0; + action_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_Action_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.Action getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.Action.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.Action build() { + com.google.cloud.contentwarehouse.v1.Action result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.Action buildPartial() { + com.google.cloud.contentwarehouse.v1.Action result = + new com.google.cloud.contentwarehouse.v1.Action(this); + result.actionId_ = actionId_; + if (actionCase_ == 2) { + if (accessControlBuilder_ == null) { + result.action_ = action_; + } else { + result.action_ = accessControlBuilder_.build(); + } + } + if (actionCase_ == 3) { + if (dataValidationBuilder_ == null) { + result.action_ = action_; + } else { + result.action_ = dataValidationBuilder_.build(); + } + } + if (actionCase_ == 4) { + if (dataUpdateBuilder_ == null) { + result.action_ = action_; + } else { + result.action_ = dataUpdateBuilder_.build(); + } + } + if (actionCase_ == 5) { + if (addToFolderBuilder_ == null) { + result.action_ = action_; + } else { + result.action_ = addToFolderBuilder_.build(); + } + } + if (actionCase_ == 6) { + if (publishToPubSubBuilder_ == null) { + result.action_ = action_; + } else { + result.action_ = publishToPubSubBuilder_.build(); + } + } + if (actionCase_ == 9) { + if (removeFromFolderActionBuilder_ == null) { + result.action_ = action_; + } else { + result.action_ = removeFromFolderActionBuilder_.build(); + } + } + if (actionCase_ == 10) { + if (deleteDocumentActionBuilder_ == null) { + result.action_ = action_; + } else { + result.action_ = deleteDocumentActionBuilder_.build(); + } + } + result.actionCase_ = actionCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.Action) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.Action) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.Action other) { + if (other == com.google.cloud.contentwarehouse.v1.Action.getDefaultInstance()) return this; + if (!other.getActionId().isEmpty()) { + actionId_ = other.actionId_; + onChanged(); + } + switch (other.getActionCase()) { + case ACCESS_CONTROL: + { + mergeAccessControl(other.getAccessControl()); + break; + } + case DATA_VALIDATION: + { + mergeDataValidation(other.getDataValidation()); + break; + } + case DATA_UPDATE: + { + mergeDataUpdate(other.getDataUpdate()); + break; + } + case ADD_TO_FOLDER: + { + mergeAddToFolder(other.getAddToFolder()); + break; + } + case PUBLISH_TO_PUB_SUB: + { + mergePublishToPubSub(other.getPublishToPubSub()); + break; + } + case REMOVE_FROM_FOLDER_ACTION: + { + mergeRemoveFromFolderAction(other.getRemoveFromFolderAction()); + break; + } + case DELETE_DOCUMENT_ACTION: + { + mergeDeleteDocumentAction(other.getDeleteDocumentAction()); + break; + } + case ACTION_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + actionId_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + input.readMessage(getAccessControlFieldBuilder().getBuilder(), extensionRegistry); + actionCase_ = 2; + break; + } // case 18 + case 26: + { + input.readMessage(getDataValidationFieldBuilder().getBuilder(), extensionRegistry); + actionCase_ = 3; + break; + } // case 26 + case 34: + { + input.readMessage(getDataUpdateFieldBuilder().getBuilder(), extensionRegistry); + actionCase_ = 4; + break; + } // case 34 + case 42: + { + input.readMessage(getAddToFolderFieldBuilder().getBuilder(), extensionRegistry); + actionCase_ = 5; + break; + } // case 42 + case 50: + { + input.readMessage(getPublishToPubSubFieldBuilder().getBuilder(), extensionRegistry); + actionCase_ = 6; + break; + } // case 50 + case 74: + { + input.readMessage( + getRemoveFromFolderActionFieldBuilder().getBuilder(), extensionRegistry); + actionCase_ = 9; + break; + } // case 74 + case 82: + { + input.readMessage( + getDeleteDocumentActionFieldBuilder().getBuilder(), extensionRegistry); + actionCase_ = 10; + break; + } // case 82 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int actionCase_ = 0; + private java.lang.Object action_; + + public ActionCase getActionCase() { + return ActionCase.forNumber(actionCase_); + } + + public Builder clearAction() { + actionCase_ = 0; + action_ = null; + onChanged(); + return this; + } + + private java.lang.Object actionId_ = ""; + /** + * + * + *
+     * ID of the action. Managed internally.
+     * 
+ * + * string action_id = 1; + * + * @return The actionId. + */ + public java.lang.String getActionId() { + java.lang.Object ref = actionId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + actionId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * ID of the action. Managed internally.
+     * 
+ * + * string action_id = 1; + * + * @return The bytes for actionId. + */ + public com.google.protobuf.ByteString getActionIdBytes() { + java.lang.Object ref = actionId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + actionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * ID of the action. Managed internally.
+     * 
+ * + * string action_id = 1; + * + * @param value The actionId to set. + * @return This builder for chaining. + */ + public Builder setActionId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + actionId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * ID of the action. Managed internally.
+     * 
+ * + * string action_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearActionId() { + + actionId_ = getDefaultInstance().getActionId(); + onChanged(); + return this; + } + /** + * + * + *
+     * ID of the action. Managed internally.
+     * 
+ * + * string action_id = 1; + * + * @param value The bytes for actionId to set. + * @return This builder for chaining. + */ + public Builder setActionIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + actionId_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.AccessControlAction, + com.google.cloud.contentwarehouse.v1.AccessControlAction.Builder, + com.google.cloud.contentwarehouse.v1.AccessControlActionOrBuilder> + accessControlBuilder_; + /** + * + * + *
+     * Action triggering access control operations.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.AccessControlAction access_control = 2; + * + * @return Whether the accessControl field is set. + */ + @java.lang.Override + public boolean hasAccessControl() { + return actionCase_ == 2; + } + /** + * + * + *
+     * Action triggering access control operations.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.AccessControlAction access_control = 2; + * + * @return The accessControl. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.AccessControlAction getAccessControl() { + if (accessControlBuilder_ == null) { + if (actionCase_ == 2) { + return (com.google.cloud.contentwarehouse.v1.AccessControlAction) action_; + } + return com.google.cloud.contentwarehouse.v1.AccessControlAction.getDefaultInstance(); + } else { + if (actionCase_ == 2) { + return accessControlBuilder_.getMessage(); + } + return com.google.cloud.contentwarehouse.v1.AccessControlAction.getDefaultInstance(); + } + } + /** + * + * + *
+     * Action triggering access control operations.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.AccessControlAction access_control = 2; + */ + public Builder setAccessControl( + com.google.cloud.contentwarehouse.v1.AccessControlAction value) { + if (accessControlBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + action_ = value; + onChanged(); + } else { + accessControlBuilder_.setMessage(value); + } + actionCase_ = 2; + return this; + } + /** + * + * + *
+     * Action triggering access control operations.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.AccessControlAction access_control = 2; + */ + public Builder setAccessControl( + com.google.cloud.contentwarehouse.v1.AccessControlAction.Builder builderForValue) { + if (accessControlBuilder_ == null) { + action_ = builderForValue.build(); + onChanged(); + } else { + accessControlBuilder_.setMessage(builderForValue.build()); + } + actionCase_ = 2; + return this; + } + /** + * + * + *
+     * Action triggering access control operations.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.AccessControlAction access_control = 2; + */ + public Builder mergeAccessControl( + com.google.cloud.contentwarehouse.v1.AccessControlAction value) { + if (accessControlBuilder_ == null) { + if (actionCase_ == 2 + && action_ + != com.google.cloud.contentwarehouse.v1.AccessControlAction.getDefaultInstance()) { + action_ = + com.google.cloud.contentwarehouse.v1.AccessControlAction.newBuilder( + (com.google.cloud.contentwarehouse.v1.AccessControlAction) action_) + .mergeFrom(value) + .buildPartial(); + } else { + action_ = value; + } + onChanged(); + } else { + if (actionCase_ == 2) { + accessControlBuilder_.mergeFrom(value); + } else { + accessControlBuilder_.setMessage(value); + } + } + actionCase_ = 2; + return this; + } + /** + * + * + *
+     * Action triggering access control operations.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.AccessControlAction access_control = 2; + */ + public Builder clearAccessControl() { + if (accessControlBuilder_ == null) { + if (actionCase_ == 2) { + actionCase_ = 0; + action_ = null; + onChanged(); + } + } else { + if (actionCase_ == 2) { + actionCase_ = 0; + action_ = null; + } + accessControlBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Action triggering access control operations.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.AccessControlAction access_control = 2; + */ + public com.google.cloud.contentwarehouse.v1.AccessControlAction.Builder + getAccessControlBuilder() { + return getAccessControlFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Action triggering access control operations.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.AccessControlAction access_control = 2; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.AccessControlActionOrBuilder + getAccessControlOrBuilder() { + if ((actionCase_ == 2) && (accessControlBuilder_ != null)) { + return accessControlBuilder_.getMessageOrBuilder(); + } else { + if (actionCase_ == 2) { + return (com.google.cloud.contentwarehouse.v1.AccessControlAction) action_; + } + return com.google.cloud.contentwarehouse.v1.AccessControlAction.getDefaultInstance(); + } + } + /** + * + * + *
+     * Action triggering access control operations.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.AccessControlAction access_control = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.AccessControlAction, + com.google.cloud.contentwarehouse.v1.AccessControlAction.Builder, + com.google.cloud.contentwarehouse.v1.AccessControlActionOrBuilder> + getAccessControlFieldBuilder() { + if (accessControlBuilder_ == null) { + if (!(actionCase_ == 2)) { + action_ = com.google.cloud.contentwarehouse.v1.AccessControlAction.getDefaultInstance(); + } + accessControlBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.AccessControlAction, + com.google.cloud.contentwarehouse.v1.AccessControlAction.Builder, + com.google.cloud.contentwarehouse.v1.AccessControlActionOrBuilder>( + (com.google.cloud.contentwarehouse.v1.AccessControlAction) action_, + getParentForChildren(), + isClean()); + action_ = null; + } + actionCase_ = 2; + onChanged(); + ; + return accessControlBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.DataValidationAction, + com.google.cloud.contentwarehouse.v1.DataValidationAction.Builder, + com.google.cloud.contentwarehouse.v1.DataValidationActionOrBuilder> + dataValidationBuilder_; + /** + * + * + *
+     * Action triggering data validation operations.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DataValidationAction data_validation = 3; + * + * @return Whether the dataValidation field is set. + */ + @java.lang.Override + public boolean hasDataValidation() { + return actionCase_ == 3; + } + /** + * + * + *
+     * Action triggering data validation operations.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DataValidationAction data_validation = 3; + * + * @return The dataValidation. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DataValidationAction getDataValidation() { + if (dataValidationBuilder_ == null) { + if (actionCase_ == 3) { + return (com.google.cloud.contentwarehouse.v1.DataValidationAction) action_; + } + return com.google.cloud.contentwarehouse.v1.DataValidationAction.getDefaultInstance(); + } else { + if (actionCase_ == 3) { + return dataValidationBuilder_.getMessage(); + } + return com.google.cloud.contentwarehouse.v1.DataValidationAction.getDefaultInstance(); + } + } + /** + * + * + *
+     * Action triggering data validation operations.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DataValidationAction data_validation = 3; + */ + public Builder setDataValidation( + com.google.cloud.contentwarehouse.v1.DataValidationAction value) { + if (dataValidationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + action_ = value; + onChanged(); + } else { + dataValidationBuilder_.setMessage(value); + } + actionCase_ = 3; + return this; + } + /** + * + * + *
+     * Action triggering data validation operations.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DataValidationAction data_validation = 3; + */ + public Builder setDataValidation( + com.google.cloud.contentwarehouse.v1.DataValidationAction.Builder builderForValue) { + if (dataValidationBuilder_ == null) { + action_ = builderForValue.build(); + onChanged(); + } else { + dataValidationBuilder_.setMessage(builderForValue.build()); + } + actionCase_ = 3; + return this; + } + /** + * + * + *
+     * Action triggering data validation operations.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DataValidationAction data_validation = 3; + */ + public Builder mergeDataValidation( + com.google.cloud.contentwarehouse.v1.DataValidationAction value) { + if (dataValidationBuilder_ == null) { + if (actionCase_ == 3 + && action_ + != com.google.cloud.contentwarehouse.v1.DataValidationAction.getDefaultInstance()) { + action_ = + com.google.cloud.contentwarehouse.v1.DataValidationAction.newBuilder( + (com.google.cloud.contentwarehouse.v1.DataValidationAction) action_) + .mergeFrom(value) + .buildPartial(); + } else { + action_ = value; + } + onChanged(); + } else { + if (actionCase_ == 3) { + dataValidationBuilder_.mergeFrom(value); + } else { + dataValidationBuilder_.setMessage(value); + } + } + actionCase_ = 3; + return this; + } + /** + * + * + *
+     * Action triggering data validation operations.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DataValidationAction data_validation = 3; + */ + public Builder clearDataValidation() { + if (dataValidationBuilder_ == null) { + if (actionCase_ == 3) { + actionCase_ = 0; + action_ = null; + onChanged(); + } + } else { + if (actionCase_ == 3) { + actionCase_ = 0; + action_ = null; + } + dataValidationBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Action triggering data validation operations.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DataValidationAction data_validation = 3; + */ + public com.google.cloud.contentwarehouse.v1.DataValidationAction.Builder + getDataValidationBuilder() { + return getDataValidationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Action triggering data validation operations.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DataValidationAction data_validation = 3; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DataValidationActionOrBuilder + getDataValidationOrBuilder() { + if ((actionCase_ == 3) && (dataValidationBuilder_ != null)) { + return dataValidationBuilder_.getMessageOrBuilder(); + } else { + if (actionCase_ == 3) { + return (com.google.cloud.contentwarehouse.v1.DataValidationAction) action_; + } + return com.google.cloud.contentwarehouse.v1.DataValidationAction.getDefaultInstance(); + } + } + /** + * + * + *
+     * Action triggering data validation operations.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DataValidationAction data_validation = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.DataValidationAction, + com.google.cloud.contentwarehouse.v1.DataValidationAction.Builder, + com.google.cloud.contentwarehouse.v1.DataValidationActionOrBuilder> + getDataValidationFieldBuilder() { + if (dataValidationBuilder_ == null) { + if (!(actionCase_ == 3)) { + action_ = com.google.cloud.contentwarehouse.v1.DataValidationAction.getDefaultInstance(); + } + dataValidationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.DataValidationAction, + com.google.cloud.contentwarehouse.v1.DataValidationAction.Builder, + com.google.cloud.contentwarehouse.v1.DataValidationActionOrBuilder>( + (com.google.cloud.contentwarehouse.v1.DataValidationAction) action_, + getParentForChildren(), + isClean()); + action_ = null; + } + actionCase_ = 3; + onChanged(); + ; + return dataValidationBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.DataUpdateAction, + com.google.cloud.contentwarehouse.v1.DataUpdateAction.Builder, + com.google.cloud.contentwarehouse.v1.DataUpdateActionOrBuilder> + dataUpdateBuilder_; + /** + * + * + *
+     * Action triggering data update operations.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DataUpdateAction data_update = 4; + * + * @return Whether the dataUpdate field is set. + */ + @java.lang.Override + public boolean hasDataUpdate() { + return actionCase_ == 4; + } + /** + * + * + *
+     * Action triggering data update operations.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DataUpdateAction data_update = 4; + * + * @return The dataUpdate. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DataUpdateAction getDataUpdate() { + if (dataUpdateBuilder_ == null) { + if (actionCase_ == 4) { + return (com.google.cloud.contentwarehouse.v1.DataUpdateAction) action_; + } + return com.google.cloud.contentwarehouse.v1.DataUpdateAction.getDefaultInstance(); + } else { + if (actionCase_ == 4) { + return dataUpdateBuilder_.getMessage(); + } + return com.google.cloud.contentwarehouse.v1.DataUpdateAction.getDefaultInstance(); + } + } + /** + * + * + *
+     * Action triggering data update operations.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DataUpdateAction data_update = 4; + */ + public Builder setDataUpdate(com.google.cloud.contentwarehouse.v1.DataUpdateAction value) { + if (dataUpdateBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + action_ = value; + onChanged(); + } else { + dataUpdateBuilder_.setMessage(value); + } + actionCase_ = 4; + return this; + } + /** + * + * + *
+     * Action triggering data update operations.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DataUpdateAction data_update = 4; + */ + public Builder setDataUpdate( + com.google.cloud.contentwarehouse.v1.DataUpdateAction.Builder builderForValue) { + if (dataUpdateBuilder_ == null) { + action_ = builderForValue.build(); + onChanged(); + } else { + dataUpdateBuilder_.setMessage(builderForValue.build()); + } + actionCase_ = 4; + return this; + } + /** + * + * + *
+     * Action triggering data update operations.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DataUpdateAction data_update = 4; + */ + public Builder mergeDataUpdate(com.google.cloud.contentwarehouse.v1.DataUpdateAction value) { + if (dataUpdateBuilder_ == null) { + if (actionCase_ == 4 + && action_ + != com.google.cloud.contentwarehouse.v1.DataUpdateAction.getDefaultInstance()) { + action_ = + com.google.cloud.contentwarehouse.v1.DataUpdateAction.newBuilder( + (com.google.cloud.contentwarehouse.v1.DataUpdateAction) action_) + .mergeFrom(value) + .buildPartial(); + } else { + action_ = value; + } + onChanged(); + } else { + if (actionCase_ == 4) { + dataUpdateBuilder_.mergeFrom(value); + } else { + dataUpdateBuilder_.setMessage(value); + } + } + actionCase_ = 4; + return this; + } + /** + * + * + *
+     * Action triggering data update operations.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DataUpdateAction data_update = 4; + */ + public Builder clearDataUpdate() { + if (dataUpdateBuilder_ == null) { + if (actionCase_ == 4) { + actionCase_ = 0; + action_ = null; + onChanged(); + } + } else { + if (actionCase_ == 4) { + actionCase_ = 0; + action_ = null; + } + dataUpdateBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Action triggering data update operations.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DataUpdateAction data_update = 4; + */ + public com.google.cloud.contentwarehouse.v1.DataUpdateAction.Builder getDataUpdateBuilder() { + return getDataUpdateFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Action triggering data update operations.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DataUpdateAction data_update = 4; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DataUpdateActionOrBuilder getDataUpdateOrBuilder() { + if ((actionCase_ == 4) && (dataUpdateBuilder_ != null)) { + return dataUpdateBuilder_.getMessageOrBuilder(); + } else { + if (actionCase_ == 4) { + return (com.google.cloud.contentwarehouse.v1.DataUpdateAction) action_; + } + return com.google.cloud.contentwarehouse.v1.DataUpdateAction.getDefaultInstance(); + } + } + /** + * + * + *
+     * Action triggering data update operations.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DataUpdateAction data_update = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.DataUpdateAction, + com.google.cloud.contentwarehouse.v1.DataUpdateAction.Builder, + com.google.cloud.contentwarehouse.v1.DataUpdateActionOrBuilder> + getDataUpdateFieldBuilder() { + if (dataUpdateBuilder_ == null) { + if (!(actionCase_ == 4)) { + action_ = com.google.cloud.contentwarehouse.v1.DataUpdateAction.getDefaultInstance(); + } + dataUpdateBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.DataUpdateAction, + com.google.cloud.contentwarehouse.v1.DataUpdateAction.Builder, + com.google.cloud.contentwarehouse.v1.DataUpdateActionOrBuilder>( + (com.google.cloud.contentwarehouse.v1.DataUpdateAction) action_, + getParentForChildren(), + isClean()); + action_ = null; + } + actionCase_ = 4; + onChanged(); + ; + return dataUpdateBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.AddToFolderAction, + com.google.cloud.contentwarehouse.v1.AddToFolderAction.Builder, + com.google.cloud.contentwarehouse.v1.AddToFolderActionOrBuilder> + addToFolderBuilder_; + /** + * + * + *
+     * Action triggering create document link operation.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.AddToFolderAction add_to_folder = 5; + * + * @return Whether the addToFolder field is set. + */ + @java.lang.Override + public boolean hasAddToFolder() { + return actionCase_ == 5; + } + /** + * + * + *
+     * Action triggering create document link operation.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.AddToFolderAction add_to_folder = 5; + * + * @return The addToFolder. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.AddToFolderAction getAddToFolder() { + if (addToFolderBuilder_ == null) { + if (actionCase_ == 5) { + return (com.google.cloud.contentwarehouse.v1.AddToFolderAction) action_; + } + return com.google.cloud.contentwarehouse.v1.AddToFolderAction.getDefaultInstance(); + } else { + if (actionCase_ == 5) { + return addToFolderBuilder_.getMessage(); + } + return com.google.cloud.contentwarehouse.v1.AddToFolderAction.getDefaultInstance(); + } + } + /** + * + * + *
+     * Action triggering create document link operation.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.AddToFolderAction add_to_folder = 5; + */ + public Builder setAddToFolder(com.google.cloud.contentwarehouse.v1.AddToFolderAction value) { + if (addToFolderBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + action_ = value; + onChanged(); + } else { + addToFolderBuilder_.setMessage(value); + } + actionCase_ = 5; + return this; + } + /** + * + * + *
+     * Action triggering create document link operation.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.AddToFolderAction add_to_folder = 5; + */ + public Builder setAddToFolder( + com.google.cloud.contentwarehouse.v1.AddToFolderAction.Builder builderForValue) { + if (addToFolderBuilder_ == null) { + action_ = builderForValue.build(); + onChanged(); + } else { + addToFolderBuilder_.setMessage(builderForValue.build()); + } + actionCase_ = 5; + return this; + } + /** + * + * + *
+     * Action triggering create document link operation.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.AddToFolderAction add_to_folder = 5; + */ + public Builder mergeAddToFolder(com.google.cloud.contentwarehouse.v1.AddToFolderAction value) { + if (addToFolderBuilder_ == null) { + if (actionCase_ == 5 + && action_ + != com.google.cloud.contentwarehouse.v1.AddToFolderAction.getDefaultInstance()) { + action_ = + com.google.cloud.contentwarehouse.v1.AddToFolderAction.newBuilder( + (com.google.cloud.contentwarehouse.v1.AddToFolderAction) action_) + .mergeFrom(value) + .buildPartial(); + } else { + action_ = value; + } + onChanged(); + } else { + if (actionCase_ == 5) { + addToFolderBuilder_.mergeFrom(value); + } else { + addToFolderBuilder_.setMessage(value); + } + } + actionCase_ = 5; + return this; + } + /** + * + * + *
+     * Action triggering create document link operation.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.AddToFolderAction add_to_folder = 5; + */ + public Builder clearAddToFolder() { + if (addToFolderBuilder_ == null) { + if (actionCase_ == 5) { + actionCase_ = 0; + action_ = null; + onChanged(); + } + } else { + if (actionCase_ == 5) { + actionCase_ = 0; + action_ = null; + } + addToFolderBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Action triggering create document link operation.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.AddToFolderAction add_to_folder = 5; + */ + public com.google.cloud.contentwarehouse.v1.AddToFolderAction.Builder getAddToFolderBuilder() { + return getAddToFolderFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Action triggering create document link operation.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.AddToFolderAction add_to_folder = 5; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.AddToFolderActionOrBuilder + getAddToFolderOrBuilder() { + if ((actionCase_ == 5) && (addToFolderBuilder_ != null)) { + return addToFolderBuilder_.getMessageOrBuilder(); + } else { + if (actionCase_ == 5) { + return (com.google.cloud.contentwarehouse.v1.AddToFolderAction) action_; + } + return com.google.cloud.contentwarehouse.v1.AddToFolderAction.getDefaultInstance(); + } + } + /** + * + * + *
+     * Action triggering create document link operation.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.AddToFolderAction add_to_folder = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.AddToFolderAction, + com.google.cloud.contentwarehouse.v1.AddToFolderAction.Builder, + com.google.cloud.contentwarehouse.v1.AddToFolderActionOrBuilder> + getAddToFolderFieldBuilder() { + if (addToFolderBuilder_ == null) { + if (!(actionCase_ == 5)) { + action_ = com.google.cloud.contentwarehouse.v1.AddToFolderAction.getDefaultInstance(); + } + addToFolderBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.AddToFolderAction, + com.google.cloud.contentwarehouse.v1.AddToFolderAction.Builder, + com.google.cloud.contentwarehouse.v1.AddToFolderActionOrBuilder>( + (com.google.cloud.contentwarehouse.v1.AddToFolderAction) action_, + getParentForChildren(), + isClean()); + action_ = null; + } + actionCase_ = 5; + onChanged(); + ; + return addToFolderBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.PublishAction, + com.google.cloud.contentwarehouse.v1.PublishAction.Builder, + com.google.cloud.contentwarehouse.v1.PublishActionOrBuilder> + publishToPubSubBuilder_; + /** + * + * + *
+     * Action publish to Pub/Sub operation.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.PublishAction publish_to_pub_sub = 6; + * + * @return Whether the publishToPubSub field is set. + */ + @java.lang.Override + public boolean hasPublishToPubSub() { + return actionCase_ == 6; + } + /** + * + * + *
+     * Action publish to Pub/Sub operation.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.PublishAction publish_to_pub_sub = 6; + * + * @return The publishToPubSub. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.PublishAction getPublishToPubSub() { + if (publishToPubSubBuilder_ == null) { + if (actionCase_ == 6) { + return (com.google.cloud.contentwarehouse.v1.PublishAction) action_; + } + return com.google.cloud.contentwarehouse.v1.PublishAction.getDefaultInstance(); + } else { + if (actionCase_ == 6) { + return publishToPubSubBuilder_.getMessage(); + } + return com.google.cloud.contentwarehouse.v1.PublishAction.getDefaultInstance(); + } + } + /** + * + * + *
+     * Action publish to Pub/Sub operation.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.PublishAction publish_to_pub_sub = 6; + */ + public Builder setPublishToPubSub(com.google.cloud.contentwarehouse.v1.PublishAction value) { + if (publishToPubSubBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + action_ = value; + onChanged(); + } else { + publishToPubSubBuilder_.setMessage(value); + } + actionCase_ = 6; + return this; + } + /** + * + * + *
+     * Action publish to Pub/Sub operation.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.PublishAction publish_to_pub_sub = 6; + */ + public Builder setPublishToPubSub( + com.google.cloud.contentwarehouse.v1.PublishAction.Builder builderForValue) { + if (publishToPubSubBuilder_ == null) { + action_ = builderForValue.build(); + onChanged(); + } else { + publishToPubSubBuilder_.setMessage(builderForValue.build()); + } + actionCase_ = 6; + return this; + } + /** + * + * + *
+     * Action publish to Pub/Sub operation.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.PublishAction publish_to_pub_sub = 6; + */ + public Builder mergePublishToPubSub(com.google.cloud.contentwarehouse.v1.PublishAction value) { + if (publishToPubSubBuilder_ == null) { + if (actionCase_ == 6 + && action_ != com.google.cloud.contentwarehouse.v1.PublishAction.getDefaultInstance()) { + action_ = + com.google.cloud.contentwarehouse.v1.PublishAction.newBuilder( + (com.google.cloud.contentwarehouse.v1.PublishAction) action_) + .mergeFrom(value) + .buildPartial(); + } else { + action_ = value; + } + onChanged(); + } else { + if (actionCase_ == 6) { + publishToPubSubBuilder_.mergeFrom(value); + } else { + publishToPubSubBuilder_.setMessage(value); + } + } + actionCase_ = 6; + return this; + } + /** + * + * + *
+     * Action publish to Pub/Sub operation.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.PublishAction publish_to_pub_sub = 6; + */ + public Builder clearPublishToPubSub() { + if (publishToPubSubBuilder_ == null) { + if (actionCase_ == 6) { + actionCase_ = 0; + action_ = null; + onChanged(); + } + } else { + if (actionCase_ == 6) { + actionCase_ = 0; + action_ = null; + } + publishToPubSubBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Action publish to Pub/Sub operation.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.PublishAction publish_to_pub_sub = 6; + */ + public com.google.cloud.contentwarehouse.v1.PublishAction.Builder getPublishToPubSubBuilder() { + return getPublishToPubSubFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Action publish to Pub/Sub operation.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.PublishAction publish_to_pub_sub = 6; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.PublishActionOrBuilder + getPublishToPubSubOrBuilder() { + if ((actionCase_ == 6) && (publishToPubSubBuilder_ != null)) { + return publishToPubSubBuilder_.getMessageOrBuilder(); + } else { + if (actionCase_ == 6) { + return (com.google.cloud.contentwarehouse.v1.PublishAction) action_; + } + return com.google.cloud.contentwarehouse.v1.PublishAction.getDefaultInstance(); + } + } + /** + * + * + *
+     * Action publish to Pub/Sub operation.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.PublishAction publish_to_pub_sub = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.PublishAction, + com.google.cloud.contentwarehouse.v1.PublishAction.Builder, + com.google.cloud.contentwarehouse.v1.PublishActionOrBuilder> + getPublishToPubSubFieldBuilder() { + if (publishToPubSubBuilder_ == null) { + if (!(actionCase_ == 6)) { + action_ = com.google.cloud.contentwarehouse.v1.PublishAction.getDefaultInstance(); + } + publishToPubSubBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.PublishAction, + com.google.cloud.contentwarehouse.v1.PublishAction.Builder, + com.google.cloud.contentwarehouse.v1.PublishActionOrBuilder>( + (com.google.cloud.contentwarehouse.v1.PublishAction) action_, + getParentForChildren(), + isClean()); + action_ = null; + } + actionCase_ = 6; + onChanged(); + ; + return publishToPubSubBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction, + com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction.Builder, + com.google.cloud.contentwarehouse.v1.RemoveFromFolderActionOrBuilder> + removeFromFolderActionBuilder_; + /** + * + * + *
+     * Action removing a document from a folder.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RemoveFromFolderAction remove_from_folder_action = 9; + * + * + * @return Whether the removeFromFolderAction field is set. + */ + @java.lang.Override + public boolean hasRemoveFromFolderAction() { + return actionCase_ == 9; + } + /** + * + * + *
+     * Action removing a document from a folder.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RemoveFromFolderAction remove_from_folder_action = 9; + * + * + * @return The removeFromFolderAction. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction getRemoveFromFolderAction() { + if (removeFromFolderActionBuilder_ == null) { + if (actionCase_ == 9) { + return (com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction) action_; + } + return com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction.getDefaultInstance(); + } else { + if (actionCase_ == 9) { + return removeFromFolderActionBuilder_.getMessage(); + } + return com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction.getDefaultInstance(); + } + } + /** + * + * + *
+     * Action removing a document from a folder.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RemoveFromFolderAction remove_from_folder_action = 9; + * + */ + public Builder setRemoveFromFolderAction( + com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction value) { + if (removeFromFolderActionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + action_ = value; + onChanged(); + } else { + removeFromFolderActionBuilder_.setMessage(value); + } + actionCase_ = 9; + return this; + } + /** + * + * + *
+     * Action removing a document from a folder.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RemoveFromFolderAction remove_from_folder_action = 9; + * + */ + public Builder setRemoveFromFolderAction( + com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction.Builder builderForValue) { + if (removeFromFolderActionBuilder_ == null) { + action_ = builderForValue.build(); + onChanged(); + } else { + removeFromFolderActionBuilder_.setMessage(builderForValue.build()); + } + actionCase_ = 9; + return this; + } + /** + * + * + *
+     * Action removing a document from a folder.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RemoveFromFolderAction remove_from_folder_action = 9; + * + */ + public Builder mergeRemoveFromFolderAction( + com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction value) { + if (removeFromFolderActionBuilder_ == null) { + if (actionCase_ == 9 + && action_ + != com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction + .getDefaultInstance()) { + action_ = + com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction.newBuilder( + (com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction) action_) + .mergeFrom(value) + .buildPartial(); + } else { + action_ = value; + } + onChanged(); + } else { + if (actionCase_ == 9) { + removeFromFolderActionBuilder_.mergeFrom(value); + } else { + removeFromFolderActionBuilder_.setMessage(value); + } + } + actionCase_ = 9; + return this; + } + /** + * + * + *
+     * Action removing a document from a folder.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RemoveFromFolderAction remove_from_folder_action = 9; + * + */ + public Builder clearRemoveFromFolderAction() { + if (removeFromFolderActionBuilder_ == null) { + if (actionCase_ == 9) { + actionCase_ = 0; + action_ = null; + onChanged(); + } + } else { + if (actionCase_ == 9) { + actionCase_ = 0; + action_ = null; + } + removeFromFolderActionBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Action removing a document from a folder.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RemoveFromFolderAction remove_from_folder_action = 9; + * + */ + public com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction.Builder + getRemoveFromFolderActionBuilder() { + return getRemoveFromFolderActionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Action removing a document from a folder.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RemoveFromFolderAction remove_from_folder_action = 9; + * + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RemoveFromFolderActionOrBuilder + getRemoveFromFolderActionOrBuilder() { + if ((actionCase_ == 9) && (removeFromFolderActionBuilder_ != null)) { + return removeFromFolderActionBuilder_.getMessageOrBuilder(); + } else { + if (actionCase_ == 9) { + return (com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction) action_; + } + return com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction.getDefaultInstance(); + } + } + /** + * + * + *
+     * Action removing a document from a folder.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RemoveFromFolderAction remove_from_folder_action = 9; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction, + com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction.Builder, + com.google.cloud.contentwarehouse.v1.RemoveFromFolderActionOrBuilder> + getRemoveFromFolderActionFieldBuilder() { + if (removeFromFolderActionBuilder_ == null) { + if (!(actionCase_ == 9)) { + action_ = + com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction.getDefaultInstance(); + } + removeFromFolderActionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction, + com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction.Builder, + com.google.cloud.contentwarehouse.v1.RemoveFromFolderActionOrBuilder>( + (com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction) action_, + getParentForChildren(), + isClean()); + action_ = null; + } + actionCase_ = 9; + onChanged(); + ; + return removeFromFolderActionBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.DeleteDocumentAction, + com.google.cloud.contentwarehouse.v1.DeleteDocumentAction.Builder, + com.google.cloud.contentwarehouse.v1.DeleteDocumentActionOrBuilder> + deleteDocumentActionBuilder_; + /** + * + * + *
+     * Action deleting the document.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DeleteDocumentAction delete_document_action = 10; + * + * + * @return Whether the deleteDocumentAction field is set. + */ + @java.lang.Override + public boolean hasDeleteDocumentAction() { + return actionCase_ == 10; + } + /** + * + * + *
+     * Action deleting the document.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DeleteDocumentAction delete_document_action = 10; + * + * + * @return The deleteDocumentAction. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DeleteDocumentAction getDeleteDocumentAction() { + if (deleteDocumentActionBuilder_ == null) { + if (actionCase_ == 10) { + return (com.google.cloud.contentwarehouse.v1.DeleteDocumentAction) action_; + } + return com.google.cloud.contentwarehouse.v1.DeleteDocumentAction.getDefaultInstance(); + } else { + if (actionCase_ == 10) { + return deleteDocumentActionBuilder_.getMessage(); + } + return com.google.cloud.contentwarehouse.v1.DeleteDocumentAction.getDefaultInstance(); + } + } + /** + * + * + *
+     * Action deleting the document.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DeleteDocumentAction delete_document_action = 10; + * + */ + public Builder setDeleteDocumentAction( + com.google.cloud.contentwarehouse.v1.DeleteDocumentAction value) { + if (deleteDocumentActionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + action_ = value; + onChanged(); + } else { + deleteDocumentActionBuilder_.setMessage(value); + } + actionCase_ = 10; + return this; + } + /** + * + * + *
+     * Action deleting the document.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DeleteDocumentAction delete_document_action = 10; + * + */ + public Builder setDeleteDocumentAction( + com.google.cloud.contentwarehouse.v1.DeleteDocumentAction.Builder builderForValue) { + if (deleteDocumentActionBuilder_ == null) { + action_ = builderForValue.build(); + onChanged(); + } else { + deleteDocumentActionBuilder_.setMessage(builderForValue.build()); + } + actionCase_ = 10; + return this; + } + /** + * + * + *
+     * Action deleting the document.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DeleteDocumentAction delete_document_action = 10; + * + */ + public Builder mergeDeleteDocumentAction( + com.google.cloud.contentwarehouse.v1.DeleteDocumentAction value) { + if (deleteDocumentActionBuilder_ == null) { + if (actionCase_ == 10 + && action_ + != com.google.cloud.contentwarehouse.v1.DeleteDocumentAction.getDefaultInstance()) { + action_ = + com.google.cloud.contentwarehouse.v1.DeleteDocumentAction.newBuilder( + (com.google.cloud.contentwarehouse.v1.DeleteDocumentAction) action_) + .mergeFrom(value) + .buildPartial(); + } else { + action_ = value; + } + onChanged(); + } else { + if (actionCase_ == 10) { + deleteDocumentActionBuilder_.mergeFrom(value); + } else { + deleteDocumentActionBuilder_.setMessage(value); + } + } + actionCase_ = 10; + return this; + } + /** + * + * + *
+     * Action deleting the document.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DeleteDocumentAction delete_document_action = 10; + * + */ + public Builder clearDeleteDocumentAction() { + if (deleteDocumentActionBuilder_ == null) { + if (actionCase_ == 10) { + actionCase_ = 0; + action_ = null; + onChanged(); + } + } else { + if (actionCase_ == 10) { + actionCase_ = 0; + action_ = null; + } + deleteDocumentActionBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Action deleting the document.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DeleteDocumentAction delete_document_action = 10; + * + */ + public com.google.cloud.contentwarehouse.v1.DeleteDocumentAction.Builder + getDeleteDocumentActionBuilder() { + return getDeleteDocumentActionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Action deleting the document.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DeleteDocumentAction delete_document_action = 10; + * + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DeleteDocumentActionOrBuilder + getDeleteDocumentActionOrBuilder() { + if ((actionCase_ == 10) && (deleteDocumentActionBuilder_ != null)) { + return deleteDocumentActionBuilder_.getMessageOrBuilder(); + } else { + if (actionCase_ == 10) { + return (com.google.cloud.contentwarehouse.v1.DeleteDocumentAction) action_; + } + return com.google.cloud.contentwarehouse.v1.DeleteDocumentAction.getDefaultInstance(); + } + } + /** + * + * + *
+     * Action deleting the document.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DeleteDocumentAction delete_document_action = 10; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.DeleteDocumentAction, + com.google.cloud.contentwarehouse.v1.DeleteDocumentAction.Builder, + com.google.cloud.contentwarehouse.v1.DeleteDocumentActionOrBuilder> + getDeleteDocumentActionFieldBuilder() { + if (deleteDocumentActionBuilder_ == null) { + if (!(actionCase_ == 10)) { + action_ = com.google.cloud.contentwarehouse.v1.DeleteDocumentAction.getDefaultInstance(); + } + deleteDocumentActionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.DeleteDocumentAction, + com.google.cloud.contentwarehouse.v1.DeleteDocumentAction.Builder, + com.google.cloud.contentwarehouse.v1.DeleteDocumentActionOrBuilder>( + (com.google.cloud.contentwarehouse.v1.DeleteDocumentAction) action_, + getParentForChildren(), + isClean()); + action_ = null; + } + actionCase_ = 10; + onChanged(); + ; + return deleteDocumentActionBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.Action) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.Action) + private static final com.google.cloud.contentwarehouse.v1.Action DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.Action(); + } + + public static com.google.cloud.contentwarehouse.v1.Action getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Action parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.Action getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ActionExecutorOutput.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ActionExecutorOutput.java new file mode 100644 index 000000000000..a78ce70d5eec --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ActionExecutorOutput.java @@ -0,0 +1,962 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/rule_engine.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Represents the output of the Action Executor.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.ActionExecutorOutput} + */ +public final class ActionExecutorOutput extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.ActionExecutorOutput) + ActionExecutorOutputOrBuilder { + private static final long serialVersionUID = 0L; + // Use ActionExecutorOutput.newBuilder() to construct. + private ActionExecutorOutput(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ActionExecutorOutput() { + ruleActionsPairs_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ActionExecutorOutput(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_ActionExecutorOutput_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_ActionExecutorOutput_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.ActionExecutorOutput.class, + com.google.cloud.contentwarehouse.v1.ActionExecutorOutput.Builder.class); + } + + public static final int RULE_ACTIONS_PAIRS_FIELD_NUMBER = 1; + private java.util.List ruleActionsPairs_; + /** + * + * + *
+   * List of rule and corresponding actions result.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.RuleActionsPair rule_actions_pairs = 1; + */ + @java.lang.Override + public java.util.List + getRuleActionsPairsList() { + return ruleActionsPairs_; + } + /** + * + * + *
+   * List of rule and corresponding actions result.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.RuleActionsPair rule_actions_pairs = 1; + */ + @java.lang.Override + public java.util.List + getRuleActionsPairsOrBuilderList() { + return ruleActionsPairs_; + } + /** + * + * + *
+   * List of rule and corresponding actions result.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.RuleActionsPair rule_actions_pairs = 1; + */ + @java.lang.Override + public int getRuleActionsPairsCount() { + return ruleActionsPairs_.size(); + } + /** + * + * + *
+   * List of rule and corresponding actions result.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.RuleActionsPair rule_actions_pairs = 1; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RuleActionsPair getRuleActionsPairs(int index) { + return ruleActionsPairs_.get(index); + } + /** + * + * + *
+   * List of rule and corresponding actions result.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.RuleActionsPair rule_actions_pairs = 1; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RuleActionsPairOrBuilder getRuleActionsPairsOrBuilder( + int index) { + return ruleActionsPairs_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < ruleActionsPairs_.size(); i++) { + output.writeMessage(1, ruleActionsPairs_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < ruleActionsPairs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, ruleActionsPairs_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.ActionExecutorOutput)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.ActionExecutorOutput other = + (com.google.cloud.contentwarehouse.v1.ActionExecutorOutput) obj; + + if (!getRuleActionsPairsList().equals(other.getRuleActionsPairsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getRuleActionsPairsCount() > 0) { + hash = (37 * hash) + RULE_ACTIONS_PAIRS_FIELD_NUMBER; + hash = (53 * hash) + getRuleActionsPairsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.ActionExecutorOutput parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.ActionExecutorOutput parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ActionExecutorOutput parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.ActionExecutorOutput parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ActionExecutorOutput parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.ActionExecutorOutput parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ActionExecutorOutput parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.ActionExecutorOutput parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ActionExecutorOutput parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.ActionExecutorOutput parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ActionExecutorOutput parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.ActionExecutorOutput parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.ActionExecutorOutput prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Represents the output of the Action Executor.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.ActionExecutorOutput} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.ActionExecutorOutput) + com.google.cloud.contentwarehouse.v1.ActionExecutorOutputOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_ActionExecutorOutput_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_ActionExecutorOutput_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.ActionExecutorOutput.class, + com.google.cloud.contentwarehouse.v1.ActionExecutorOutput.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.ActionExecutorOutput.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (ruleActionsPairsBuilder_ == null) { + ruleActionsPairs_ = java.util.Collections.emptyList(); + } else { + ruleActionsPairs_ = null; + ruleActionsPairsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_ActionExecutorOutput_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ActionExecutorOutput getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.ActionExecutorOutput.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ActionExecutorOutput build() { + com.google.cloud.contentwarehouse.v1.ActionExecutorOutput result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ActionExecutorOutput buildPartial() { + com.google.cloud.contentwarehouse.v1.ActionExecutorOutput result = + new com.google.cloud.contentwarehouse.v1.ActionExecutorOutput(this); + int from_bitField0_ = bitField0_; + if (ruleActionsPairsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + ruleActionsPairs_ = java.util.Collections.unmodifiableList(ruleActionsPairs_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.ruleActionsPairs_ = ruleActionsPairs_; + } else { + result.ruleActionsPairs_ = ruleActionsPairsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.ActionExecutorOutput) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.ActionExecutorOutput) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.ActionExecutorOutput other) { + if (other == com.google.cloud.contentwarehouse.v1.ActionExecutorOutput.getDefaultInstance()) + return this; + if (ruleActionsPairsBuilder_ == null) { + if (!other.ruleActionsPairs_.isEmpty()) { + if (ruleActionsPairs_.isEmpty()) { + ruleActionsPairs_ = other.ruleActionsPairs_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureRuleActionsPairsIsMutable(); + ruleActionsPairs_.addAll(other.ruleActionsPairs_); + } + onChanged(); + } + } else { + if (!other.ruleActionsPairs_.isEmpty()) { + if (ruleActionsPairsBuilder_.isEmpty()) { + ruleActionsPairsBuilder_.dispose(); + ruleActionsPairsBuilder_ = null; + ruleActionsPairs_ = other.ruleActionsPairs_; + bitField0_ = (bitField0_ & ~0x00000001); + ruleActionsPairsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getRuleActionsPairsFieldBuilder() + : null; + } else { + ruleActionsPairsBuilder_.addAllMessages(other.ruleActionsPairs_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.contentwarehouse.v1.RuleActionsPair m = + input.readMessage( + com.google.cloud.contentwarehouse.v1.RuleActionsPair.parser(), + extensionRegistry); + if (ruleActionsPairsBuilder_ == null) { + ensureRuleActionsPairsIsMutable(); + ruleActionsPairs_.add(m); + } else { + ruleActionsPairsBuilder_.addMessage(m); + } + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List ruleActionsPairs_ = + java.util.Collections.emptyList(); + + private void ensureRuleActionsPairsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + ruleActionsPairs_ = + new java.util.ArrayList( + ruleActionsPairs_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.RuleActionsPair, + com.google.cloud.contentwarehouse.v1.RuleActionsPair.Builder, + com.google.cloud.contentwarehouse.v1.RuleActionsPairOrBuilder> + ruleActionsPairsBuilder_; + + /** + * + * + *
+     * List of rule and corresponding actions result.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.RuleActionsPair rule_actions_pairs = 1; + * + */ + public java.util.List + getRuleActionsPairsList() { + if (ruleActionsPairsBuilder_ == null) { + return java.util.Collections.unmodifiableList(ruleActionsPairs_); + } else { + return ruleActionsPairsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * List of rule and corresponding actions result.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.RuleActionsPair rule_actions_pairs = 1; + * + */ + public int getRuleActionsPairsCount() { + if (ruleActionsPairsBuilder_ == null) { + return ruleActionsPairs_.size(); + } else { + return ruleActionsPairsBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of rule and corresponding actions result.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.RuleActionsPair rule_actions_pairs = 1; + * + */ + public com.google.cloud.contentwarehouse.v1.RuleActionsPair getRuleActionsPairs(int index) { + if (ruleActionsPairsBuilder_ == null) { + return ruleActionsPairs_.get(index); + } else { + return ruleActionsPairsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of rule and corresponding actions result.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.RuleActionsPair rule_actions_pairs = 1; + * + */ + public Builder setRuleActionsPairs( + int index, com.google.cloud.contentwarehouse.v1.RuleActionsPair value) { + if (ruleActionsPairsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRuleActionsPairsIsMutable(); + ruleActionsPairs_.set(index, value); + onChanged(); + } else { + ruleActionsPairsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of rule and corresponding actions result.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.RuleActionsPair rule_actions_pairs = 1; + * + */ + public Builder setRuleActionsPairs( + int index, com.google.cloud.contentwarehouse.v1.RuleActionsPair.Builder builderForValue) { + if (ruleActionsPairsBuilder_ == null) { + ensureRuleActionsPairsIsMutable(); + ruleActionsPairs_.set(index, builderForValue.build()); + onChanged(); + } else { + ruleActionsPairsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of rule and corresponding actions result.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.RuleActionsPair rule_actions_pairs = 1; + * + */ + public Builder addRuleActionsPairs(com.google.cloud.contentwarehouse.v1.RuleActionsPair value) { + if (ruleActionsPairsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRuleActionsPairsIsMutable(); + ruleActionsPairs_.add(value); + onChanged(); + } else { + ruleActionsPairsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * List of rule and corresponding actions result.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.RuleActionsPair rule_actions_pairs = 1; + * + */ + public Builder addRuleActionsPairs( + int index, com.google.cloud.contentwarehouse.v1.RuleActionsPair value) { + if (ruleActionsPairsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRuleActionsPairsIsMutable(); + ruleActionsPairs_.add(index, value); + onChanged(); + } else { + ruleActionsPairsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of rule and corresponding actions result.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.RuleActionsPair rule_actions_pairs = 1; + * + */ + public Builder addRuleActionsPairs( + com.google.cloud.contentwarehouse.v1.RuleActionsPair.Builder builderForValue) { + if (ruleActionsPairsBuilder_ == null) { + ensureRuleActionsPairsIsMutable(); + ruleActionsPairs_.add(builderForValue.build()); + onChanged(); + } else { + ruleActionsPairsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of rule and corresponding actions result.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.RuleActionsPair rule_actions_pairs = 1; + * + */ + public Builder addRuleActionsPairs( + int index, com.google.cloud.contentwarehouse.v1.RuleActionsPair.Builder builderForValue) { + if (ruleActionsPairsBuilder_ == null) { + ensureRuleActionsPairsIsMutable(); + ruleActionsPairs_.add(index, builderForValue.build()); + onChanged(); + } else { + ruleActionsPairsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of rule and corresponding actions result.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.RuleActionsPair rule_actions_pairs = 1; + * + */ + public Builder addAllRuleActionsPairs( + java.lang.Iterable values) { + if (ruleActionsPairsBuilder_ == null) { + ensureRuleActionsPairsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, ruleActionsPairs_); + onChanged(); + } else { + ruleActionsPairsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * List of rule and corresponding actions result.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.RuleActionsPair rule_actions_pairs = 1; + * + */ + public Builder clearRuleActionsPairs() { + if (ruleActionsPairsBuilder_ == null) { + ruleActionsPairs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + ruleActionsPairsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of rule and corresponding actions result.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.RuleActionsPair rule_actions_pairs = 1; + * + */ + public Builder removeRuleActionsPairs(int index) { + if (ruleActionsPairsBuilder_ == null) { + ensureRuleActionsPairsIsMutable(); + ruleActionsPairs_.remove(index); + onChanged(); + } else { + ruleActionsPairsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * List of rule and corresponding actions result.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.RuleActionsPair rule_actions_pairs = 1; + * + */ + public com.google.cloud.contentwarehouse.v1.RuleActionsPair.Builder getRuleActionsPairsBuilder( + int index) { + return getRuleActionsPairsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of rule and corresponding actions result.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.RuleActionsPair rule_actions_pairs = 1; + * + */ + public com.google.cloud.contentwarehouse.v1.RuleActionsPairOrBuilder + getRuleActionsPairsOrBuilder(int index) { + if (ruleActionsPairsBuilder_ == null) { + return ruleActionsPairs_.get(index); + } else { + return ruleActionsPairsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of rule and corresponding actions result.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.RuleActionsPair rule_actions_pairs = 1; + * + */ + public java.util.List + getRuleActionsPairsOrBuilderList() { + if (ruleActionsPairsBuilder_ != null) { + return ruleActionsPairsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(ruleActionsPairs_); + } + } + /** + * + * + *
+     * List of rule and corresponding actions result.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.RuleActionsPair rule_actions_pairs = 1; + * + */ + public com.google.cloud.contentwarehouse.v1.RuleActionsPair.Builder + addRuleActionsPairsBuilder() { + return getRuleActionsPairsFieldBuilder() + .addBuilder(com.google.cloud.contentwarehouse.v1.RuleActionsPair.getDefaultInstance()); + } + /** + * + * + *
+     * List of rule and corresponding actions result.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.RuleActionsPair rule_actions_pairs = 1; + * + */ + public com.google.cloud.contentwarehouse.v1.RuleActionsPair.Builder addRuleActionsPairsBuilder( + int index) { + return getRuleActionsPairsFieldBuilder() + .addBuilder( + index, com.google.cloud.contentwarehouse.v1.RuleActionsPair.getDefaultInstance()); + } + /** + * + * + *
+     * List of rule and corresponding actions result.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.RuleActionsPair rule_actions_pairs = 1; + * + */ + public java.util.List + getRuleActionsPairsBuilderList() { + return getRuleActionsPairsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.RuleActionsPair, + com.google.cloud.contentwarehouse.v1.RuleActionsPair.Builder, + com.google.cloud.contentwarehouse.v1.RuleActionsPairOrBuilder> + getRuleActionsPairsFieldBuilder() { + if (ruleActionsPairsBuilder_ == null) { + ruleActionsPairsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.RuleActionsPair, + com.google.cloud.contentwarehouse.v1.RuleActionsPair.Builder, + com.google.cloud.contentwarehouse.v1.RuleActionsPairOrBuilder>( + ruleActionsPairs_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + ruleActionsPairs_ = null; + } + return ruleActionsPairsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.ActionExecutorOutput) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.ActionExecutorOutput) + private static final com.google.cloud.contentwarehouse.v1.ActionExecutorOutput DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.ActionExecutorOutput(); + } + + public static com.google.cloud.contentwarehouse.v1.ActionExecutorOutput getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ActionExecutorOutput parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ActionExecutorOutput getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ActionExecutorOutputOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ActionExecutorOutputOrBuilder.java new file mode 100644 index 000000000000..6da3d2c540f5 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ActionExecutorOutputOrBuilder.java @@ -0,0 +1,78 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/rule_engine.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface ActionExecutorOutputOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.ActionExecutorOutput) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of rule and corresponding actions result.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.RuleActionsPair rule_actions_pairs = 1; + */ + java.util.List getRuleActionsPairsList(); + /** + * + * + *
+   * List of rule and corresponding actions result.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.RuleActionsPair rule_actions_pairs = 1; + */ + com.google.cloud.contentwarehouse.v1.RuleActionsPair getRuleActionsPairs(int index); + /** + * + * + *
+   * List of rule and corresponding actions result.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.RuleActionsPair rule_actions_pairs = 1; + */ + int getRuleActionsPairsCount(); + /** + * + * + *
+   * List of rule and corresponding actions result.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.RuleActionsPair rule_actions_pairs = 1; + */ + java.util.List + getRuleActionsPairsOrBuilderList(); + /** + * + * + *
+   * List of rule and corresponding actions result.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.RuleActionsPair rule_actions_pairs = 1; + */ + com.google.cloud.contentwarehouse.v1.RuleActionsPairOrBuilder getRuleActionsPairsOrBuilder( + int index); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ActionOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ActionOrBuilder.java new file mode 100644 index 000000000000..4acbd64d487b --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ActionOrBuilder.java @@ -0,0 +1,305 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/rule_engine.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface ActionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.Action) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * ID of the action. Managed internally.
+   * 
+ * + * string action_id = 1; + * + * @return The actionId. + */ + java.lang.String getActionId(); + /** + * + * + *
+   * ID of the action. Managed internally.
+   * 
+ * + * string action_id = 1; + * + * @return The bytes for actionId. + */ + com.google.protobuf.ByteString getActionIdBytes(); + + /** + * + * + *
+   * Action triggering access control operations.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.AccessControlAction access_control = 2; + * + * @return Whether the accessControl field is set. + */ + boolean hasAccessControl(); + /** + * + * + *
+   * Action triggering access control operations.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.AccessControlAction access_control = 2; + * + * @return The accessControl. + */ + com.google.cloud.contentwarehouse.v1.AccessControlAction getAccessControl(); + /** + * + * + *
+   * Action triggering access control operations.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.AccessControlAction access_control = 2; + */ + com.google.cloud.contentwarehouse.v1.AccessControlActionOrBuilder getAccessControlOrBuilder(); + + /** + * + * + *
+   * Action triggering data validation operations.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.DataValidationAction data_validation = 3; + * + * @return Whether the dataValidation field is set. + */ + boolean hasDataValidation(); + /** + * + * + *
+   * Action triggering data validation operations.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.DataValidationAction data_validation = 3; + * + * @return The dataValidation. + */ + com.google.cloud.contentwarehouse.v1.DataValidationAction getDataValidation(); + /** + * + * + *
+   * Action triggering data validation operations.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.DataValidationAction data_validation = 3; + */ + com.google.cloud.contentwarehouse.v1.DataValidationActionOrBuilder getDataValidationOrBuilder(); + + /** + * + * + *
+   * Action triggering data update operations.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.DataUpdateAction data_update = 4; + * + * @return Whether the dataUpdate field is set. + */ + boolean hasDataUpdate(); + /** + * + * + *
+   * Action triggering data update operations.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.DataUpdateAction data_update = 4; + * + * @return The dataUpdate. + */ + com.google.cloud.contentwarehouse.v1.DataUpdateAction getDataUpdate(); + /** + * + * + *
+   * Action triggering data update operations.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.DataUpdateAction data_update = 4; + */ + com.google.cloud.contentwarehouse.v1.DataUpdateActionOrBuilder getDataUpdateOrBuilder(); + + /** + * + * + *
+   * Action triggering create document link operation.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.AddToFolderAction add_to_folder = 5; + * + * @return Whether the addToFolder field is set. + */ + boolean hasAddToFolder(); + /** + * + * + *
+   * Action triggering create document link operation.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.AddToFolderAction add_to_folder = 5; + * + * @return The addToFolder. + */ + com.google.cloud.contentwarehouse.v1.AddToFolderAction getAddToFolder(); + /** + * + * + *
+   * Action triggering create document link operation.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.AddToFolderAction add_to_folder = 5; + */ + com.google.cloud.contentwarehouse.v1.AddToFolderActionOrBuilder getAddToFolderOrBuilder(); + + /** + * + * + *
+   * Action publish to Pub/Sub operation.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.PublishAction publish_to_pub_sub = 6; + * + * @return Whether the publishToPubSub field is set. + */ + boolean hasPublishToPubSub(); + /** + * + * + *
+   * Action publish to Pub/Sub operation.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.PublishAction publish_to_pub_sub = 6; + * + * @return The publishToPubSub. + */ + com.google.cloud.contentwarehouse.v1.PublishAction getPublishToPubSub(); + /** + * + * + *
+   * Action publish to Pub/Sub operation.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.PublishAction publish_to_pub_sub = 6; + */ + com.google.cloud.contentwarehouse.v1.PublishActionOrBuilder getPublishToPubSubOrBuilder(); + + /** + * + * + *
+   * Action removing a document from a folder.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RemoveFromFolderAction remove_from_folder_action = 9; + * + * + * @return Whether the removeFromFolderAction field is set. + */ + boolean hasRemoveFromFolderAction(); + /** + * + * + *
+   * Action removing a document from a folder.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RemoveFromFolderAction remove_from_folder_action = 9; + * + * + * @return The removeFromFolderAction. + */ + com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction getRemoveFromFolderAction(); + /** + * + * + *
+   * Action removing a document from a folder.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RemoveFromFolderAction remove_from_folder_action = 9; + * + */ + com.google.cloud.contentwarehouse.v1.RemoveFromFolderActionOrBuilder + getRemoveFromFolderActionOrBuilder(); + + /** + * + * + *
+   * Action deleting the document.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.DeleteDocumentAction delete_document_action = 10; + * + * + * @return Whether the deleteDocumentAction field is set. + */ + boolean hasDeleteDocumentAction(); + /** + * + * + *
+   * Action deleting the document.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.DeleteDocumentAction delete_document_action = 10; + * + * + * @return The deleteDocumentAction. + */ + com.google.cloud.contentwarehouse.v1.DeleteDocumentAction getDeleteDocumentAction(); + /** + * + * + *
+   * Action deleting the document.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.DeleteDocumentAction delete_document_action = 10; + * + */ + com.google.cloud.contentwarehouse.v1.DeleteDocumentActionOrBuilder + getDeleteDocumentActionOrBuilder(); + + public com.google.cloud.contentwarehouse.v1.Action.ActionCase getActionCase(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ActionOutput.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ActionOutput.java new file mode 100644 index 000000000000..1841ded02cff --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ActionOutput.java @@ -0,0 +1,1135 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/rule_engine.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Represents the result of executing an action.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.ActionOutput} + */ +public final class ActionOutput extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.ActionOutput) + ActionOutputOrBuilder { + private static final long serialVersionUID = 0L; + // Use ActionOutput.newBuilder() to construct. + private ActionOutput(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ActionOutput() { + actionId_ = ""; + actionState_ = 0; + outputMessage_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ActionOutput(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_ActionOutput_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_ActionOutput_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.ActionOutput.class, + com.google.cloud.contentwarehouse.v1.ActionOutput.Builder.class); + } + + /** + * + * + *
+   * Represents execution state of the action.
+   * 
+ * + * Protobuf enum {@code google.cloud.contentwarehouse.v1.ActionOutput.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** UNKNOWN = 0; */ + UNKNOWN(0), + /** + * + * + *
+     * State indicating action executed successfully.
+     * 
+ * + * ACTION_SUCCEEDED = 1; + */ + ACTION_SUCCEEDED(1), + /** + * + * + *
+     * State indicating action failed.
+     * 
+ * + * ACTION_FAILED = 2; + */ + ACTION_FAILED(2), + /** + * + * + *
+     * State indicating action timed out.
+     * 
+ * + * ACTION_TIMED_OUT = 3; + */ + ACTION_TIMED_OUT(3), + /** + * + * + *
+     * State indicating action is pending.
+     * 
+ * + * ACTION_PENDING = 4; + */ + ACTION_PENDING(4), + UNRECOGNIZED(-1), + ; + + /** UNKNOWN = 0; */ + public static final int UNKNOWN_VALUE = 0; + /** + * + * + *
+     * State indicating action executed successfully.
+     * 
+ * + * ACTION_SUCCEEDED = 1; + */ + public static final int ACTION_SUCCEEDED_VALUE = 1; + /** + * + * + *
+     * State indicating action failed.
+     * 
+ * + * ACTION_FAILED = 2; + */ + public static final int ACTION_FAILED_VALUE = 2; + /** + * + * + *
+     * State indicating action timed out.
+     * 
+ * + * ACTION_TIMED_OUT = 3; + */ + public static final int ACTION_TIMED_OUT_VALUE = 3; + /** + * + * + *
+     * State indicating action is pending.
+     * 
+ * + * ACTION_PENDING = 4; + */ + public static final int ACTION_PENDING_VALUE = 4; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static State valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static State forNumber(int value) { + switch (value) { + case 0: + return UNKNOWN; + case 1: + return ACTION_SUCCEEDED; + case 2: + return ACTION_FAILED; + case 3: + return ACTION_TIMED_OUT; + case 4: + return ACTION_PENDING; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public State findValueByNumber(int number) { + return State.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.ActionOutput.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final State[] VALUES = values(); + + public static State valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.contentwarehouse.v1.ActionOutput.State) + } + + public static final int ACTION_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object actionId_; + /** + * + * + *
+   * ID of the action.
+   * 
+ * + * string action_id = 1; + * + * @return The actionId. + */ + @java.lang.Override + public java.lang.String getActionId() { + java.lang.Object ref = actionId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + actionId_ = s; + return s; + } + } + /** + * + * + *
+   * ID of the action.
+   * 
+ * + * string action_id = 1; + * + * @return The bytes for actionId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getActionIdBytes() { + java.lang.Object ref = actionId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + actionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ACTION_STATE_FIELD_NUMBER = 2; + private int actionState_; + /** + * + * + *
+   * State of an action.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.ActionOutput.State action_state = 2; + * + * @return The enum numeric value on the wire for actionState. + */ + @java.lang.Override + public int getActionStateValue() { + return actionState_; + } + /** + * + * + *
+   * State of an action.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.ActionOutput.State action_state = 2; + * + * @return The actionState. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ActionOutput.State getActionState() { + @SuppressWarnings("deprecation") + com.google.cloud.contentwarehouse.v1.ActionOutput.State result = + com.google.cloud.contentwarehouse.v1.ActionOutput.State.valueOf(actionState_); + return result == null + ? com.google.cloud.contentwarehouse.v1.ActionOutput.State.UNRECOGNIZED + : result; + } + + public static final int OUTPUT_MESSAGE_FIELD_NUMBER = 3; + private volatile java.lang.Object outputMessage_; + /** + * + * + *
+   * Action execution output message.
+   * 
+ * + * string output_message = 3; + * + * @return The outputMessage. + */ + @java.lang.Override + public java.lang.String getOutputMessage() { + java.lang.Object ref = outputMessage_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + outputMessage_ = s; + return s; + } + } + /** + * + * + *
+   * Action execution output message.
+   * 
+ * + * string output_message = 3; + * + * @return The bytes for outputMessage. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOutputMessageBytes() { + java.lang.Object ref = outputMessage_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + outputMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(actionId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, actionId_); + } + if (actionState_ + != com.google.cloud.contentwarehouse.v1.ActionOutput.State.UNKNOWN.getNumber()) { + output.writeEnum(2, actionState_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(outputMessage_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, outputMessage_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(actionId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, actionId_); + } + if (actionState_ + != com.google.cloud.contentwarehouse.v1.ActionOutput.State.UNKNOWN.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, actionState_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(outputMessage_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, outputMessage_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.ActionOutput)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.ActionOutput other = + (com.google.cloud.contentwarehouse.v1.ActionOutput) obj; + + if (!getActionId().equals(other.getActionId())) return false; + if (actionState_ != other.actionState_) return false; + if (!getOutputMessage().equals(other.getOutputMessage())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ACTION_ID_FIELD_NUMBER; + hash = (53 * hash) + getActionId().hashCode(); + hash = (37 * hash) + ACTION_STATE_FIELD_NUMBER; + hash = (53 * hash) + actionState_; + hash = (37 * hash) + OUTPUT_MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getOutputMessage().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.ActionOutput parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.ActionOutput parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ActionOutput parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.ActionOutput parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ActionOutput parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.ActionOutput parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ActionOutput parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.ActionOutput parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ActionOutput parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.ActionOutput parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ActionOutput parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.ActionOutput parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.contentwarehouse.v1.ActionOutput prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Represents the result of executing an action.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.ActionOutput} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.ActionOutput) + com.google.cloud.contentwarehouse.v1.ActionOutputOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_ActionOutput_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_ActionOutput_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.ActionOutput.class, + com.google.cloud.contentwarehouse.v1.ActionOutput.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.ActionOutput.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + actionId_ = ""; + + actionState_ = 0; + + outputMessage_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_ActionOutput_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ActionOutput getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.ActionOutput.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ActionOutput build() { + com.google.cloud.contentwarehouse.v1.ActionOutput result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ActionOutput buildPartial() { + com.google.cloud.contentwarehouse.v1.ActionOutput result = + new com.google.cloud.contentwarehouse.v1.ActionOutput(this); + result.actionId_ = actionId_; + result.actionState_ = actionState_; + result.outputMessage_ = outputMessage_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.ActionOutput) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.ActionOutput) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.ActionOutput other) { + if (other == com.google.cloud.contentwarehouse.v1.ActionOutput.getDefaultInstance()) + return this; + if (!other.getActionId().isEmpty()) { + actionId_ = other.actionId_; + onChanged(); + } + if (other.actionState_ != 0) { + setActionStateValue(other.getActionStateValue()); + } + if (!other.getOutputMessage().isEmpty()) { + outputMessage_ = other.outputMessage_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + actionId_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 16: + { + actionState_ = input.readEnum(); + + break; + } // case 16 + case 26: + { + outputMessage_ = input.readStringRequireUtf8(); + + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object actionId_ = ""; + /** + * + * + *
+     * ID of the action.
+     * 
+ * + * string action_id = 1; + * + * @return The actionId. + */ + public java.lang.String getActionId() { + java.lang.Object ref = actionId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + actionId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * ID of the action.
+     * 
+ * + * string action_id = 1; + * + * @return The bytes for actionId. + */ + public com.google.protobuf.ByteString getActionIdBytes() { + java.lang.Object ref = actionId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + actionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * ID of the action.
+     * 
+ * + * string action_id = 1; + * + * @param value The actionId to set. + * @return This builder for chaining. + */ + public Builder setActionId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + actionId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * ID of the action.
+     * 
+ * + * string action_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearActionId() { + + actionId_ = getDefaultInstance().getActionId(); + onChanged(); + return this; + } + /** + * + * + *
+     * ID of the action.
+     * 
+ * + * string action_id = 1; + * + * @param value The bytes for actionId to set. + * @return This builder for chaining. + */ + public Builder setActionIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + actionId_ = value; + onChanged(); + return this; + } + + private int actionState_ = 0; + /** + * + * + *
+     * State of an action.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ActionOutput.State action_state = 2; + * + * @return The enum numeric value on the wire for actionState. + */ + @java.lang.Override + public int getActionStateValue() { + return actionState_; + } + /** + * + * + *
+     * State of an action.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ActionOutput.State action_state = 2; + * + * @param value The enum numeric value on the wire for actionState to set. + * @return This builder for chaining. + */ + public Builder setActionStateValue(int value) { + + actionState_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * State of an action.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ActionOutput.State action_state = 2; + * + * @return The actionState. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ActionOutput.State getActionState() { + @SuppressWarnings("deprecation") + com.google.cloud.contentwarehouse.v1.ActionOutput.State result = + com.google.cloud.contentwarehouse.v1.ActionOutput.State.valueOf(actionState_); + return result == null + ? com.google.cloud.contentwarehouse.v1.ActionOutput.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * State of an action.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ActionOutput.State action_state = 2; + * + * @param value The actionState to set. + * @return This builder for chaining. + */ + public Builder setActionState(com.google.cloud.contentwarehouse.v1.ActionOutput.State value) { + if (value == null) { + throw new NullPointerException(); + } + + actionState_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * State of an action.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ActionOutput.State action_state = 2; + * + * @return This builder for chaining. + */ + public Builder clearActionState() { + + actionState_ = 0; + onChanged(); + return this; + } + + private java.lang.Object outputMessage_ = ""; + /** + * + * + *
+     * Action execution output message.
+     * 
+ * + * string output_message = 3; + * + * @return The outputMessage. + */ + public java.lang.String getOutputMessage() { + java.lang.Object ref = outputMessage_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + outputMessage_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Action execution output message.
+     * 
+ * + * string output_message = 3; + * + * @return The bytes for outputMessage. + */ + public com.google.protobuf.ByteString getOutputMessageBytes() { + java.lang.Object ref = outputMessage_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + outputMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Action execution output message.
+     * 
+ * + * string output_message = 3; + * + * @param value The outputMessage to set. + * @return This builder for chaining. + */ + public Builder setOutputMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + outputMessage_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Action execution output message.
+     * 
+ * + * string output_message = 3; + * + * @return This builder for chaining. + */ + public Builder clearOutputMessage() { + + outputMessage_ = getDefaultInstance().getOutputMessage(); + onChanged(); + return this; + } + /** + * + * + *
+     * Action execution output message.
+     * 
+ * + * string output_message = 3; + * + * @param value The bytes for outputMessage to set. + * @return This builder for chaining. + */ + public Builder setOutputMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + outputMessage_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.ActionOutput) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.ActionOutput) + private static final com.google.cloud.contentwarehouse.v1.ActionOutput DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.ActionOutput(); + } + + public static com.google.cloud.contentwarehouse.v1.ActionOutput getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ActionOutput parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ActionOutput getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ActionOutputOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ActionOutputOrBuilder.java new file mode 100644 index 000000000000..d3be73972ce0 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ActionOutputOrBuilder.java @@ -0,0 +1,100 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/rule_engine.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface ActionOutputOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.ActionOutput) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * ID of the action.
+   * 
+ * + * string action_id = 1; + * + * @return The actionId. + */ + java.lang.String getActionId(); + /** + * + * + *
+   * ID of the action.
+   * 
+ * + * string action_id = 1; + * + * @return The bytes for actionId. + */ + com.google.protobuf.ByteString getActionIdBytes(); + + /** + * + * + *
+   * State of an action.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.ActionOutput.State action_state = 2; + * + * @return The enum numeric value on the wire for actionState. + */ + int getActionStateValue(); + /** + * + * + *
+   * State of an action.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.ActionOutput.State action_state = 2; + * + * @return The actionState. + */ + com.google.cloud.contentwarehouse.v1.ActionOutput.State getActionState(); + + /** + * + * + *
+   * Action execution output message.
+   * 
+ * + * string output_message = 3; + * + * @return The outputMessage. + */ + java.lang.String getOutputMessage(); + /** + * + * + *
+   * Action execution output message.
+   * 
+ * + * string output_message = 3; + * + * @return The bytes for outputMessage. + */ + com.google.protobuf.ByteString getOutputMessageBytes(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/AddToFolderAction.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/AddToFolderAction.java new file mode 100644 index 000000000000..0620292bd4c5 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/AddToFolderAction.java @@ -0,0 +1,737 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/rule_engine.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Represents the action responsible for adding document under a folder.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.AddToFolderAction} + */ +public final class AddToFolderAction extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.AddToFolderAction) + AddToFolderActionOrBuilder { + private static final long serialVersionUID = 0L; + // Use AddToFolderAction.newBuilder() to construct. + private AddToFolderAction(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AddToFolderAction() { + folders_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AddToFolderAction(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_AddToFolderAction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_AddToFolderAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.AddToFolderAction.class, + com.google.cloud.contentwarehouse.v1.AddToFolderAction.Builder.class); + } + + public static final int FOLDERS_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList folders_; + /** + * + * + *
+   * Names of the folder under which new document is to be added.
+   * Format:
+   * projects/{project_number}/locations/{location}/documents/{document_id}.
+   * 
+ * + * repeated string folders = 1 [(.google.api.resource_reference) = { ... } + * + * @return A list containing the folders. + */ + public com.google.protobuf.ProtocolStringList getFoldersList() { + return folders_; + } + /** + * + * + *
+   * Names of the folder under which new document is to be added.
+   * Format:
+   * projects/{project_number}/locations/{location}/documents/{document_id}.
+   * 
+ * + * repeated string folders = 1 [(.google.api.resource_reference) = { ... } + * + * @return The count of folders. + */ + public int getFoldersCount() { + return folders_.size(); + } + /** + * + * + *
+   * Names of the folder under which new document is to be added.
+   * Format:
+   * projects/{project_number}/locations/{location}/documents/{document_id}.
+   * 
+ * + * repeated string folders = 1 [(.google.api.resource_reference) = { ... } + * + * @param index The index of the element to return. + * @return The folders at the given index. + */ + public java.lang.String getFolders(int index) { + return folders_.get(index); + } + /** + * + * + *
+   * Names of the folder under which new document is to be added.
+   * Format:
+   * projects/{project_number}/locations/{location}/documents/{document_id}.
+   * 
+ * + * repeated string folders = 1 [(.google.api.resource_reference) = { ... } + * + * @param index The index of the value to return. + * @return The bytes of the folders at the given index. + */ + public com.google.protobuf.ByteString getFoldersBytes(int index) { + return folders_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < folders_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, folders_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < folders_.size(); i++) { + dataSize += computeStringSizeNoTag(folders_.getRaw(i)); + } + size += dataSize; + size += 1 * getFoldersList().size(); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.AddToFolderAction)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.AddToFolderAction other = + (com.google.cloud.contentwarehouse.v1.AddToFolderAction) obj; + + if (!getFoldersList().equals(other.getFoldersList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getFoldersCount() > 0) { + hash = (37 * hash) + FOLDERS_FIELD_NUMBER; + hash = (53 * hash) + getFoldersList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.AddToFolderAction parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.AddToFolderAction parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.AddToFolderAction parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.AddToFolderAction parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.AddToFolderAction parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.AddToFolderAction parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.AddToFolderAction parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.AddToFolderAction parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.AddToFolderAction parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.AddToFolderAction parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.AddToFolderAction parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.AddToFolderAction parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.AddToFolderAction prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Represents the action responsible for adding document under a folder.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.AddToFolderAction} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.AddToFolderAction) + com.google.cloud.contentwarehouse.v1.AddToFolderActionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_AddToFolderAction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_AddToFolderAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.AddToFolderAction.class, + com.google.cloud.contentwarehouse.v1.AddToFolderAction.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.AddToFolderAction.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + folders_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_AddToFolderAction_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.AddToFolderAction getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.AddToFolderAction.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.AddToFolderAction build() { + com.google.cloud.contentwarehouse.v1.AddToFolderAction result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.AddToFolderAction buildPartial() { + com.google.cloud.contentwarehouse.v1.AddToFolderAction result = + new com.google.cloud.contentwarehouse.v1.AddToFolderAction(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + folders_ = folders_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.folders_ = folders_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.AddToFolderAction) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.AddToFolderAction) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.AddToFolderAction other) { + if (other == com.google.cloud.contentwarehouse.v1.AddToFolderAction.getDefaultInstance()) + return this; + if (!other.folders_.isEmpty()) { + if (folders_.isEmpty()) { + folders_ = other.folders_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureFoldersIsMutable(); + folders_.addAll(other.folders_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureFoldersIsMutable(); + folders_.add(s); + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList folders_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureFoldersIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + folders_ = new com.google.protobuf.LazyStringArrayList(folders_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * Names of the folder under which new document is to be added.
+     * Format:
+     * projects/{project_number}/locations/{location}/documents/{document_id}.
+     * 
+ * + * repeated string folders = 1 [(.google.api.resource_reference) = { ... } + * + * @return A list containing the folders. + */ + public com.google.protobuf.ProtocolStringList getFoldersList() { + return folders_.getUnmodifiableView(); + } + /** + * + * + *
+     * Names of the folder under which new document is to be added.
+     * Format:
+     * projects/{project_number}/locations/{location}/documents/{document_id}.
+     * 
+ * + * repeated string folders = 1 [(.google.api.resource_reference) = { ... } + * + * @return The count of folders. + */ + public int getFoldersCount() { + return folders_.size(); + } + /** + * + * + *
+     * Names of the folder under which new document is to be added.
+     * Format:
+     * projects/{project_number}/locations/{location}/documents/{document_id}.
+     * 
+ * + * repeated string folders = 1 [(.google.api.resource_reference) = { ... } + * + * @param index The index of the element to return. + * @return The folders at the given index. + */ + public java.lang.String getFolders(int index) { + return folders_.get(index); + } + /** + * + * + *
+     * Names of the folder under which new document is to be added.
+     * Format:
+     * projects/{project_number}/locations/{location}/documents/{document_id}.
+     * 
+ * + * repeated string folders = 1 [(.google.api.resource_reference) = { ... } + * + * @param index The index of the value to return. + * @return The bytes of the folders at the given index. + */ + public com.google.protobuf.ByteString getFoldersBytes(int index) { + return folders_.getByteString(index); + } + /** + * + * + *
+     * Names of the folder under which new document is to be added.
+     * Format:
+     * projects/{project_number}/locations/{location}/documents/{document_id}.
+     * 
+ * + * repeated string folders = 1 [(.google.api.resource_reference) = { ... } + * + * @param index The index to set the value at. + * @param value The folders to set. + * @return This builder for chaining. + */ + public Builder setFolders(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureFoldersIsMutable(); + folders_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Names of the folder under which new document is to be added.
+     * Format:
+     * projects/{project_number}/locations/{location}/documents/{document_id}.
+     * 
+ * + * repeated string folders = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The folders to add. + * @return This builder for chaining. + */ + public Builder addFolders(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureFoldersIsMutable(); + folders_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Names of the folder under which new document is to be added.
+     * Format:
+     * projects/{project_number}/locations/{location}/documents/{document_id}.
+     * 
+ * + * repeated string folders = 1 [(.google.api.resource_reference) = { ... } + * + * @param values The folders to add. + * @return This builder for chaining. + */ + public Builder addAllFolders(java.lang.Iterable values) { + ensureFoldersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, folders_); + onChanged(); + return this; + } + /** + * + * + *
+     * Names of the folder under which new document is to be added.
+     * Format:
+     * projects/{project_number}/locations/{location}/documents/{document_id}.
+     * 
+ * + * repeated string folders = 1 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearFolders() { + folders_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Names of the folder under which new document is to be added.
+     * Format:
+     * projects/{project_number}/locations/{location}/documents/{document_id}.
+     * 
+ * + * repeated string folders = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes of the folders to add. + * @return This builder for chaining. + */ + public Builder addFoldersBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureFoldersIsMutable(); + folders_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.AddToFolderAction) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.AddToFolderAction) + private static final com.google.cloud.contentwarehouse.v1.AddToFolderAction DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.AddToFolderAction(); + } + + public static com.google.cloud.contentwarehouse.v1.AddToFolderAction getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AddToFolderAction parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.AddToFolderAction getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/AddToFolderActionOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/AddToFolderActionOrBuilder.java new file mode 100644 index 000000000000..b9e79c06472c --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/AddToFolderActionOrBuilder.java @@ -0,0 +1,84 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/rule_engine.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface AddToFolderActionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.AddToFolderAction) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Names of the folder under which new document is to be added.
+   * Format:
+   * projects/{project_number}/locations/{location}/documents/{document_id}.
+   * 
+ * + * repeated string folders = 1 [(.google.api.resource_reference) = { ... } + * + * @return A list containing the folders. + */ + java.util.List getFoldersList(); + /** + * + * + *
+   * Names of the folder under which new document is to be added.
+   * Format:
+   * projects/{project_number}/locations/{location}/documents/{document_id}.
+   * 
+ * + * repeated string folders = 1 [(.google.api.resource_reference) = { ... } + * + * @return The count of folders. + */ + int getFoldersCount(); + /** + * + * + *
+   * Names of the folder under which new document is to be added.
+   * Format:
+   * projects/{project_number}/locations/{location}/documents/{document_id}.
+   * 
+ * + * repeated string folders = 1 [(.google.api.resource_reference) = { ... } + * + * @param index The index of the element to return. + * @return The folders at the given index. + */ + java.lang.String getFolders(int index); + /** + * + * + *
+   * Names of the folder under which new document is to be added.
+   * Format:
+   * projects/{project_number}/locations/{location}/documents/{document_id}.
+   * 
+ * + * repeated string folders = 1 [(.google.api.resource_reference) = { ... } + * + * @param index The index of the value to return. + * @return The bytes of the folders at the given index. + */ + com.google.protobuf.ByteString getFoldersBytes(int index); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/AsyncDocumentServiceRequestProto.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/AsyncDocumentServiceRequestProto.java new file mode 100644 index 000000000000..17e08941c7ba --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/AsyncDocumentServiceRequestProto.java @@ -0,0 +1,82 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/async_document_service_request.proto + +package com.google.cloud.contentwarehouse.v1; + +public final class AsyncDocumentServiceRequestProto { + private AsyncDocumentServiceRequestProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_CreateDocumentMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_CreateDocumentMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_UpdateDocumentMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_UpdateDocumentMetadata_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\nEgoogle/cloud/contentwarehouse/v1/async" + + "_document_service_request.proto\022 google." + + "cloud.contentwarehouse.v1\032\037google/api/fi" + + "eld_behavior.proto\032\031google/api/resource." + + "proto\"\030\n\026CreateDocumentMetadata\"\030\n\026Updat" + + "eDocumentMetadataB\234\001\n$com.google.cloud.c" + + "ontentwarehouse.v1B AsyncDocumentService" + + "RequestProtoP\001ZPgoogle.golang.org/genpro" + + "to/googleapis/cloud/contentwarehouse/v1;" + + "contentwarehouseb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + }); + internal_static_google_cloud_contentwarehouse_v1_CreateDocumentMetadata_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_contentwarehouse_v1_CreateDocumentMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_CreateDocumentMetadata_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_contentwarehouse_v1_UpdateDocumentMetadata_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_contentwarehouse_v1_UpdateDocumentMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_UpdateDocumentMetadata_descriptor, + new java.lang.String[] {}); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/CloudAIDocumentOption.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/CloudAIDocumentOption.java new file mode 100644 index 000000000000..1d8856cb5d1b --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/CloudAIDocumentOption.java @@ -0,0 +1,884 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_service_request.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Request Option for processing Cloud AI Document in CW Document.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.CloudAIDocumentOption} + */ +public final class CloudAIDocumentOption extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.CloudAIDocumentOption) + CloudAIDocumentOptionOrBuilder { + private static final long serialVersionUID = 0L; + // Use CloudAIDocumentOption.newBuilder() to construct. + private CloudAIDocumentOption(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CloudAIDocumentOption() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CloudAIDocumentOption(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_CloudAIDocumentOption_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetCustomizedEntitiesPropertiesConversions(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_CloudAIDocumentOption_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption.class, + com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption.Builder.class); + } + + public static final int ENABLE_ENTITIES_CONVERSIONS_FIELD_NUMBER = 1; + private boolean enableEntitiesConversions_; + /** + * + * + *
+   * Whether to convert all the entities to properties.
+   * 
+ * + * bool enable_entities_conversions = 1; + * + * @return The enableEntitiesConversions. + */ + @java.lang.Override + public boolean getEnableEntitiesConversions() { + return enableEntitiesConversions_; + } + + public static final int CUSTOMIZED_ENTITIES_PROPERTIES_CONVERSIONS_FIELD_NUMBER = 2; + + private static final class CustomizedEntitiesPropertiesConversionsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.contentwarehouse.v1.DocumentServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_CloudAIDocumentOption_CustomizedEntitiesPropertiesConversionsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField + customizedEntitiesPropertiesConversions_; + + private com.google.protobuf.MapField + internalGetCustomizedEntitiesPropertiesConversions() { + if (customizedEntitiesPropertiesConversions_ == null) { + return com.google.protobuf.MapField.emptyMapField( + CustomizedEntitiesPropertiesConversionsDefaultEntryHolder.defaultEntry); + } + return customizedEntitiesPropertiesConversions_; + } + + public int getCustomizedEntitiesPropertiesConversionsCount() { + return internalGetCustomizedEntitiesPropertiesConversions().getMap().size(); + } + /** + * + * + *
+   * If set, only selected entities will be converted to properties.
+   * 
+ * + * map<string, string> customized_entities_properties_conversions = 2; + */ + @java.lang.Override + public boolean containsCustomizedEntitiesPropertiesConversions(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetCustomizedEntitiesPropertiesConversions().getMap().containsKey(key); + } + /** Use {@link #getCustomizedEntitiesPropertiesConversionsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getCustomizedEntitiesPropertiesConversions() { + return getCustomizedEntitiesPropertiesConversionsMap(); + } + /** + * + * + *
+   * If set, only selected entities will be converted to properties.
+   * 
+ * + * map<string, string> customized_entities_properties_conversions = 2; + */ + @java.lang.Override + public java.util.Map + getCustomizedEntitiesPropertiesConversionsMap() { + return internalGetCustomizedEntitiesPropertiesConversions().getMap(); + } + /** + * + * + *
+   * If set, only selected entities will be converted to properties.
+   * 
+ * + * map<string, string> customized_entities_properties_conversions = 2; + */ + @java.lang.Override + public java.lang.String getCustomizedEntitiesPropertiesConversionsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetCustomizedEntitiesPropertiesConversions().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * If set, only selected entities will be converted to properties.
+   * 
+ * + * map<string, string> customized_entities_properties_conversions = 2; + */ + @java.lang.Override + public java.lang.String getCustomizedEntitiesPropertiesConversionsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetCustomizedEntitiesPropertiesConversions().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (enableEntitiesConversions_ != false) { + output.writeBool(1, enableEntitiesConversions_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, + internalGetCustomizedEntitiesPropertiesConversions(), + CustomizedEntitiesPropertiesConversionsDefaultEntryHolder.defaultEntry, + 2); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (enableEntitiesConversions_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, enableEntitiesConversions_); + } + for (java.util.Map.Entry entry : + internalGetCustomizedEntitiesPropertiesConversions().getMap().entrySet()) { + com.google.protobuf.MapEntry + customizedEntitiesPropertiesConversions__ = + CustomizedEntitiesPropertiesConversionsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, customizedEntitiesPropertiesConversions__); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption other = + (com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption) obj; + + if (getEnableEntitiesConversions() != other.getEnableEntitiesConversions()) return false; + if (!internalGetCustomizedEntitiesPropertiesConversions() + .equals(other.internalGetCustomizedEntitiesPropertiesConversions())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ENABLE_ENTITIES_CONVERSIONS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnableEntitiesConversions()); + if (!internalGetCustomizedEntitiesPropertiesConversions().getMap().isEmpty()) { + hash = (37 * hash) + CUSTOMIZED_ENTITIES_PROPERTIES_CONVERSIONS_FIELD_NUMBER; + hash = (53 * hash) + internalGetCustomizedEntitiesPropertiesConversions().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request Option for processing Cloud AI Document in CW Document.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.CloudAIDocumentOption} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.CloudAIDocumentOption) + com.google.cloud.contentwarehouse.v1.CloudAIDocumentOptionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_CloudAIDocumentOption_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetCustomizedEntitiesPropertiesConversions(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 2: + return internalGetMutableCustomizedEntitiesPropertiesConversions(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_CloudAIDocumentOption_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption.class, + com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + enableEntitiesConversions_ = false; + + internalGetMutableCustomizedEntitiesPropertiesConversions().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_CloudAIDocumentOption_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption build() { + com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption buildPartial() { + com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption result = + new com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption(this); + int from_bitField0_ = bitField0_; + result.enableEntitiesConversions_ = enableEntitiesConversions_; + result.customizedEntitiesPropertiesConversions_ = + internalGetCustomizedEntitiesPropertiesConversions(); + result.customizedEntitiesPropertiesConversions_.makeImmutable(); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption other) { + if (other == com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption.getDefaultInstance()) + return this; + if (other.getEnableEntitiesConversions() != false) { + setEnableEntitiesConversions(other.getEnableEntitiesConversions()); + } + internalGetMutableCustomizedEntitiesPropertiesConversions() + .mergeFrom(other.internalGetCustomizedEntitiesPropertiesConversions()); + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + enableEntitiesConversions_ = input.readBool(); + + break; + } // case 8 + case 18: + { + com.google.protobuf.MapEntry + customizedEntitiesPropertiesConversions__ = + input.readMessage( + CustomizedEntitiesPropertiesConversionsDefaultEntryHolder.defaultEntry + .getParserForType(), + extensionRegistry); + internalGetMutableCustomizedEntitiesPropertiesConversions() + .getMutableMap() + .put( + customizedEntitiesPropertiesConversions__.getKey(), + customizedEntitiesPropertiesConversions__.getValue()); + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private boolean enableEntitiesConversions_; + /** + * + * + *
+     * Whether to convert all the entities to properties.
+     * 
+ * + * bool enable_entities_conversions = 1; + * + * @return The enableEntitiesConversions. + */ + @java.lang.Override + public boolean getEnableEntitiesConversions() { + return enableEntitiesConversions_; + } + /** + * + * + *
+     * Whether to convert all the entities to properties.
+     * 
+ * + * bool enable_entities_conversions = 1; + * + * @param value The enableEntitiesConversions to set. + * @return This builder for chaining. + */ + public Builder setEnableEntitiesConversions(boolean value) { + + enableEntitiesConversions_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether to convert all the entities to properties.
+     * 
+ * + * bool enable_entities_conversions = 1; + * + * @return This builder for chaining. + */ + public Builder clearEnableEntitiesConversions() { + + enableEntitiesConversions_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.MapField + customizedEntitiesPropertiesConversions_; + + private com.google.protobuf.MapField + internalGetCustomizedEntitiesPropertiesConversions() { + if (customizedEntitiesPropertiesConversions_ == null) { + return com.google.protobuf.MapField.emptyMapField( + CustomizedEntitiesPropertiesConversionsDefaultEntryHolder.defaultEntry); + } + return customizedEntitiesPropertiesConversions_; + } + + private com.google.protobuf.MapField + internalGetMutableCustomizedEntitiesPropertiesConversions() { + onChanged(); + ; + if (customizedEntitiesPropertiesConversions_ == null) { + customizedEntitiesPropertiesConversions_ = + com.google.protobuf.MapField.newMapField( + CustomizedEntitiesPropertiesConversionsDefaultEntryHolder.defaultEntry); + } + if (!customizedEntitiesPropertiesConversions_.isMutable()) { + customizedEntitiesPropertiesConversions_ = customizedEntitiesPropertiesConversions_.copy(); + } + return customizedEntitiesPropertiesConversions_; + } + + public int getCustomizedEntitiesPropertiesConversionsCount() { + return internalGetCustomizedEntitiesPropertiesConversions().getMap().size(); + } + /** + * + * + *
+     * If set, only selected entities will be converted to properties.
+     * 
+ * + * map<string, string> customized_entities_properties_conversions = 2; + */ + @java.lang.Override + public boolean containsCustomizedEntitiesPropertiesConversions(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetCustomizedEntitiesPropertiesConversions().getMap().containsKey(key); + } + /** Use {@link #getCustomizedEntitiesPropertiesConversionsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getCustomizedEntitiesPropertiesConversions() { + return getCustomizedEntitiesPropertiesConversionsMap(); + } + /** + * + * + *
+     * If set, only selected entities will be converted to properties.
+     * 
+ * + * map<string, string> customized_entities_properties_conversions = 2; + */ + @java.lang.Override + public java.util.Map + getCustomizedEntitiesPropertiesConversionsMap() { + return internalGetCustomizedEntitiesPropertiesConversions().getMap(); + } + /** + * + * + *
+     * If set, only selected entities will be converted to properties.
+     * 
+ * + * map<string, string> customized_entities_properties_conversions = 2; + */ + @java.lang.Override + public java.lang.String getCustomizedEntitiesPropertiesConversionsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetCustomizedEntitiesPropertiesConversions().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * If set, only selected entities will be converted to properties.
+     * 
+ * + * map<string, string> customized_entities_properties_conversions = 2; + */ + @java.lang.Override + public java.lang.String getCustomizedEntitiesPropertiesConversionsOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetCustomizedEntitiesPropertiesConversions().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearCustomizedEntitiesPropertiesConversions() { + internalGetMutableCustomizedEntitiesPropertiesConversions().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * If set, only selected entities will be converted to properties.
+     * 
+ * + * map<string, string> customized_entities_properties_conversions = 2; + */ + public Builder removeCustomizedEntitiesPropertiesConversions(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableCustomizedEntitiesPropertiesConversions().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableCustomizedEntitiesPropertiesConversions() { + return internalGetMutableCustomizedEntitiesPropertiesConversions().getMutableMap(); + } + /** + * + * + *
+     * If set, only selected entities will be converted to properties.
+     * 
+ * + * map<string, string> customized_entities_properties_conversions = 2; + */ + public Builder putCustomizedEntitiesPropertiesConversions( + java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + + internalGetMutableCustomizedEntitiesPropertiesConversions().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * If set, only selected entities will be converted to properties.
+     * 
+ * + * map<string, string> customized_entities_properties_conversions = 2; + */ + public Builder putAllCustomizedEntitiesPropertiesConversions( + java.util.Map values) { + internalGetMutableCustomizedEntitiesPropertiesConversions().getMutableMap().putAll(values); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.CloudAIDocumentOption) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.CloudAIDocumentOption) + private static final com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption(); + } + + public static com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CloudAIDocumentOption parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/CloudAIDocumentOptionOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/CloudAIDocumentOptionOrBuilder.java new file mode 100644 index 000000000000..c4f6e40fbfcd --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/CloudAIDocumentOptionOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_service_request.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface CloudAIDocumentOptionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.CloudAIDocumentOption) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Whether to convert all the entities to properties.
+   * 
+ * + * bool enable_entities_conversions = 1; + * + * @return The enableEntitiesConversions. + */ + boolean getEnableEntitiesConversions(); + + /** + * + * + *
+   * If set, only selected entities will be converted to properties.
+   * 
+ * + * map<string, string> customized_entities_properties_conversions = 2; + */ + int getCustomizedEntitiesPropertiesConversionsCount(); + /** + * + * + *
+   * If set, only selected entities will be converted to properties.
+   * 
+ * + * map<string, string> customized_entities_properties_conversions = 2; + */ + boolean containsCustomizedEntitiesPropertiesConversions(java.lang.String key); + /** Use {@link #getCustomizedEntitiesPropertiesConversionsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getCustomizedEntitiesPropertiesConversions(); + /** + * + * + *
+   * If set, only selected entities will be converted to properties.
+   * 
+ * + * map<string, string> customized_entities_properties_conversions = 2; + */ + java.util.Map getCustomizedEntitiesPropertiesConversionsMap(); + /** + * + * + *
+   * If set, only selected entities will be converted to properties.
+   * 
+ * + * map<string, string> customized_entities_properties_conversions = 2; + */ + + /* nullable */ + java.lang.String getCustomizedEntitiesPropertiesConversionsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * If set, only selected entities will be converted to properties.
+   * 
+ * + * map<string, string> customized_entities_properties_conversions = 2; + */ + java.lang.String getCustomizedEntitiesPropertiesConversionsOrThrow(java.lang.String key); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/CommonProto.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/CommonProto.java new file mode 100644 index 000000000000..7bee0a98a3d0 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/CommonProto.java @@ -0,0 +1,155 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/common.proto + +package com.google.cloud.contentwarehouse.v1; + +public final class CommonProto { + private CommonProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_RequestMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_RequestMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_ResponseMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_ResponseMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_UserInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_UserInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_UpdateOptions_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_UpdateOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_MergeFieldsOptions_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_MergeFieldsOptions_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n-google/cloud/contentwarehouse/v1/commo" + + "n.proto\022 google.cloud.contentwarehouse.v" + + "1\032\031google/api/resource.proto\032 google/pro" + + "tobuf/field_mask.proto\"P\n\017RequestMetadat" + + "a\022=\n\tuser_info\030\001 \001(\0132*.google.cloud.cont" + + "entwarehouse.v1.UserInfo\"&\n\020ResponseMeta" + + "data\022\022\n\nrequest_id\030\001 \001(\t\")\n\010UserInfo\022\n\n\002" + + "id\030\001 \001(\t\022\021\n\tgroup_ids\030\002 \003(\t\"\327\001\n\rUpdateOp" + + "tions\022A\n\013update_type\030\001 \001(\0162,.google.clou" + + "d.contentwarehouse.v1.UpdateType\022/\n\013upda" + + "te_mask\030\002 \001(\0132\032.google.protobuf.FieldMas" + + "k\022R\n\024merge_fields_options\030\003 \001(\01324.google" + + ".cloud.contentwarehouse.v1.MergeFieldsOp" + + "tions\"\226\001\n\022MergeFieldsOptions\022#\n\026replace_" + + "message_fields\030\001 \001(\010H\000\210\001\001\022$\n\027replace_rep" + + "eated_fields\030\002 \001(\010H\001\210\001\001B\031\n\027_replace_mess" + + "age_fieldsB\032\n\030_replace_repeated_fields*\336" + + "\001\n\nUpdateType\022\033\n\027UPDATE_TYPE_UNSPECIFIED" + + "\020\000\022\027\n\023UPDATE_TYPE_REPLACE\020\001\022\025\n\021UPDATE_TY" + + "PE_MERGE\020\002\022*\n&UPDATE_TYPE_INSERT_PROPERT" + + "IES_BY_NAMES\020\003\022+\n\'UPDATE_TYPE_REPLACE_PR" + + "OPERTIES_BY_NAMES\020\004\022*\n&UPDATE_TYPE_DELET" + + "E_PROPERTIES_BY_NAMES\020\005*O\n\014DatabaseType\022" + + "\016\n\nDB_UNKNOWN\020\000\022\024\n\020DB_INFRA_SPANNER\020\001\022\031\n" + + "\025DB_CLOUD_SQL_POSTGRES\020\002*\252\001\n\021AccessContr" + + "olMode\022\024\n\020ACL_MODE_UNKNOWN\020\000\022\035\n\031ACL_MODE" + + "_UNIVERSAL_ACCESS\020\001\0220\n,ACL_MODE_DOCUMENT" + + "_LEVEL_ACCESS_CONTROL_BYOID\020\002\022.\n*ACL_MOD" + + "E_DOCUMENT_LEVEL_ACCESS_CONTROL_GCI\020\003B\335\001" + + "\n$com.google.cloud.contentwarehouse.v1B\013" + + "CommonProtoP\001ZPgoogle.golang.org/genprot" + + "o/googleapis/cloud/contentwarehouse/v1;c" + + "ontentwarehouse\352AS\n(contentwarehouse.goo" + + "gleapis.com/Location\022\'projects/{project}" + + "/locations/{location}b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.ResourceProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + }); + internal_static_google_cloud_contentwarehouse_v1_RequestMetadata_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_contentwarehouse_v1_RequestMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_RequestMetadata_descriptor, + new java.lang.String[] { + "UserInfo", + }); + internal_static_google_cloud_contentwarehouse_v1_ResponseMetadata_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_contentwarehouse_v1_ResponseMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_ResponseMetadata_descriptor, + new java.lang.String[] { + "RequestId", + }); + internal_static_google_cloud_contentwarehouse_v1_UserInfo_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_contentwarehouse_v1_UserInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_UserInfo_descriptor, + new java.lang.String[] { + "Id", "GroupIds", + }); + internal_static_google_cloud_contentwarehouse_v1_UpdateOptions_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_contentwarehouse_v1_UpdateOptions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_UpdateOptions_descriptor, + new java.lang.String[] { + "UpdateType", "UpdateMask", "MergeFieldsOptions", + }); + internal_static_google_cloud_contentwarehouse_v1_MergeFieldsOptions_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_contentwarehouse_v1_MergeFieldsOptions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_MergeFieldsOptions_descriptor, + new java.lang.String[] { + "ReplaceMessageFields", + "ReplaceRepeatedFields", + "ReplaceMessageFields", + "ReplaceRepeatedFields", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ResourceProto.resourceDefinition); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.ResourceProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/CreateDocumentLinkRequest.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/CreateDocumentLinkRequest.java new file mode 100644 index 000000000000..1aa039f55252 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/CreateDocumentLinkRequest.java @@ -0,0 +1,1232 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_link_service.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Request message for DocumentLinkService.CreateDocumentLink.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest} + */ +public final class CreateDocumentLinkRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest) + CreateDocumentLinkRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateDocumentLinkRequest.newBuilder() to construct. + private CreateDocumentLinkRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateDocumentLinkRequest() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateDocumentLinkRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentLinkServiceProto + .internal_static_google_cloud_contentwarehouse_v1_CreateDocumentLinkRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentLinkServiceProto + .internal_static_google_cloud_contentwarehouse_v1_CreateDocumentLinkRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest.class, + com.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object 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}.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. 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}.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DOCUMENT_LINK_FIELD_NUMBER = 2; + private com.google.cloud.contentwarehouse.v1.DocumentLink documentLink_; + /** + * + * + *
+   * Required. Document links associated with the source documents (source_document_id).
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.DocumentLink document_link = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the documentLink field is set. + */ + @java.lang.Override + public boolean hasDocumentLink() { + return documentLink_ != null; + } + /** + * + * + *
+   * Required. Document links associated with the source documents (source_document_id).
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.DocumentLink document_link = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The documentLink. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DocumentLink getDocumentLink() { + return documentLink_ == null + ? com.google.cloud.contentwarehouse.v1.DocumentLink.getDefaultInstance() + : documentLink_; + } + /** + * + * + *
+   * Required. Document links associated with the source documents (source_document_id).
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.DocumentLink document_link = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DocumentLinkOrBuilder getDocumentLinkOrBuilder() { + return getDocumentLink(); + } + + public static final int REQUEST_METADATA_FIELD_NUMBER = 3; + private com.google.cloud.contentwarehouse.v1.RequestMetadata requestMetadata_; + /** + * + * + *
+   * The meta information collected about the document creator, used to enforce
+   * access control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + * + * @return Whether the requestMetadata field is set. + */ + @java.lang.Override + public boolean hasRequestMetadata() { + return requestMetadata_ != null; + } + /** + * + * + *
+   * The meta information collected about the document creator, used to enforce
+   * access control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + * + * @return The requestMetadata. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RequestMetadata getRequestMetadata() { + return requestMetadata_ == null + ? com.google.cloud.contentwarehouse.v1.RequestMetadata.getDefaultInstance() + : requestMetadata_; + } + /** + * + * + *
+   * The meta information collected about the document creator, used to enforce
+   * access control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder + getRequestMetadataOrBuilder() { + return getRequestMetadata(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (documentLink_ != null) { + output.writeMessage(2, getDocumentLink()); + } + if (requestMetadata_ != null) { + output.writeMessage(3, getRequestMetadata()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (documentLink_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getDocumentLink()); + } + if (requestMetadata_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getRequestMetadata()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest other = + (com.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasDocumentLink() != other.hasDocumentLink()) return false; + if (hasDocumentLink()) { + if (!getDocumentLink().equals(other.getDocumentLink())) return false; + } + if (hasRequestMetadata() != other.hasRequestMetadata()) return false; + if (hasRequestMetadata()) { + if (!getRequestMetadata().equals(other.getRequestMetadata())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasDocumentLink()) { + hash = (37 * hash) + DOCUMENT_LINK_FIELD_NUMBER; + hash = (53 * hash) + getDocumentLink().hashCode(); + } + if (hasRequestMetadata()) { + hash = (37 * hash) + REQUEST_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getRequestMetadata().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for DocumentLinkService.CreateDocumentLink.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest) + com.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentLinkServiceProto + .internal_static_google_cloud_contentwarehouse_v1_CreateDocumentLinkRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentLinkServiceProto + .internal_static_google_cloud_contentwarehouse_v1_CreateDocumentLinkRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest.class, + com.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + if (documentLinkBuilder_ == null) { + documentLink_ = null; + } else { + documentLink_ = null; + documentLinkBuilder_ = null; + } + if (requestMetadataBuilder_ == null) { + requestMetadata_ = null; + } else { + requestMetadata_ = null; + requestMetadataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.DocumentLinkServiceProto + .internal_static_google_cloud_contentwarehouse_v1_CreateDocumentLinkRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest + getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest build() { + com.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest buildPartial() { + com.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest result = + new com.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest(this); + result.parent_ = parent_; + if (documentLinkBuilder_ == null) { + result.documentLink_ = documentLink_; + } else { + result.documentLink_ = documentLinkBuilder_.build(); + } + if (requestMetadataBuilder_ == null) { + result.requestMetadata_ = requestMetadata_; + } else { + result.requestMetadata_ = requestMetadataBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest other) { + if (other + == com.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasDocumentLink()) { + mergeDocumentLink(other.getDocumentLink()); + } + if (other.hasRequestMetadata()) { + mergeRequestMetadata(other.getRequestMetadata()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + input.readMessage(getDocumentLinkFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + case 26: + { + input.readMessage(getRequestMetadataFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object 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}.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. 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}.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. 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}.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. 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}.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. 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}.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private com.google.cloud.contentwarehouse.v1.DocumentLink documentLink_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.DocumentLink, + com.google.cloud.contentwarehouse.v1.DocumentLink.Builder, + com.google.cloud.contentwarehouse.v1.DocumentLinkOrBuilder> + documentLinkBuilder_; + /** + * + * + *
+     * Required. Document links associated with the source documents (source_document_id).
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.DocumentLink document_link = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the documentLink field is set. + */ + public boolean hasDocumentLink() { + return documentLinkBuilder_ != null || documentLink_ != null; + } + /** + * + * + *
+     * Required. Document links associated with the source documents (source_document_id).
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.DocumentLink document_link = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The documentLink. + */ + public com.google.cloud.contentwarehouse.v1.DocumentLink getDocumentLink() { + if (documentLinkBuilder_ == null) { + return documentLink_ == null + ? com.google.cloud.contentwarehouse.v1.DocumentLink.getDefaultInstance() + : documentLink_; + } else { + return documentLinkBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Document links associated with the source documents (source_document_id).
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.DocumentLink document_link = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDocumentLink(com.google.cloud.contentwarehouse.v1.DocumentLink value) { + if (documentLinkBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + documentLink_ = value; + onChanged(); + } else { + documentLinkBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. Document links associated with the source documents (source_document_id).
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.DocumentLink document_link = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDocumentLink( + com.google.cloud.contentwarehouse.v1.DocumentLink.Builder builderForValue) { + if (documentLinkBuilder_ == null) { + documentLink_ = builderForValue.build(); + onChanged(); + } else { + documentLinkBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. Document links associated with the source documents (source_document_id).
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.DocumentLink document_link = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeDocumentLink(com.google.cloud.contentwarehouse.v1.DocumentLink value) { + if (documentLinkBuilder_ == null) { + if (documentLink_ != null) { + documentLink_ = + com.google.cloud.contentwarehouse.v1.DocumentLink.newBuilder(documentLink_) + .mergeFrom(value) + .buildPartial(); + } else { + documentLink_ = value; + } + onChanged(); + } else { + documentLinkBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. Document links associated with the source documents (source_document_id).
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.DocumentLink document_link = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearDocumentLink() { + if (documentLinkBuilder_ == null) { + documentLink_ = null; + onChanged(); + } else { + documentLink_ = null; + documentLinkBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. Document links associated with the source documents (source_document_id).
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.DocumentLink document_link = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.contentwarehouse.v1.DocumentLink.Builder getDocumentLinkBuilder() { + + onChanged(); + return getDocumentLinkFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Document links associated with the source documents (source_document_id).
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.DocumentLink document_link = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.contentwarehouse.v1.DocumentLinkOrBuilder getDocumentLinkOrBuilder() { + if (documentLinkBuilder_ != null) { + return documentLinkBuilder_.getMessageOrBuilder(); + } else { + return documentLink_ == null + ? com.google.cloud.contentwarehouse.v1.DocumentLink.getDefaultInstance() + : documentLink_; + } + } + /** + * + * + *
+     * Required. Document links associated with the source documents (source_document_id).
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.DocumentLink document_link = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.DocumentLink, + com.google.cloud.contentwarehouse.v1.DocumentLink.Builder, + com.google.cloud.contentwarehouse.v1.DocumentLinkOrBuilder> + getDocumentLinkFieldBuilder() { + if (documentLinkBuilder_ == null) { + documentLinkBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.DocumentLink, + com.google.cloud.contentwarehouse.v1.DocumentLink.Builder, + com.google.cloud.contentwarehouse.v1.DocumentLinkOrBuilder>( + getDocumentLink(), getParentForChildren(), isClean()); + documentLink_ = null; + } + return documentLinkBuilder_; + } + + private com.google.cloud.contentwarehouse.v1.RequestMetadata requestMetadata_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.RequestMetadata, + com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder, + com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder> + requestMetadataBuilder_; + /** + * + * + *
+     * The meta information collected about the document creator, used to enforce
+     * access control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + * + * @return Whether the requestMetadata field is set. + */ + public boolean hasRequestMetadata() { + return requestMetadataBuilder_ != null || requestMetadata_ != null; + } + /** + * + * + *
+     * The meta information collected about the document creator, used to enforce
+     * access control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + * + * @return The requestMetadata. + */ + public com.google.cloud.contentwarehouse.v1.RequestMetadata getRequestMetadata() { + if (requestMetadataBuilder_ == null) { + return requestMetadata_ == null + ? com.google.cloud.contentwarehouse.v1.RequestMetadata.getDefaultInstance() + : requestMetadata_; + } else { + return requestMetadataBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The meta information collected about the document creator, used to enforce
+     * access control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + */ + public Builder setRequestMetadata(com.google.cloud.contentwarehouse.v1.RequestMetadata value) { + if (requestMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + requestMetadata_ = value; + onChanged(); + } else { + requestMetadataBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The meta information collected about the document creator, used to enforce
+     * access control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + */ + public Builder setRequestMetadata( + com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder builderForValue) { + if (requestMetadataBuilder_ == null) { + requestMetadata_ = builderForValue.build(); + onChanged(); + } else { + requestMetadataBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The meta information collected about the document creator, used to enforce
+     * access control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + */ + public Builder mergeRequestMetadata( + com.google.cloud.contentwarehouse.v1.RequestMetadata value) { + if (requestMetadataBuilder_ == null) { + if (requestMetadata_ != null) { + requestMetadata_ = + com.google.cloud.contentwarehouse.v1.RequestMetadata.newBuilder(requestMetadata_) + .mergeFrom(value) + .buildPartial(); + } else { + requestMetadata_ = value; + } + onChanged(); + } else { + requestMetadataBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The meta information collected about the document creator, used to enforce
+     * access control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + */ + public Builder clearRequestMetadata() { + if (requestMetadataBuilder_ == null) { + requestMetadata_ = null; + onChanged(); + } else { + requestMetadata_ = null; + requestMetadataBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The meta information collected about the document creator, used to enforce
+     * access control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + */ + public com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder + getRequestMetadataBuilder() { + + onChanged(); + return getRequestMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The meta information collected about the document creator, used to enforce
+     * access control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + */ + public com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder + getRequestMetadataOrBuilder() { + if (requestMetadataBuilder_ != null) { + return requestMetadataBuilder_.getMessageOrBuilder(); + } else { + return requestMetadata_ == null + ? com.google.cloud.contentwarehouse.v1.RequestMetadata.getDefaultInstance() + : requestMetadata_; + } + } + /** + * + * + *
+     * The meta information collected about the document creator, used to enforce
+     * access control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.RequestMetadata, + com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder, + com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder> + getRequestMetadataFieldBuilder() { + if (requestMetadataBuilder_ == null) { + requestMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.RequestMetadata, + com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder, + com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder>( + getRequestMetadata(), getParentForChildren(), isClean()); + requestMetadata_ = null; + } + return requestMetadataBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest) + private static final com.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest(); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateDocumentLinkRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/CreateDocumentLinkRequestOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/CreateDocumentLinkRequestOrBuilder.java new file mode 100644 index 000000000000..f671be5dfc96 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/CreateDocumentLinkRequestOrBuilder.java @@ -0,0 +1,139 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_link_service.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface CreateDocumentLinkRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * 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}.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * 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}.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. Document links associated with the source documents (source_document_id).
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.DocumentLink document_link = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the documentLink field is set. + */ + boolean hasDocumentLink(); + /** + * + * + *
+   * Required. Document links associated with the source documents (source_document_id).
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.DocumentLink document_link = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The documentLink. + */ + com.google.cloud.contentwarehouse.v1.DocumentLink getDocumentLink(); + /** + * + * + *
+   * Required. Document links associated with the source documents (source_document_id).
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.DocumentLink document_link = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.contentwarehouse.v1.DocumentLinkOrBuilder getDocumentLinkOrBuilder(); + + /** + * + * + *
+   * The meta information collected about the document creator, used to enforce
+   * access control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + * + * @return Whether the requestMetadata field is set. + */ + boolean hasRequestMetadata(); + /** + * + * + *
+   * The meta information collected about the document creator, used to enforce
+   * access control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + * + * @return The requestMetadata. + */ + com.google.cloud.contentwarehouse.v1.RequestMetadata getRequestMetadata(); + /** + * + * + *
+   * The meta information collected about the document creator, used to enforce
+   * access control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + */ + com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder getRequestMetadataOrBuilder(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/CreateDocumentMetadata.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/CreateDocumentMetadata.java new file mode 100644 index 000000000000..48045be390d6 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/CreateDocumentMetadata.java @@ -0,0 +1,437 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/async_document_service_request.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Metadata object for CreateDocument request (currently empty).
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.CreateDocumentMetadata} + */ +public final class CreateDocumentMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.CreateDocumentMetadata) + CreateDocumentMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateDocumentMetadata.newBuilder() to construct. + private CreateDocumentMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateDocumentMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateDocumentMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.AsyncDocumentServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_CreateDocumentMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.AsyncDocumentServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_CreateDocumentMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.CreateDocumentMetadata.class, + com.google.cloud.contentwarehouse.v1.CreateDocumentMetadata.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.CreateDocumentMetadata)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.CreateDocumentMetadata other = + (com.google.cloud.contentwarehouse.v1.CreateDocumentMetadata) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.CreateDocumentMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Metadata object for CreateDocument request (currently empty).
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.CreateDocumentMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.CreateDocumentMetadata) + com.google.cloud.contentwarehouse.v1.CreateDocumentMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.AsyncDocumentServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_CreateDocumentMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.AsyncDocumentServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_CreateDocumentMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.CreateDocumentMetadata.class, + com.google.cloud.contentwarehouse.v1.CreateDocumentMetadata.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.CreateDocumentMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.AsyncDocumentServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_CreateDocumentMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.CreateDocumentMetadata getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.CreateDocumentMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.CreateDocumentMetadata build() { + com.google.cloud.contentwarehouse.v1.CreateDocumentMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.CreateDocumentMetadata buildPartial() { + com.google.cloud.contentwarehouse.v1.CreateDocumentMetadata result = + new com.google.cloud.contentwarehouse.v1.CreateDocumentMetadata(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.CreateDocumentMetadata) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.CreateDocumentMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.CreateDocumentMetadata other) { + if (other == com.google.cloud.contentwarehouse.v1.CreateDocumentMetadata.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.CreateDocumentMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.CreateDocumentMetadata) + private static final com.google.cloud.contentwarehouse.v1.CreateDocumentMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.CreateDocumentMetadata(); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateDocumentMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.CreateDocumentMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/CreateDocumentMetadataOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/CreateDocumentMetadataOrBuilder.java new file mode 100644 index 000000000000..a7fe4c4daba5 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/CreateDocumentMetadataOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/async_document_service_request.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface CreateDocumentMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.CreateDocumentMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/CreateDocumentRequest.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/CreateDocumentRequest.java new file mode 100644 index 000000000000..5783534a0970 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/CreateDocumentRequest.java @@ -0,0 +1,2081 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_service_request.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Request message for DocumentService.CreateDocument.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.CreateDocumentRequest} + */ +public final class CreateDocumentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.CreateDocumentRequest) + CreateDocumentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateDocumentRequest.newBuilder() to construct. + private CreateDocumentRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateDocumentRequest() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateDocumentRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_CreateDocumentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_CreateDocumentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.CreateDocumentRequest.class, + com.google.cloud.contentwarehouse.v1.CreateDocumentRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent name.
+   * Format: projects/{project_number}/locations/{location}.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent name.
+   * Format: projects/{project_number}/locations/{location}.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DOCUMENT_FIELD_NUMBER = 2; + private com.google.cloud.contentwarehouse.v1.Document document_; + /** + * + * + *
+   * Required. The document to create.
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.Document document = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the document field is set. + */ + @java.lang.Override + public boolean hasDocument() { + return document_ != null; + } + /** + * + * + *
+   * Required. The document to create.
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.Document document = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The document. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.Document getDocument() { + return document_ == null + ? com.google.cloud.contentwarehouse.v1.Document.getDefaultInstance() + : document_; + } + /** + * + * + *
+   * Required. The document to create.
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.Document document = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DocumentOrBuilder getDocumentOrBuilder() { + return getDocument(); + } + + public static final int REQUEST_METADATA_FIELD_NUMBER = 3; + private com.google.cloud.contentwarehouse.v1.RequestMetadata requestMetadata_; + /** + * + * + *
+   * The meta information collected about the end user, used to enforce access
+   * control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + * + * @return Whether the requestMetadata field is set. + */ + @java.lang.Override + public boolean hasRequestMetadata() { + return requestMetadata_ != null; + } + /** + * + * + *
+   * The meta information collected about the end user, used to enforce access
+   * control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + * + * @return The requestMetadata. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RequestMetadata getRequestMetadata() { + return requestMetadata_ == null + ? com.google.cloud.contentwarehouse.v1.RequestMetadata.getDefaultInstance() + : requestMetadata_; + } + /** + * + * + *
+   * The meta information collected about the end user, used to enforce access
+   * control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder + getRequestMetadataOrBuilder() { + return getRequestMetadata(); + } + + public static final int POLICY_FIELD_NUMBER = 4; + private com.google.iam.v1.Policy policy_; + /** + * + * + *
+   * Default document policy during creation. Conditions defined in the policy
+   * will be ignored.
+   * 
+ * + * .google.iam.v1.Policy policy = 4; + * + * @return Whether the policy field is set. + */ + @java.lang.Override + public boolean hasPolicy() { + return policy_ != null; + } + /** + * + * + *
+   * Default document policy during creation. Conditions defined in the policy
+   * will be ignored.
+   * 
+ * + * .google.iam.v1.Policy policy = 4; + * + * @return The policy. + */ + @java.lang.Override + public com.google.iam.v1.Policy getPolicy() { + return policy_ == null ? com.google.iam.v1.Policy.getDefaultInstance() : policy_; + } + /** + * + * + *
+   * Default document policy during creation. Conditions defined in the policy
+   * will be ignored.
+   * 
+ * + * .google.iam.v1.Policy policy = 4; + */ + @java.lang.Override + public com.google.iam.v1.PolicyOrBuilder getPolicyOrBuilder() { + return getPolicy(); + } + + public static final int CLOUD_AI_DOCUMENT_OPTION_FIELD_NUMBER = 5; + private com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption cloudAiDocumentOption_; + /** + * + * + *
+   * Request Option for processing Cloud AI Document in CW Document.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.CloudAIDocumentOption cloud_ai_document_option = 5; + * + * + * @return Whether the cloudAiDocumentOption field is set. + */ + @java.lang.Override + public boolean hasCloudAiDocumentOption() { + return cloudAiDocumentOption_ != null; + } + /** + * + * + *
+   * Request Option for processing Cloud AI Document in CW Document.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.CloudAIDocumentOption cloud_ai_document_option = 5; + * + * + * @return The cloudAiDocumentOption. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption getCloudAiDocumentOption() { + return cloudAiDocumentOption_ == null + ? com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption.getDefaultInstance() + : cloudAiDocumentOption_; + } + /** + * + * + *
+   * Request Option for processing Cloud AI Document in CW Document.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.CloudAIDocumentOption cloud_ai_document_option = 5; + * + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.CloudAIDocumentOptionOrBuilder + getCloudAiDocumentOptionOrBuilder() { + return getCloudAiDocumentOption(); + } + + public static final int CREATE_MASK_FIELD_NUMBER = 6; + private com.google.protobuf.FieldMask createMask_; + /** + * + * + *
+   * Field mask for creating Document fields. If mask path is empty,
+   * it means all fields are masked.
+   * For the `FieldMask` definition,
+   * see
+   * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+   * 
+ * + * .google.protobuf.FieldMask create_mask = 6; + * + * @return Whether the createMask field is set. + */ + @java.lang.Override + public boolean hasCreateMask() { + return createMask_ != null; + } + /** + * + * + *
+   * Field mask for creating Document fields. If mask path is empty,
+   * it means all fields are masked.
+   * For the `FieldMask` definition,
+   * see
+   * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+   * 
+ * + * .google.protobuf.FieldMask create_mask = 6; + * + * @return The createMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getCreateMask() { + return createMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : createMask_; + } + /** + * + * + *
+   * Field mask for creating Document fields. If mask path is empty,
+   * it means all fields are masked.
+   * For the `FieldMask` definition,
+   * see
+   * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+   * 
+ * + * .google.protobuf.FieldMask create_mask = 6; + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getCreateMaskOrBuilder() { + return getCreateMask(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (document_ != null) { + output.writeMessage(2, getDocument()); + } + if (requestMetadata_ != null) { + output.writeMessage(3, getRequestMetadata()); + } + if (policy_ != null) { + output.writeMessage(4, getPolicy()); + } + if (cloudAiDocumentOption_ != null) { + output.writeMessage(5, getCloudAiDocumentOption()); + } + if (createMask_ != null) { + output.writeMessage(6, getCreateMask()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (document_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getDocument()); + } + if (requestMetadata_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getRequestMetadata()); + } + if (policy_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getPolicy()); + } + if (cloudAiDocumentOption_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(5, getCloudAiDocumentOption()); + } + if (createMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getCreateMask()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.CreateDocumentRequest)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.CreateDocumentRequest other = + (com.google.cloud.contentwarehouse.v1.CreateDocumentRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasDocument() != other.hasDocument()) return false; + if (hasDocument()) { + if (!getDocument().equals(other.getDocument())) return false; + } + if (hasRequestMetadata() != other.hasRequestMetadata()) return false; + if (hasRequestMetadata()) { + if (!getRequestMetadata().equals(other.getRequestMetadata())) return false; + } + if (hasPolicy() != other.hasPolicy()) return false; + if (hasPolicy()) { + if (!getPolicy().equals(other.getPolicy())) return false; + } + if (hasCloudAiDocumentOption() != other.hasCloudAiDocumentOption()) return false; + if (hasCloudAiDocumentOption()) { + if (!getCloudAiDocumentOption().equals(other.getCloudAiDocumentOption())) return false; + } + if (hasCreateMask() != other.hasCreateMask()) return false; + if (hasCreateMask()) { + if (!getCreateMask().equals(other.getCreateMask())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasDocument()) { + hash = (37 * hash) + DOCUMENT_FIELD_NUMBER; + hash = (53 * hash) + getDocument().hashCode(); + } + if (hasRequestMetadata()) { + hash = (37 * hash) + REQUEST_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getRequestMetadata().hashCode(); + } + if (hasPolicy()) { + hash = (37 * hash) + POLICY_FIELD_NUMBER; + hash = (53 * hash) + getPolicy().hashCode(); + } + if (hasCloudAiDocumentOption()) { + hash = (37 * hash) + CLOUD_AI_DOCUMENT_OPTION_FIELD_NUMBER; + hash = (53 * hash) + getCloudAiDocumentOption().hashCode(); + } + if (hasCreateMask()) { + hash = (37 * hash) + CREATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getCreateMask().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.CreateDocumentRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for DocumentService.CreateDocument.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.CreateDocumentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.CreateDocumentRequest) + com.google.cloud.contentwarehouse.v1.CreateDocumentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_CreateDocumentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_CreateDocumentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.CreateDocumentRequest.class, + com.google.cloud.contentwarehouse.v1.CreateDocumentRequest.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.CreateDocumentRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + if (documentBuilder_ == null) { + document_ = null; + } else { + document_ = null; + documentBuilder_ = null; + } + if (requestMetadataBuilder_ == null) { + requestMetadata_ = null; + } else { + requestMetadata_ = null; + requestMetadataBuilder_ = null; + } + if (policyBuilder_ == null) { + policy_ = null; + } else { + policy_ = null; + policyBuilder_ = null; + } + if (cloudAiDocumentOptionBuilder_ == null) { + cloudAiDocumentOption_ = null; + } else { + cloudAiDocumentOption_ = null; + cloudAiDocumentOptionBuilder_ = null; + } + if (createMaskBuilder_ == null) { + createMask_ = null; + } else { + createMask_ = null; + createMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_CreateDocumentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.CreateDocumentRequest getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.CreateDocumentRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.CreateDocumentRequest build() { + com.google.cloud.contentwarehouse.v1.CreateDocumentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.CreateDocumentRequest buildPartial() { + com.google.cloud.contentwarehouse.v1.CreateDocumentRequest result = + new com.google.cloud.contentwarehouse.v1.CreateDocumentRequest(this); + result.parent_ = parent_; + if (documentBuilder_ == null) { + result.document_ = document_; + } else { + result.document_ = documentBuilder_.build(); + } + if (requestMetadataBuilder_ == null) { + result.requestMetadata_ = requestMetadata_; + } else { + result.requestMetadata_ = requestMetadataBuilder_.build(); + } + if (policyBuilder_ == null) { + result.policy_ = policy_; + } else { + result.policy_ = policyBuilder_.build(); + } + if (cloudAiDocumentOptionBuilder_ == null) { + result.cloudAiDocumentOption_ = cloudAiDocumentOption_; + } else { + result.cloudAiDocumentOption_ = cloudAiDocumentOptionBuilder_.build(); + } + if (createMaskBuilder_ == null) { + result.createMask_ = createMask_; + } else { + result.createMask_ = createMaskBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.CreateDocumentRequest) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.CreateDocumentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.CreateDocumentRequest other) { + if (other == com.google.cloud.contentwarehouse.v1.CreateDocumentRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasDocument()) { + mergeDocument(other.getDocument()); + } + if (other.hasRequestMetadata()) { + mergeRequestMetadata(other.getRequestMetadata()); + } + if (other.hasPolicy()) { + mergePolicy(other.getPolicy()); + } + if (other.hasCloudAiDocumentOption()) { + mergeCloudAiDocumentOption(other.getCloudAiDocumentOption()); + } + if (other.hasCreateMask()) { + mergeCreateMask(other.getCreateMask()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + input.readMessage(getDocumentFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + case 26: + { + input.readMessage(getRequestMetadataFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 26 + case 34: + { + input.readMessage(getPolicyFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 34 + case 42: + { + input.readMessage( + getCloudAiDocumentOptionFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 42 + case 50: + { + input.readMessage(getCreateMaskFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 50 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent name.
+     * Format: projects/{project_number}/locations/{location}.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent name.
+     * Format: projects/{project_number}/locations/{location}.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent name.
+     * Format: projects/{project_number}/locations/{location}.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent name.
+     * Format: projects/{project_number}/locations/{location}.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent name.
+     * Format: projects/{project_number}/locations/{location}.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private com.google.cloud.contentwarehouse.v1.Document document_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.Document, + com.google.cloud.contentwarehouse.v1.Document.Builder, + com.google.cloud.contentwarehouse.v1.DocumentOrBuilder> + documentBuilder_; + /** + * + * + *
+     * Required. The document to create.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.Document document = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the document field is set. + */ + public boolean hasDocument() { + return documentBuilder_ != null || document_ != null; + } + /** + * + * + *
+     * Required. The document to create.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.Document document = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The document. + */ + public com.google.cloud.contentwarehouse.v1.Document getDocument() { + if (documentBuilder_ == null) { + return document_ == null + ? com.google.cloud.contentwarehouse.v1.Document.getDefaultInstance() + : document_; + } else { + return documentBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The document to create.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.Document document = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDocument(com.google.cloud.contentwarehouse.v1.Document value) { + if (documentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + document_ = value; + onChanged(); + } else { + documentBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The document to create.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.Document document = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDocument( + com.google.cloud.contentwarehouse.v1.Document.Builder builderForValue) { + if (documentBuilder_ == null) { + document_ = builderForValue.build(); + onChanged(); + } else { + documentBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The document to create.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.Document document = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeDocument(com.google.cloud.contentwarehouse.v1.Document value) { + if (documentBuilder_ == null) { + if (document_ != null) { + document_ = + com.google.cloud.contentwarehouse.v1.Document.newBuilder(document_) + .mergeFrom(value) + .buildPartial(); + } else { + document_ = value; + } + onChanged(); + } else { + documentBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The document to create.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.Document document = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearDocument() { + if (documentBuilder_ == null) { + document_ = null; + onChanged(); + } else { + document_ = null; + documentBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The document to create.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.Document document = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.contentwarehouse.v1.Document.Builder getDocumentBuilder() { + + onChanged(); + return getDocumentFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The document to create.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.Document document = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.contentwarehouse.v1.DocumentOrBuilder getDocumentOrBuilder() { + if (documentBuilder_ != null) { + return documentBuilder_.getMessageOrBuilder(); + } else { + return document_ == null + ? com.google.cloud.contentwarehouse.v1.Document.getDefaultInstance() + : document_; + } + } + /** + * + * + *
+     * Required. The document to create.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.Document document = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.Document, + com.google.cloud.contentwarehouse.v1.Document.Builder, + com.google.cloud.contentwarehouse.v1.DocumentOrBuilder> + getDocumentFieldBuilder() { + if (documentBuilder_ == null) { + documentBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.Document, + com.google.cloud.contentwarehouse.v1.Document.Builder, + com.google.cloud.contentwarehouse.v1.DocumentOrBuilder>( + getDocument(), getParentForChildren(), isClean()); + document_ = null; + } + return documentBuilder_; + } + + private com.google.cloud.contentwarehouse.v1.RequestMetadata requestMetadata_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.RequestMetadata, + com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder, + com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder> + requestMetadataBuilder_; + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + * + * @return Whether the requestMetadata field is set. + */ + public boolean hasRequestMetadata() { + return requestMetadataBuilder_ != null || requestMetadata_ != null; + } + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + * + * @return The requestMetadata. + */ + public com.google.cloud.contentwarehouse.v1.RequestMetadata getRequestMetadata() { + if (requestMetadataBuilder_ == null) { + return requestMetadata_ == null + ? com.google.cloud.contentwarehouse.v1.RequestMetadata.getDefaultInstance() + : requestMetadata_; + } else { + return requestMetadataBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + */ + public Builder setRequestMetadata(com.google.cloud.contentwarehouse.v1.RequestMetadata value) { + if (requestMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + requestMetadata_ = value; + onChanged(); + } else { + requestMetadataBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + */ + public Builder setRequestMetadata( + com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder builderForValue) { + if (requestMetadataBuilder_ == null) { + requestMetadata_ = builderForValue.build(); + onChanged(); + } else { + requestMetadataBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + */ + public Builder mergeRequestMetadata( + com.google.cloud.contentwarehouse.v1.RequestMetadata value) { + if (requestMetadataBuilder_ == null) { + if (requestMetadata_ != null) { + requestMetadata_ = + com.google.cloud.contentwarehouse.v1.RequestMetadata.newBuilder(requestMetadata_) + .mergeFrom(value) + .buildPartial(); + } else { + requestMetadata_ = value; + } + onChanged(); + } else { + requestMetadataBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + */ + public Builder clearRequestMetadata() { + if (requestMetadataBuilder_ == null) { + requestMetadata_ = null; + onChanged(); + } else { + requestMetadata_ = null; + requestMetadataBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + */ + public com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder + getRequestMetadataBuilder() { + + onChanged(); + return getRequestMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + */ + public com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder + getRequestMetadataOrBuilder() { + if (requestMetadataBuilder_ != null) { + return requestMetadataBuilder_.getMessageOrBuilder(); + } else { + return requestMetadata_ == null + ? com.google.cloud.contentwarehouse.v1.RequestMetadata.getDefaultInstance() + : requestMetadata_; + } + } + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.RequestMetadata, + com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder, + com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder> + getRequestMetadataFieldBuilder() { + if (requestMetadataBuilder_ == null) { + requestMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.RequestMetadata, + com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder, + com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder>( + getRequestMetadata(), getParentForChildren(), isClean()); + requestMetadata_ = null; + } + return requestMetadataBuilder_; + } + + private com.google.iam.v1.Policy policy_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.iam.v1.Policy, + com.google.iam.v1.Policy.Builder, + com.google.iam.v1.PolicyOrBuilder> + policyBuilder_; + /** + * + * + *
+     * Default document policy during creation. Conditions defined in the policy
+     * will be ignored.
+     * 
+ * + * .google.iam.v1.Policy policy = 4; + * + * @return Whether the policy field is set. + */ + public boolean hasPolicy() { + return policyBuilder_ != null || policy_ != null; + } + /** + * + * + *
+     * Default document policy during creation. Conditions defined in the policy
+     * will be ignored.
+     * 
+ * + * .google.iam.v1.Policy policy = 4; + * + * @return The policy. + */ + public com.google.iam.v1.Policy getPolicy() { + if (policyBuilder_ == null) { + return policy_ == null ? com.google.iam.v1.Policy.getDefaultInstance() : policy_; + } else { + return policyBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Default document policy during creation. Conditions defined in the policy
+     * will be ignored.
+     * 
+ * + * .google.iam.v1.Policy policy = 4; + */ + public Builder setPolicy(com.google.iam.v1.Policy value) { + if (policyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + policy_ = value; + onChanged(); + } else { + policyBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Default document policy during creation. Conditions defined in the policy
+     * will be ignored.
+     * 
+ * + * .google.iam.v1.Policy policy = 4; + */ + public Builder setPolicy(com.google.iam.v1.Policy.Builder builderForValue) { + if (policyBuilder_ == null) { + policy_ = builderForValue.build(); + onChanged(); + } else { + policyBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Default document policy during creation. Conditions defined in the policy
+     * will be ignored.
+     * 
+ * + * .google.iam.v1.Policy policy = 4; + */ + public Builder mergePolicy(com.google.iam.v1.Policy value) { + if (policyBuilder_ == null) { + if (policy_ != null) { + policy_ = com.google.iam.v1.Policy.newBuilder(policy_).mergeFrom(value).buildPartial(); + } else { + policy_ = value; + } + onChanged(); + } else { + policyBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Default document policy during creation. Conditions defined in the policy
+     * will be ignored.
+     * 
+ * + * .google.iam.v1.Policy policy = 4; + */ + public Builder clearPolicy() { + if (policyBuilder_ == null) { + policy_ = null; + onChanged(); + } else { + policy_ = null; + policyBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Default document policy during creation. Conditions defined in the policy
+     * will be ignored.
+     * 
+ * + * .google.iam.v1.Policy policy = 4; + */ + public com.google.iam.v1.Policy.Builder getPolicyBuilder() { + + onChanged(); + return getPolicyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Default document policy during creation. Conditions defined in the policy
+     * will be ignored.
+     * 
+ * + * .google.iam.v1.Policy policy = 4; + */ + public com.google.iam.v1.PolicyOrBuilder getPolicyOrBuilder() { + if (policyBuilder_ != null) { + return policyBuilder_.getMessageOrBuilder(); + } else { + return policy_ == null ? com.google.iam.v1.Policy.getDefaultInstance() : policy_; + } + } + /** + * + * + *
+     * Default document policy during creation. Conditions defined in the policy
+     * will be ignored.
+     * 
+ * + * .google.iam.v1.Policy policy = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.iam.v1.Policy, + com.google.iam.v1.Policy.Builder, + com.google.iam.v1.PolicyOrBuilder> + getPolicyFieldBuilder() { + if (policyBuilder_ == null) { + policyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.iam.v1.Policy, + com.google.iam.v1.Policy.Builder, + com.google.iam.v1.PolicyOrBuilder>(getPolicy(), getParentForChildren(), isClean()); + policy_ = null; + } + return policyBuilder_; + } + + private com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption cloudAiDocumentOption_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption, + com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption.Builder, + com.google.cloud.contentwarehouse.v1.CloudAIDocumentOptionOrBuilder> + cloudAiDocumentOptionBuilder_; + /** + * + * + *
+     * Request Option for processing Cloud AI Document in CW Document.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.CloudAIDocumentOption cloud_ai_document_option = 5; + * + * + * @return Whether the cloudAiDocumentOption field is set. + */ + public boolean hasCloudAiDocumentOption() { + return cloudAiDocumentOptionBuilder_ != null || cloudAiDocumentOption_ != null; + } + /** + * + * + *
+     * Request Option for processing Cloud AI Document in CW Document.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.CloudAIDocumentOption cloud_ai_document_option = 5; + * + * + * @return The cloudAiDocumentOption. + */ + public com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption getCloudAiDocumentOption() { + if (cloudAiDocumentOptionBuilder_ == null) { + return cloudAiDocumentOption_ == null + ? com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption.getDefaultInstance() + : cloudAiDocumentOption_; + } else { + return cloudAiDocumentOptionBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Request Option for processing Cloud AI Document in CW Document.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.CloudAIDocumentOption cloud_ai_document_option = 5; + * + */ + public Builder setCloudAiDocumentOption( + com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption value) { + if (cloudAiDocumentOptionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + cloudAiDocumentOption_ = value; + onChanged(); + } else { + cloudAiDocumentOptionBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Request Option for processing Cloud AI Document in CW Document.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.CloudAIDocumentOption cloud_ai_document_option = 5; + * + */ + public Builder setCloudAiDocumentOption( + com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption.Builder builderForValue) { + if (cloudAiDocumentOptionBuilder_ == null) { + cloudAiDocumentOption_ = builderForValue.build(); + onChanged(); + } else { + cloudAiDocumentOptionBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Request Option for processing Cloud AI Document in CW Document.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.CloudAIDocumentOption cloud_ai_document_option = 5; + * + */ + public Builder mergeCloudAiDocumentOption( + com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption value) { + if (cloudAiDocumentOptionBuilder_ == null) { + if (cloudAiDocumentOption_ != null) { + cloudAiDocumentOption_ = + com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption.newBuilder( + cloudAiDocumentOption_) + .mergeFrom(value) + .buildPartial(); + } else { + cloudAiDocumentOption_ = value; + } + onChanged(); + } else { + cloudAiDocumentOptionBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Request Option for processing Cloud AI Document in CW Document.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.CloudAIDocumentOption cloud_ai_document_option = 5; + * + */ + public Builder clearCloudAiDocumentOption() { + if (cloudAiDocumentOptionBuilder_ == null) { + cloudAiDocumentOption_ = null; + onChanged(); + } else { + cloudAiDocumentOption_ = null; + cloudAiDocumentOptionBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Request Option for processing Cloud AI Document in CW Document.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.CloudAIDocumentOption cloud_ai_document_option = 5; + * + */ + public com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption.Builder + getCloudAiDocumentOptionBuilder() { + + onChanged(); + return getCloudAiDocumentOptionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Request Option for processing Cloud AI Document in CW Document.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.CloudAIDocumentOption cloud_ai_document_option = 5; + * + */ + public com.google.cloud.contentwarehouse.v1.CloudAIDocumentOptionOrBuilder + getCloudAiDocumentOptionOrBuilder() { + if (cloudAiDocumentOptionBuilder_ != null) { + return cloudAiDocumentOptionBuilder_.getMessageOrBuilder(); + } else { + return cloudAiDocumentOption_ == null + ? com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption.getDefaultInstance() + : cloudAiDocumentOption_; + } + } + /** + * + * + *
+     * Request Option for processing Cloud AI Document in CW Document.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.CloudAIDocumentOption cloud_ai_document_option = 5; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption, + com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption.Builder, + com.google.cloud.contentwarehouse.v1.CloudAIDocumentOptionOrBuilder> + getCloudAiDocumentOptionFieldBuilder() { + if (cloudAiDocumentOptionBuilder_ == null) { + cloudAiDocumentOptionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption, + com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption.Builder, + com.google.cloud.contentwarehouse.v1.CloudAIDocumentOptionOrBuilder>( + getCloudAiDocumentOption(), getParentForChildren(), isClean()); + cloudAiDocumentOption_ = null; + } + return cloudAiDocumentOptionBuilder_; + } + + private com.google.protobuf.FieldMask createMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + createMaskBuilder_; + /** + * + * + *
+     * Field mask for creating Document fields. If mask path is empty,
+     * it means all fields are masked.
+     * For the `FieldMask` definition,
+     * see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask create_mask = 6; + * + * @return Whether the createMask field is set. + */ + public boolean hasCreateMask() { + return createMaskBuilder_ != null || createMask_ != null; + } + /** + * + * + *
+     * Field mask for creating Document fields. If mask path is empty,
+     * it means all fields are masked.
+     * For the `FieldMask` definition,
+     * see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask create_mask = 6; + * + * @return The createMask. + */ + public com.google.protobuf.FieldMask getCreateMask() { + if (createMaskBuilder_ == null) { + return createMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : createMask_; + } else { + return createMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Field mask for creating Document fields. If mask path is empty,
+     * it means all fields are masked.
+     * For the `FieldMask` definition,
+     * see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask create_mask = 6; + */ + public Builder setCreateMask(com.google.protobuf.FieldMask value) { + if (createMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createMask_ = value; + onChanged(); + } else { + createMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Field mask for creating Document fields. If mask path is empty,
+     * it means all fields are masked.
+     * For the `FieldMask` definition,
+     * see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask create_mask = 6; + */ + public Builder setCreateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (createMaskBuilder_ == null) { + createMask_ = builderForValue.build(); + onChanged(); + } else { + createMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Field mask for creating Document fields. If mask path is empty,
+     * it means all fields are masked.
+     * For the `FieldMask` definition,
+     * see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask create_mask = 6; + */ + public Builder mergeCreateMask(com.google.protobuf.FieldMask value) { + if (createMaskBuilder_ == null) { + if (createMask_ != null) { + createMask_ = + com.google.protobuf.FieldMask.newBuilder(createMask_).mergeFrom(value).buildPartial(); + } else { + createMask_ = value; + } + onChanged(); + } else { + createMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Field mask for creating Document fields. If mask path is empty,
+     * it means all fields are masked.
+     * For the `FieldMask` definition,
+     * see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask create_mask = 6; + */ + public Builder clearCreateMask() { + if (createMaskBuilder_ == null) { + createMask_ = null; + onChanged(); + } else { + createMask_ = null; + createMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Field mask for creating Document fields. If mask path is empty,
+     * it means all fields are masked.
+     * For the `FieldMask` definition,
+     * see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask create_mask = 6; + */ + public com.google.protobuf.FieldMask.Builder getCreateMaskBuilder() { + + onChanged(); + return getCreateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Field mask for creating Document fields. If mask path is empty,
+     * it means all fields are masked.
+     * For the `FieldMask` definition,
+     * see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask create_mask = 6; + */ + public com.google.protobuf.FieldMaskOrBuilder getCreateMaskOrBuilder() { + if (createMaskBuilder_ != null) { + return createMaskBuilder_.getMessageOrBuilder(); + } else { + return createMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : createMask_; + } + } + /** + * + * + *
+     * Field mask for creating Document fields. If mask path is empty,
+     * it means all fields are masked.
+     * For the `FieldMask` definition,
+     * see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask create_mask = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getCreateMaskFieldBuilder() { + if (createMaskBuilder_ == null) { + createMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getCreateMask(), getParentForChildren(), isClean()); + createMask_ = null; + } + return createMaskBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.CreateDocumentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.CreateDocumentRequest) + private static final com.google.cloud.contentwarehouse.v1.CreateDocumentRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.CreateDocumentRequest(); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateDocumentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.CreateDocumentRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/CreateDocumentRequestOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/CreateDocumentRequestOrBuilder.java new file mode 100644 index 000000000000..86ca8b3afb62 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/CreateDocumentRequestOrBuilder.java @@ -0,0 +1,259 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_service_request.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface CreateDocumentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.CreateDocumentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent name.
+   * Format: projects/{project_number}/locations/{location}.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent name.
+   * Format: projects/{project_number}/locations/{location}.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The document to create.
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.Document document = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the document field is set. + */ + boolean hasDocument(); + /** + * + * + *
+   * Required. The document to create.
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.Document document = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The document. + */ + com.google.cloud.contentwarehouse.v1.Document getDocument(); + /** + * + * + *
+   * Required. The document to create.
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.Document document = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.contentwarehouse.v1.DocumentOrBuilder getDocumentOrBuilder(); + + /** + * + * + *
+   * The meta information collected about the end user, used to enforce access
+   * control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + * + * @return Whether the requestMetadata field is set. + */ + boolean hasRequestMetadata(); + /** + * + * + *
+   * The meta information collected about the end user, used to enforce access
+   * control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + * + * @return The requestMetadata. + */ + com.google.cloud.contentwarehouse.v1.RequestMetadata getRequestMetadata(); + /** + * + * + *
+   * The meta information collected about the end user, used to enforce access
+   * control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + */ + com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder getRequestMetadataOrBuilder(); + + /** + * + * + *
+   * Default document policy during creation. Conditions defined in the policy
+   * will be ignored.
+   * 
+ * + * .google.iam.v1.Policy policy = 4; + * + * @return Whether the policy field is set. + */ + boolean hasPolicy(); + /** + * + * + *
+   * Default document policy during creation. Conditions defined in the policy
+   * will be ignored.
+   * 
+ * + * .google.iam.v1.Policy policy = 4; + * + * @return The policy. + */ + com.google.iam.v1.Policy getPolicy(); + /** + * + * + *
+   * Default document policy during creation. Conditions defined in the policy
+   * will be ignored.
+   * 
+ * + * .google.iam.v1.Policy policy = 4; + */ + com.google.iam.v1.PolicyOrBuilder getPolicyOrBuilder(); + + /** + * + * + *
+   * Request Option for processing Cloud AI Document in CW Document.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.CloudAIDocumentOption cloud_ai_document_option = 5; + * + * + * @return Whether the cloudAiDocumentOption field is set. + */ + boolean hasCloudAiDocumentOption(); + /** + * + * + *
+   * Request Option for processing Cloud AI Document in CW Document.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.CloudAIDocumentOption cloud_ai_document_option = 5; + * + * + * @return The cloudAiDocumentOption. + */ + com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption getCloudAiDocumentOption(); + /** + * + * + *
+   * Request Option for processing Cloud AI Document in CW Document.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.CloudAIDocumentOption cloud_ai_document_option = 5; + * + */ + com.google.cloud.contentwarehouse.v1.CloudAIDocumentOptionOrBuilder + getCloudAiDocumentOptionOrBuilder(); + + /** + * + * + *
+   * Field mask for creating Document fields. If mask path is empty,
+   * it means all fields are masked.
+   * For the `FieldMask` definition,
+   * see
+   * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+   * 
+ * + * .google.protobuf.FieldMask create_mask = 6; + * + * @return Whether the createMask field is set. + */ + boolean hasCreateMask(); + /** + * + * + *
+   * Field mask for creating Document fields. If mask path is empty,
+   * it means all fields are masked.
+   * For the `FieldMask` definition,
+   * see
+   * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+   * 
+ * + * .google.protobuf.FieldMask create_mask = 6; + * + * @return The createMask. + */ + com.google.protobuf.FieldMask getCreateMask(); + /** + * + * + *
+   * Field mask for creating Document fields. If mask path is empty,
+   * it means all fields are masked.
+   * For the `FieldMask` definition,
+   * see
+   * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+   * 
+ * + * .google.protobuf.FieldMask create_mask = 6; + */ + com.google.protobuf.FieldMaskOrBuilder getCreateMaskOrBuilder(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/CreateDocumentResponse.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/CreateDocumentResponse.java new file mode 100644 index 000000000000..92885d334070 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/CreateDocumentResponse.java @@ -0,0 +1,1283 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_service.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Response message for DocumentService.CreateDocument.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.CreateDocumentResponse} + */ +public final class CreateDocumentResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.CreateDocumentResponse) + CreateDocumentResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateDocumentResponse.newBuilder() to construct. + private CreateDocumentResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateDocumentResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateDocumentResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceProto + .internal_static_google_cloud_contentwarehouse_v1_CreateDocumentResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceProto + .internal_static_google_cloud_contentwarehouse_v1_CreateDocumentResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.CreateDocumentResponse.class, + com.google.cloud.contentwarehouse.v1.CreateDocumentResponse.Builder.class); + } + + public static final int DOCUMENT_FIELD_NUMBER = 1; + private com.google.cloud.contentwarehouse.v1.Document document_; + /** + * + * + *
+   * Document created after executing create request.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.Document document = 1; + * + * @return Whether the document field is set. + */ + @java.lang.Override + public boolean hasDocument() { + return document_ != null; + } + /** + * + * + *
+   * Document created after executing create request.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.Document document = 1; + * + * @return The document. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.Document getDocument() { + return document_ == null + ? com.google.cloud.contentwarehouse.v1.Document.getDefaultInstance() + : document_; + } + /** + * + * + *
+   * Document created after executing create request.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.Document document = 1; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DocumentOrBuilder getDocumentOrBuilder() { + return getDocument(); + } + + public static final int RULE_ENGINE_OUTPUT_FIELD_NUMBER = 2; + private com.google.cloud.contentwarehouse.v1.RuleEngineOutput ruleEngineOutput_; + /** + * + * + *
+   * Output from Rule Engine recording the rule evaluator and action executor's
+   * output.
+   * Refer format in: google/cloud/contentwarehouse/v1/rule_engine.proto
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RuleEngineOutput rule_engine_output = 2; + * + * @return Whether the ruleEngineOutput field is set. + */ + @java.lang.Override + public boolean hasRuleEngineOutput() { + return ruleEngineOutput_ != null; + } + /** + * + * + *
+   * Output from Rule Engine recording the rule evaluator and action executor's
+   * output.
+   * Refer format in: google/cloud/contentwarehouse/v1/rule_engine.proto
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RuleEngineOutput rule_engine_output = 2; + * + * @return The ruleEngineOutput. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RuleEngineOutput getRuleEngineOutput() { + return ruleEngineOutput_ == null + ? com.google.cloud.contentwarehouse.v1.RuleEngineOutput.getDefaultInstance() + : ruleEngineOutput_; + } + /** + * + * + *
+   * Output from Rule Engine recording the rule evaluator and action executor's
+   * output.
+   * Refer format in: google/cloud/contentwarehouse/v1/rule_engine.proto
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RuleEngineOutput rule_engine_output = 2; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RuleEngineOutputOrBuilder + getRuleEngineOutputOrBuilder() { + return getRuleEngineOutput(); + } + + public static final int METADATA_FIELD_NUMBER = 3; + private com.google.cloud.contentwarehouse.v1.ResponseMetadata metadata_; + /** + * + * + *
+   * Additional information for the API invocation, such as the request tracking
+   * id.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 3; + * + * @return Whether the metadata field is set. + */ + @java.lang.Override + public boolean hasMetadata() { + return metadata_ != null; + } + /** + * + * + *
+   * Additional information for the API invocation, such as the request tracking
+   * id.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 3; + * + * @return The metadata. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ResponseMetadata getMetadata() { + return metadata_ == null + ? com.google.cloud.contentwarehouse.v1.ResponseMetadata.getDefaultInstance() + : metadata_; + } + /** + * + * + *
+   * Additional information for the API invocation, such as the request tracking
+   * id.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 3; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ResponseMetadataOrBuilder getMetadataOrBuilder() { + return getMetadata(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (document_ != null) { + output.writeMessage(1, getDocument()); + } + if (ruleEngineOutput_ != null) { + output.writeMessage(2, getRuleEngineOutput()); + } + if (metadata_ != null) { + output.writeMessage(3, getMetadata()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (document_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getDocument()); + } + if (ruleEngineOutput_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getRuleEngineOutput()); + } + if (metadata_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getMetadata()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.CreateDocumentResponse)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.CreateDocumentResponse other = + (com.google.cloud.contentwarehouse.v1.CreateDocumentResponse) obj; + + if (hasDocument() != other.hasDocument()) return false; + if (hasDocument()) { + if (!getDocument().equals(other.getDocument())) return false; + } + if (hasRuleEngineOutput() != other.hasRuleEngineOutput()) return false; + if (hasRuleEngineOutput()) { + if (!getRuleEngineOutput().equals(other.getRuleEngineOutput())) return false; + } + if (hasMetadata() != other.hasMetadata()) return false; + if (hasMetadata()) { + if (!getMetadata().equals(other.getMetadata())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasDocument()) { + hash = (37 * hash) + DOCUMENT_FIELD_NUMBER; + hash = (53 * hash) + getDocument().hashCode(); + } + if (hasRuleEngineOutput()) { + hash = (37 * hash) + RULE_ENGINE_OUTPUT_FIELD_NUMBER; + hash = (53 * hash) + getRuleEngineOutput().hashCode(); + } + if (hasMetadata()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + getMetadata().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.CreateDocumentResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for DocumentService.CreateDocument.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.CreateDocumentResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.CreateDocumentResponse) + com.google.cloud.contentwarehouse.v1.CreateDocumentResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceProto + .internal_static_google_cloud_contentwarehouse_v1_CreateDocumentResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceProto + .internal_static_google_cloud_contentwarehouse_v1_CreateDocumentResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.CreateDocumentResponse.class, + com.google.cloud.contentwarehouse.v1.CreateDocumentResponse.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.CreateDocumentResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (documentBuilder_ == null) { + document_ = null; + } else { + document_ = null; + documentBuilder_ = null; + } + if (ruleEngineOutputBuilder_ == null) { + ruleEngineOutput_ = null; + } else { + ruleEngineOutput_ = null; + ruleEngineOutputBuilder_ = null; + } + if (metadataBuilder_ == null) { + metadata_ = null; + } else { + metadata_ = null; + metadataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceProto + .internal_static_google_cloud_contentwarehouse_v1_CreateDocumentResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.CreateDocumentResponse getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.CreateDocumentResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.CreateDocumentResponse build() { + com.google.cloud.contentwarehouse.v1.CreateDocumentResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.CreateDocumentResponse buildPartial() { + com.google.cloud.contentwarehouse.v1.CreateDocumentResponse result = + new com.google.cloud.contentwarehouse.v1.CreateDocumentResponse(this); + if (documentBuilder_ == null) { + result.document_ = document_; + } else { + result.document_ = documentBuilder_.build(); + } + if (ruleEngineOutputBuilder_ == null) { + result.ruleEngineOutput_ = ruleEngineOutput_; + } else { + result.ruleEngineOutput_ = ruleEngineOutputBuilder_.build(); + } + if (metadataBuilder_ == null) { + result.metadata_ = metadata_; + } else { + result.metadata_ = metadataBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.CreateDocumentResponse) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.CreateDocumentResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.CreateDocumentResponse other) { + if (other == com.google.cloud.contentwarehouse.v1.CreateDocumentResponse.getDefaultInstance()) + return this; + if (other.hasDocument()) { + mergeDocument(other.getDocument()); + } + if (other.hasRuleEngineOutput()) { + mergeRuleEngineOutput(other.getRuleEngineOutput()); + } + if (other.hasMetadata()) { + mergeMetadata(other.getMetadata()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getDocumentFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 18: + { + input.readMessage( + getRuleEngineOutputFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + case 26: + { + input.readMessage(getMetadataFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private com.google.cloud.contentwarehouse.v1.Document document_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.Document, + com.google.cloud.contentwarehouse.v1.Document.Builder, + com.google.cloud.contentwarehouse.v1.DocumentOrBuilder> + documentBuilder_; + /** + * + * + *
+     * Document created after executing create request.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.Document document = 1; + * + * @return Whether the document field is set. + */ + public boolean hasDocument() { + return documentBuilder_ != null || document_ != null; + } + /** + * + * + *
+     * Document created after executing create request.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.Document document = 1; + * + * @return The document. + */ + public com.google.cloud.contentwarehouse.v1.Document getDocument() { + if (documentBuilder_ == null) { + return document_ == null + ? com.google.cloud.contentwarehouse.v1.Document.getDefaultInstance() + : document_; + } else { + return documentBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Document created after executing create request.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.Document document = 1; + */ + public Builder setDocument(com.google.cloud.contentwarehouse.v1.Document value) { + if (documentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + document_ = value; + onChanged(); + } else { + documentBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Document created after executing create request.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.Document document = 1; + */ + public Builder setDocument( + com.google.cloud.contentwarehouse.v1.Document.Builder builderForValue) { + if (documentBuilder_ == null) { + document_ = builderForValue.build(); + onChanged(); + } else { + documentBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Document created after executing create request.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.Document document = 1; + */ + public Builder mergeDocument(com.google.cloud.contentwarehouse.v1.Document value) { + if (documentBuilder_ == null) { + if (document_ != null) { + document_ = + com.google.cloud.contentwarehouse.v1.Document.newBuilder(document_) + .mergeFrom(value) + .buildPartial(); + } else { + document_ = value; + } + onChanged(); + } else { + documentBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Document created after executing create request.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.Document document = 1; + */ + public Builder clearDocument() { + if (documentBuilder_ == null) { + document_ = null; + onChanged(); + } else { + document_ = null; + documentBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Document created after executing create request.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.Document document = 1; + */ + public com.google.cloud.contentwarehouse.v1.Document.Builder getDocumentBuilder() { + + onChanged(); + return getDocumentFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Document created after executing create request.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.Document document = 1; + */ + public com.google.cloud.contentwarehouse.v1.DocumentOrBuilder getDocumentOrBuilder() { + if (documentBuilder_ != null) { + return documentBuilder_.getMessageOrBuilder(); + } else { + return document_ == null + ? com.google.cloud.contentwarehouse.v1.Document.getDefaultInstance() + : document_; + } + } + /** + * + * + *
+     * Document created after executing create request.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.Document document = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.Document, + com.google.cloud.contentwarehouse.v1.Document.Builder, + com.google.cloud.contentwarehouse.v1.DocumentOrBuilder> + getDocumentFieldBuilder() { + if (documentBuilder_ == null) { + documentBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.Document, + com.google.cloud.contentwarehouse.v1.Document.Builder, + com.google.cloud.contentwarehouse.v1.DocumentOrBuilder>( + getDocument(), getParentForChildren(), isClean()); + document_ = null; + } + return documentBuilder_; + } + + private com.google.cloud.contentwarehouse.v1.RuleEngineOutput ruleEngineOutput_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.RuleEngineOutput, + com.google.cloud.contentwarehouse.v1.RuleEngineOutput.Builder, + com.google.cloud.contentwarehouse.v1.RuleEngineOutputOrBuilder> + ruleEngineOutputBuilder_; + /** + * + * + *
+     * Output from Rule Engine recording the rule evaluator and action executor's
+     * output.
+     * Refer format in: google/cloud/contentwarehouse/v1/rule_engine.proto
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RuleEngineOutput rule_engine_output = 2; + * + * @return Whether the ruleEngineOutput field is set. + */ + public boolean hasRuleEngineOutput() { + return ruleEngineOutputBuilder_ != null || ruleEngineOutput_ != null; + } + /** + * + * + *
+     * Output from Rule Engine recording the rule evaluator and action executor's
+     * output.
+     * Refer format in: google/cloud/contentwarehouse/v1/rule_engine.proto
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RuleEngineOutput rule_engine_output = 2; + * + * @return The ruleEngineOutput. + */ + public com.google.cloud.contentwarehouse.v1.RuleEngineOutput getRuleEngineOutput() { + if (ruleEngineOutputBuilder_ == null) { + return ruleEngineOutput_ == null + ? com.google.cloud.contentwarehouse.v1.RuleEngineOutput.getDefaultInstance() + : ruleEngineOutput_; + } else { + return ruleEngineOutputBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output from Rule Engine recording the rule evaluator and action executor's
+     * output.
+     * Refer format in: google/cloud/contentwarehouse/v1/rule_engine.proto
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RuleEngineOutput rule_engine_output = 2; + */ + public Builder setRuleEngineOutput( + com.google.cloud.contentwarehouse.v1.RuleEngineOutput value) { + if (ruleEngineOutputBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ruleEngineOutput_ = value; + onChanged(); + } else { + ruleEngineOutputBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output from Rule Engine recording the rule evaluator and action executor's
+     * output.
+     * Refer format in: google/cloud/contentwarehouse/v1/rule_engine.proto
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RuleEngineOutput rule_engine_output = 2; + */ + public Builder setRuleEngineOutput( + com.google.cloud.contentwarehouse.v1.RuleEngineOutput.Builder builderForValue) { + if (ruleEngineOutputBuilder_ == null) { + ruleEngineOutput_ = builderForValue.build(); + onChanged(); + } else { + ruleEngineOutputBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output from Rule Engine recording the rule evaluator and action executor's
+     * output.
+     * Refer format in: google/cloud/contentwarehouse/v1/rule_engine.proto
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RuleEngineOutput rule_engine_output = 2; + */ + public Builder mergeRuleEngineOutput( + com.google.cloud.contentwarehouse.v1.RuleEngineOutput value) { + if (ruleEngineOutputBuilder_ == null) { + if (ruleEngineOutput_ != null) { + ruleEngineOutput_ = + com.google.cloud.contentwarehouse.v1.RuleEngineOutput.newBuilder(ruleEngineOutput_) + .mergeFrom(value) + .buildPartial(); + } else { + ruleEngineOutput_ = value; + } + onChanged(); + } else { + ruleEngineOutputBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output from Rule Engine recording the rule evaluator and action executor's
+     * output.
+     * Refer format in: google/cloud/contentwarehouse/v1/rule_engine.proto
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RuleEngineOutput rule_engine_output = 2; + */ + public Builder clearRuleEngineOutput() { + if (ruleEngineOutputBuilder_ == null) { + ruleEngineOutput_ = null; + onChanged(); + } else { + ruleEngineOutput_ = null; + ruleEngineOutputBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output from Rule Engine recording the rule evaluator and action executor's
+     * output.
+     * Refer format in: google/cloud/contentwarehouse/v1/rule_engine.proto
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RuleEngineOutput rule_engine_output = 2; + */ + public com.google.cloud.contentwarehouse.v1.RuleEngineOutput.Builder + getRuleEngineOutputBuilder() { + + onChanged(); + return getRuleEngineOutputFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output from Rule Engine recording the rule evaluator and action executor's
+     * output.
+     * Refer format in: google/cloud/contentwarehouse/v1/rule_engine.proto
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RuleEngineOutput rule_engine_output = 2; + */ + public com.google.cloud.contentwarehouse.v1.RuleEngineOutputOrBuilder + getRuleEngineOutputOrBuilder() { + if (ruleEngineOutputBuilder_ != null) { + return ruleEngineOutputBuilder_.getMessageOrBuilder(); + } else { + return ruleEngineOutput_ == null + ? com.google.cloud.contentwarehouse.v1.RuleEngineOutput.getDefaultInstance() + : ruleEngineOutput_; + } + } + /** + * + * + *
+     * Output from Rule Engine recording the rule evaluator and action executor's
+     * output.
+     * Refer format in: google/cloud/contentwarehouse/v1/rule_engine.proto
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RuleEngineOutput rule_engine_output = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.RuleEngineOutput, + com.google.cloud.contentwarehouse.v1.RuleEngineOutput.Builder, + com.google.cloud.contentwarehouse.v1.RuleEngineOutputOrBuilder> + getRuleEngineOutputFieldBuilder() { + if (ruleEngineOutputBuilder_ == null) { + ruleEngineOutputBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.RuleEngineOutput, + com.google.cloud.contentwarehouse.v1.RuleEngineOutput.Builder, + com.google.cloud.contentwarehouse.v1.RuleEngineOutputOrBuilder>( + getRuleEngineOutput(), getParentForChildren(), isClean()); + ruleEngineOutput_ = null; + } + return ruleEngineOutputBuilder_; + } + + private com.google.cloud.contentwarehouse.v1.ResponseMetadata metadata_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.ResponseMetadata, + com.google.cloud.contentwarehouse.v1.ResponseMetadata.Builder, + com.google.cloud.contentwarehouse.v1.ResponseMetadataOrBuilder> + metadataBuilder_; + /** + * + * + *
+     * Additional information for the API invocation, such as the request tracking
+     * id.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 3; + * + * @return Whether the metadata field is set. + */ + public boolean hasMetadata() { + return metadataBuilder_ != null || metadata_ != null; + } + /** + * + * + *
+     * Additional information for the API invocation, such as the request tracking
+     * id.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 3; + * + * @return The metadata. + */ + public com.google.cloud.contentwarehouse.v1.ResponseMetadata getMetadata() { + if (metadataBuilder_ == null) { + return metadata_ == null + ? com.google.cloud.contentwarehouse.v1.ResponseMetadata.getDefaultInstance() + : metadata_; + } else { + return metadataBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Additional information for the API invocation, such as the request tracking
+     * id.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 3; + */ + public Builder setMetadata(com.google.cloud.contentwarehouse.v1.ResponseMetadata value) { + if (metadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metadata_ = value; + onChanged(); + } else { + metadataBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Additional information for the API invocation, such as the request tracking
+     * id.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 3; + */ + public Builder setMetadata( + com.google.cloud.contentwarehouse.v1.ResponseMetadata.Builder builderForValue) { + if (metadataBuilder_ == null) { + metadata_ = builderForValue.build(); + onChanged(); + } else { + metadataBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Additional information for the API invocation, such as the request tracking
+     * id.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 3; + */ + public Builder mergeMetadata(com.google.cloud.contentwarehouse.v1.ResponseMetadata value) { + if (metadataBuilder_ == null) { + if (metadata_ != null) { + metadata_ = + com.google.cloud.contentwarehouse.v1.ResponseMetadata.newBuilder(metadata_) + .mergeFrom(value) + .buildPartial(); + } else { + metadata_ = value; + } + onChanged(); + } else { + metadataBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Additional information for the API invocation, such as the request tracking
+     * id.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 3; + */ + public Builder clearMetadata() { + if (metadataBuilder_ == null) { + metadata_ = null; + onChanged(); + } else { + metadata_ = null; + metadataBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Additional information for the API invocation, such as the request tracking
+     * id.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 3; + */ + public com.google.cloud.contentwarehouse.v1.ResponseMetadata.Builder getMetadataBuilder() { + + onChanged(); + return getMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Additional information for the API invocation, such as the request tracking
+     * id.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 3; + */ + public com.google.cloud.contentwarehouse.v1.ResponseMetadataOrBuilder getMetadataOrBuilder() { + if (metadataBuilder_ != null) { + return metadataBuilder_.getMessageOrBuilder(); + } else { + return metadata_ == null + ? com.google.cloud.contentwarehouse.v1.ResponseMetadata.getDefaultInstance() + : metadata_; + } + } + /** + * + * + *
+     * Additional information for the API invocation, such as the request tracking
+     * id.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.ResponseMetadata, + com.google.cloud.contentwarehouse.v1.ResponseMetadata.Builder, + com.google.cloud.contentwarehouse.v1.ResponseMetadataOrBuilder> + getMetadataFieldBuilder() { + if (metadataBuilder_ == null) { + metadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.ResponseMetadata, + com.google.cloud.contentwarehouse.v1.ResponseMetadata.Builder, + com.google.cloud.contentwarehouse.v1.ResponseMetadataOrBuilder>( + getMetadata(), getParentForChildren(), isClean()); + metadata_ = null; + } + return metadataBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.CreateDocumentResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.CreateDocumentResponse) + private static final com.google.cloud.contentwarehouse.v1.CreateDocumentResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.CreateDocumentResponse(); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateDocumentResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.CreateDocumentResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/CreateDocumentResponseOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/CreateDocumentResponseOrBuilder.java new file mode 100644 index 000000000000..f2c6d79ba68d --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/CreateDocumentResponseOrBuilder.java @@ -0,0 +1,139 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_service.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface CreateDocumentResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.CreateDocumentResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Document created after executing create request.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.Document document = 1; + * + * @return Whether the document field is set. + */ + boolean hasDocument(); + /** + * + * + *
+   * Document created after executing create request.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.Document document = 1; + * + * @return The document. + */ + com.google.cloud.contentwarehouse.v1.Document getDocument(); + /** + * + * + *
+   * Document created after executing create request.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.Document document = 1; + */ + com.google.cloud.contentwarehouse.v1.DocumentOrBuilder getDocumentOrBuilder(); + + /** + * + * + *
+   * Output from Rule Engine recording the rule evaluator and action executor's
+   * output.
+   * Refer format in: google/cloud/contentwarehouse/v1/rule_engine.proto
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RuleEngineOutput rule_engine_output = 2; + * + * @return Whether the ruleEngineOutput field is set. + */ + boolean hasRuleEngineOutput(); + /** + * + * + *
+   * Output from Rule Engine recording the rule evaluator and action executor's
+   * output.
+   * Refer format in: google/cloud/contentwarehouse/v1/rule_engine.proto
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RuleEngineOutput rule_engine_output = 2; + * + * @return The ruleEngineOutput. + */ + com.google.cloud.contentwarehouse.v1.RuleEngineOutput getRuleEngineOutput(); + /** + * + * + *
+   * Output from Rule Engine recording the rule evaluator and action executor's
+   * output.
+   * Refer format in: google/cloud/contentwarehouse/v1/rule_engine.proto
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RuleEngineOutput rule_engine_output = 2; + */ + com.google.cloud.contentwarehouse.v1.RuleEngineOutputOrBuilder getRuleEngineOutputOrBuilder(); + + /** + * + * + *
+   * Additional information for the API invocation, such as the request tracking
+   * id.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 3; + * + * @return Whether the metadata field is set. + */ + boolean hasMetadata(); + /** + * + * + *
+   * Additional information for the API invocation, such as the request tracking
+   * id.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 3; + * + * @return The metadata. + */ + com.google.cloud.contentwarehouse.v1.ResponseMetadata getMetadata(); + /** + * + * + *
+   * Additional information for the API invocation, such as the request tracking
+   * id.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 3; + */ + com.google.cloud.contentwarehouse.v1.ResponseMetadataOrBuilder getMetadataOrBuilder(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/CreateDocumentSchemaRequest.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/CreateDocumentSchemaRequest.java new file mode 100644 index 000000000000..decc192f3435 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/CreateDocumentSchemaRequest.java @@ -0,0 +1,929 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_schema_service.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Request message for DocumentSchemaService.CreateDocumentSchema.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest} + */ +public final class CreateDocumentSchemaRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest) + CreateDocumentSchemaRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateDocumentSchemaRequest.newBuilder() to construct. + private CreateDocumentSchemaRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateDocumentSchemaRequest() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateDocumentSchemaRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaServiceProto + .internal_static_google_cloud_contentwarehouse_v1_CreateDocumentSchemaRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaServiceProto + .internal_static_google_cloud_contentwarehouse_v1_CreateDocumentSchemaRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest.class, + com.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DOCUMENT_SCHEMA_FIELD_NUMBER = 2; + private com.google.cloud.contentwarehouse.v1.DocumentSchema documentSchema_; + /** + * + * + *
+   * Required. The document schema to create.
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.DocumentSchema document_schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the documentSchema field is set. + */ + @java.lang.Override + public boolean hasDocumentSchema() { + return documentSchema_ != null; + } + /** + * + * + *
+   * Required. The document schema to create.
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.DocumentSchema document_schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The documentSchema. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DocumentSchema getDocumentSchema() { + return documentSchema_ == null + ? com.google.cloud.contentwarehouse.v1.DocumentSchema.getDefaultInstance() + : documentSchema_; + } + /** + * + * + *
+   * Required. The document schema to create.
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.DocumentSchema document_schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DocumentSchemaOrBuilder getDocumentSchemaOrBuilder() { + return getDocumentSchema(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (documentSchema_ != null) { + output.writeMessage(2, getDocumentSchema()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (documentSchema_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getDocumentSchema()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest other = + (com.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasDocumentSchema() != other.hasDocumentSchema()) return false; + if (hasDocumentSchema()) { + if (!getDocumentSchema().equals(other.getDocumentSchema())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasDocumentSchema()) { + hash = (37 * hash) + DOCUMENT_SCHEMA_FIELD_NUMBER; + hash = (53 * hash) + getDocumentSchema().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for DocumentSchemaService.CreateDocumentSchema.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest) + com.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaServiceProto + .internal_static_google_cloud_contentwarehouse_v1_CreateDocumentSchemaRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaServiceProto + .internal_static_google_cloud_contentwarehouse_v1_CreateDocumentSchemaRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest.class, + com.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + if (documentSchemaBuilder_ == null) { + documentSchema_ = null; + } else { + documentSchema_ = null; + documentSchemaBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaServiceProto + .internal_static_google_cloud_contentwarehouse_v1_CreateDocumentSchemaRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest + getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest build() { + com.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest buildPartial() { + com.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest result = + new com.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest(this); + result.parent_ = parent_; + if (documentSchemaBuilder_ == null) { + result.documentSchema_ = documentSchema_; + } else { + result.documentSchema_ = documentSchemaBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest other) { + if (other + == com.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasDocumentSchema()) { + mergeDocumentSchema(other.getDocumentSchema()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + input.readMessage(getDocumentSchemaFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private com.google.cloud.contentwarehouse.v1.DocumentSchema documentSchema_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.DocumentSchema, + com.google.cloud.contentwarehouse.v1.DocumentSchema.Builder, + com.google.cloud.contentwarehouse.v1.DocumentSchemaOrBuilder> + documentSchemaBuilder_; + /** + * + * + *
+     * Required. The document schema to create.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.DocumentSchema document_schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the documentSchema field is set. + */ + public boolean hasDocumentSchema() { + return documentSchemaBuilder_ != null || documentSchema_ != null; + } + /** + * + * + *
+     * Required. The document schema to create.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.DocumentSchema document_schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The documentSchema. + */ + public com.google.cloud.contentwarehouse.v1.DocumentSchema getDocumentSchema() { + if (documentSchemaBuilder_ == null) { + return documentSchema_ == null + ? com.google.cloud.contentwarehouse.v1.DocumentSchema.getDefaultInstance() + : documentSchema_; + } else { + return documentSchemaBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The document schema to create.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.DocumentSchema document_schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDocumentSchema(com.google.cloud.contentwarehouse.v1.DocumentSchema value) { + if (documentSchemaBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + documentSchema_ = value; + onChanged(); + } else { + documentSchemaBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The document schema to create.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.DocumentSchema document_schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDocumentSchema( + com.google.cloud.contentwarehouse.v1.DocumentSchema.Builder builderForValue) { + if (documentSchemaBuilder_ == null) { + documentSchema_ = builderForValue.build(); + onChanged(); + } else { + documentSchemaBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The document schema to create.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.DocumentSchema document_schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeDocumentSchema(com.google.cloud.contentwarehouse.v1.DocumentSchema value) { + if (documentSchemaBuilder_ == null) { + if (documentSchema_ != null) { + documentSchema_ = + com.google.cloud.contentwarehouse.v1.DocumentSchema.newBuilder(documentSchema_) + .mergeFrom(value) + .buildPartial(); + } else { + documentSchema_ = value; + } + onChanged(); + } else { + documentSchemaBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The document schema to create.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.DocumentSchema document_schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearDocumentSchema() { + if (documentSchemaBuilder_ == null) { + documentSchema_ = null; + onChanged(); + } else { + documentSchema_ = null; + documentSchemaBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The document schema to create.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.DocumentSchema document_schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.contentwarehouse.v1.DocumentSchema.Builder getDocumentSchemaBuilder() { + + onChanged(); + return getDocumentSchemaFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The document schema to create.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.DocumentSchema document_schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.contentwarehouse.v1.DocumentSchemaOrBuilder + getDocumentSchemaOrBuilder() { + if (documentSchemaBuilder_ != null) { + return documentSchemaBuilder_.getMessageOrBuilder(); + } else { + return documentSchema_ == null + ? com.google.cloud.contentwarehouse.v1.DocumentSchema.getDefaultInstance() + : documentSchema_; + } + } + /** + * + * + *
+     * Required. The document schema to create.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.DocumentSchema document_schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.DocumentSchema, + com.google.cloud.contentwarehouse.v1.DocumentSchema.Builder, + com.google.cloud.contentwarehouse.v1.DocumentSchemaOrBuilder> + getDocumentSchemaFieldBuilder() { + if (documentSchemaBuilder_ == null) { + documentSchemaBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.DocumentSchema, + com.google.cloud.contentwarehouse.v1.DocumentSchema.Builder, + com.google.cloud.contentwarehouse.v1.DocumentSchemaOrBuilder>( + getDocumentSchema(), getParentForChildren(), isClean()); + documentSchema_ = null; + } + return documentSchemaBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest) + private static final com.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest(); + } + + public static com.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateDocumentSchemaRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/CreateDocumentSchemaRequestOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/CreateDocumentSchemaRequestOrBuilder.java new file mode 100644 index 000000000000..d2206ac27865 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/CreateDocumentSchemaRequestOrBuilder.java @@ -0,0 +1,95 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_schema_service.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface CreateDocumentSchemaRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The document schema to create.
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.DocumentSchema document_schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the documentSchema field is set. + */ + boolean hasDocumentSchema(); + /** + * + * + *
+   * Required. The document schema to create.
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.DocumentSchema document_schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The documentSchema. + */ + com.google.cloud.contentwarehouse.v1.DocumentSchema getDocumentSchema(); + /** + * + * + *
+   * Required. The document schema to create.
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.DocumentSchema document_schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.contentwarehouse.v1.DocumentSchemaOrBuilder getDocumentSchemaOrBuilder(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/CreateRuleSetRequest.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/CreateRuleSetRequest.java new file mode 100644 index 000000000000..0d67d6700d14 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/CreateRuleSetRequest.java @@ -0,0 +1,929 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/ruleset_service_request.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Request message for RuleSetService.CreateRuleSet.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.CreateRuleSetRequest} + */ +public final class CreateRuleSetRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.CreateRuleSetRequest) + CreateRuleSetRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateRuleSetRequest.newBuilder() to construct. + private CreateRuleSetRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateRuleSetRequest() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateRuleSetRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.RuleSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_CreateRuleSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.RuleSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_CreateRuleSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.CreateRuleSetRequest.class, + com.google.cloud.contentwarehouse.v1.CreateRuleSetRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent name.
+   * Format: projects/{project_number}/locations/{location}.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent name.
+   * Format: projects/{project_number}/locations/{location}.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RULE_SET_FIELD_NUMBER = 2; + private com.google.cloud.contentwarehouse.v1.RuleSet ruleSet_; + /** + * + * + *
+   * Required. The rule set to create.
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.RuleSet rule_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the ruleSet field is set. + */ + @java.lang.Override + public boolean hasRuleSet() { + return ruleSet_ != null; + } + /** + * + * + *
+   * Required. The rule set to create.
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.RuleSet rule_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The ruleSet. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RuleSet getRuleSet() { + return ruleSet_ == null + ? com.google.cloud.contentwarehouse.v1.RuleSet.getDefaultInstance() + : ruleSet_; + } + /** + * + * + *
+   * Required. The rule set to create.
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.RuleSet rule_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RuleSetOrBuilder getRuleSetOrBuilder() { + return getRuleSet(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (ruleSet_ != null) { + output.writeMessage(2, getRuleSet()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (ruleSet_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getRuleSet()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.CreateRuleSetRequest)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.CreateRuleSetRequest other = + (com.google.cloud.contentwarehouse.v1.CreateRuleSetRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasRuleSet() != other.hasRuleSet()) return false; + if (hasRuleSet()) { + if (!getRuleSet().equals(other.getRuleSet())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasRuleSet()) { + hash = (37 * hash) + RULE_SET_FIELD_NUMBER; + hash = (53 * hash) + getRuleSet().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.CreateRuleSetRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.CreateRuleSetRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.CreateRuleSetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.CreateRuleSetRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.CreateRuleSetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.CreateRuleSetRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.CreateRuleSetRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.CreateRuleSetRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.CreateRuleSetRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.CreateRuleSetRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.CreateRuleSetRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.CreateRuleSetRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.CreateRuleSetRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for RuleSetService.CreateRuleSet.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.CreateRuleSetRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.CreateRuleSetRequest) + com.google.cloud.contentwarehouse.v1.CreateRuleSetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.RuleSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_CreateRuleSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.RuleSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_CreateRuleSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.CreateRuleSetRequest.class, + com.google.cloud.contentwarehouse.v1.CreateRuleSetRequest.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.CreateRuleSetRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + if (ruleSetBuilder_ == null) { + ruleSet_ = null; + } else { + ruleSet_ = null; + ruleSetBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.RuleSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_CreateRuleSetRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.CreateRuleSetRequest getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.CreateRuleSetRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.CreateRuleSetRequest build() { + com.google.cloud.contentwarehouse.v1.CreateRuleSetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.CreateRuleSetRequest buildPartial() { + com.google.cloud.contentwarehouse.v1.CreateRuleSetRequest result = + new com.google.cloud.contentwarehouse.v1.CreateRuleSetRequest(this); + result.parent_ = parent_; + if (ruleSetBuilder_ == null) { + result.ruleSet_ = ruleSet_; + } else { + result.ruleSet_ = ruleSetBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.CreateRuleSetRequest) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.CreateRuleSetRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.CreateRuleSetRequest other) { + if (other == com.google.cloud.contentwarehouse.v1.CreateRuleSetRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasRuleSet()) { + mergeRuleSet(other.getRuleSet()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + input.readMessage(getRuleSetFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent name.
+     * Format: projects/{project_number}/locations/{location}.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent name.
+     * Format: projects/{project_number}/locations/{location}.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent name.
+     * Format: projects/{project_number}/locations/{location}.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent name.
+     * Format: projects/{project_number}/locations/{location}.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent name.
+     * Format: projects/{project_number}/locations/{location}.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private com.google.cloud.contentwarehouse.v1.RuleSet ruleSet_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.RuleSet, + com.google.cloud.contentwarehouse.v1.RuleSet.Builder, + com.google.cloud.contentwarehouse.v1.RuleSetOrBuilder> + ruleSetBuilder_; + /** + * + * + *
+     * Required. The rule set to create.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.RuleSet rule_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the ruleSet field is set. + */ + public boolean hasRuleSet() { + return ruleSetBuilder_ != null || ruleSet_ != null; + } + /** + * + * + *
+     * Required. The rule set to create.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.RuleSet rule_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The ruleSet. + */ + public com.google.cloud.contentwarehouse.v1.RuleSet getRuleSet() { + if (ruleSetBuilder_ == null) { + return ruleSet_ == null + ? com.google.cloud.contentwarehouse.v1.RuleSet.getDefaultInstance() + : ruleSet_; + } else { + return ruleSetBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The rule set to create.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.RuleSet rule_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setRuleSet(com.google.cloud.contentwarehouse.v1.RuleSet value) { + if (ruleSetBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ruleSet_ = value; + onChanged(); + } else { + ruleSetBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The rule set to create.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.RuleSet rule_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setRuleSet( + com.google.cloud.contentwarehouse.v1.RuleSet.Builder builderForValue) { + if (ruleSetBuilder_ == null) { + ruleSet_ = builderForValue.build(); + onChanged(); + } else { + ruleSetBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The rule set to create.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.RuleSet rule_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeRuleSet(com.google.cloud.contentwarehouse.v1.RuleSet value) { + if (ruleSetBuilder_ == null) { + if (ruleSet_ != null) { + ruleSet_ = + com.google.cloud.contentwarehouse.v1.RuleSet.newBuilder(ruleSet_) + .mergeFrom(value) + .buildPartial(); + } else { + ruleSet_ = value; + } + onChanged(); + } else { + ruleSetBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The rule set to create.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.RuleSet rule_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearRuleSet() { + if (ruleSetBuilder_ == null) { + ruleSet_ = null; + onChanged(); + } else { + ruleSet_ = null; + ruleSetBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The rule set to create.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.RuleSet rule_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.contentwarehouse.v1.RuleSet.Builder getRuleSetBuilder() { + + onChanged(); + return getRuleSetFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The rule set to create.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.RuleSet rule_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.contentwarehouse.v1.RuleSetOrBuilder getRuleSetOrBuilder() { + if (ruleSetBuilder_ != null) { + return ruleSetBuilder_.getMessageOrBuilder(); + } else { + return ruleSet_ == null + ? com.google.cloud.contentwarehouse.v1.RuleSet.getDefaultInstance() + : ruleSet_; + } + } + /** + * + * + *
+     * Required. The rule set to create.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.RuleSet rule_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.RuleSet, + com.google.cloud.contentwarehouse.v1.RuleSet.Builder, + com.google.cloud.contentwarehouse.v1.RuleSetOrBuilder> + getRuleSetFieldBuilder() { + if (ruleSetBuilder_ == null) { + ruleSetBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.RuleSet, + com.google.cloud.contentwarehouse.v1.RuleSet.Builder, + com.google.cloud.contentwarehouse.v1.RuleSetOrBuilder>( + getRuleSet(), getParentForChildren(), isClean()); + ruleSet_ = null; + } + return ruleSetBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.CreateRuleSetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.CreateRuleSetRequest) + private static final com.google.cloud.contentwarehouse.v1.CreateRuleSetRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.CreateRuleSetRequest(); + } + + public static com.google.cloud.contentwarehouse.v1.CreateRuleSetRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateRuleSetRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.CreateRuleSetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/CreateRuleSetRequestOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/CreateRuleSetRequestOrBuilder.java new file mode 100644 index 000000000000..3ac8e8bbaa0d --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/CreateRuleSetRequestOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/ruleset_service_request.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface CreateRuleSetRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.CreateRuleSetRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent name.
+   * Format: projects/{project_number}/locations/{location}.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent name.
+   * Format: projects/{project_number}/locations/{location}.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The rule set to create.
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.RuleSet rule_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the ruleSet field is set. + */ + boolean hasRuleSet(); + /** + * + * + *
+   * Required. The rule set to create.
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.RuleSet rule_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The ruleSet. + */ + com.google.cloud.contentwarehouse.v1.RuleSet getRuleSet(); + /** + * + * + *
+   * Required. The rule set to create.
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.RuleSet rule_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.contentwarehouse.v1.RuleSetOrBuilder getRuleSetOrBuilder(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/CreateSynonymSetRequest.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/CreateSynonymSetRequest.java new file mode 100644 index 000000000000..347f06c9fef5 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/CreateSynonymSetRequest.java @@ -0,0 +1,932 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/synonymset_service_request.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Request message for SynonymSetService.CreateSynonymSet.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.CreateSynonymSetRequest} + */ +public final class CreateSynonymSetRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.CreateSynonymSetRequest) + CreateSynonymSetRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateSynonymSetRequest.newBuilder() to construct. + private CreateSynonymSetRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateSynonymSetRequest() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateSynonymSetRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.SynonymSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_CreateSynonymSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.SynonymSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_CreateSynonymSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest.class, + com.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent name.
+   * Format: projects/{project_number}/locations/{location}.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent name.
+   * Format: projects/{project_number}/locations/{location}.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SYNONYM_SET_FIELD_NUMBER = 2; + private com.google.cloud.contentwarehouse.v1.SynonymSet synonymSet_; + /** + * + * + *
+   * Required. The synonymSet to be created for a context
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.SynonymSet synonym_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the synonymSet field is set. + */ + @java.lang.Override + public boolean hasSynonymSet() { + return synonymSet_ != null; + } + /** + * + * + *
+   * Required. The synonymSet to be created for a context
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.SynonymSet synonym_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The synonymSet. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.SynonymSet getSynonymSet() { + return synonymSet_ == null + ? com.google.cloud.contentwarehouse.v1.SynonymSet.getDefaultInstance() + : synonymSet_; + } + /** + * + * + *
+   * Required. The synonymSet to be created for a context
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.SynonymSet synonym_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.SynonymSetOrBuilder getSynonymSetOrBuilder() { + return getSynonymSet(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (synonymSet_ != null) { + output.writeMessage(2, getSynonymSet()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (synonymSet_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getSynonymSet()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest other = + (com.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasSynonymSet() != other.hasSynonymSet()) return false; + if (hasSynonymSet()) { + if (!getSynonymSet().equals(other.getSynonymSet())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasSynonymSet()) { + hash = (37 * hash) + SYNONYM_SET_FIELD_NUMBER; + hash = (53 * hash) + getSynonymSet().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for SynonymSetService.CreateSynonymSet.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.CreateSynonymSetRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.CreateSynonymSetRequest) + com.google.cloud.contentwarehouse.v1.CreateSynonymSetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.SynonymSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_CreateSynonymSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.SynonymSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_CreateSynonymSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest.class, + com.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + if (synonymSetBuilder_ == null) { + synonymSet_ = null; + } else { + synonymSet_ = null; + synonymSetBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.SynonymSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_CreateSynonymSetRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest + getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest build() { + com.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest buildPartial() { + com.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest result = + new com.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest(this); + result.parent_ = parent_; + if (synonymSetBuilder_ == null) { + result.synonymSet_ = synonymSet_; + } else { + result.synonymSet_ = synonymSetBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest other) { + if (other + == com.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasSynonymSet()) { + mergeSynonymSet(other.getSynonymSet()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + input.readMessage(getSynonymSetFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent name.
+     * Format: projects/{project_number}/locations/{location}.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent name.
+     * Format: projects/{project_number}/locations/{location}.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent name.
+     * Format: projects/{project_number}/locations/{location}.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent name.
+     * Format: projects/{project_number}/locations/{location}.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent name.
+     * Format: projects/{project_number}/locations/{location}.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private com.google.cloud.contentwarehouse.v1.SynonymSet synonymSet_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.SynonymSet, + com.google.cloud.contentwarehouse.v1.SynonymSet.Builder, + com.google.cloud.contentwarehouse.v1.SynonymSetOrBuilder> + synonymSetBuilder_; + /** + * + * + *
+     * Required. The synonymSet to be created for a context
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.SynonymSet synonym_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the synonymSet field is set. + */ + public boolean hasSynonymSet() { + return synonymSetBuilder_ != null || synonymSet_ != null; + } + /** + * + * + *
+     * Required. The synonymSet to be created for a context
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.SynonymSet synonym_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The synonymSet. + */ + public com.google.cloud.contentwarehouse.v1.SynonymSet getSynonymSet() { + if (synonymSetBuilder_ == null) { + return synonymSet_ == null + ? com.google.cloud.contentwarehouse.v1.SynonymSet.getDefaultInstance() + : synonymSet_; + } else { + return synonymSetBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The synonymSet to be created for a context
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.SynonymSet synonym_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSynonymSet(com.google.cloud.contentwarehouse.v1.SynonymSet value) { + if (synonymSetBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + synonymSet_ = value; + onChanged(); + } else { + synonymSetBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The synonymSet to be created for a context
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.SynonymSet synonym_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSynonymSet( + com.google.cloud.contentwarehouse.v1.SynonymSet.Builder builderForValue) { + if (synonymSetBuilder_ == null) { + synonymSet_ = builderForValue.build(); + onChanged(); + } else { + synonymSetBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The synonymSet to be created for a context
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.SynonymSet synonym_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeSynonymSet(com.google.cloud.contentwarehouse.v1.SynonymSet value) { + if (synonymSetBuilder_ == null) { + if (synonymSet_ != null) { + synonymSet_ = + com.google.cloud.contentwarehouse.v1.SynonymSet.newBuilder(synonymSet_) + .mergeFrom(value) + .buildPartial(); + } else { + synonymSet_ = value; + } + onChanged(); + } else { + synonymSetBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The synonymSet to be created for a context
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.SynonymSet synonym_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearSynonymSet() { + if (synonymSetBuilder_ == null) { + synonymSet_ = null; + onChanged(); + } else { + synonymSet_ = null; + synonymSetBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The synonymSet to be created for a context
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.SynonymSet synonym_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.contentwarehouse.v1.SynonymSet.Builder getSynonymSetBuilder() { + + onChanged(); + return getSynonymSetFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The synonymSet to be created for a context
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.SynonymSet synonym_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.contentwarehouse.v1.SynonymSetOrBuilder getSynonymSetOrBuilder() { + if (synonymSetBuilder_ != null) { + return synonymSetBuilder_.getMessageOrBuilder(); + } else { + return synonymSet_ == null + ? com.google.cloud.contentwarehouse.v1.SynonymSet.getDefaultInstance() + : synonymSet_; + } + } + /** + * + * + *
+     * Required. The synonymSet to be created for a context
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.SynonymSet synonym_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.SynonymSet, + com.google.cloud.contentwarehouse.v1.SynonymSet.Builder, + com.google.cloud.contentwarehouse.v1.SynonymSetOrBuilder> + getSynonymSetFieldBuilder() { + if (synonymSetBuilder_ == null) { + synonymSetBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.SynonymSet, + com.google.cloud.contentwarehouse.v1.SynonymSet.Builder, + com.google.cloud.contentwarehouse.v1.SynonymSetOrBuilder>( + getSynonymSet(), getParentForChildren(), isClean()); + synonymSet_ = null; + } + return synonymSetBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.CreateSynonymSetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.CreateSynonymSetRequest) + private static final com.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest(); + } + + public static com.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateSynonymSetRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/CreateSynonymSetRequestOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/CreateSynonymSetRequestOrBuilder.java new file mode 100644 index 000000000000..381a6c44293a --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/CreateSynonymSetRequestOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/synonymset_service_request.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface CreateSynonymSetRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.CreateSynonymSetRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent name.
+   * Format: projects/{project_number}/locations/{location}.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent name.
+   * Format: projects/{project_number}/locations/{location}.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The synonymSet to be created for a context
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.SynonymSet synonym_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the synonymSet field is set. + */ + boolean hasSynonymSet(); + /** + * + * + *
+   * Required. The synonymSet to be created for a context
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.SynonymSet synonym_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The synonymSet. + */ + com.google.cloud.contentwarehouse.v1.SynonymSet getSynonymSet(); + /** + * + * + *
+   * Required. The synonymSet to be created for a context
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.SynonymSet synonym_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.contentwarehouse.v1.SynonymSetOrBuilder getSynonymSetOrBuilder(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DataUpdateAction.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DataUpdateAction.java new file mode 100644 index 000000000000..92d88c7c0be6 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DataUpdateAction.java @@ -0,0 +1,803 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/rule_engine.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Represents the action responsible for properties update operations.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.DataUpdateAction} + */ +public final class DataUpdateAction extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.DataUpdateAction) + DataUpdateActionOrBuilder { + private static final long serialVersionUID = 0L; + // Use DataUpdateAction.newBuilder() to construct. + private DataUpdateAction(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DataUpdateAction() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DataUpdateAction(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_DataUpdateAction_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 1: + return internalGetEntries(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_DataUpdateAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.DataUpdateAction.class, + com.google.cloud.contentwarehouse.v1.DataUpdateAction.Builder.class); + } + + public static final int ENTRIES_FIELD_NUMBER = 1; + + private static final class EntriesDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_DataUpdateAction_EntriesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField entries_; + + private com.google.protobuf.MapField internalGetEntries() { + if (entries_ == null) { + return com.google.protobuf.MapField.emptyMapField(EntriesDefaultEntryHolder.defaultEntry); + } + return entries_; + } + + public int getEntriesCount() { + return internalGetEntries().getMap().size(); + } + /** + * + * + *
+   * Map of (K, V) -> (valid name of the field, new value of the field)
+   * E.g., ("age", "60") entry triggers update of field age with a value of 60.
+   * If the field is not present then new entry is added.
+   * During update action execution, value strings will be casted to
+   * appropriate types.
+   * 
+ * + * map<string, string> entries = 1; + */ + @java.lang.Override + public boolean containsEntries(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetEntries().getMap().containsKey(key); + } + /** Use {@link #getEntriesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getEntries() { + return getEntriesMap(); + } + /** + * + * + *
+   * Map of (K, V) -> (valid name of the field, new value of the field)
+   * E.g., ("age", "60") entry triggers update of field age with a value of 60.
+   * If the field is not present then new entry is added.
+   * During update action execution, value strings will be casted to
+   * appropriate types.
+   * 
+ * + * map<string, string> entries = 1; + */ + @java.lang.Override + public java.util.Map getEntriesMap() { + return internalGetEntries().getMap(); + } + /** + * + * + *
+   * Map of (K, V) -> (valid name of the field, new value of the field)
+   * E.g., ("age", "60") entry triggers update of field age with a value of 60.
+   * If the field is not present then new entry is added.
+   * During update action execution, value strings will be casted to
+   * appropriate types.
+   * 
+ * + * map<string, string> entries = 1; + */ + @java.lang.Override + public java.lang.String getEntriesOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetEntries().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Map of (K, V) -> (valid name of the field, new value of the field)
+   * E.g., ("age", "60") entry triggers update of field age with a value of 60.
+   * If the field is not present then new entry is added.
+   * During update action execution, value strings will be casted to
+   * appropriate types.
+   * 
+ * + * map<string, string> entries = 1; + */ + @java.lang.Override + public java.lang.String getEntriesOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetEntries().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetEntries(), EntriesDefaultEntryHolder.defaultEntry, 1); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry entry : + internalGetEntries().getMap().entrySet()) { + com.google.protobuf.MapEntry entries__ = + EntriesDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, entries__); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.DataUpdateAction)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.DataUpdateAction other = + (com.google.cloud.contentwarehouse.v1.DataUpdateAction) obj; + + if (!internalGetEntries().equals(other.internalGetEntries())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetEntries().getMap().isEmpty()) { + hash = (37 * hash) + ENTRIES_FIELD_NUMBER; + hash = (53 * hash) + internalGetEntries().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.DataUpdateAction parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.DataUpdateAction parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DataUpdateAction parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.DataUpdateAction parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DataUpdateAction parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.DataUpdateAction parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DataUpdateAction parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.DataUpdateAction parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DataUpdateAction parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.DataUpdateAction parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DataUpdateAction parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.DataUpdateAction parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.DataUpdateAction prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Represents the action responsible for properties update operations.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.DataUpdateAction} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.DataUpdateAction) + com.google.cloud.contentwarehouse.v1.DataUpdateActionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_DataUpdateAction_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 1: + return internalGetEntries(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 1: + return internalGetMutableEntries(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_DataUpdateAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.DataUpdateAction.class, + com.google.cloud.contentwarehouse.v1.DataUpdateAction.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.DataUpdateAction.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + internalGetMutableEntries().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_DataUpdateAction_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DataUpdateAction getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.DataUpdateAction.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DataUpdateAction build() { + com.google.cloud.contentwarehouse.v1.DataUpdateAction result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DataUpdateAction buildPartial() { + com.google.cloud.contentwarehouse.v1.DataUpdateAction result = + new com.google.cloud.contentwarehouse.v1.DataUpdateAction(this); + int from_bitField0_ = bitField0_; + result.entries_ = internalGetEntries(); + result.entries_.makeImmutable(); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.DataUpdateAction) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.DataUpdateAction) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.DataUpdateAction other) { + if (other == com.google.cloud.contentwarehouse.v1.DataUpdateAction.getDefaultInstance()) + return this; + internalGetMutableEntries().mergeFrom(other.internalGetEntries()); + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.MapEntry entries__ = + input.readMessage( + EntriesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableEntries() + .getMutableMap() + .put(entries__.getKey(), entries__.getValue()); + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.MapField entries_; + + private com.google.protobuf.MapField internalGetEntries() { + if (entries_ == null) { + return com.google.protobuf.MapField.emptyMapField(EntriesDefaultEntryHolder.defaultEntry); + } + return entries_; + } + + private com.google.protobuf.MapField + internalGetMutableEntries() { + onChanged(); + ; + if (entries_ == null) { + entries_ = com.google.protobuf.MapField.newMapField(EntriesDefaultEntryHolder.defaultEntry); + } + if (!entries_.isMutable()) { + entries_ = entries_.copy(); + } + return entries_; + } + + public int getEntriesCount() { + return internalGetEntries().getMap().size(); + } + /** + * + * + *
+     * Map of (K, V) -> (valid name of the field, new value of the field)
+     * E.g., ("age", "60") entry triggers update of field age with a value of 60.
+     * If the field is not present then new entry is added.
+     * During update action execution, value strings will be casted to
+     * appropriate types.
+     * 
+ * + * map<string, string> entries = 1; + */ + @java.lang.Override + public boolean containsEntries(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetEntries().getMap().containsKey(key); + } + /** Use {@link #getEntriesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getEntries() { + return getEntriesMap(); + } + /** + * + * + *
+     * Map of (K, V) -> (valid name of the field, new value of the field)
+     * E.g., ("age", "60") entry triggers update of field age with a value of 60.
+     * If the field is not present then new entry is added.
+     * During update action execution, value strings will be casted to
+     * appropriate types.
+     * 
+ * + * map<string, string> entries = 1; + */ + @java.lang.Override + public java.util.Map getEntriesMap() { + return internalGetEntries().getMap(); + } + /** + * + * + *
+     * Map of (K, V) -> (valid name of the field, new value of the field)
+     * E.g., ("age", "60") entry triggers update of field age with a value of 60.
+     * If the field is not present then new entry is added.
+     * During update action execution, value strings will be casted to
+     * appropriate types.
+     * 
+ * + * map<string, string> entries = 1; + */ + @java.lang.Override + public java.lang.String getEntriesOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetEntries().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Map of (K, V) -> (valid name of the field, new value of the field)
+     * E.g., ("age", "60") entry triggers update of field age with a value of 60.
+     * If the field is not present then new entry is added.
+     * During update action execution, value strings will be casted to
+     * appropriate types.
+     * 
+ * + * map<string, string> entries = 1; + */ + @java.lang.Override + public java.lang.String getEntriesOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetEntries().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearEntries() { + internalGetMutableEntries().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Map of (K, V) -> (valid name of the field, new value of the field)
+     * E.g., ("age", "60") entry triggers update of field age with a value of 60.
+     * If the field is not present then new entry is added.
+     * During update action execution, value strings will be casted to
+     * appropriate types.
+     * 
+ * + * map<string, string> entries = 1; + */ + public Builder removeEntries(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableEntries().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableEntries() { + return internalGetMutableEntries().getMutableMap(); + } + /** + * + * + *
+     * Map of (K, V) -> (valid name of the field, new value of the field)
+     * E.g., ("age", "60") entry triggers update of field age with a value of 60.
+     * If the field is not present then new entry is added.
+     * During update action execution, value strings will be casted to
+     * appropriate types.
+     * 
+ * + * map<string, string> entries = 1; + */ + public Builder putEntries(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + + internalGetMutableEntries().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Map of (K, V) -> (valid name of the field, new value of the field)
+     * E.g., ("age", "60") entry triggers update of field age with a value of 60.
+     * If the field is not present then new entry is added.
+     * During update action execution, value strings will be casted to
+     * appropriate types.
+     * 
+ * + * map<string, string> entries = 1; + */ + public Builder putAllEntries(java.util.Map values) { + internalGetMutableEntries().getMutableMap().putAll(values); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.DataUpdateAction) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.DataUpdateAction) + private static final com.google.cloud.contentwarehouse.v1.DataUpdateAction DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.DataUpdateAction(); + } + + public static com.google.cloud.contentwarehouse.v1.DataUpdateAction getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DataUpdateAction parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DataUpdateAction getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DataUpdateActionOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DataUpdateActionOrBuilder.java new file mode 100644 index 000000000000..e6705b217c5f --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DataUpdateActionOrBuilder.java @@ -0,0 +1,104 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/rule_engine.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface DataUpdateActionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.DataUpdateAction) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Map of (K, V) -> (valid name of the field, new value of the field)
+   * E.g., ("age", "60") entry triggers update of field age with a value of 60.
+   * If the field is not present then new entry is added.
+   * During update action execution, value strings will be casted to
+   * appropriate types.
+   * 
+ * + * map<string, string> entries = 1; + */ + int getEntriesCount(); + /** + * + * + *
+   * Map of (K, V) -> (valid name of the field, new value of the field)
+   * E.g., ("age", "60") entry triggers update of field age with a value of 60.
+   * If the field is not present then new entry is added.
+   * During update action execution, value strings will be casted to
+   * appropriate types.
+   * 
+ * + * map<string, string> entries = 1; + */ + boolean containsEntries(java.lang.String key); + /** Use {@link #getEntriesMap()} instead. */ + @java.lang.Deprecated + java.util.Map getEntries(); + /** + * + * + *
+   * Map of (K, V) -> (valid name of the field, new value of the field)
+   * E.g., ("age", "60") entry triggers update of field age with a value of 60.
+   * If the field is not present then new entry is added.
+   * During update action execution, value strings will be casted to
+   * appropriate types.
+   * 
+ * + * map<string, string> entries = 1; + */ + java.util.Map getEntriesMap(); + /** + * + * + *
+   * Map of (K, V) -> (valid name of the field, new value of the field)
+   * E.g., ("age", "60") entry triggers update of field age with a value of 60.
+   * If the field is not present then new entry is added.
+   * During update action execution, value strings will be casted to
+   * appropriate types.
+   * 
+ * + * map<string, string> entries = 1; + */ + + /* nullable */ + java.lang.String getEntriesOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Map of (K, V) -> (valid name of the field, new value of the field)
+   * E.g., ("age", "60") entry triggers update of field age with a value of 60.
+   * If the field is not present then new entry is added.
+   * During update action execution, value strings will be casted to
+   * appropriate types.
+   * 
+ * + * map<string, string> entries = 1; + */ + java.lang.String getEntriesOrThrow(java.lang.String key); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DataValidationAction.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DataValidationAction.java new file mode 100644 index 000000000000..d4b9ae2cab97 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DataValidationAction.java @@ -0,0 +1,785 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/rule_engine.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Represents the action responsible for data validation operations.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.DataValidationAction} + */ +public final class DataValidationAction extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.DataValidationAction) + DataValidationActionOrBuilder { + private static final long serialVersionUID = 0L; + // Use DataValidationAction.newBuilder() to construct. + private DataValidationAction(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DataValidationAction() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DataValidationAction(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_DataValidationAction_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 1: + return internalGetConditions(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_DataValidationAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.DataValidationAction.class, + com.google.cloud.contentwarehouse.v1.DataValidationAction.Builder.class); + } + + public static final int CONDITIONS_FIELD_NUMBER = 1; + + private static final class ConditionsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_DataValidationAction_ConditionsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField conditions_; + + private com.google.protobuf.MapField internalGetConditions() { + if (conditions_ == null) { + return com.google.protobuf.MapField.emptyMapField(ConditionsDefaultEntryHolder.defaultEntry); + } + return conditions_; + } + + public int getConditionsCount() { + return internalGetConditions().getMap().size(); + } + /** + * + * + *
+   * Map of (K, V) -> (field, string condition to be evaluated on the field)
+   * E.g., ("age", "age > 18  && age < 60") entry triggers validation of field
+   * age with the given condition. Map entries will be ANDed during validation.
+   * 
+ * + * map<string, string> conditions = 1; + */ + @java.lang.Override + public boolean containsConditions(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetConditions().getMap().containsKey(key); + } + /** Use {@link #getConditionsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getConditions() { + return getConditionsMap(); + } + /** + * + * + *
+   * Map of (K, V) -> (field, string condition to be evaluated on the field)
+   * E.g., ("age", "age > 18  && age < 60") entry triggers validation of field
+   * age with the given condition. Map entries will be ANDed during validation.
+   * 
+ * + * map<string, string> conditions = 1; + */ + @java.lang.Override + public java.util.Map getConditionsMap() { + return internalGetConditions().getMap(); + } + /** + * + * + *
+   * Map of (K, V) -> (field, string condition to be evaluated on the field)
+   * E.g., ("age", "age > 18  && age < 60") entry triggers validation of field
+   * age with the given condition. Map entries will be ANDed during validation.
+   * 
+ * + * map<string, string> conditions = 1; + */ + @java.lang.Override + public java.lang.String getConditionsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetConditions().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Map of (K, V) -> (field, string condition to be evaluated on the field)
+   * E.g., ("age", "age > 18  && age < 60") entry triggers validation of field
+   * age with the given condition. Map entries will be ANDed during validation.
+   * 
+ * + * map<string, string> conditions = 1; + */ + @java.lang.Override + public java.lang.String getConditionsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetConditions().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetConditions(), ConditionsDefaultEntryHolder.defaultEntry, 1); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry entry : + internalGetConditions().getMap().entrySet()) { + com.google.protobuf.MapEntry conditions__ = + ConditionsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, conditions__); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.DataValidationAction)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.DataValidationAction other = + (com.google.cloud.contentwarehouse.v1.DataValidationAction) obj; + + if (!internalGetConditions().equals(other.internalGetConditions())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetConditions().getMap().isEmpty()) { + hash = (37 * hash) + CONDITIONS_FIELD_NUMBER; + hash = (53 * hash) + internalGetConditions().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.DataValidationAction parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.DataValidationAction parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DataValidationAction parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.DataValidationAction parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DataValidationAction parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.DataValidationAction parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DataValidationAction parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.DataValidationAction parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DataValidationAction parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.DataValidationAction parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DataValidationAction parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.DataValidationAction parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.DataValidationAction prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Represents the action responsible for data validation operations.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.DataValidationAction} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.DataValidationAction) + com.google.cloud.contentwarehouse.v1.DataValidationActionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_DataValidationAction_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 1: + return internalGetConditions(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 1: + return internalGetMutableConditions(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_DataValidationAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.DataValidationAction.class, + com.google.cloud.contentwarehouse.v1.DataValidationAction.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.DataValidationAction.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + internalGetMutableConditions().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_DataValidationAction_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DataValidationAction getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.DataValidationAction.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DataValidationAction build() { + com.google.cloud.contentwarehouse.v1.DataValidationAction result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DataValidationAction buildPartial() { + com.google.cloud.contentwarehouse.v1.DataValidationAction result = + new com.google.cloud.contentwarehouse.v1.DataValidationAction(this); + int from_bitField0_ = bitField0_; + result.conditions_ = internalGetConditions(); + result.conditions_.makeImmutable(); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.DataValidationAction) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.DataValidationAction) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.DataValidationAction other) { + if (other == com.google.cloud.contentwarehouse.v1.DataValidationAction.getDefaultInstance()) + return this; + internalGetMutableConditions().mergeFrom(other.internalGetConditions()); + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.MapEntry conditions__ = + input.readMessage( + ConditionsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableConditions() + .getMutableMap() + .put(conditions__.getKey(), conditions__.getValue()); + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.MapField conditions_; + + private com.google.protobuf.MapField + internalGetConditions() { + if (conditions_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ConditionsDefaultEntryHolder.defaultEntry); + } + return conditions_; + } + + private com.google.protobuf.MapField + internalGetMutableConditions() { + onChanged(); + ; + if (conditions_ == null) { + conditions_ = + com.google.protobuf.MapField.newMapField(ConditionsDefaultEntryHolder.defaultEntry); + } + if (!conditions_.isMutable()) { + conditions_ = conditions_.copy(); + } + return conditions_; + } + + public int getConditionsCount() { + return internalGetConditions().getMap().size(); + } + /** + * + * + *
+     * Map of (K, V) -> (field, string condition to be evaluated on the field)
+     * E.g., ("age", "age > 18  && age < 60") entry triggers validation of field
+     * age with the given condition. Map entries will be ANDed during validation.
+     * 
+ * + * map<string, string> conditions = 1; + */ + @java.lang.Override + public boolean containsConditions(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetConditions().getMap().containsKey(key); + } + /** Use {@link #getConditionsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getConditions() { + return getConditionsMap(); + } + /** + * + * + *
+     * Map of (K, V) -> (field, string condition to be evaluated on the field)
+     * E.g., ("age", "age > 18  && age < 60") entry triggers validation of field
+     * age with the given condition. Map entries will be ANDed during validation.
+     * 
+ * + * map<string, string> conditions = 1; + */ + @java.lang.Override + public java.util.Map getConditionsMap() { + return internalGetConditions().getMap(); + } + /** + * + * + *
+     * Map of (K, V) -> (field, string condition to be evaluated on the field)
+     * E.g., ("age", "age > 18  && age < 60") entry triggers validation of field
+     * age with the given condition. Map entries will be ANDed during validation.
+     * 
+ * + * map<string, string> conditions = 1; + */ + @java.lang.Override + public java.lang.String getConditionsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetConditions().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Map of (K, V) -> (field, string condition to be evaluated on the field)
+     * E.g., ("age", "age > 18  && age < 60") entry triggers validation of field
+     * age with the given condition. Map entries will be ANDed during validation.
+     * 
+ * + * map<string, string> conditions = 1; + */ + @java.lang.Override + public java.lang.String getConditionsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetConditions().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearConditions() { + internalGetMutableConditions().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Map of (K, V) -> (field, string condition to be evaluated on the field)
+     * E.g., ("age", "age > 18  && age < 60") entry triggers validation of field
+     * age with the given condition. Map entries will be ANDed during validation.
+     * 
+ * + * map<string, string> conditions = 1; + */ + public Builder removeConditions(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableConditions().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableConditions() { + return internalGetMutableConditions().getMutableMap(); + } + /** + * + * + *
+     * Map of (K, V) -> (field, string condition to be evaluated on the field)
+     * E.g., ("age", "age > 18  && age < 60") entry triggers validation of field
+     * age with the given condition. Map entries will be ANDed during validation.
+     * 
+ * + * map<string, string> conditions = 1; + */ + public Builder putConditions(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + + internalGetMutableConditions().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Map of (K, V) -> (field, string condition to be evaluated on the field)
+     * E.g., ("age", "age > 18  && age < 60") entry triggers validation of field
+     * age with the given condition. Map entries will be ANDed during validation.
+     * 
+ * + * map<string, string> conditions = 1; + */ + public Builder putAllConditions(java.util.Map values) { + internalGetMutableConditions().getMutableMap().putAll(values); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.DataValidationAction) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.DataValidationAction) + private static final com.google.cloud.contentwarehouse.v1.DataValidationAction DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.DataValidationAction(); + } + + public static com.google.cloud.contentwarehouse.v1.DataValidationAction getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DataValidationAction parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DataValidationAction getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DataValidationActionOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DataValidationActionOrBuilder.java new file mode 100644 index 000000000000..8dd962adbe6f --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DataValidationActionOrBuilder.java @@ -0,0 +1,94 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/rule_engine.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface DataValidationActionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.DataValidationAction) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Map of (K, V) -> (field, string condition to be evaluated on the field)
+   * E.g., ("age", "age > 18  && age < 60") entry triggers validation of field
+   * age with the given condition. Map entries will be ANDed during validation.
+   * 
+ * + * map<string, string> conditions = 1; + */ + int getConditionsCount(); + /** + * + * + *
+   * Map of (K, V) -> (field, string condition to be evaluated on the field)
+   * E.g., ("age", "age > 18  && age < 60") entry triggers validation of field
+   * age with the given condition. Map entries will be ANDed during validation.
+   * 
+ * + * map<string, string> conditions = 1; + */ + boolean containsConditions(java.lang.String key); + /** Use {@link #getConditionsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getConditions(); + /** + * + * + *
+   * Map of (K, V) -> (field, string condition to be evaluated on the field)
+   * E.g., ("age", "age > 18  && age < 60") entry triggers validation of field
+   * age with the given condition. Map entries will be ANDed during validation.
+   * 
+ * + * map<string, string> conditions = 1; + */ + java.util.Map getConditionsMap(); + /** + * + * + *
+   * Map of (K, V) -> (field, string condition to be evaluated on the field)
+   * E.g., ("age", "age > 18  && age < 60") entry triggers validation of field
+   * age with the given condition. Map entries will be ANDed during validation.
+   * 
+ * + * map<string, string> conditions = 1; + */ + + /* nullable */ + java.lang.String getConditionsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Map of (K, V) -> (field, string condition to be evaluated on the field)
+   * E.g., ("age", "age > 18  && age < 60") entry triggers validation of field
+   * age with the given condition. Map entries will be ANDed during validation.
+   * 
+ * + * map<string, string> conditions = 1; + */ + java.lang.String getConditionsOrThrow(java.lang.String key); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DatabaseType.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DatabaseType.java new file mode 100644 index 000000000000..b456985a2b3e --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DatabaseType.java @@ -0,0 +1,176 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/common.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Type of database used by the customer
+ * 
+ * + * Protobuf enum {@code google.cloud.contentwarehouse.v1.DatabaseType} + */ +public enum DatabaseType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * This value is required by protobuf best practices
+   * 
+ * + * DB_UNKNOWN = 0; + */ + DB_UNKNOWN(0), + /** + * + * + *
+   * Internal Spanner
+   * 
+ * + * DB_INFRA_SPANNER = 1; + */ + DB_INFRA_SPANNER(1), + /** + * + * + *
+   * Cloud Sql with a Postgres Sql instance
+   * 
+ * + * DB_CLOUD_SQL_POSTGRES = 2; + */ + DB_CLOUD_SQL_POSTGRES(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * This value is required by protobuf best practices
+   * 
+ * + * DB_UNKNOWN = 0; + */ + public static final int DB_UNKNOWN_VALUE = 0; + /** + * + * + *
+   * Internal Spanner
+   * 
+ * + * DB_INFRA_SPANNER = 1; + */ + public static final int DB_INFRA_SPANNER_VALUE = 1; + /** + * + * + *
+   * Cloud Sql with a Postgres Sql instance
+   * 
+ * + * DB_CLOUD_SQL_POSTGRES = 2; + */ + public static final int DB_CLOUD_SQL_POSTGRES_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static DatabaseType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static DatabaseType forNumber(int value) { + switch (value) { + case 0: + return DB_UNKNOWN; + case 1: + return DB_INFRA_SPANNER; + case 2: + return DB_CLOUD_SQL_POSTGRES; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public DatabaseType findValueByNumber(int number) { + return DatabaseType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.CommonProto.getDescriptor().getEnumTypes().get(1); + } + + private static final DatabaseType[] VALUES = values(); + + public static DatabaseType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private DatabaseType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.contentwarehouse.v1.DatabaseType) +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DateTimeArray.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DateTimeArray.java new file mode 100644 index 000000000000..b35a2c4e1cb5 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DateTimeArray.java @@ -0,0 +1,940 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * DateTime values.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.DateTimeArray} + */ +public final class DateTimeArray extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.DateTimeArray) + DateTimeArrayOrBuilder { + private static final long serialVersionUID = 0L; + // Use DateTimeArray.newBuilder() to construct. + private DateTimeArray(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DateTimeArray() { + values_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DateTimeArray(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_DateTimeArray_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_DateTimeArray_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.DateTimeArray.class, + com.google.cloud.contentwarehouse.v1.DateTimeArray.Builder.class); + } + + public static final int VALUES_FIELD_NUMBER = 1; + private java.util.List values_; + /** + * + * + *
+   * List of datetime values.
+   * Both OffsetDateTime and ZonedDateTime are supported.
+   * 
+ * + * repeated .google.type.DateTime values = 1; + */ + @java.lang.Override + public java.util.List getValuesList() { + return values_; + } + /** + * + * + *
+   * List of datetime values.
+   * Both OffsetDateTime and ZonedDateTime are supported.
+   * 
+ * + * repeated .google.type.DateTime values = 1; + */ + @java.lang.Override + public java.util.List getValuesOrBuilderList() { + return values_; + } + /** + * + * + *
+   * List of datetime values.
+   * Both OffsetDateTime and ZonedDateTime are supported.
+   * 
+ * + * repeated .google.type.DateTime values = 1; + */ + @java.lang.Override + public int getValuesCount() { + return values_.size(); + } + /** + * + * + *
+   * List of datetime values.
+   * Both OffsetDateTime and ZonedDateTime are supported.
+   * 
+ * + * repeated .google.type.DateTime values = 1; + */ + @java.lang.Override + public com.google.type.DateTime getValues(int index) { + return values_.get(index); + } + /** + * + * + *
+   * List of datetime values.
+   * Both OffsetDateTime and ZonedDateTime are supported.
+   * 
+ * + * repeated .google.type.DateTime values = 1; + */ + @java.lang.Override + public com.google.type.DateTimeOrBuilder getValuesOrBuilder(int index) { + return values_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < values_.size(); i++) { + output.writeMessage(1, values_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < values_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, values_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.DateTimeArray)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.DateTimeArray other = + (com.google.cloud.contentwarehouse.v1.DateTimeArray) obj; + + if (!getValuesList().equals(other.getValuesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getValuesCount() > 0) { + hash = (37 * hash) + VALUES_FIELD_NUMBER; + hash = (53 * hash) + getValuesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.DateTimeArray parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.DateTimeArray parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DateTimeArray parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.DateTimeArray parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DateTimeArray parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.DateTimeArray parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DateTimeArray parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.DateTimeArray parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DateTimeArray parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.DateTimeArray parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DateTimeArray parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.DateTimeArray parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.contentwarehouse.v1.DateTimeArray prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * DateTime values.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.DateTimeArray} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.DateTimeArray) + com.google.cloud.contentwarehouse.v1.DateTimeArrayOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_DateTimeArray_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_DateTimeArray_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.DateTimeArray.class, + com.google.cloud.contentwarehouse.v1.DateTimeArray.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.DateTimeArray.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (valuesBuilder_ == null) { + values_ = java.util.Collections.emptyList(); + } else { + values_ = null; + valuesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_DateTimeArray_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DateTimeArray getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.DateTimeArray.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DateTimeArray build() { + com.google.cloud.contentwarehouse.v1.DateTimeArray result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DateTimeArray buildPartial() { + com.google.cloud.contentwarehouse.v1.DateTimeArray result = + new com.google.cloud.contentwarehouse.v1.DateTimeArray(this); + int from_bitField0_ = bitField0_; + if (valuesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + values_ = java.util.Collections.unmodifiableList(values_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.values_ = values_; + } else { + result.values_ = valuesBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.DateTimeArray) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.DateTimeArray) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.DateTimeArray other) { + if (other == com.google.cloud.contentwarehouse.v1.DateTimeArray.getDefaultInstance()) + return this; + if (valuesBuilder_ == null) { + if (!other.values_.isEmpty()) { + if (values_.isEmpty()) { + values_ = other.values_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureValuesIsMutable(); + values_.addAll(other.values_); + } + onChanged(); + } + } else { + if (!other.values_.isEmpty()) { + if (valuesBuilder_.isEmpty()) { + valuesBuilder_.dispose(); + valuesBuilder_ = null; + values_ = other.values_; + bitField0_ = (bitField0_ & ~0x00000001); + valuesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getValuesFieldBuilder() + : null; + } else { + valuesBuilder_.addAllMessages(other.values_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.type.DateTime m = + input.readMessage(com.google.type.DateTime.parser(), extensionRegistry); + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.add(m); + } else { + valuesBuilder_.addMessage(m); + } + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List values_ = java.util.Collections.emptyList(); + + private void ensureValuesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + values_ = new java.util.ArrayList(values_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.type.DateTime, + com.google.type.DateTime.Builder, + com.google.type.DateTimeOrBuilder> + valuesBuilder_; + + /** + * + * + *
+     * List of datetime values.
+     * Both OffsetDateTime and ZonedDateTime are supported.
+     * 
+ * + * repeated .google.type.DateTime values = 1; + */ + public java.util.List getValuesList() { + if (valuesBuilder_ == null) { + return java.util.Collections.unmodifiableList(values_); + } else { + return valuesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * List of datetime values.
+     * Both OffsetDateTime and ZonedDateTime are supported.
+     * 
+ * + * repeated .google.type.DateTime values = 1; + */ + public int getValuesCount() { + if (valuesBuilder_ == null) { + return values_.size(); + } else { + return valuesBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of datetime values.
+     * Both OffsetDateTime and ZonedDateTime are supported.
+     * 
+ * + * repeated .google.type.DateTime values = 1; + */ + public com.google.type.DateTime getValues(int index) { + if (valuesBuilder_ == null) { + return values_.get(index); + } else { + return valuesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of datetime values.
+     * Both OffsetDateTime and ZonedDateTime are supported.
+     * 
+ * + * repeated .google.type.DateTime values = 1; + */ + public Builder setValues(int index, com.google.type.DateTime value) { + if (valuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.set(index, value); + onChanged(); + } else { + valuesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of datetime values.
+     * Both OffsetDateTime and ZonedDateTime are supported.
+     * 
+ * + * repeated .google.type.DateTime values = 1; + */ + public Builder setValues(int index, com.google.type.DateTime.Builder builderForValue) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.set(index, builderForValue.build()); + onChanged(); + } else { + valuesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of datetime values.
+     * Both OffsetDateTime and ZonedDateTime are supported.
+     * 
+ * + * repeated .google.type.DateTime values = 1; + */ + public Builder addValues(com.google.type.DateTime value) { + if (valuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.add(value); + onChanged(); + } else { + valuesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * List of datetime values.
+     * Both OffsetDateTime and ZonedDateTime are supported.
+     * 
+ * + * repeated .google.type.DateTime values = 1; + */ + public Builder addValues(int index, com.google.type.DateTime value) { + if (valuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.add(index, value); + onChanged(); + } else { + valuesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of datetime values.
+     * Both OffsetDateTime and ZonedDateTime are supported.
+     * 
+ * + * repeated .google.type.DateTime values = 1; + */ + public Builder addValues(com.google.type.DateTime.Builder builderForValue) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.add(builderForValue.build()); + onChanged(); + } else { + valuesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of datetime values.
+     * Both OffsetDateTime and ZonedDateTime are supported.
+     * 
+ * + * repeated .google.type.DateTime values = 1; + */ + public Builder addValues(int index, com.google.type.DateTime.Builder builderForValue) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.add(index, builderForValue.build()); + onChanged(); + } else { + valuesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of datetime values.
+     * Both OffsetDateTime and ZonedDateTime are supported.
+     * 
+ * + * repeated .google.type.DateTime values = 1; + */ + public Builder addAllValues(java.lang.Iterable values) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, values_); + onChanged(); + } else { + valuesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * List of datetime values.
+     * Both OffsetDateTime and ZonedDateTime are supported.
+     * 
+ * + * repeated .google.type.DateTime values = 1; + */ + public Builder clearValues() { + if (valuesBuilder_ == null) { + values_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + valuesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of datetime values.
+     * Both OffsetDateTime and ZonedDateTime are supported.
+     * 
+ * + * repeated .google.type.DateTime values = 1; + */ + public Builder removeValues(int index) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.remove(index); + onChanged(); + } else { + valuesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * List of datetime values.
+     * Both OffsetDateTime and ZonedDateTime are supported.
+     * 
+ * + * repeated .google.type.DateTime values = 1; + */ + public com.google.type.DateTime.Builder getValuesBuilder(int index) { + return getValuesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of datetime values.
+     * Both OffsetDateTime and ZonedDateTime are supported.
+     * 
+ * + * repeated .google.type.DateTime values = 1; + */ + public com.google.type.DateTimeOrBuilder getValuesOrBuilder(int index) { + if (valuesBuilder_ == null) { + return values_.get(index); + } else { + return valuesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of datetime values.
+     * Both OffsetDateTime and ZonedDateTime are supported.
+     * 
+ * + * repeated .google.type.DateTime values = 1; + */ + public java.util.List getValuesOrBuilderList() { + if (valuesBuilder_ != null) { + return valuesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(values_); + } + } + /** + * + * + *
+     * List of datetime values.
+     * Both OffsetDateTime and ZonedDateTime are supported.
+     * 
+ * + * repeated .google.type.DateTime values = 1; + */ + public com.google.type.DateTime.Builder addValuesBuilder() { + return getValuesFieldBuilder().addBuilder(com.google.type.DateTime.getDefaultInstance()); + } + /** + * + * + *
+     * List of datetime values.
+     * Both OffsetDateTime and ZonedDateTime are supported.
+     * 
+ * + * repeated .google.type.DateTime values = 1; + */ + public com.google.type.DateTime.Builder addValuesBuilder(int index) { + return getValuesFieldBuilder() + .addBuilder(index, com.google.type.DateTime.getDefaultInstance()); + } + /** + * + * + *
+     * List of datetime values.
+     * Both OffsetDateTime and ZonedDateTime are supported.
+     * 
+ * + * repeated .google.type.DateTime values = 1; + */ + public java.util.List getValuesBuilderList() { + return getValuesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.type.DateTime, + com.google.type.DateTime.Builder, + com.google.type.DateTimeOrBuilder> + getValuesFieldBuilder() { + if (valuesBuilder_ == null) { + valuesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.type.DateTime, + com.google.type.DateTime.Builder, + com.google.type.DateTimeOrBuilder>( + values_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + values_ = null; + } + return valuesBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.DateTimeArray) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.DateTimeArray) + private static final com.google.cloud.contentwarehouse.v1.DateTimeArray DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.DateTimeArray(); + } + + public static com.google.cloud.contentwarehouse.v1.DateTimeArray getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DateTimeArray parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DateTimeArray getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DateTimeArrayOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DateTimeArrayOrBuilder.java new file mode 100644 index 000000000000..e6e0f797a2c1 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DateTimeArrayOrBuilder.java @@ -0,0 +1,81 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface DateTimeArrayOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.DateTimeArray) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of datetime values.
+   * Both OffsetDateTime and ZonedDateTime are supported.
+   * 
+ * + * repeated .google.type.DateTime values = 1; + */ + java.util.List getValuesList(); + /** + * + * + *
+   * List of datetime values.
+   * Both OffsetDateTime and ZonedDateTime are supported.
+   * 
+ * + * repeated .google.type.DateTime values = 1; + */ + com.google.type.DateTime getValues(int index); + /** + * + * + *
+   * List of datetime values.
+   * Both OffsetDateTime and ZonedDateTime are supported.
+   * 
+ * + * repeated .google.type.DateTime values = 1; + */ + int getValuesCount(); + /** + * + * + *
+   * List of datetime values.
+   * Both OffsetDateTime and ZonedDateTime are supported.
+   * 
+ * + * repeated .google.type.DateTime values = 1; + */ + java.util.List getValuesOrBuilderList(); + /** + * + * + *
+   * List of datetime values.
+   * Both OffsetDateTime and ZonedDateTime are supported.
+   * 
+ * + * repeated .google.type.DateTime values = 1; + */ + com.google.type.DateTimeOrBuilder getValuesOrBuilder(int index); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DateTimeTypeOptions.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DateTimeTypeOptions.java new file mode 100644 index 000000000000..a8e4ebdf463b --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DateTimeTypeOptions.java @@ -0,0 +1,437 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_schema.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Configurations for a date time property.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.DateTimeTypeOptions} + */ +public final class DateTimeTypeOptions extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.DateTimeTypeOptions) + DateTimeTypeOptionsOrBuilder { + private static final long serialVersionUID = 0L; + // Use DateTimeTypeOptions.newBuilder() to construct. + private DateTimeTypeOptions(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DateTimeTypeOptions() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DateTimeTypeOptions(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaProto + .internal_static_google_cloud_contentwarehouse_v1_DateTimeTypeOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaProto + .internal_static_google_cloud_contentwarehouse_v1_DateTimeTypeOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions.class, + com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions other = + (com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Configurations for a date time property.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.DateTimeTypeOptions} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.DateTimeTypeOptions) + com.google.cloud.contentwarehouse.v1.DateTimeTypeOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaProto + .internal_static_google_cloud_contentwarehouse_v1_DateTimeTypeOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaProto + .internal_static_google_cloud_contentwarehouse_v1_DateTimeTypeOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions.class, + com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaProto + .internal_static_google_cloud_contentwarehouse_v1_DateTimeTypeOptions_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions build() { + com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions buildPartial() { + com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions result = + new com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions other) { + if (other == com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.DateTimeTypeOptions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.DateTimeTypeOptions) + private static final com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions(); + } + + public static com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DateTimeTypeOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DateTimeTypeOptionsOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DateTimeTypeOptionsOrBuilder.java new file mode 100644 index 000000000000..2dd724c06904 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DateTimeTypeOptionsOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_schema.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface DateTimeTypeOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.DateTimeTypeOptions) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DeleteDocumentAction.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DeleteDocumentAction.java new file mode 100644 index 000000000000..844e4369cd8b --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DeleteDocumentAction.java @@ -0,0 +1,532 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/rule_engine.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Represents the action responsible for deleting the document.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.DeleteDocumentAction} + */ +public final class DeleteDocumentAction extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.DeleteDocumentAction) + DeleteDocumentActionOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteDocumentAction.newBuilder() to construct. + private DeleteDocumentAction(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteDocumentAction() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteDocumentAction(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_DeleteDocumentAction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_DeleteDocumentAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.DeleteDocumentAction.class, + com.google.cloud.contentwarehouse.v1.DeleteDocumentAction.Builder.class); + } + + public static final int ENABLE_HARD_DELETE_FIELD_NUMBER = 1; + private boolean enableHardDelete_; + /** + * + * + *
+   * Boolean field to select between hard vs soft delete options.
+   * Set 'true' for 'hard delete' and 'false' for 'soft delete'.
+   * 
+ * + * bool enable_hard_delete = 1; + * + * @return The enableHardDelete. + */ + @java.lang.Override + public boolean getEnableHardDelete() { + return enableHardDelete_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (enableHardDelete_ != false) { + output.writeBool(1, enableHardDelete_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (enableHardDelete_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, enableHardDelete_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.DeleteDocumentAction)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.DeleteDocumentAction other = + (com.google.cloud.contentwarehouse.v1.DeleteDocumentAction) obj; + + if (getEnableHardDelete() != other.getEnableHardDelete()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ENABLE_HARD_DELETE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnableHardDelete()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.DeleteDocumentAction parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteDocumentAction parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteDocumentAction parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteDocumentAction parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteDocumentAction parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteDocumentAction parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteDocumentAction parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteDocumentAction parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteDocumentAction parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteDocumentAction parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteDocumentAction parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteDocumentAction parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.DeleteDocumentAction prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Represents the action responsible for deleting the document.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.DeleteDocumentAction} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.DeleteDocumentAction) + com.google.cloud.contentwarehouse.v1.DeleteDocumentActionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_DeleteDocumentAction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_DeleteDocumentAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.DeleteDocumentAction.class, + com.google.cloud.contentwarehouse.v1.DeleteDocumentAction.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.DeleteDocumentAction.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + enableHardDelete_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_DeleteDocumentAction_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DeleteDocumentAction getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.DeleteDocumentAction.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DeleteDocumentAction build() { + com.google.cloud.contentwarehouse.v1.DeleteDocumentAction result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DeleteDocumentAction buildPartial() { + com.google.cloud.contentwarehouse.v1.DeleteDocumentAction result = + new com.google.cloud.contentwarehouse.v1.DeleteDocumentAction(this); + result.enableHardDelete_ = enableHardDelete_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.DeleteDocumentAction) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.DeleteDocumentAction) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.DeleteDocumentAction other) { + if (other == com.google.cloud.contentwarehouse.v1.DeleteDocumentAction.getDefaultInstance()) + return this; + if (other.getEnableHardDelete() != false) { + setEnableHardDelete(other.getEnableHardDelete()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + enableHardDelete_ = input.readBool(); + + break; + } // case 8 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private boolean enableHardDelete_; + /** + * + * + *
+     * Boolean field to select between hard vs soft delete options.
+     * Set 'true' for 'hard delete' and 'false' for 'soft delete'.
+     * 
+ * + * bool enable_hard_delete = 1; + * + * @return The enableHardDelete. + */ + @java.lang.Override + public boolean getEnableHardDelete() { + return enableHardDelete_; + } + /** + * + * + *
+     * Boolean field to select between hard vs soft delete options.
+     * Set 'true' for 'hard delete' and 'false' for 'soft delete'.
+     * 
+ * + * bool enable_hard_delete = 1; + * + * @param value The enableHardDelete to set. + * @return This builder for chaining. + */ + public Builder setEnableHardDelete(boolean value) { + + enableHardDelete_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Boolean field to select between hard vs soft delete options.
+     * Set 'true' for 'hard delete' and 'false' for 'soft delete'.
+     * 
+ * + * bool enable_hard_delete = 1; + * + * @return This builder for chaining. + */ + public Builder clearEnableHardDelete() { + + enableHardDelete_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.DeleteDocumentAction) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.DeleteDocumentAction) + private static final com.google.cloud.contentwarehouse.v1.DeleteDocumentAction DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.DeleteDocumentAction(); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteDocumentAction getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteDocumentAction parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DeleteDocumentAction getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DeleteDocumentActionOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DeleteDocumentActionOrBuilder.java new file mode 100644 index 000000000000..06e924521eb3 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DeleteDocumentActionOrBuilder.java @@ -0,0 +1,39 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/rule_engine.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface DeleteDocumentActionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.DeleteDocumentAction) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Boolean field to select between hard vs soft delete options.
+   * Set 'true' for 'hard delete' and 'false' for 'soft delete'.
+   * 
+ * + * bool enable_hard_delete = 1; + * + * @return The enableHardDelete. + */ + boolean getEnableHardDelete(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DeleteDocumentLinkRequest.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DeleteDocumentLinkRequest.java new file mode 100644 index 000000000000..927481658f8d --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DeleteDocumentLinkRequest.java @@ -0,0 +1,933 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_link_service.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Request message for DocumentLinkService.DeleteDocumentLink.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest} + */ +public final class DeleteDocumentLinkRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest) + DeleteDocumentLinkRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteDocumentLinkRequest.newBuilder() to construct. + private DeleteDocumentLinkRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteDocumentLinkRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteDocumentLinkRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentLinkServiceProto + .internal_static_google_cloud_contentwarehouse_v1_DeleteDocumentLinkRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentLinkServiceProto + .internal_static_google_cloud_contentwarehouse_v1_DeleteDocumentLinkRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest.class, + com.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object 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}.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the document-link to be deleted.
+   * Format:
+   * projects/{project_number}/locations/{location}/documents/{source_document_id}/documentLinks/{document_link_id}.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUEST_METADATA_FIELD_NUMBER = 2; + private com.google.cloud.contentwarehouse.v1.RequestMetadata requestMetadata_; + /** + * + * + *
+   * The meta information collected about the document creator, used to enforce
+   * access control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + * + * @return Whether the requestMetadata field is set. + */ + @java.lang.Override + public boolean hasRequestMetadata() { + return requestMetadata_ != null; + } + /** + * + * + *
+   * The meta information collected about the document creator, used to enforce
+   * access control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + * + * @return The requestMetadata. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RequestMetadata getRequestMetadata() { + return requestMetadata_ == null + ? com.google.cloud.contentwarehouse.v1.RequestMetadata.getDefaultInstance() + : requestMetadata_; + } + /** + * + * + *
+   * The meta information collected about the document creator, used to enforce
+   * access control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder + getRequestMetadataOrBuilder() { + return getRequestMetadata(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (requestMetadata_ != null) { + output.writeMessage(2, getRequestMetadata()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (requestMetadata_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getRequestMetadata()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest other = + (com.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (hasRequestMetadata() != other.hasRequestMetadata()) return false; + if (hasRequestMetadata()) { + if (!getRequestMetadata().equals(other.getRequestMetadata())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasRequestMetadata()) { + hash = (37 * hash) + REQUEST_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getRequestMetadata().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for DocumentLinkService.DeleteDocumentLink.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest) + com.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentLinkServiceProto + .internal_static_google_cloud_contentwarehouse_v1_DeleteDocumentLinkRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentLinkServiceProto + .internal_static_google_cloud_contentwarehouse_v1_DeleteDocumentLinkRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest.class, + com.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (requestMetadataBuilder_ == null) { + requestMetadata_ = null; + } else { + requestMetadata_ = null; + requestMetadataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.DocumentLinkServiceProto + .internal_static_google_cloud_contentwarehouse_v1_DeleteDocumentLinkRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest + getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest build() { + com.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest buildPartial() { + com.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest result = + new com.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest(this); + result.name_ = name_; + if (requestMetadataBuilder_ == null) { + result.requestMetadata_ = requestMetadata_; + } else { + result.requestMetadata_ = requestMetadataBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest other) { + if (other + == com.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasRequestMetadata()) { + mergeRequestMetadata(other.getRequestMetadata()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + input.readMessage(getRequestMetadataFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object 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}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the document-link to be deleted.
+     * Format:
+     * projects/{project_number}/locations/{location}/documents/{source_document_id}/documentLinks/{document_link_id}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the document-link to be deleted.
+     * Format:
+     * projects/{project_number}/locations/{location}/documents/{source_document_id}/documentLinks/{document_link_id}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the document-link to be deleted.
+     * Format:
+     * projects/{project_number}/locations/{location}/documents/{source_document_id}/documentLinks/{document_link_id}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the document-link to be deleted.
+     * Format:
+     * projects/{project_number}/locations/{location}/documents/{source_document_id}/documentLinks/{document_link_id}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.cloud.contentwarehouse.v1.RequestMetadata requestMetadata_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.RequestMetadata, + com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder, + com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder> + requestMetadataBuilder_; + /** + * + * + *
+     * The meta information collected about the document creator, used to enforce
+     * access control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + * + * @return Whether the requestMetadata field is set. + */ + public boolean hasRequestMetadata() { + return requestMetadataBuilder_ != null || requestMetadata_ != null; + } + /** + * + * + *
+     * The meta information collected about the document creator, used to enforce
+     * access control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + * + * @return The requestMetadata. + */ + public com.google.cloud.contentwarehouse.v1.RequestMetadata getRequestMetadata() { + if (requestMetadataBuilder_ == null) { + return requestMetadata_ == null + ? com.google.cloud.contentwarehouse.v1.RequestMetadata.getDefaultInstance() + : requestMetadata_; + } else { + return requestMetadataBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The meta information collected about the document creator, used to enforce
+     * access control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + */ + public Builder setRequestMetadata(com.google.cloud.contentwarehouse.v1.RequestMetadata value) { + if (requestMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + requestMetadata_ = value; + onChanged(); + } else { + requestMetadataBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The meta information collected about the document creator, used to enforce
+     * access control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + */ + public Builder setRequestMetadata( + com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder builderForValue) { + if (requestMetadataBuilder_ == null) { + requestMetadata_ = builderForValue.build(); + onChanged(); + } else { + requestMetadataBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The meta information collected about the document creator, used to enforce
+     * access control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + */ + public Builder mergeRequestMetadata( + com.google.cloud.contentwarehouse.v1.RequestMetadata value) { + if (requestMetadataBuilder_ == null) { + if (requestMetadata_ != null) { + requestMetadata_ = + com.google.cloud.contentwarehouse.v1.RequestMetadata.newBuilder(requestMetadata_) + .mergeFrom(value) + .buildPartial(); + } else { + requestMetadata_ = value; + } + onChanged(); + } else { + requestMetadataBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The meta information collected about the document creator, used to enforce
+     * access control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + */ + public Builder clearRequestMetadata() { + if (requestMetadataBuilder_ == null) { + requestMetadata_ = null; + onChanged(); + } else { + requestMetadata_ = null; + requestMetadataBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The meta information collected about the document creator, used to enforce
+     * access control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + */ + public com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder + getRequestMetadataBuilder() { + + onChanged(); + return getRequestMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The meta information collected about the document creator, used to enforce
+     * access control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + */ + public com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder + getRequestMetadataOrBuilder() { + if (requestMetadataBuilder_ != null) { + return requestMetadataBuilder_.getMessageOrBuilder(); + } else { + return requestMetadata_ == null + ? com.google.cloud.contentwarehouse.v1.RequestMetadata.getDefaultInstance() + : requestMetadata_; + } + } + /** + * + * + *
+     * The meta information collected about the document creator, used to enforce
+     * access control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.RequestMetadata, + com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder, + com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder> + getRequestMetadataFieldBuilder() { + if (requestMetadataBuilder_ == null) { + requestMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.RequestMetadata, + com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder, + com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder>( + getRequestMetadata(), getParentForChildren(), isClean()); + requestMetadata_ = null; + } + return requestMetadataBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest) + private static final com.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest(); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteDocumentLinkRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DeleteDocumentLinkRequestOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DeleteDocumentLinkRequestOrBuilder.java new file mode 100644 index 000000000000..eb1d19beeb15 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DeleteDocumentLinkRequestOrBuilder.java @@ -0,0 +1,96 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_link_service.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface DeleteDocumentLinkRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the document-link to be deleted.
+   * Format:
+   * projects/{project_number}/locations/{location}/documents/{source_document_id}/documentLinks/{document_link_id}.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the document-link to be deleted.
+   * Format:
+   * projects/{project_number}/locations/{location}/documents/{source_document_id}/documentLinks/{document_link_id}.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The meta information collected about the document creator, used to enforce
+   * access control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + * + * @return Whether the requestMetadata field is set. + */ + boolean hasRequestMetadata(); + /** + * + * + *
+   * The meta information collected about the document creator, used to enforce
+   * access control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + * + * @return The requestMetadata. + */ + com.google.cloud.contentwarehouse.v1.RequestMetadata getRequestMetadata(); + /** + * + * + *
+   * The meta information collected about the document creator, used to enforce
+   * access control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + */ + com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder getRequestMetadataOrBuilder(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DeleteDocumentRequest.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DeleteDocumentRequest.java new file mode 100644 index 000000000000..ff02a8785e6d --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DeleteDocumentRequest.java @@ -0,0 +1,942 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_service_request.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Request message for DocumentService.DeleteDocument.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.DeleteDocumentRequest} + */ +public final class DeleteDocumentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.DeleteDocumentRequest) + DeleteDocumentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteDocumentRequest.newBuilder() to construct. + private DeleteDocumentRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteDocumentRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteDocumentRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_DeleteDocumentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_DeleteDocumentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.DeleteDocumentRequest.class, + com.google.cloud.contentwarehouse.v1.DeleteDocumentRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object 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}.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * 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}.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUEST_METADATA_FIELD_NUMBER = 2; + private com.google.cloud.contentwarehouse.v1.RequestMetadata requestMetadata_; + /** + * + * + *
+   * The meta information collected about the end user, used to enforce access
+   * control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + * + * @return Whether the requestMetadata field is set. + */ + @java.lang.Override + public boolean hasRequestMetadata() { + return requestMetadata_ != null; + } + /** + * + * + *
+   * The meta information collected about the end user, used to enforce access
+   * control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + * + * @return The requestMetadata. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RequestMetadata getRequestMetadata() { + return requestMetadata_ == null + ? com.google.cloud.contentwarehouse.v1.RequestMetadata.getDefaultInstance() + : requestMetadata_; + } + /** + * + * + *
+   * The meta information collected about the end user, used to enforce access
+   * control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder + getRequestMetadataOrBuilder() { + return getRequestMetadata(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (requestMetadata_ != null) { + output.writeMessage(2, getRequestMetadata()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (requestMetadata_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getRequestMetadata()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.DeleteDocumentRequest)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.DeleteDocumentRequest other = + (com.google.cloud.contentwarehouse.v1.DeleteDocumentRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (hasRequestMetadata() != other.hasRequestMetadata()) return false; + if (hasRequestMetadata()) { + if (!getRequestMetadata().equals(other.getRequestMetadata())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasRequestMetadata()) { + hash = (37 * hash) + REQUEST_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getRequestMetadata().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.DeleteDocumentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteDocumentRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteDocumentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteDocumentRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteDocumentRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteDocumentRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteDocumentRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteDocumentRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteDocumentRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteDocumentRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteDocumentRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteDocumentRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.DeleteDocumentRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for DocumentService.DeleteDocument.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.DeleteDocumentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.DeleteDocumentRequest) + com.google.cloud.contentwarehouse.v1.DeleteDocumentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_DeleteDocumentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_DeleteDocumentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.DeleteDocumentRequest.class, + com.google.cloud.contentwarehouse.v1.DeleteDocumentRequest.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.DeleteDocumentRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (requestMetadataBuilder_ == null) { + requestMetadata_ = null; + } else { + requestMetadata_ = null; + requestMetadataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_DeleteDocumentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DeleteDocumentRequest getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.DeleteDocumentRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DeleteDocumentRequest build() { + com.google.cloud.contentwarehouse.v1.DeleteDocumentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DeleteDocumentRequest buildPartial() { + com.google.cloud.contentwarehouse.v1.DeleteDocumentRequest result = + new com.google.cloud.contentwarehouse.v1.DeleteDocumentRequest(this); + result.name_ = name_; + if (requestMetadataBuilder_ == null) { + result.requestMetadata_ = requestMetadata_; + } else { + result.requestMetadata_ = requestMetadataBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.DeleteDocumentRequest) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.DeleteDocumentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.DeleteDocumentRequest other) { + if (other == com.google.cloud.contentwarehouse.v1.DeleteDocumentRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasRequestMetadata()) { + mergeRequestMetadata(other.getRequestMetadata()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + input.readMessage(getRequestMetadataFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object 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}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 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}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * 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}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.cloud.contentwarehouse.v1.RequestMetadata requestMetadata_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.RequestMetadata, + com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder, + com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder> + requestMetadataBuilder_; + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + * + * @return Whether the requestMetadata field is set. + */ + public boolean hasRequestMetadata() { + return requestMetadataBuilder_ != null || requestMetadata_ != null; + } + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + * + * @return The requestMetadata. + */ + public com.google.cloud.contentwarehouse.v1.RequestMetadata getRequestMetadata() { + if (requestMetadataBuilder_ == null) { + return requestMetadata_ == null + ? com.google.cloud.contentwarehouse.v1.RequestMetadata.getDefaultInstance() + : requestMetadata_; + } else { + return requestMetadataBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + */ + public Builder setRequestMetadata(com.google.cloud.contentwarehouse.v1.RequestMetadata value) { + if (requestMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + requestMetadata_ = value; + onChanged(); + } else { + requestMetadataBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + */ + public Builder setRequestMetadata( + com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder builderForValue) { + if (requestMetadataBuilder_ == null) { + requestMetadata_ = builderForValue.build(); + onChanged(); + } else { + requestMetadataBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + */ + public Builder mergeRequestMetadata( + com.google.cloud.contentwarehouse.v1.RequestMetadata value) { + if (requestMetadataBuilder_ == null) { + if (requestMetadata_ != null) { + requestMetadata_ = + com.google.cloud.contentwarehouse.v1.RequestMetadata.newBuilder(requestMetadata_) + .mergeFrom(value) + .buildPartial(); + } else { + requestMetadata_ = value; + } + onChanged(); + } else { + requestMetadataBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + */ + public Builder clearRequestMetadata() { + if (requestMetadataBuilder_ == null) { + requestMetadata_ = null; + onChanged(); + } else { + requestMetadata_ = null; + requestMetadataBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + */ + public com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder + getRequestMetadataBuilder() { + + onChanged(); + return getRequestMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + */ + public com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder + getRequestMetadataOrBuilder() { + if (requestMetadataBuilder_ != null) { + return requestMetadataBuilder_.getMessageOrBuilder(); + } else { + return requestMetadata_ == null + ? com.google.cloud.contentwarehouse.v1.RequestMetadata.getDefaultInstance() + : requestMetadata_; + } + } + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.RequestMetadata, + com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder, + com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder> + getRequestMetadataFieldBuilder() { + if (requestMetadataBuilder_ == null) { + requestMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.RequestMetadata, + com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder, + com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder>( + getRequestMetadata(), getParentForChildren(), isClean()); + requestMetadata_ = null; + } + return requestMetadataBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.DeleteDocumentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.DeleteDocumentRequest) + private static final com.google.cloud.contentwarehouse.v1.DeleteDocumentRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.DeleteDocumentRequest(); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteDocumentRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteDocumentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DeleteDocumentRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DeleteDocumentRequestOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DeleteDocumentRequestOrBuilder.java new file mode 100644 index 000000000000..6cfca169c426 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DeleteDocumentRequestOrBuilder.java @@ -0,0 +1,100 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_service_request.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface DeleteDocumentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.DeleteDocumentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * 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}.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * 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}.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The meta information collected about the end user, used to enforce access
+   * control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + * + * @return Whether the requestMetadata field is set. + */ + boolean hasRequestMetadata(); + /** + * + * + *
+   * The meta information collected about the end user, used to enforce access
+   * control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + * + * @return The requestMetadata. + */ + com.google.cloud.contentwarehouse.v1.RequestMetadata getRequestMetadata(); + /** + * + * + *
+   * The meta information collected about the end user, used to enforce access
+   * control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + */ + com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder getRequestMetadataOrBuilder(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DeleteDocumentSchemaRequest.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DeleteDocumentSchemaRequest.java new file mode 100644 index 000000000000..267001209a21 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DeleteDocumentSchemaRequest.java @@ -0,0 +1,636 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_schema_service.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Request message for DocumentSchemaService.DeleteDocumentSchema.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest} + */ +public final class DeleteDocumentSchemaRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest) + DeleteDocumentSchemaRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteDocumentSchemaRequest.newBuilder() to construct. + private DeleteDocumentSchemaRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteDocumentSchemaRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteDocumentSchemaRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaServiceProto + .internal_static_google_cloud_contentwarehouse_v1_DeleteDocumentSchemaRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaServiceProto + .internal_static_google_cloud_contentwarehouse_v1_DeleteDocumentSchemaRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest.class, + com.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the document schema to delete.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the document schema to delete.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest other = + (com.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for DocumentSchemaService.DeleteDocumentSchema.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest) + com.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaServiceProto + .internal_static_google_cloud_contentwarehouse_v1_DeleteDocumentSchemaRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaServiceProto + .internal_static_google_cloud_contentwarehouse_v1_DeleteDocumentSchemaRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest.class, + com.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaServiceProto + .internal_static_google_cloud_contentwarehouse_v1_DeleteDocumentSchemaRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest + getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest build() { + com.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest buildPartial() { + com.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest result = + new com.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest other) { + if (other + == com.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the document schema to delete.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the document schema to delete.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the document schema to delete.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the document schema to delete.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the document schema to delete.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest) + private static final com.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest(); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteDocumentSchemaRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DeleteDocumentSchemaRequestOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DeleteDocumentSchemaRequestOrBuilder.java new file mode 100644 index 000000000000..68baa85c8b0c --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DeleteDocumentSchemaRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_schema_service.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface DeleteDocumentSchemaRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the document schema to delete.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the document schema to delete.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DeleteRuleSetRequest.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DeleteRuleSetRequest.java new file mode 100644 index 000000000000..cdca7fde2f9e --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DeleteRuleSetRequest.java @@ -0,0 +1,644 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/ruleset_service_request.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Request message for RuleSetService.DeleteRuleSet.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.DeleteRuleSetRequest} + */ +public final class DeleteRuleSetRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.DeleteRuleSetRequest) + DeleteRuleSetRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteRuleSetRequest.newBuilder() to construct. + private DeleteRuleSetRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteRuleSetRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteRuleSetRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.RuleSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_DeleteRuleSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.RuleSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_DeleteRuleSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest.class, + com.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the rule set to delete.
+   * Format:
+   * projects/{project_number}/locations/{location}/ruleSets/{rule_set_id}.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the rule set to delete.
+   * Format:
+   * projects/{project_number}/locations/{location}/ruleSets/{rule_set_id}.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest other = + (com.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for RuleSetService.DeleteRuleSet.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.DeleteRuleSetRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.DeleteRuleSetRequest) + com.google.cloud.contentwarehouse.v1.DeleteRuleSetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.RuleSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_DeleteRuleSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.RuleSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_DeleteRuleSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest.class, + com.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.RuleSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_DeleteRuleSetRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest build() { + com.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest buildPartial() { + com.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest result = + new com.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest other) { + if (other == com.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the rule set to delete.
+     * Format:
+     * projects/{project_number}/locations/{location}/ruleSets/{rule_set_id}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the rule set to delete.
+     * Format:
+     * projects/{project_number}/locations/{location}/ruleSets/{rule_set_id}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the rule set to delete.
+     * Format:
+     * projects/{project_number}/locations/{location}/ruleSets/{rule_set_id}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the rule set to delete.
+     * Format:
+     * projects/{project_number}/locations/{location}/ruleSets/{rule_set_id}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the rule set to delete.
+     * Format:
+     * projects/{project_number}/locations/{location}/ruleSets/{rule_set_id}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.DeleteRuleSetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.DeleteRuleSetRequest) + private static final com.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest(); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteRuleSetRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DeleteRuleSetRequestOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DeleteRuleSetRequestOrBuilder.java new file mode 100644 index 000000000000..6bcceb42f635 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DeleteRuleSetRequestOrBuilder.java @@ -0,0 +1,58 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/ruleset_service_request.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface DeleteRuleSetRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.DeleteRuleSetRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the rule set to delete.
+   * Format:
+   * projects/{project_number}/locations/{location}/ruleSets/{rule_set_id}.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the rule set to delete.
+   * Format:
+   * projects/{project_number}/locations/{location}/ruleSets/{rule_set_id}.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DeleteSynonymSetRequest.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DeleteSynonymSetRequest.java new file mode 100644 index 000000000000..7b79cd036f4b --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DeleteSynonymSetRequest.java @@ -0,0 +1,647 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/synonymset_service_request.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Request message for SynonymSetService.DeleteSynonymSet.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest} + */ +public final class DeleteSynonymSetRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest) + DeleteSynonymSetRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteSynonymSetRequest.newBuilder() to construct. + private DeleteSynonymSetRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteSynonymSetRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteSynonymSetRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.SynonymSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_DeleteSynonymSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.SynonymSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_DeleteSynonymSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest.class, + com.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the synonymSet to delete
+   * Format:
+   * projects/{project_number}/locations/{location}/synonymSets/{context}.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the synonymSet to delete
+   * Format:
+   * projects/{project_number}/locations/{location}/synonymSets/{context}.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest other = + (com.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for SynonymSetService.DeleteSynonymSet.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest) + com.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.SynonymSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_DeleteSynonymSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.SynonymSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_DeleteSynonymSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest.class, + com.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.SynonymSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_DeleteSynonymSetRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest + getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest build() { + com.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest buildPartial() { + com.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest result = + new com.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest other) { + if (other + == com.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the synonymSet to delete
+     * Format:
+     * projects/{project_number}/locations/{location}/synonymSets/{context}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the synonymSet to delete
+     * Format:
+     * projects/{project_number}/locations/{location}/synonymSets/{context}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the synonymSet to delete
+     * Format:
+     * projects/{project_number}/locations/{location}/synonymSets/{context}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the synonymSet to delete
+     * Format:
+     * projects/{project_number}/locations/{location}/synonymSets/{context}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the synonymSet to delete
+     * Format:
+     * projects/{project_number}/locations/{location}/synonymSets/{context}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest) + private static final com.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest(); + } + + public static com.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteSynonymSetRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DeleteSynonymSetRequestOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DeleteSynonymSetRequestOrBuilder.java new file mode 100644 index 000000000000..0955c099a9de --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DeleteSynonymSetRequestOrBuilder.java @@ -0,0 +1,58 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/synonymset_service_request.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface DeleteSynonymSetRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the synonymSet to delete
+   * Format:
+   * projects/{project_number}/locations/{location}/synonymSets/{context}.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the synonymSet to delete
+   * Format:
+   * projects/{project_number}/locations/{location}/synonymSets/{context}.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/Document.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/Document.java new file mode 100644 index 000000000000..f73c917d59f4 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/Document.java @@ -0,0 +1,4602 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Defines the structure for content warehouse document proto.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.Document} + */ +public final class Document extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.Document) + DocumentOrBuilder { + private static final long serialVersionUID = 0L; + // Use Document.newBuilder() to construct. + private Document(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Document() { + name_ = ""; + referenceId_ = ""; + displayName_ = ""; + title_ = ""; + displayUri_ = ""; + documentSchemaName_ = ""; + structuredContentUri_ = ""; + properties_ = java.util.Collections.emptyList(); + rawDocumentFileType_ = 0; + creator_ = ""; + updater_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Document(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_Document_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_Document_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.Document.class, + com.google.cloud.contentwarehouse.v1.Document.Builder.class); + } + + private int structuredContentCase_ = 0; + private java.lang.Object structuredContent_; + + public enum StructuredContentCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + PLAIN_TEXT(15), + CLOUD_AI_DOCUMENT(4), + STRUCTUREDCONTENT_NOT_SET(0); + private final int value; + + private StructuredContentCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static StructuredContentCase valueOf(int value) { + return forNumber(value); + } + + public static StructuredContentCase forNumber(int value) { + switch (value) { + case 15: + return PLAIN_TEXT; + case 4: + return CLOUD_AI_DOCUMENT; + case 0: + return STRUCTUREDCONTENT_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public StructuredContentCase getStructuredContentCase() { + return StructuredContentCase.forNumber(structuredContentCase_); + } + + private int rawDocumentCase_ = 0; + private java.lang.Object rawDocument_; + + public enum RawDocumentCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + RAW_DOCUMENT_PATH(5), + INLINE_RAW_DOCUMENT(6), + RAWDOCUMENT_NOT_SET(0); + private final int value; + + private RawDocumentCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static RawDocumentCase valueOf(int value) { + return forNumber(value); + } + + public static RawDocumentCase forNumber(int value) { + switch (value) { + case 5: + return RAW_DOCUMENT_PATH; + case 6: + return INLINE_RAW_DOCUMENT; + case 0: + return RAWDOCUMENT_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public RawDocumentCase getRawDocumentCase() { + return RawDocumentCase.forNumber(rawDocumentCase_); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The resource name of the document.
+   * Format:
+   * projects/{project_number}/locations/{location}/documents/{document_id}.
+   * The name is ignored when creating a document.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * The resource name of the document.
+   * Format:
+   * projects/{project_number}/locations/{location}/documents/{document_id}.
+   * The name is ignored when creating a document.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REFERENCE_ID_FIELD_NUMBER = 11; + private volatile java.lang.Object referenceId_; + /** + * + * + *
+   * The reference ID set by customers. Must be unique per project and location.
+   * 
+ * + * string reference_id = 11; + * + * @return The referenceId. + */ + @java.lang.Override + public java.lang.String getReferenceId() { + java.lang.Object ref = referenceId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + referenceId_ = s; + return s; + } + } + /** + * + * + *
+   * The reference ID set by customers. Must be unique per project and location.
+   * 
+ * + * string reference_id = 11; + * + * @return The bytes for referenceId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getReferenceIdBytes() { + java.lang.Object ref = referenceId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + referenceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object displayName_; + /** + * + * + *
+   * Required. Display name of the document given by the user. This name will be displayed
+   * in the UI.
+   * Customer can populate this field with the name of the document. This
+   * differs from the 'title' field as 'title' is optional and stores the top
+   * heading in the document.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Display name of the document given by the user. This name will be displayed
+   * in the UI.
+   * Customer can populate this field with the name of the document. This
+   * differs from the 'title' field as 'title' is optional and stores the top
+   * heading in the document.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TITLE_FIELD_NUMBER = 18; + private volatile java.lang.Object title_; + /** + * + * + *
+   * Title that describes the document.
+   * This is usually present in the top section of the document, and is a
+   * mandatory field for the question-answering feature.
+   * 
+ * + * string title = 18; + * + * @return The title. + */ + @java.lang.Override + public java.lang.String getTitle() { + java.lang.Object ref = title_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + title_ = s; + return s; + } + } + /** + * + * + *
+   * Title that describes the document.
+   * This is usually present in the top section of the document, and is a
+   * mandatory field for the question-answering feature.
+   * 
+ * + * string title = 18; + * + * @return The bytes for title. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_URI_FIELD_NUMBER = 17; + private volatile java.lang.Object displayUri_; + /** + * + * + *
+   * Uri to display the document, for example, in the UI.
+   * 
+ * + * string display_uri = 17; + * + * @return The displayUri. + */ + @java.lang.Override + public java.lang.String getDisplayUri() { + java.lang.Object ref = displayUri_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayUri_ = s; + return s; + } + } + /** + * + * + *
+   * Uri to display the document, for example, in the UI.
+   * 
+ * + * string display_uri = 17; + * + * @return The bytes for displayUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayUriBytes() { + java.lang.Object ref = displayUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DOCUMENT_SCHEMA_NAME_FIELD_NUMBER = 3; + private volatile java.lang.Object documentSchemaName_; + /** + * + * + *
+   * The Document schema name.
+   * Format:
+   * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
+   * 
+ * + * string document_schema_name = 3 [(.google.api.resource_reference) = { ... } + * + * @return The documentSchemaName. + */ + @java.lang.Override + public java.lang.String getDocumentSchemaName() { + java.lang.Object ref = documentSchemaName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + documentSchemaName_ = s; + return s; + } + } + /** + * + * + *
+   * The Document schema name.
+   * Format:
+   * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
+   * 
+ * + * string document_schema_name = 3 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for documentSchemaName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDocumentSchemaNameBytes() { + java.lang.Object ref = documentSchemaName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + documentSchemaName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PLAIN_TEXT_FIELD_NUMBER = 15; + /** + * + * + *
+   * Other document format, such as PPTX, XLXS
+   * 
+ * + * string plain_text = 15; + * + * @return Whether the plainText field is set. + */ + public boolean hasPlainText() { + return structuredContentCase_ == 15; + } + /** + * + * + *
+   * Other document format, such as PPTX, XLXS
+   * 
+ * + * string plain_text = 15; + * + * @return The plainText. + */ + public java.lang.String getPlainText() { + java.lang.Object ref = ""; + if (structuredContentCase_ == 15) { + ref = structuredContent_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (structuredContentCase_ == 15) { + structuredContent_ = s; + } + return s; + } + } + /** + * + * + *
+   * Other document format, such as PPTX, XLXS
+   * 
+ * + * string plain_text = 15; + * + * @return The bytes for plainText. + */ + public com.google.protobuf.ByteString getPlainTextBytes() { + java.lang.Object ref = ""; + if (structuredContentCase_ == 15) { + ref = structuredContent_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (structuredContentCase_ == 15) { + structuredContent_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CLOUD_AI_DOCUMENT_FIELD_NUMBER = 4; + /** + * + * + *
+   * Document AI format to save the structured content, including OCR.
+   * 
+ * + * .google.cloud.documentai.v1.Document cloud_ai_document = 4; + * + * @return Whether the cloudAiDocument field is set. + */ + @java.lang.Override + public boolean hasCloudAiDocument() { + return structuredContentCase_ == 4; + } + /** + * + * + *
+   * Document AI format to save the structured content, including OCR.
+   * 
+ * + * .google.cloud.documentai.v1.Document cloud_ai_document = 4; + * + * @return The cloudAiDocument. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.Document getCloudAiDocument() { + if (structuredContentCase_ == 4) { + return (com.google.cloud.documentai.v1.Document) structuredContent_; + } + return com.google.cloud.documentai.v1.Document.getDefaultInstance(); + } + /** + * + * + *
+   * Document AI format to save the structured content, including OCR.
+   * 
+ * + * .google.cloud.documentai.v1.Document cloud_ai_document = 4; + */ + @java.lang.Override + public com.google.cloud.documentai.v1.DocumentOrBuilder getCloudAiDocumentOrBuilder() { + if (structuredContentCase_ == 4) { + return (com.google.cloud.documentai.v1.Document) structuredContent_; + } + return com.google.cloud.documentai.v1.Document.getDefaultInstance(); + } + + public static final int STRUCTURED_CONTENT_URI_FIELD_NUMBER = 16; + private volatile java.lang.Object structuredContentUri_; + /** + * + * + *
+   * A path linked to structured content file.
+   * 
+ * + * string structured_content_uri = 16; + * + * @return The structuredContentUri. + */ + @java.lang.Override + public java.lang.String getStructuredContentUri() { + java.lang.Object ref = structuredContentUri_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + structuredContentUri_ = s; + return s; + } + } + /** + * + * + *
+   * A path linked to structured content file.
+   * 
+ * + * string structured_content_uri = 16; + * + * @return The bytes for structuredContentUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStructuredContentUriBytes() { + java.lang.Object ref = structuredContentUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + structuredContentUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RAW_DOCUMENT_PATH_FIELD_NUMBER = 5; + /** + * + * + *
+   * Raw document file in Cloud Storage path.
+   * 
+ * + * string raw_document_path = 5; + * + * @return Whether the rawDocumentPath field is set. + */ + public boolean hasRawDocumentPath() { + return rawDocumentCase_ == 5; + } + /** + * + * + *
+   * Raw document file in Cloud Storage path.
+   * 
+ * + * string raw_document_path = 5; + * + * @return The rawDocumentPath. + */ + public java.lang.String getRawDocumentPath() { + java.lang.Object ref = ""; + if (rawDocumentCase_ == 5) { + ref = rawDocument_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (rawDocumentCase_ == 5) { + rawDocument_ = s; + } + return s; + } + } + /** + * + * + *
+   * Raw document file in Cloud Storage path.
+   * 
+ * + * string raw_document_path = 5; + * + * @return The bytes for rawDocumentPath. + */ + public com.google.protobuf.ByteString getRawDocumentPathBytes() { + java.lang.Object ref = ""; + if (rawDocumentCase_ == 5) { + ref = rawDocument_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (rawDocumentCase_ == 5) { + rawDocument_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INLINE_RAW_DOCUMENT_FIELD_NUMBER = 6; + /** + * + * + *
+   * Raw document content.
+   * 
+ * + * bytes inline_raw_document = 6; + * + * @return Whether the inlineRawDocument field is set. + */ + @java.lang.Override + public boolean hasInlineRawDocument() { + return rawDocumentCase_ == 6; + } + /** + * + * + *
+   * Raw document content.
+   * 
+ * + * bytes inline_raw_document = 6; + * + * @return The inlineRawDocument. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInlineRawDocument() { + if (rawDocumentCase_ == 6) { + return (com.google.protobuf.ByteString) rawDocument_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + public static final int PROPERTIES_FIELD_NUMBER = 7; + private java.util.List properties_; + /** + * + * + *
+   * List of values that are user supplied metadata.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Property properties = 7; + */ + @java.lang.Override + public java.util.List getPropertiesList() { + return properties_; + } + /** + * + * + *
+   * List of values that are user supplied metadata.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Property properties = 7; + */ + @java.lang.Override + public java.util.List + getPropertiesOrBuilderList() { + return properties_; + } + /** + * + * + *
+   * List of values that are user supplied metadata.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Property properties = 7; + */ + @java.lang.Override + public int getPropertiesCount() { + return properties_.size(); + } + /** + * + * + *
+   * List of values that are user supplied metadata.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Property properties = 7; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.Property getProperties(int index) { + return properties_.get(index); + } + /** + * + * + *
+   * List of values that are user supplied metadata.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Property properties = 7; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.PropertyOrBuilder getPropertiesOrBuilder(int index) { + return properties_.get(index); + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 8; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The time when the document is last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. The time when the document is last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Output only. The time when the document is last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 9; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The time when the document is created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. The time when the document is created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. The time when the document is created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int RAW_DOCUMENT_FILE_TYPE_FIELD_NUMBER = 10; + private int rawDocumentFileType_; + /** + * + * + *
+   * This is used when DocAI was not used to load the document and parsing/
+   * extracting is needed for the inline_raw_document.  For example, if
+   * inline_raw_document is the byte representation of a PDF file, then
+   * this should be set to: RAW_DOCUMENT_FILE_TYPE_PDF.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RawDocumentFileType raw_document_file_type = 10; + * + * @return The enum numeric value on the wire for rawDocumentFileType. + */ + @java.lang.Override + public int getRawDocumentFileTypeValue() { + return rawDocumentFileType_; + } + /** + * + * + *
+   * This is used when DocAI was not used to load the document and parsing/
+   * extracting is needed for the inline_raw_document.  For example, if
+   * inline_raw_document is the byte representation of a PDF file, then
+   * this should be set to: RAW_DOCUMENT_FILE_TYPE_PDF.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RawDocumentFileType raw_document_file_type = 10; + * + * @return The rawDocumentFileType. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RawDocumentFileType getRawDocumentFileType() { + @SuppressWarnings("deprecation") + com.google.cloud.contentwarehouse.v1.RawDocumentFileType result = + com.google.cloud.contentwarehouse.v1.RawDocumentFileType.valueOf(rawDocumentFileType_); + return result == null + ? com.google.cloud.contentwarehouse.v1.RawDocumentFileType.UNRECOGNIZED + : result; + } + + public static final int ASYNC_ENABLED_FIELD_NUMBER = 12; + private boolean asyncEnabled_; + /** + * + * + *
+   * If true, makes the document visible to asynchronous policies and rules.
+   * 
+ * + * bool async_enabled = 12; + * + * @return The asyncEnabled. + */ + @java.lang.Override + public boolean getAsyncEnabled() { + return asyncEnabled_; + } + + public static final int TEXT_EXTRACTION_DISABLED_FIELD_NUMBER = 19; + private boolean textExtractionDisabled_; + /** + * + * + *
+   * If true, text extraction will not be performed.
+   * 
+ * + * bool text_extraction_disabled = 19; + * + * @return The textExtractionDisabled. + */ + @java.lang.Override + public boolean getTextExtractionDisabled() { + return textExtractionDisabled_; + } + + public static final int CREATOR_FIELD_NUMBER = 13; + private volatile java.lang.Object creator_; + /** + * + * + *
+   * The user who creates the document.
+   * 
+ * + * string creator = 13; + * + * @return The creator. + */ + @java.lang.Override + public java.lang.String getCreator() { + java.lang.Object ref = creator_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + creator_ = s; + return s; + } + } + /** + * + * + *
+   * The user who creates the document.
+   * 
+ * + * string creator = 13; + * + * @return The bytes for creator. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCreatorBytes() { + java.lang.Object ref = creator_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + creator_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UPDATER_FIELD_NUMBER = 14; + private volatile java.lang.Object updater_; + /** + * + * + *
+   * The user who lastly updates the document.
+   * 
+ * + * string updater = 14; + * + * @return The updater. + */ + @java.lang.Override + public java.lang.String getUpdater() { + java.lang.Object ref = updater_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + updater_ = s; + return s; + } + } + /** + * + * + *
+   * The user who lastly updates the document.
+   * 
+ * + * string updater = 14; + * + * @return The bytes for updater. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUpdaterBytes() { + java.lang.Object ref = updater_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + updater_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(documentSchemaName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, documentSchemaName_); + } + if (structuredContentCase_ == 4) { + output.writeMessage(4, (com.google.cloud.documentai.v1.Document) structuredContent_); + } + if (rawDocumentCase_ == 5) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, rawDocument_); + } + if (rawDocumentCase_ == 6) { + output.writeBytes(6, (com.google.protobuf.ByteString) rawDocument_); + } + for (int i = 0; i < properties_.size(); i++) { + output.writeMessage(7, properties_.get(i)); + } + if (updateTime_ != null) { + output.writeMessage(8, getUpdateTime()); + } + if (createTime_ != null) { + output.writeMessage(9, getCreateTime()); + } + if (rawDocumentFileType_ + != com.google.cloud.contentwarehouse.v1.RawDocumentFileType + .RAW_DOCUMENT_FILE_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(10, rawDocumentFileType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(referenceId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 11, referenceId_); + } + if (asyncEnabled_ != false) { + output.writeBool(12, asyncEnabled_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(creator_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 13, creator_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(updater_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 14, updater_); + } + if (structuredContentCase_ == 15) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 15, structuredContent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(structuredContentUri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 16, structuredContentUri_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayUri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 17, displayUri_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(title_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 18, title_); + } + if (textExtractionDisabled_ != false) { + output.writeBool(19, textExtractionDisabled_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(documentSchemaName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, documentSchemaName_); + } + if (structuredContentCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.cloud.documentai.v1.Document) structuredContent_); + } + if (rawDocumentCase_ == 5) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, rawDocument_); + } + if (rawDocumentCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeBytesSize( + 6, (com.google.protobuf.ByteString) rawDocument_); + } + for (int i = 0; i < properties_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, properties_.get(i)); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getUpdateTime()); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getCreateTime()); + } + if (rawDocumentFileType_ + != com.google.cloud.contentwarehouse.v1.RawDocumentFileType + .RAW_DOCUMENT_FILE_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(10, rawDocumentFileType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(referenceId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, referenceId_); + } + if (asyncEnabled_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(12, asyncEnabled_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(creator_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(13, creator_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(updater_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(14, updater_); + } + if (structuredContentCase_ == 15) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(15, structuredContent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(structuredContentUri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(16, structuredContentUri_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayUri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(17, displayUri_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(title_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(18, title_); + } + if (textExtractionDisabled_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(19, textExtractionDisabled_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.Document)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.Document other = + (com.google.cloud.contentwarehouse.v1.Document) obj; + + if (!getName().equals(other.getName())) return false; + if (!getReferenceId().equals(other.getReferenceId())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getTitle().equals(other.getTitle())) return false; + if (!getDisplayUri().equals(other.getDisplayUri())) return false; + if (!getDocumentSchemaName().equals(other.getDocumentSchemaName())) return false; + if (!getStructuredContentUri().equals(other.getStructuredContentUri())) return false; + if (!getPropertiesList().equals(other.getPropertiesList())) return false; + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (rawDocumentFileType_ != other.rawDocumentFileType_) return false; + if (getAsyncEnabled() != other.getAsyncEnabled()) return false; + if (getTextExtractionDisabled() != other.getTextExtractionDisabled()) return false; + if (!getCreator().equals(other.getCreator())) return false; + if (!getUpdater().equals(other.getUpdater())) return false; + if (!getStructuredContentCase().equals(other.getStructuredContentCase())) return false; + switch (structuredContentCase_) { + case 15: + if (!getPlainText().equals(other.getPlainText())) return false; + break; + case 4: + if (!getCloudAiDocument().equals(other.getCloudAiDocument())) return false; + break; + case 0: + default: + } + if (!getRawDocumentCase().equals(other.getRawDocumentCase())) return false; + switch (rawDocumentCase_) { + case 5: + if (!getRawDocumentPath().equals(other.getRawDocumentPath())) return false; + break; + case 6: + if (!getInlineRawDocument().equals(other.getInlineRawDocument())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + REFERENCE_ID_FIELD_NUMBER; + hash = (53 * hash) + getReferenceId().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + TITLE_FIELD_NUMBER; + hash = (53 * hash) + getTitle().hashCode(); + hash = (37 * hash) + DISPLAY_URI_FIELD_NUMBER; + hash = (53 * hash) + getDisplayUri().hashCode(); + hash = (37 * hash) + DOCUMENT_SCHEMA_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDocumentSchemaName().hashCode(); + hash = (37 * hash) + STRUCTURED_CONTENT_URI_FIELD_NUMBER; + hash = (53 * hash) + getStructuredContentUri().hashCode(); + if (getPropertiesCount() > 0) { + hash = (37 * hash) + PROPERTIES_FIELD_NUMBER; + hash = (53 * hash) + getPropertiesList().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + hash = (37 * hash) + RAW_DOCUMENT_FILE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + rawDocumentFileType_; + hash = (37 * hash) + ASYNC_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAsyncEnabled()); + hash = (37 * hash) + TEXT_EXTRACTION_DISABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getTextExtractionDisabled()); + hash = (37 * hash) + CREATOR_FIELD_NUMBER; + hash = (53 * hash) + getCreator().hashCode(); + hash = (37 * hash) + UPDATER_FIELD_NUMBER; + hash = (53 * hash) + getUpdater().hashCode(); + switch (structuredContentCase_) { + case 15: + hash = (37 * hash) + PLAIN_TEXT_FIELD_NUMBER; + hash = (53 * hash) + getPlainText().hashCode(); + break; + case 4: + hash = (37 * hash) + CLOUD_AI_DOCUMENT_FIELD_NUMBER; + hash = (53 * hash) + getCloudAiDocument().hashCode(); + break; + case 0: + default: + } + switch (rawDocumentCase_) { + case 5: + hash = (37 * hash) + RAW_DOCUMENT_PATH_FIELD_NUMBER; + hash = (53 * hash) + getRawDocumentPath().hashCode(); + break; + case 6: + hash = (37 * hash) + INLINE_RAW_DOCUMENT_FIELD_NUMBER; + hash = (53 * hash) + getInlineRawDocument().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.Document parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.Document parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.Document parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.Document parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.Document parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.Document parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.Document parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.Document parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.Document parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.Document parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.Document parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.Document parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.contentwarehouse.v1.Document prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Defines the structure for content warehouse document proto.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.Document} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.Document) + com.google.cloud.contentwarehouse.v1.DocumentOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_Document_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_Document_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.Document.class, + com.google.cloud.contentwarehouse.v1.Document.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.Document.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + referenceId_ = ""; + + displayName_ = ""; + + title_ = ""; + + displayUri_ = ""; + + documentSchemaName_ = ""; + + if (cloudAiDocumentBuilder_ != null) { + cloudAiDocumentBuilder_.clear(); + } + structuredContentUri_ = ""; + + if (propertiesBuilder_ == null) { + properties_ = java.util.Collections.emptyList(); + } else { + properties_ = null; + propertiesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + rawDocumentFileType_ = 0; + + asyncEnabled_ = false; + + textExtractionDisabled_ = false; + + creator_ = ""; + + updater_ = ""; + + structuredContentCase_ = 0; + structuredContent_ = null; + rawDocumentCase_ = 0; + rawDocument_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_Document_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.Document getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.Document.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.Document build() { + com.google.cloud.contentwarehouse.v1.Document result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.Document buildPartial() { + com.google.cloud.contentwarehouse.v1.Document result = + new com.google.cloud.contentwarehouse.v1.Document(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.referenceId_ = referenceId_; + result.displayName_ = displayName_; + result.title_ = title_; + result.displayUri_ = displayUri_; + result.documentSchemaName_ = documentSchemaName_; + if (structuredContentCase_ == 15) { + result.structuredContent_ = structuredContent_; + } + if (structuredContentCase_ == 4) { + if (cloudAiDocumentBuilder_ == null) { + result.structuredContent_ = structuredContent_; + } else { + result.structuredContent_ = cloudAiDocumentBuilder_.build(); + } + } + result.structuredContentUri_ = structuredContentUri_; + if (rawDocumentCase_ == 5) { + result.rawDocument_ = rawDocument_; + } + if (rawDocumentCase_ == 6) { + result.rawDocument_ = rawDocument_; + } + if (propertiesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + properties_ = java.util.Collections.unmodifiableList(properties_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.properties_ = properties_; + } else { + result.properties_ = propertiesBuilder_.build(); + } + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + result.rawDocumentFileType_ = rawDocumentFileType_; + result.asyncEnabled_ = asyncEnabled_; + result.textExtractionDisabled_ = textExtractionDisabled_; + result.creator_ = creator_; + result.updater_ = updater_; + result.structuredContentCase_ = structuredContentCase_; + result.rawDocumentCase_ = rawDocumentCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.Document) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.Document) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.Document other) { + if (other == com.google.cloud.contentwarehouse.v1.Document.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getReferenceId().isEmpty()) { + referenceId_ = other.referenceId_; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (!other.getTitle().isEmpty()) { + title_ = other.title_; + onChanged(); + } + if (!other.getDisplayUri().isEmpty()) { + displayUri_ = other.displayUri_; + onChanged(); + } + if (!other.getDocumentSchemaName().isEmpty()) { + documentSchemaName_ = other.documentSchemaName_; + onChanged(); + } + if (!other.getStructuredContentUri().isEmpty()) { + structuredContentUri_ = other.structuredContentUri_; + onChanged(); + } + if (propertiesBuilder_ == null) { + if (!other.properties_.isEmpty()) { + if (properties_.isEmpty()) { + properties_ = other.properties_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePropertiesIsMutable(); + properties_.addAll(other.properties_); + } + onChanged(); + } + } else { + if (!other.properties_.isEmpty()) { + if (propertiesBuilder_.isEmpty()) { + propertiesBuilder_.dispose(); + propertiesBuilder_ = null; + properties_ = other.properties_; + bitField0_ = (bitField0_ & ~0x00000001); + propertiesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getPropertiesFieldBuilder() + : null; + } else { + propertiesBuilder_.addAllMessages(other.properties_); + } + } + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.rawDocumentFileType_ != 0) { + setRawDocumentFileTypeValue(other.getRawDocumentFileTypeValue()); + } + if (other.getAsyncEnabled() != false) { + setAsyncEnabled(other.getAsyncEnabled()); + } + if (other.getTextExtractionDisabled() != false) { + setTextExtractionDisabled(other.getTextExtractionDisabled()); + } + if (!other.getCreator().isEmpty()) { + creator_ = other.creator_; + onChanged(); + } + if (!other.getUpdater().isEmpty()) { + updater_ = other.updater_; + onChanged(); + } + switch (other.getStructuredContentCase()) { + case PLAIN_TEXT: + { + structuredContentCase_ = 15; + structuredContent_ = other.structuredContent_; + onChanged(); + break; + } + case CLOUD_AI_DOCUMENT: + { + mergeCloudAiDocument(other.getCloudAiDocument()); + break; + } + case STRUCTUREDCONTENT_NOT_SET: + { + break; + } + } + switch (other.getRawDocumentCase()) { + case RAW_DOCUMENT_PATH: + { + rawDocumentCase_ = 5; + rawDocument_ = other.rawDocument_; + onChanged(); + break; + } + case INLINE_RAW_DOCUMENT: + { + setInlineRawDocument(other.getInlineRawDocument()); + break; + } + case RAWDOCUMENT_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + displayName_ = input.readStringRequireUtf8(); + + break; + } // case 18 + case 26: + { + documentSchemaName_ = input.readStringRequireUtf8(); + + break; + } // case 26 + case 34: + { + input.readMessage(getCloudAiDocumentFieldBuilder().getBuilder(), extensionRegistry); + structuredContentCase_ = 4; + break; + } // case 34 + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + rawDocumentCase_ = 5; + rawDocument_ = s; + break; + } // case 42 + case 50: + { + rawDocument_ = input.readBytes(); + rawDocumentCase_ = 6; + break; + } // case 50 + case 58: + { + com.google.cloud.contentwarehouse.v1.Property m = + input.readMessage( + com.google.cloud.contentwarehouse.v1.Property.parser(), extensionRegistry); + if (propertiesBuilder_ == null) { + ensurePropertiesIsMutable(); + properties_.add(m); + } else { + propertiesBuilder_.addMessage(m); + } + break; + } // case 58 + case 66: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 66 + case 74: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 74 + case 80: + { + rawDocumentFileType_ = input.readEnum(); + + break; + } // case 80 + case 90: + { + referenceId_ = input.readStringRequireUtf8(); + + break; + } // case 90 + case 96: + { + asyncEnabled_ = input.readBool(); + + break; + } // case 96 + case 106: + { + creator_ = input.readStringRequireUtf8(); + + break; + } // case 106 + case 114: + { + updater_ = input.readStringRequireUtf8(); + + break; + } // case 114 + case 122: + { + java.lang.String s = input.readStringRequireUtf8(); + structuredContentCase_ = 15; + structuredContent_ = s; + break; + } // case 122 + case 130: + { + structuredContentUri_ = input.readStringRequireUtf8(); + + break; + } // case 130 + case 138: + { + displayUri_ = input.readStringRequireUtf8(); + + break; + } // case 138 + case 146: + { + title_ = input.readStringRequireUtf8(); + + break; + } // case 146 + case 152: + { + textExtractionDisabled_ = input.readBool(); + + break; + } // case 152 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int structuredContentCase_ = 0; + private java.lang.Object structuredContent_; + + public StructuredContentCase getStructuredContentCase() { + return StructuredContentCase.forNumber(structuredContentCase_); + } + + public Builder clearStructuredContent() { + structuredContentCase_ = 0; + structuredContent_ = null; + onChanged(); + return this; + } + + private int rawDocumentCase_ = 0; + private java.lang.Object rawDocument_; + + public RawDocumentCase getRawDocumentCase() { + return RawDocumentCase.forNumber(rawDocumentCase_); + } + + public Builder clearRawDocument() { + rawDocumentCase_ = 0; + rawDocument_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The resource name of the document.
+     * Format:
+     * projects/{project_number}/locations/{location}/documents/{document_id}.
+     * The name is ignored when creating a document.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource name of the document.
+     * Format:
+     * projects/{project_number}/locations/{location}/documents/{document_id}.
+     * The name is ignored when creating a document.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource name of the document.
+     * Format:
+     * projects/{project_number}/locations/{location}/documents/{document_id}.
+     * The name is ignored when creating a document.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the document.
+     * Format:
+     * projects/{project_number}/locations/{location}/documents/{document_id}.
+     * The name is ignored when creating a document.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the document.
+     * Format:
+     * projects/{project_number}/locations/{location}/documents/{document_id}.
+     * The name is ignored when creating a document.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object referenceId_ = ""; + /** + * + * + *
+     * The reference ID set by customers. Must be unique per project and location.
+     * 
+ * + * string reference_id = 11; + * + * @return The referenceId. + */ + public java.lang.String getReferenceId() { + java.lang.Object ref = referenceId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + referenceId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The reference ID set by customers. Must be unique per project and location.
+     * 
+ * + * string reference_id = 11; + * + * @return The bytes for referenceId. + */ + public com.google.protobuf.ByteString getReferenceIdBytes() { + java.lang.Object ref = referenceId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + referenceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The reference ID set by customers. Must be unique per project and location.
+     * 
+ * + * string reference_id = 11; + * + * @param value The referenceId to set. + * @return This builder for chaining. + */ + public Builder setReferenceId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + referenceId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The reference ID set by customers. Must be unique per project and location.
+     * 
+ * + * string reference_id = 11; + * + * @return This builder for chaining. + */ + public Builder clearReferenceId() { + + referenceId_ = getDefaultInstance().getReferenceId(); + onChanged(); + return this; + } + /** + * + * + *
+     * The reference ID set by customers. Must be unique per project and location.
+     * 
+ * + * string reference_id = 11; + * + * @param value The bytes for referenceId to set. + * @return This builder for chaining. + */ + public Builder setReferenceIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + referenceId_ = value; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * Required. Display name of the document given by the user. This name will be displayed
+     * in the UI.
+     * Customer can populate this field with the name of the document. This
+     * differs from the 'title' field as 'title' is optional and stores the top
+     * heading in the document.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Display name of the document given by the user. This name will be displayed
+     * in the UI.
+     * Customer can populate this field with the name of the document. This
+     * differs from the 'title' field as 'title' is optional and stores the top
+     * heading in the document.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Display name of the document given by the user. This name will be displayed
+     * in the UI.
+     * Customer can populate this field with the name of the document. This
+     * differs from the 'title' field as 'title' is optional and stores the top
+     * heading in the document.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Display name of the document given by the user. This name will be displayed
+     * in the UI.
+     * Customer can populate this field with the name of the document. This
+     * differs from the 'title' field as 'title' is optional and stores the top
+     * heading in the document.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Display name of the document given by the user. This name will be displayed
+     * in the UI.
+     * Customer can populate this field with the name of the document. This
+     * differs from the 'title' field as 'title' is optional and stores the top
+     * heading in the document.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayName_ = value; + onChanged(); + return this; + } + + private java.lang.Object title_ = ""; + /** + * + * + *
+     * Title that describes the document.
+     * This is usually present in the top section of the document, and is a
+     * mandatory field for the question-answering feature.
+     * 
+ * + * string title = 18; + * + * @return The title. + */ + public java.lang.String getTitle() { + java.lang.Object ref = title_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + title_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Title that describes the document.
+     * This is usually present in the top section of the document, and is a
+     * mandatory field for the question-answering feature.
+     * 
+ * + * string title = 18; + * + * @return The bytes for title. + */ + public com.google.protobuf.ByteString getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Title that describes the document.
+     * This is usually present in the top section of the document, and is a
+     * mandatory field for the question-answering feature.
+     * 
+ * + * string title = 18; + * + * @param value The title to set. + * @return This builder for chaining. + */ + public Builder setTitle(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + title_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Title that describes the document.
+     * This is usually present in the top section of the document, and is a
+     * mandatory field for the question-answering feature.
+     * 
+ * + * string title = 18; + * + * @return This builder for chaining. + */ + public Builder clearTitle() { + + title_ = getDefaultInstance().getTitle(); + onChanged(); + return this; + } + /** + * + * + *
+     * Title that describes the document.
+     * This is usually present in the top section of the document, and is a
+     * mandatory field for the question-answering feature.
+     * 
+ * + * string title = 18; + * + * @param value The bytes for title to set. + * @return This builder for chaining. + */ + public Builder setTitleBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + title_ = value; + onChanged(); + return this; + } + + private java.lang.Object displayUri_ = ""; + /** + * + * + *
+     * Uri to display the document, for example, in the UI.
+     * 
+ * + * string display_uri = 17; + * + * @return The displayUri. + */ + public java.lang.String getDisplayUri() { + java.lang.Object ref = displayUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Uri to display the document, for example, in the UI.
+     * 
+ * + * string display_uri = 17; + * + * @return The bytes for displayUri. + */ + public com.google.protobuf.ByteString getDisplayUriBytes() { + java.lang.Object ref = displayUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Uri to display the document, for example, in the UI.
+     * 
+ * + * string display_uri = 17; + * + * @param value The displayUri to set. + * @return This builder for chaining. + */ + public Builder setDisplayUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayUri_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Uri to display the document, for example, in the UI.
+     * 
+ * + * string display_uri = 17; + * + * @return This builder for chaining. + */ + public Builder clearDisplayUri() { + + displayUri_ = getDefaultInstance().getDisplayUri(); + onChanged(); + return this; + } + /** + * + * + *
+     * Uri to display the document, for example, in the UI.
+     * 
+ * + * string display_uri = 17; + * + * @param value The bytes for displayUri to set. + * @return This builder for chaining. + */ + public Builder setDisplayUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayUri_ = value; + onChanged(); + return this; + } + + private java.lang.Object documentSchemaName_ = ""; + /** + * + * + *
+     * The Document schema name.
+     * Format:
+     * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
+     * 
+ * + * string document_schema_name = 3 [(.google.api.resource_reference) = { ... } + * + * @return The documentSchemaName. + */ + public java.lang.String getDocumentSchemaName() { + java.lang.Object ref = documentSchemaName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + documentSchemaName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The Document schema name.
+     * Format:
+     * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
+     * 
+ * + * string document_schema_name = 3 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for documentSchemaName. + */ + public com.google.protobuf.ByteString getDocumentSchemaNameBytes() { + java.lang.Object ref = documentSchemaName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + documentSchemaName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The Document schema name.
+     * Format:
+     * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
+     * 
+ * + * string document_schema_name = 3 [(.google.api.resource_reference) = { ... } + * + * @param value The documentSchemaName to set. + * @return This builder for chaining. + */ + public Builder setDocumentSchemaName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + documentSchemaName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The Document schema name.
+     * Format:
+     * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
+     * 
+ * + * string document_schema_name = 3 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearDocumentSchemaName() { + + documentSchemaName_ = getDefaultInstance().getDocumentSchemaName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The Document schema name.
+     * Format:
+     * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
+     * 
+ * + * string document_schema_name = 3 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for documentSchemaName to set. + * @return This builder for chaining. + */ + public Builder setDocumentSchemaNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + documentSchemaName_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Other document format, such as PPTX, XLXS
+     * 
+ * + * string plain_text = 15; + * + * @return Whether the plainText field is set. + */ + @java.lang.Override + public boolean hasPlainText() { + return structuredContentCase_ == 15; + } + /** + * + * + *
+     * Other document format, such as PPTX, XLXS
+     * 
+ * + * string plain_text = 15; + * + * @return The plainText. + */ + @java.lang.Override + public java.lang.String getPlainText() { + java.lang.Object ref = ""; + if (structuredContentCase_ == 15) { + ref = structuredContent_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (structuredContentCase_ == 15) { + structuredContent_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Other document format, such as PPTX, XLXS
+     * 
+ * + * string plain_text = 15; + * + * @return The bytes for plainText. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPlainTextBytes() { + java.lang.Object ref = ""; + if (structuredContentCase_ == 15) { + ref = structuredContent_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (structuredContentCase_ == 15) { + structuredContent_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Other document format, such as PPTX, XLXS
+     * 
+ * + * string plain_text = 15; + * + * @param value The plainText to set. + * @return This builder for chaining. + */ + public Builder setPlainText(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + structuredContentCase_ = 15; + structuredContent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Other document format, such as PPTX, XLXS
+     * 
+ * + * string plain_text = 15; + * + * @return This builder for chaining. + */ + public Builder clearPlainText() { + if (structuredContentCase_ == 15) { + structuredContentCase_ = 0; + structuredContent_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Other document format, such as PPTX, XLXS
+     * 
+ * + * string plain_text = 15; + * + * @param value The bytes for plainText to set. + * @return This builder for chaining. + */ + public Builder setPlainTextBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + structuredContentCase_ = 15; + structuredContent_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.Document, + com.google.cloud.documentai.v1.Document.Builder, + com.google.cloud.documentai.v1.DocumentOrBuilder> + cloudAiDocumentBuilder_; + /** + * + * + *
+     * Document AI format to save the structured content, including OCR.
+     * 
+ * + * .google.cloud.documentai.v1.Document cloud_ai_document = 4; + * + * @return Whether the cloudAiDocument field is set. + */ + @java.lang.Override + public boolean hasCloudAiDocument() { + return structuredContentCase_ == 4; + } + /** + * + * + *
+     * Document AI format to save the structured content, including OCR.
+     * 
+ * + * .google.cloud.documentai.v1.Document cloud_ai_document = 4; + * + * @return The cloudAiDocument. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.Document getCloudAiDocument() { + if (cloudAiDocumentBuilder_ == null) { + if (structuredContentCase_ == 4) { + return (com.google.cloud.documentai.v1.Document) structuredContent_; + } + return com.google.cloud.documentai.v1.Document.getDefaultInstance(); + } else { + if (structuredContentCase_ == 4) { + return cloudAiDocumentBuilder_.getMessage(); + } + return com.google.cloud.documentai.v1.Document.getDefaultInstance(); + } + } + /** + * + * + *
+     * Document AI format to save the structured content, including OCR.
+     * 
+ * + * .google.cloud.documentai.v1.Document cloud_ai_document = 4; + */ + public Builder setCloudAiDocument(com.google.cloud.documentai.v1.Document value) { + if (cloudAiDocumentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + structuredContent_ = value; + onChanged(); + } else { + cloudAiDocumentBuilder_.setMessage(value); + } + structuredContentCase_ = 4; + return this; + } + /** + * + * + *
+     * Document AI format to save the structured content, including OCR.
+     * 
+ * + * .google.cloud.documentai.v1.Document cloud_ai_document = 4; + */ + public Builder setCloudAiDocument( + com.google.cloud.documentai.v1.Document.Builder builderForValue) { + if (cloudAiDocumentBuilder_ == null) { + structuredContent_ = builderForValue.build(); + onChanged(); + } else { + cloudAiDocumentBuilder_.setMessage(builderForValue.build()); + } + structuredContentCase_ = 4; + return this; + } + /** + * + * + *
+     * Document AI format to save the structured content, including OCR.
+     * 
+ * + * .google.cloud.documentai.v1.Document cloud_ai_document = 4; + */ + public Builder mergeCloudAiDocument(com.google.cloud.documentai.v1.Document value) { + if (cloudAiDocumentBuilder_ == null) { + if (structuredContentCase_ == 4 + && structuredContent_ != com.google.cloud.documentai.v1.Document.getDefaultInstance()) { + structuredContent_ = + com.google.cloud.documentai.v1.Document.newBuilder( + (com.google.cloud.documentai.v1.Document) structuredContent_) + .mergeFrom(value) + .buildPartial(); + } else { + structuredContent_ = value; + } + onChanged(); + } else { + if (structuredContentCase_ == 4) { + cloudAiDocumentBuilder_.mergeFrom(value); + } else { + cloudAiDocumentBuilder_.setMessage(value); + } + } + structuredContentCase_ = 4; + return this; + } + /** + * + * + *
+     * Document AI format to save the structured content, including OCR.
+     * 
+ * + * .google.cloud.documentai.v1.Document cloud_ai_document = 4; + */ + public Builder clearCloudAiDocument() { + if (cloudAiDocumentBuilder_ == null) { + if (structuredContentCase_ == 4) { + structuredContentCase_ = 0; + structuredContent_ = null; + onChanged(); + } + } else { + if (structuredContentCase_ == 4) { + structuredContentCase_ = 0; + structuredContent_ = null; + } + cloudAiDocumentBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Document AI format to save the structured content, including OCR.
+     * 
+ * + * .google.cloud.documentai.v1.Document cloud_ai_document = 4; + */ + public com.google.cloud.documentai.v1.Document.Builder getCloudAiDocumentBuilder() { + return getCloudAiDocumentFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Document AI format to save the structured content, including OCR.
+     * 
+ * + * .google.cloud.documentai.v1.Document cloud_ai_document = 4; + */ + @java.lang.Override + public com.google.cloud.documentai.v1.DocumentOrBuilder getCloudAiDocumentOrBuilder() { + if ((structuredContentCase_ == 4) && (cloudAiDocumentBuilder_ != null)) { + return cloudAiDocumentBuilder_.getMessageOrBuilder(); + } else { + if (structuredContentCase_ == 4) { + return (com.google.cloud.documentai.v1.Document) structuredContent_; + } + return com.google.cloud.documentai.v1.Document.getDefaultInstance(); + } + } + /** + * + * + *
+     * Document AI format to save the structured content, including OCR.
+     * 
+ * + * .google.cloud.documentai.v1.Document cloud_ai_document = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.Document, + com.google.cloud.documentai.v1.Document.Builder, + com.google.cloud.documentai.v1.DocumentOrBuilder> + getCloudAiDocumentFieldBuilder() { + if (cloudAiDocumentBuilder_ == null) { + if (!(structuredContentCase_ == 4)) { + structuredContent_ = com.google.cloud.documentai.v1.Document.getDefaultInstance(); + } + cloudAiDocumentBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.Document, + com.google.cloud.documentai.v1.Document.Builder, + com.google.cloud.documentai.v1.DocumentOrBuilder>( + (com.google.cloud.documentai.v1.Document) structuredContent_, + getParentForChildren(), + isClean()); + structuredContent_ = null; + } + structuredContentCase_ = 4; + onChanged(); + ; + return cloudAiDocumentBuilder_; + } + + private java.lang.Object structuredContentUri_ = ""; + /** + * + * + *
+     * A path linked to structured content file.
+     * 
+ * + * string structured_content_uri = 16; + * + * @return The structuredContentUri. + */ + public java.lang.String getStructuredContentUri() { + java.lang.Object ref = structuredContentUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + structuredContentUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A path linked to structured content file.
+     * 
+ * + * string structured_content_uri = 16; + * + * @return The bytes for structuredContentUri. + */ + public com.google.protobuf.ByteString getStructuredContentUriBytes() { + java.lang.Object ref = structuredContentUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + structuredContentUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A path linked to structured content file.
+     * 
+ * + * string structured_content_uri = 16; + * + * @param value The structuredContentUri to set. + * @return This builder for chaining. + */ + public Builder setStructuredContentUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + structuredContentUri_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A path linked to structured content file.
+     * 
+ * + * string structured_content_uri = 16; + * + * @return This builder for chaining. + */ + public Builder clearStructuredContentUri() { + + structuredContentUri_ = getDefaultInstance().getStructuredContentUri(); + onChanged(); + return this; + } + /** + * + * + *
+     * A path linked to structured content file.
+     * 
+ * + * string structured_content_uri = 16; + * + * @param value The bytes for structuredContentUri to set. + * @return This builder for chaining. + */ + public Builder setStructuredContentUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + structuredContentUri_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Raw document file in Cloud Storage path.
+     * 
+ * + * string raw_document_path = 5; + * + * @return Whether the rawDocumentPath field is set. + */ + @java.lang.Override + public boolean hasRawDocumentPath() { + return rawDocumentCase_ == 5; + } + /** + * + * + *
+     * Raw document file in Cloud Storage path.
+     * 
+ * + * string raw_document_path = 5; + * + * @return The rawDocumentPath. + */ + @java.lang.Override + public java.lang.String getRawDocumentPath() { + java.lang.Object ref = ""; + if (rawDocumentCase_ == 5) { + ref = rawDocument_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (rawDocumentCase_ == 5) { + rawDocument_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Raw document file in Cloud Storage path.
+     * 
+ * + * string raw_document_path = 5; + * + * @return The bytes for rawDocumentPath. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRawDocumentPathBytes() { + java.lang.Object ref = ""; + if (rawDocumentCase_ == 5) { + ref = rawDocument_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (rawDocumentCase_ == 5) { + rawDocument_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Raw document file in Cloud Storage path.
+     * 
+ * + * string raw_document_path = 5; + * + * @param value The rawDocumentPath to set. + * @return This builder for chaining. + */ + public Builder setRawDocumentPath(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + rawDocumentCase_ = 5; + rawDocument_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Raw document file in Cloud Storage path.
+     * 
+ * + * string raw_document_path = 5; + * + * @return This builder for chaining. + */ + public Builder clearRawDocumentPath() { + if (rawDocumentCase_ == 5) { + rawDocumentCase_ = 0; + rawDocument_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Raw document file in Cloud Storage path.
+     * 
+ * + * string raw_document_path = 5; + * + * @param value The bytes for rawDocumentPath to set. + * @return This builder for chaining. + */ + public Builder setRawDocumentPathBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + rawDocumentCase_ = 5; + rawDocument_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Raw document content.
+     * 
+ * + * bytes inline_raw_document = 6; + * + * @return Whether the inlineRawDocument field is set. + */ + public boolean hasInlineRawDocument() { + return rawDocumentCase_ == 6; + } + /** + * + * + *
+     * Raw document content.
+     * 
+ * + * bytes inline_raw_document = 6; + * + * @return The inlineRawDocument. + */ + public com.google.protobuf.ByteString getInlineRawDocument() { + if (rawDocumentCase_ == 6) { + return (com.google.protobuf.ByteString) rawDocument_; + } + return com.google.protobuf.ByteString.EMPTY; + } + /** + * + * + *
+     * Raw document content.
+     * 
+ * + * bytes inline_raw_document = 6; + * + * @param value The inlineRawDocument to set. + * @return This builder for chaining. + */ + public Builder setInlineRawDocument(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + rawDocumentCase_ = 6; + rawDocument_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Raw document content.
+     * 
+ * + * bytes inline_raw_document = 6; + * + * @return This builder for chaining. + */ + public Builder clearInlineRawDocument() { + if (rawDocumentCase_ == 6) { + rawDocumentCase_ = 0; + rawDocument_ = null; + onChanged(); + } + return this; + } + + private java.util.List properties_ = + java.util.Collections.emptyList(); + + private void ensurePropertiesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + properties_ = + new java.util.ArrayList(properties_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.Property, + com.google.cloud.contentwarehouse.v1.Property.Builder, + com.google.cloud.contentwarehouse.v1.PropertyOrBuilder> + propertiesBuilder_; + + /** + * + * + *
+     * List of values that are user supplied metadata.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Property properties = 7; + */ + public java.util.List getPropertiesList() { + if (propertiesBuilder_ == null) { + return java.util.Collections.unmodifiableList(properties_); + } else { + return propertiesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * List of values that are user supplied metadata.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Property properties = 7; + */ + public int getPropertiesCount() { + if (propertiesBuilder_ == null) { + return properties_.size(); + } else { + return propertiesBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of values that are user supplied metadata.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Property properties = 7; + */ + public com.google.cloud.contentwarehouse.v1.Property getProperties(int index) { + if (propertiesBuilder_ == null) { + return properties_.get(index); + } else { + return propertiesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of values that are user supplied metadata.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Property properties = 7; + */ + public Builder setProperties(int index, com.google.cloud.contentwarehouse.v1.Property value) { + if (propertiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePropertiesIsMutable(); + properties_.set(index, value); + onChanged(); + } else { + propertiesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of values that are user supplied metadata.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Property properties = 7; + */ + public Builder setProperties( + int index, com.google.cloud.contentwarehouse.v1.Property.Builder builderForValue) { + if (propertiesBuilder_ == null) { + ensurePropertiesIsMutable(); + properties_.set(index, builderForValue.build()); + onChanged(); + } else { + propertiesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of values that are user supplied metadata.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Property properties = 7; + */ + public Builder addProperties(com.google.cloud.contentwarehouse.v1.Property value) { + if (propertiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePropertiesIsMutable(); + properties_.add(value); + onChanged(); + } else { + propertiesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * List of values that are user supplied metadata.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Property properties = 7; + */ + public Builder addProperties(int index, com.google.cloud.contentwarehouse.v1.Property value) { + if (propertiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePropertiesIsMutable(); + properties_.add(index, value); + onChanged(); + } else { + propertiesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of values that are user supplied metadata.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Property properties = 7; + */ + public Builder addProperties( + com.google.cloud.contentwarehouse.v1.Property.Builder builderForValue) { + if (propertiesBuilder_ == null) { + ensurePropertiesIsMutable(); + properties_.add(builderForValue.build()); + onChanged(); + } else { + propertiesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of values that are user supplied metadata.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Property properties = 7; + */ + public Builder addProperties( + int index, com.google.cloud.contentwarehouse.v1.Property.Builder builderForValue) { + if (propertiesBuilder_ == null) { + ensurePropertiesIsMutable(); + properties_.add(index, builderForValue.build()); + onChanged(); + } else { + propertiesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of values that are user supplied metadata.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Property properties = 7; + */ + public Builder addAllProperties( + java.lang.Iterable values) { + if (propertiesBuilder_ == null) { + ensurePropertiesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, properties_); + onChanged(); + } else { + propertiesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * List of values that are user supplied metadata.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Property properties = 7; + */ + public Builder clearProperties() { + if (propertiesBuilder_ == null) { + properties_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + propertiesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of values that are user supplied metadata.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Property properties = 7; + */ + public Builder removeProperties(int index) { + if (propertiesBuilder_ == null) { + ensurePropertiesIsMutable(); + properties_.remove(index); + onChanged(); + } else { + propertiesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * List of values that are user supplied metadata.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Property properties = 7; + */ + public com.google.cloud.contentwarehouse.v1.Property.Builder getPropertiesBuilder(int index) { + return getPropertiesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of values that are user supplied metadata.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Property properties = 7; + */ + public com.google.cloud.contentwarehouse.v1.PropertyOrBuilder getPropertiesOrBuilder( + int index) { + if (propertiesBuilder_ == null) { + return properties_.get(index); + } else { + return propertiesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of values that are user supplied metadata.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Property properties = 7; + */ + public java.util.List + getPropertiesOrBuilderList() { + if (propertiesBuilder_ != null) { + return propertiesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(properties_); + } + } + /** + * + * + *
+     * List of values that are user supplied metadata.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Property properties = 7; + */ + public com.google.cloud.contentwarehouse.v1.Property.Builder addPropertiesBuilder() { + return getPropertiesFieldBuilder() + .addBuilder(com.google.cloud.contentwarehouse.v1.Property.getDefaultInstance()); + } + /** + * + * + *
+     * List of values that are user supplied metadata.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Property properties = 7; + */ + public com.google.cloud.contentwarehouse.v1.Property.Builder addPropertiesBuilder(int index) { + return getPropertiesFieldBuilder() + .addBuilder(index, com.google.cloud.contentwarehouse.v1.Property.getDefaultInstance()); + } + /** + * + * + *
+     * List of values that are user supplied metadata.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Property properties = 7; + */ + public java.util.List + getPropertiesBuilderList() { + return getPropertiesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.Property, + com.google.cloud.contentwarehouse.v1.Property.Builder, + com.google.cloud.contentwarehouse.v1.PropertyOrBuilder> + getPropertiesFieldBuilder() { + if (propertiesBuilder_ == null) { + propertiesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.Property, + com.google.cloud.contentwarehouse.v1.Property.Builder, + com.google.cloud.contentwarehouse.v1.PropertyOrBuilder>( + properties_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + properties_ = null; + } + return propertiesBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. The time when the document is last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * Output only. The time when the document is last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The time when the document is last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + onChanged(); + } else { + updateTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time when the document is last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The time when the document is last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (updateTime_ != null) { + updateTime_ = + com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); + } else { + updateTime_ = value; + } + onChanged(); + } else { + updateTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time when the document is last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The time when the document is last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time when the document is last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Output only. The time when the document is last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. The time when the document is created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Output only. The time when the document is created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The time when the document is created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time when the document is created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The time when the document is created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time when the document is created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The time when the document is created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time when the document is created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. The time when the document is created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private int rawDocumentFileType_ = 0; + /** + * + * + *
+     * This is used when DocAI was not used to load the document and parsing/
+     * extracting is needed for the inline_raw_document.  For example, if
+     * inline_raw_document is the byte representation of a PDF file, then
+     * this should be set to: RAW_DOCUMENT_FILE_TYPE_PDF.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RawDocumentFileType raw_document_file_type = 10; + * + * + * @return The enum numeric value on the wire for rawDocumentFileType. + */ + @java.lang.Override + public int getRawDocumentFileTypeValue() { + return rawDocumentFileType_; + } + /** + * + * + *
+     * This is used when DocAI was not used to load the document and parsing/
+     * extracting is needed for the inline_raw_document.  For example, if
+     * inline_raw_document is the byte representation of a PDF file, then
+     * this should be set to: RAW_DOCUMENT_FILE_TYPE_PDF.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RawDocumentFileType raw_document_file_type = 10; + * + * + * @param value The enum numeric value on the wire for rawDocumentFileType to set. + * @return This builder for chaining. + */ + public Builder setRawDocumentFileTypeValue(int value) { + + rawDocumentFileType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * This is used when DocAI was not used to load the document and parsing/
+     * extracting is needed for the inline_raw_document.  For example, if
+     * inline_raw_document is the byte representation of a PDF file, then
+     * this should be set to: RAW_DOCUMENT_FILE_TYPE_PDF.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RawDocumentFileType raw_document_file_type = 10; + * + * + * @return The rawDocumentFileType. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RawDocumentFileType getRawDocumentFileType() { + @SuppressWarnings("deprecation") + com.google.cloud.contentwarehouse.v1.RawDocumentFileType result = + com.google.cloud.contentwarehouse.v1.RawDocumentFileType.valueOf(rawDocumentFileType_); + return result == null + ? com.google.cloud.contentwarehouse.v1.RawDocumentFileType.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * This is used when DocAI was not used to load the document and parsing/
+     * extracting is needed for the inline_raw_document.  For example, if
+     * inline_raw_document is the byte representation of a PDF file, then
+     * this should be set to: RAW_DOCUMENT_FILE_TYPE_PDF.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RawDocumentFileType raw_document_file_type = 10; + * + * + * @param value The rawDocumentFileType to set. + * @return This builder for chaining. + */ + public Builder setRawDocumentFileType( + com.google.cloud.contentwarehouse.v1.RawDocumentFileType value) { + if (value == null) { + throw new NullPointerException(); + } + + rawDocumentFileType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * This is used when DocAI was not used to load the document and parsing/
+     * extracting is needed for the inline_raw_document.  For example, if
+     * inline_raw_document is the byte representation of a PDF file, then
+     * this should be set to: RAW_DOCUMENT_FILE_TYPE_PDF.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RawDocumentFileType raw_document_file_type = 10; + * + * + * @return This builder for chaining. + */ + public Builder clearRawDocumentFileType() { + + rawDocumentFileType_ = 0; + onChanged(); + return this; + } + + private boolean asyncEnabled_; + /** + * + * + *
+     * If true, makes the document visible to asynchronous policies and rules.
+     * 
+ * + * bool async_enabled = 12; + * + * @return The asyncEnabled. + */ + @java.lang.Override + public boolean getAsyncEnabled() { + return asyncEnabled_; + } + /** + * + * + *
+     * If true, makes the document visible to asynchronous policies and rules.
+     * 
+ * + * bool async_enabled = 12; + * + * @param value The asyncEnabled to set. + * @return This builder for chaining. + */ + public Builder setAsyncEnabled(boolean value) { + + asyncEnabled_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If true, makes the document visible to asynchronous policies and rules.
+     * 
+ * + * bool async_enabled = 12; + * + * @return This builder for chaining. + */ + public Builder clearAsyncEnabled() { + + asyncEnabled_ = false; + onChanged(); + return this; + } + + private boolean textExtractionDisabled_; + /** + * + * + *
+     * If true, text extraction will not be performed.
+     * 
+ * + * bool text_extraction_disabled = 19; + * + * @return The textExtractionDisabled. + */ + @java.lang.Override + public boolean getTextExtractionDisabled() { + return textExtractionDisabled_; + } + /** + * + * + *
+     * If true, text extraction will not be performed.
+     * 
+ * + * bool text_extraction_disabled = 19; + * + * @param value The textExtractionDisabled to set. + * @return This builder for chaining. + */ + public Builder setTextExtractionDisabled(boolean value) { + + textExtractionDisabled_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If true, text extraction will not be performed.
+     * 
+ * + * bool text_extraction_disabled = 19; + * + * @return This builder for chaining. + */ + public Builder clearTextExtractionDisabled() { + + textExtractionDisabled_ = false; + onChanged(); + return this; + } + + private java.lang.Object creator_ = ""; + /** + * + * + *
+     * The user who creates the document.
+     * 
+ * + * string creator = 13; + * + * @return The creator. + */ + public java.lang.String getCreator() { + java.lang.Object ref = creator_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + creator_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The user who creates the document.
+     * 
+ * + * string creator = 13; + * + * @return The bytes for creator. + */ + public com.google.protobuf.ByteString getCreatorBytes() { + java.lang.Object ref = creator_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + creator_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The user who creates the document.
+     * 
+ * + * string creator = 13; + * + * @param value The creator to set. + * @return This builder for chaining. + */ + public Builder setCreator(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + creator_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The user who creates the document.
+     * 
+ * + * string creator = 13; + * + * @return This builder for chaining. + */ + public Builder clearCreator() { + + creator_ = getDefaultInstance().getCreator(); + onChanged(); + return this; + } + /** + * + * + *
+     * The user who creates the document.
+     * 
+ * + * string creator = 13; + * + * @param value The bytes for creator to set. + * @return This builder for chaining. + */ + public Builder setCreatorBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + creator_ = value; + onChanged(); + return this; + } + + private java.lang.Object updater_ = ""; + /** + * + * + *
+     * The user who lastly updates the document.
+     * 
+ * + * string updater = 14; + * + * @return The updater. + */ + public java.lang.String getUpdater() { + java.lang.Object ref = updater_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + updater_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The user who lastly updates the document.
+     * 
+ * + * string updater = 14; + * + * @return The bytes for updater. + */ + public com.google.protobuf.ByteString getUpdaterBytes() { + java.lang.Object ref = updater_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + updater_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The user who lastly updates the document.
+     * 
+ * + * string updater = 14; + * + * @param value The updater to set. + * @return This builder for chaining. + */ + public Builder setUpdater(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + updater_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The user who lastly updates the document.
+     * 
+ * + * string updater = 14; + * + * @return This builder for chaining. + */ + public Builder clearUpdater() { + + updater_ = getDefaultInstance().getUpdater(); + onChanged(); + return this; + } + /** + * + * + *
+     * The user who lastly updates the document.
+     * 
+ * + * string updater = 14; + * + * @param value The bytes for updater to set. + * @return This builder for chaining. + */ + public Builder setUpdaterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + updater_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.Document) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.Document) + private static final com.google.cloud.contentwarehouse.v1.Document DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.Document(); + } + + public static com.google.cloud.contentwarehouse.v1.Document getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Document parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.Document getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentLink.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentLink.java new file mode 100644 index 000000000000..dfd668019bd6 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentLink.java @@ -0,0 +1,2287 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_link_service.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * A document-link between source and target document.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.DocumentLink} + */ +public final class DocumentLink extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.DocumentLink) + DocumentLinkOrBuilder { + private static final long serialVersionUID = 0L; + // Use DocumentLink.newBuilder() to construct. + private DocumentLink(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DocumentLink() { + name_ = ""; + description_ = ""; + state_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DocumentLink(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentLinkServiceProto + .internal_static_google_cloud_contentwarehouse_v1_DocumentLink_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentLinkServiceProto + .internal_static_google_cloud_contentwarehouse_v1_DocumentLink_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.DocumentLink.class, + com.google.cloud.contentwarehouse.v1.DocumentLink.Builder.class); + } + + /** + * + * + *
+   * The state of a document-link.
+   * 
+ * + * Protobuf enum {@code google.cloud.contentwarehouse.v1.DocumentLink.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unknown state of documentlink.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * The documentlink has both source and target documents detected.
+     * 
+ * + * ACTIVE = 1; + */ + ACTIVE(1), + /** + * + * + *
+     * Target document is deleted, and mark the documentlink as soft-deleted.
+     * 
+ * + * SOFT_DELETED = 2; + */ + SOFT_DELETED(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unknown state of documentlink.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The documentlink has both source and target documents detected.
+     * 
+ * + * ACTIVE = 1; + */ + public static final int ACTIVE_VALUE = 1; + /** + * + * + *
+     * Target document is deleted, and mark the documentlink as soft-deleted.
+     * 
+ * + * SOFT_DELETED = 2; + */ + public static final int SOFT_DELETED_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static State valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static State forNumber(int value) { + switch (value) { + case 0: + return STATE_UNSPECIFIED; + case 1: + return ACTIVE; + case 2: + return SOFT_DELETED; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public State findValueByNumber(int number) { + return State.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentLink.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final State[] VALUES = values(); + + public static State valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.contentwarehouse.v1.DocumentLink.State) + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Name of this document-link.
+   * It is required that the parent derived form the name to be consistent with
+   * the source document reference. Otherwise an exception will be thrown.
+   * Format:
+   * projects/{project_number}/locations/{location}/documents/{source_document_id}/documentLinks/{document_link_id}.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Name of this document-link.
+   * It is required that the parent derived form the name to be consistent with
+   * the source document reference. Otherwise an exception will be thrown.
+   * Format:
+   * projects/{project_number}/locations/{location}/documents/{source_document_id}/documentLinks/{document_link_id}.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SOURCE_DOCUMENT_REFERENCE_FIELD_NUMBER = 2; + private com.google.cloud.contentwarehouse.v1.DocumentReference sourceDocumentReference_; + /** + * + * + *
+   * Document references of the source document.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.DocumentReference source_document_reference = 2; + * + * @return Whether the sourceDocumentReference field is set. + */ + @java.lang.Override + public boolean hasSourceDocumentReference() { + return sourceDocumentReference_ != null; + } + /** + * + * + *
+   * Document references of the source document.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.DocumentReference source_document_reference = 2; + * + * @return The sourceDocumentReference. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DocumentReference getSourceDocumentReference() { + return sourceDocumentReference_ == null + ? com.google.cloud.contentwarehouse.v1.DocumentReference.getDefaultInstance() + : sourceDocumentReference_; + } + /** + * + * + *
+   * Document references of the source document.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.DocumentReference source_document_reference = 2; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DocumentReferenceOrBuilder + getSourceDocumentReferenceOrBuilder() { + return getSourceDocumentReference(); + } + + public static final int TARGET_DOCUMENT_REFERENCE_FIELD_NUMBER = 3; + private com.google.cloud.contentwarehouse.v1.DocumentReference targetDocumentReference_; + /** + * + * + *
+   * Document references of the target document.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.DocumentReference target_document_reference = 3; + * + * @return Whether the targetDocumentReference field is set. + */ + @java.lang.Override + public boolean hasTargetDocumentReference() { + return targetDocumentReference_ != null; + } + /** + * + * + *
+   * Document references of the target document.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.DocumentReference target_document_reference = 3; + * + * @return The targetDocumentReference. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DocumentReference getTargetDocumentReference() { + return targetDocumentReference_ == null + ? com.google.cloud.contentwarehouse.v1.DocumentReference.getDefaultInstance() + : targetDocumentReference_; + } + /** + * + * + *
+   * Document references of the target document.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.DocumentReference target_document_reference = 3; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DocumentReferenceOrBuilder + getTargetDocumentReferenceOrBuilder() { + return getTargetDocumentReference(); + } + + public static final int DESCRIPTION_FIELD_NUMBER = 4; + private volatile java.lang.Object description_; + /** + * + * + *
+   * Description of this document-link.
+   * 
+ * + * string description = 4; + * + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + /** + * + * + *
+   * Description of this document-link.
+   * 
+ * + * string description = 4; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The time when the documentLink is last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. The time when the documentLink is last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Output only. The time when the documentLink is last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The time when the documentLink is created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. The time when the documentLink is created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. The time when the documentLink is created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int STATE_FIELD_NUMBER = 7; + private int state_; + /** + * + * + *
+   * The state of the documentlink. If target node has been deleted, the
+   * link is marked as invalid. Removing a source node will result in removal
+   * of all associated links.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.DocumentLink.State state = 7; + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * The state of the documentlink. If target node has been deleted, the
+   * link is marked as invalid. Removing a source node will result in removal
+   * of all associated links.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.DocumentLink.State state = 7; + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DocumentLink.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.contentwarehouse.v1.DocumentLink.State result = + com.google.cloud.contentwarehouse.v1.DocumentLink.State.valueOf(state_); + return result == null + ? com.google.cloud.contentwarehouse.v1.DocumentLink.State.UNRECOGNIZED + : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (sourceDocumentReference_ != null) { + output.writeMessage(2, getSourceDocumentReference()); + } + if (targetDocumentReference_ != null) { + output.writeMessage(3, getTargetDocumentReference()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, description_); + } + if (updateTime_ != null) { + output.writeMessage(5, getUpdateTime()); + } + if (createTime_ != null) { + output.writeMessage(6, getCreateTime()); + } + if (state_ + != com.google.cloud.contentwarehouse.v1.DocumentLink.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(7, state_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (sourceDocumentReference_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(2, getSourceDocumentReference()); + } + if (targetDocumentReference_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(3, getTargetDocumentReference()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, description_); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getUpdateTime()); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getCreateTime()); + } + if (state_ + != com.google.cloud.contentwarehouse.v1.DocumentLink.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(7, state_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.DocumentLink)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.DocumentLink other = + (com.google.cloud.contentwarehouse.v1.DocumentLink) obj; + + if (!getName().equals(other.getName())) return false; + if (hasSourceDocumentReference() != other.hasSourceDocumentReference()) return false; + if (hasSourceDocumentReference()) { + if (!getSourceDocumentReference().equals(other.getSourceDocumentReference())) return false; + } + if (hasTargetDocumentReference() != other.hasTargetDocumentReference()) return false; + if (hasTargetDocumentReference()) { + if (!getTargetDocumentReference().equals(other.getTargetDocumentReference())) return false; + } + if (!getDescription().equals(other.getDescription())) return false; + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (state_ != other.state_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasSourceDocumentReference()) { + hash = (37 * hash) + SOURCE_DOCUMENT_REFERENCE_FIELD_NUMBER; + hash = (53 * hash) + getSourceDocumentReference().hashCode(); + } + if (hasTargetDocumentReference()) { + hash = (37 * hash) + TARGET_DOCUMENT_REFERENCE_FIELD_NUMBER; + hash = (53 * hash) + getTargetDocumentReference().hashCode(); + } + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.DocumentLink parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.DocumentLink parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DocumentLink parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.DocumentLink parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DocumentLink parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.DocumentLink parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DocumentLink parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.DocumentLink parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DocumentLink parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.DocumentLink parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DocumentLink parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.DocumentLink parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.contentwarehouse.v1.DocumentLink prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A document-link between source and target document.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.DocumentLink} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.DocumentLink) + com.google.cloud.contentwarehouse.v1.DocumentLinkOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentLinkServiceProto + .internal_static_google_cloud_contentwarehouse_v1_DocumentLink_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentLinkServiceProto + .internal_static_google_cloud_contentwarehouse_v1_DocumentLink_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.DocumentLink.class, + com.google.cloud.contentwarehouse.v1.DocumentLink.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.DocumentLink.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (sourceDocumentReferenceBuilder_ == null) { + sourceDocumentReference_ = null; + } else { + sourceDocumentReference_ = null; + sourceDocumentReferenceBuilder_ = null; + } + if (targetDocumentReferenceBuilder_ == null) { + targetDocumentReference_ = null; + } else { + targetDocumentReference_ = null; + targetDocumentReferenceBuilder_ = null; + } + description_ = ""; + + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + state_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.DocumentLinkServiceProto + .internal_static_google_cloud_contentwarehouse_v1_DocumentLink_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DocumentLink getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.DocumentLink.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DocumentLink build() { + com.google.cloud.contentwarehouse.v1.DocumentLink result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DocumentLink buildPartial() { + com.google.cloud.contentwarehouse.v1.DocumentLink result = + new com.google.cloud.contentwarehouse.v1.DocumentLink(this); + result.name_ = name_; + if (sourceDocumentReferenceBuilder_ == null) { + result.sourceDocumentReference_ = sourceDocumentReference_; + } else { + result.sourceDocumentReference_ = sourceDocumentReferenceBuilder_.build(); + } + if (targetDocumentReferenceBuilder_ == null) { + result.targetDocumentReference_ = targetDocumentReference_; + } else { + result.targetDocumentReference_ = targetDocumentReferenceBuilder_.build(); + } + result.description_ = description_; + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + result.state_ = state_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.DocumentLink) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.DocumentLink) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.DocumentLink other) { + if (other == com.google.cloud.contentwarehouse.v1.DocumentLink.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasSourceDocumentReference()) { + mergeSourceDocumentReference(other.getSourceDocumentReference()); + } + if (other.hasTargetDocumentReference()) { + mergeTargetDocumentReference(other.getTargetDocumentReference()); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + input.readMessage( + getSourceDocumentReferenceFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + case 26: + { + input.readMessage( + getTargetDocumentReferenceFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 26 + case 34: + { + description_ = input.readStringRequireUtf8(); + + break; + } // case 34 + case 42: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 42 + case 50: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 50 + case 56: + { + state_ = input.readEnum(); + + break; + } // case 56 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Name of this document-link.
+     * It is required that the parent derived form the name to be consistent with
+     * the source document reference. Otherwise an exception will be thrown.
+     * Format:
+     * projects/{project_number}/locations/{location}/documents/{source_document_id}/documentLinks/{document_link_id}.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Name of this document-link.
+     * It is required that the parent derived form the name to be consistent with
+     * the source document reference. Otherwise an exception will be thrown.
+     * Format:
+     * projects/{project_number}/locations/{location}/documents/{source_document_id}/documentLinks/{document_link_id}.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Name of this document-link.
+     * It is required that the parent derived form the name to be consistent with
+     * the source document reference. Otherwise an exception will be thrown.
+     * Format:
+     * projects/{project_number}/locations/{location}/documents/{source_document_id}/documentLinks/{document_link_id}.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Name of this document-link.
+     * It is required that the parent derived form the name to be consistent with
+     * the source document reference. Otherwise an exception will be thrown.
+     * Format:
+     * projects/{project_number}/locations/{location}/documents/{source_document_id}/documentLinks/{document_link_id}.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Name of this document-link.
+     * It is required that the parent derived form the name to be consistent with
+     * the source document reference. Otherwise an exception will be thrown.
+     * Format:
+     * projects/{project_number}/locations/{location}/documents/{source_document_id}/documentLinks/{document_link_id}.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.cloud.contentwarehouse.v1.DocumentReference sourceDocumentReference_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.DocumentReference, + com.google.cloud.contentwarehouse.v1.DocumentReference.Builder, + com.google.cloud.contentwarehouse.v1.DocumentReferenceOrBuilder> + sourceDocumentReferenceBuilder_; + /** + * + * + *
+     * Document references of the source document.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DocumentReference source_document_reference = 2; + * + * + * @return Whether the sourceDocumentReference field is set. + */ + public boolean hasSourceDocumentReference() { + return sourceDocumentReferenceBuilder_ != null || sourceDocumentReference_ != null; + } + /** + * + * + *
+     * Document references of the source document.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DocumentReference source_document_reference = 2; + * + * + * @return The sourceDocumentReference. + */ + public com.google.cloud.contentwarehouse.v1.DocumentReference getSourceDocumentReference() { + if (sourceDocumentReferenceBuilder_ == null) { + return sourceDocumentReference_ == null + ? com.google.cloud.contentwarehouse.v1.DocumentReference.getDefaultInstance() + : sourceDocumentReference_; + } else { + return sourceDocumentReferenceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Document references of the source document.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DocumentReference source_document_reference = 2; + * + */ + public Builder setSourceDocumentReference( + com.google.cloud.contentwarehouse.v1.DocumentReference value) { + if (sourceDocumentReferenceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sourceDocumentReference_ = value; + onChanged(); + } else { + sourceDocumentReferenceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Document references of the source document.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DocumentReference source_document_reference = 2; + * + */ + public Builder setSourceDocumentReference( + com.google.cloud.contentwarehouse.v1.DocumentReference.Builder builderForValue) { + if (sourceDocumentReferenceBuilder_ == null) { + sourceDocumentReference_ = builderForValue.build(); + onChanged(); + } else { + sourceDocumentReferenceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Document references of the source document.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DocumentReference source_document_reference = 2; + * + */ + public Builder mergeSourceDocumentReference( + com.google.cloud.contentwarehouse.v1.DocumentReference value) { + if (sourceDocumentReferenceBuilder_ == null) { + if (sourceDocumentReference_ != null) { + sourceDocumentReference_ = + com.google.cloud.contentwarehouse.v1.DocumentReference.newBuilder( + sourceDocumentReference_) + .mergeFrom(value) + .buildPartial(); + } else { + sourceDocumentReference_ = value; + } + onChanged(); + } else { + sourceDocumentReferenceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Document references of the source document.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DocumentReference source_document_reference = 2; + * + */ + public Builder clearSourceDocumentReference() { + if (sourceDocumentReferenceBuilder_ == null) { + sourceDocumentReference_ = null; + onChanged(); + } else { + sourceDocumentReference_ = null; + sourceDocumentReferenceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Document references of the source document.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DocumentReference source_document_reference = 2; + * + */ + public com.google.cloud.contentwarehouse.v1.DocumentReference.Builder + getSourceDocumentReferenceBuilder() { + + onChanged(); + return getSourceDocumentReferenceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Document references of the source document.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DocumentReference source_document_reference = 2; + * + */ + public com.google.cloud.contentwarehouse.v1.DocumentReferenceOrBuilder + getSourceDocumentReferenceOrBuilder() { + if (sourceDocumentReferenceBuilder_ != null) { + return sourceDocumentReferenceBuilder_.getMessageOrBuilder(); + } else { + return sourceDocumentReference_ == null + ? com.google.cloud.contentwarehouse.v1.DocumentReference.getDefaultInstance() + : sourceDocumentReference_; + } + } + /** + * + * + *
+     * Document references of the source document.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DocumentReference source_document_reference = 2; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.DocumentReference, + com.google.cloud.contentwarehouse.v1.DocumentReference.Builder, + com.google.cloud.contentwarehouse.v1.DocumentReferenceOrBuilder> + getSourceDocumentReferenceFieldBuilder() { + if (sourceDocumentReferenceBuilder_ == null) { + sourceDocumentReferenceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.DocumentReference, + com.google.cloud.contentwarehouse.v1.DocumentReference.Builder, + com.google.cloud.contentwarehouse.v1.DocumentReferenceOrBuilder>( + getSourceDocumentReference(), getParentForChildren(), isClean()); + sourceDocumentReference_ = null; + } + return sourceDocumentReferenceBuilder_; + } + + private com.google.cloud.contentwarehouse.v1.DocumentReference targetDocumentReference_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.DocumentReference, + com.google.cloud.contentwarehouse.v1.DocumentReference.Builder, + com.google.cloud.contentwarehouse.v1.DocumentReferenceOrBuilder> + targetDocumentReferenceBuilder_; + /** + * + * + *
+     * Document references of the target document.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DocumentReference target_document_reference = 3; + * + * + * @return Whether the targetDocumentReference field is set. + */ + public boolean hasTargetDocumentReference() { + return targetDocumentReferenceBuilder_ != null || targetDocumentReference_ != null; + } + /** + * + * + *
+     * Document references of the target document.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DocumentReference target_document_reference = 3; + * + * + * @return The targetDocumentReference. + */ + public com.google.cloud.contentwarehouse.v1.DocumentReference getTargetDocumentReference() { + if (targetDocumentReferenceBuilder_ == null) { + return targetDocumentReference_ == null + ? com.google.cloud.contentwarehouse.v1.DocumentReference.getDefaultInstance() + : targetDocumentReference_; + } else { + return targetDocumentReferenceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Document references of the target document.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DocumentReference target_document_reference = 3; + * + */ + public Builder setTargetDocumentReference( + com.google.cloud.contentwarehouse.v1.DocumentReference value) { + if (targetDocumentReferenceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + targetDocumentReference_ = value; + onChanged(); + } else { + targetDocumentReferenceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Document references of the target document.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DocumentReference target_document_reference = 3; + * + */ + public Builder setTargetDocumentReference( + com.google.cloud.contentwarehouse.v1.DocumentReference.Builder builderForValue) { + if (targetDocumentReferenceBuilder_ == null) { + targetDocumentReference_ = builderForValue.build(); + onChanged(); + } else { + targetDocumentReferenceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Document references of the target document.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DocumentReference target_document_reference = 3; + * + */ + public Builder mergeTargetDocumentReference( + com.google.cloud.contentwarehouse.v1.DocumentReference value) { + if (targetDocumentReferenceBuilder_ == null) { + if (targetDocumentReference_ != null) { + targetDocumentReference_ = + com.google.cloud.contentwarehouse.v1.DocumentReference.newBuilder( + targetDocumentReference_) + .mergeFrom(value) + .buildPartial(); + } else { + targetDocumentReference_ = value; + } + onChanged(); + } else { + targetDocumentReferenceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Document references of the target document.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DocumentReference target_document_reference = 3; + * + */ + public Builder clearTargetDocumentReference() { + if (targetDocumentReferenceBuilder_ == null) { + targetDocumentReference_ = null; + onChanged(); + } else { + targetDocumentReference_ = null; + targetDocumentReferenceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Document references of the target document.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DocumentReference target_document_reference = 3; + * + */ + public com.google.cloud.contentwarehouse.v1.DocumentReference.Builder + getTargetDocumentReferenceBuilder() { + + onChanged(); + return getTargetDocumentReferenceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Document references of the target document.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DocumentReference target_document_reference = 3; + * + */ + public com.google.cloud.contentwarehouse.v1.DocumentReferenceOrBuilder + getTargetDocumentReferenceOrBuilder() { + if (targetDocumentReferenceBuilder_ != null) { + return targetDocumentReferenceBuilder_.getMessageOrBuilder(); + } else { + return targetDocumentReference_ == null + ? com.google.cloud.contentwarehouse.v1.DocumentReference.getDefaultInstance() + : targetDocumentReference_; + } + } + /** + * + * + *
+     * Document references of the target document.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DocumentReference target_document_reference = 3; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.DocumentReference, + com.google.cloud.contentwarehouse.v1.DocumentReference.Builder, + com.google.cloud.contentwarehouse.v1.DocumentReferenceOrBuilder> + getTargetDocumentReferenceFieldBuilder() { + if (targetDocumentReferenceBuilder_ == null) { + targetDocumentReferenceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.DocumentReference, + com.google.cloud.contentwarehouse.v1.DocumentReference.Builder, + com.google.cloud.contentwarehouse.v1.DocumentReferenceOrBuilder>( + getTargetDocumentReference(), getParentForChildren(), isClean()); + targetDocumentReference_ = null; + } + return targetDocumentReferenceBuilder_; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * Description of this document-link.
+     * 
+ * + * string description = 4; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Description of this document-link.
+     * 
+ * + * string description = 4; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Description of this document-link.
+     * 
+ * + * string description = 4; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Description of this document-link.
+     * 
+ * + * string description = 4; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+     * Description of this document-link.
+     * 
+ * + * string description = 4; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. The time when the documentLink is last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * Output only. The time when the documentLink is last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The time when the documentLink is last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + onChanged(); + } else { + updateTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time when the documentLink is last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The time when the documentLink is last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (updateTime_ != null) { + updateTime_ = + com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); + } else { + updateTime_ = value; + } + onChanged(); + } else { + updateTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time when the documentLink is last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The time when the documentLink is last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time when the documentLink is last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Output only. The time when the documentLink is last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. The time when the documentLink is created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Output only. The time when the documentLink is created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The time when the documentLink is created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time when the documentLink is created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The time when the documentLink is created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time when the documentLink is created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The time when the documentLink is created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time when the documentLink is created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. The time when the documentLink is created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private int state_ = 0; + /** + * + * + *
+     * The state of the documentlink. If target node has been deleted, the
+     * link is marked as invalid. Removing a source node will result in removal
+     * of all associated links.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DocumentLink.State state = 7; + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * The state of the documentlink. If target node has been deleted, the
+     * link is marked as invalid. Removing a source node will result in removal
+     * of all associated links.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DocumentLink.State state = 7; + * + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + + state_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The state of the documentlink. If target node has been deleted, the
+     * link is marked as invalid. Removing a source node will result in removal
+     * of all associated links.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DocumentLink.State state = 7; + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DocumentLink.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.contentwarehouse.v1.DocumentLink.State result = + com.google.cloud.contentwarehouse.v1.DocumentLink.State.valueOf(state_); + return result == null + ? com.google.cloud.contentwarehouse.v1.DocumentLink.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The state of the documentlink. If target node has been deleted, the
+     * link is marked as invalid. Removing a source node will result in removal
+     * of all associated links.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DocumentLink.State state = 7; + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.contentwarehouse.v1.DocumentLink.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The state of the documentlink. If target node has been deleted, the
+     * link is marked as invalid. Removing a source node will result in removal
+     * of all associated links.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DocumentLink.State state = 7; + * + * @return This builder for chaining. + */ + public Builder clearState() { + + state_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.DocumentLink) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.DocumentLink) + private static final com.google.cloud.contentwarehouse.v1.DocumentLink DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.DocumentLink(); + } + + public static com.google.cloud.contentwarehouse.v1.DocumentLink getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DocumentLink parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DocumentLink getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentLinkName.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentLinkName.java new file mode 100644 index 000000000000..58df551a532c --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentLinkName.java @@ -0,0 +1,269 @@ +/* + * 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; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class DocumentLinkName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_DOCUMENT_DOCUMENT_LINK = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/documents/{document}/documentLinks/{document_link}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String document; + private final String documentLink; + + @Deprecated + protected DocumentLinkName() { + project = null; + location = null; + document = null; + documentLink = null; + } + + private DocumentLinkName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + document = Preconditions.checkNotNull(builder.getDocument()); + documentLink = Preconditions.checkNotNull(builder.getDocumentLink()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getDocument() { + return document; + } + + public String getDocumentLink() { + return documentLink; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static DocumentLinkName of( + String project, String location, String document, String documentLink) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setDocument(document) + .setDocumentLink(documentLink) + .build(); + } + + public static String format( + String project, String location, String document, String documentLink) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setDocument(document) + .setDocumentLink(documentLink) + .build() + .toString(); + } + + public static DocumentLinkName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_DOCUMENT_DOCUMENT_LINK.validatedMatch( + formattedString, "DocumentLinkName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("document"), + matchMap.get("document_link")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (DocumentLinkName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_DOCUMENT_DOCUMENT_LINK.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (document != null) { + fieldMapBuilder.put("document", document); + } + if (documentLink != null) { + fieldMapBuilder.put("document_link", documentLink); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_DOCUMENT_DOCUMENT_LINK.instantiate( + "project", + project, + "location", + location, + "document", + document, + "document_link", + documentLink); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + DocumentLinkName that = ((DocumentLinkName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.document, that.document) + && Objects.equals(this.documentLink, that.documentLink); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(document); + h *= 1000003; + h ^= Objects.hashCode(documentLink); + return h; + } + + /** + * Builder for + * projects/{project}/locations/{location}/documents/{document}/documentLinks/{document_link}. + */ + public static class Builder { + private String project; + private String location; + private String document; + private String documentLink; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getDocument() { + return document; + } + + public String getDocumentLink() { + return documentLink; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setDocument(String document) { + this.document = document; + return this; + } + + public Builder setDocumentLink(String documentLink) { + this.documentLink = documentLink; + return this; + } + + private Builder(DocumentLinkName documentLinkName) { + this.project = documentLinkName.project; + this.location = documentLinkName.location; + this.document = documentLinkName.document; + this.documentLink = documentLinkName.documentLink; + } + + public DocumentLinkName build() { + return new DocumentLinkName(this); + } + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentLinkOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentLinkOrBuilder.java new file mode 100644 index 000000000000..bbf85ba8b160 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentLinkOrBuilder.java @@ -0,0 +1,260 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_link_service.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface DocumentLinkOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.DocumentLink) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Name of this document-link.
+   * It is required that the parent derived form the name to be consistent with
+   * the source document reference. Otherwise an exception will be thrown.
+   * Format:
+   * projects/{project_number}/locations/{location}/documents/{source_document_id}/documentLinks/{document_link_id}.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Name of this document-link.
+   * It is required that the parent derived form the name to be consistent with
+   * the source document reference. Otherwise an exception will be thrown.
+   * Format:
+   * projects/{project_number}/locations/{location}/documents/{source_document_id}/documentLinks/{document_link_id}.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Document references of the source document.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.DocumentReference source_document_reference = 2; + * + * @return Whether the sourceDocumentReference field is set. + */ + boolean hasSourceDocumentReference(); + /** + * + * + *
+   * Document references of the source document.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.DocumentReference source_document_reference = 2; + * + * @return The sourceDocumentReference. + */ + com.google.cloud.contentwarehouse.v1.DocumentReference getSourceDocumentReference(); + /** + * + * + *
+   * Document references of the source document.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.DocumentReference source_document_reference = 2; + */ + com.google.cloud.contentwarehouse.v1.DocumentReferenceOrBuilder + getSourceDocumentReferenceOrBuilder(); + + /** + * + * + *
+   * Document references of the target document.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.DocumentReference target_document_reference = 3; + * + * @return Whether the targetDocumentReference field is set. + */ + boolean hasTargetDocumentReference(); + /** + * + * + *
+   * Document references of the target document.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.DocumentReference target_document_reference = 3; + * + * @return The targetDocumentReference. + */ + com.google.cloud.contentwarehouse.v1.DocumentReference getTargetDocumentReference(); + /** + * + * + *
+   * Document references of the target document.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.DocumentReference target_document_reference = 3; + */ + com.google.cloud.contentwarehouse.v1.DocumentReferenceOrBuilder + getTargetDocumentReferenceOrBuilder(); + + /** + * + * + *
+   * Description of this document-link.
+   * 
+ * + * string description = 4; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * Description of this document-link.
+   * 
+ * + * string description = 4; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Output only. The time when the documentLink is last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The time when the documentLink is last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The time when the documentLink is last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The time when the documentLink is created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The time when the documentLink is created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The time when the documentLink is created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * The state of the documentlink. If target node has been deleted, the
+   * link is marked as invalid. Removing a source node will result in removal
+   * of all associated links.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.DocumentLink.State state = 7; + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * The state of the documentlink. If target node has been deleted, the
+   * link is marked as invalid. Removing a source node will result in removal
+   * of all associated links.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.DocumentLink.State state = 7; + * + * @return The state. + */ + com.google.cloud.contentwarehouse.v1.DocumentLink.State getState(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentLinkServiceProto.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentLinkServiceProto.java new file mode 100644 index 000000000000..391c21ed0243 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentLinkServiceProto.java @@ -0,0 +1,245 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_link_service.proto + +package com.google.cloud.contentwarehouse.v1; + +public final class DocumentLinkServiceProto { + private DocumentLinkServiceProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_ListLinkedTargetsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_ListLinkedTargetsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_ListLinkedTargetsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_ListLinkedTargetsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_ListLinkedSourcesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_ListLinkedSourcesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_ListLinkedSourcesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_ListLinkedSourcesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_DocumentLink_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_DocumentLink_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_CreateDocumentLinkRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_CreateDocumentLinkRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_DeleteDocumentLinkRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_DeleteDocumentLinkRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; + private final String project; + private final String location; + private final String document; + private final String referenceId; + + @Deprecated + protected DocumentName() { + project = null; + location = null; + document = null; + referenceId = null; + } + + private DocumentName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + document = Preconditions.checkNotNull(builder.getDocument()); + referenceId = null; + pathTemplate = PROJECT_LOCATION_DOCUMENT; + } + + private DocumentName(ProjectLocationReferenceIdBuilder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + referenceId = Preconditions.checkNotNull(builder.getReferenceId()); + document = null; + pathTemplate = PROJECT_LOCATION_REFERENCE_ID; + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getDocument() { + return document; + } + + public String getReferenceId() { + return referenceId; + } + + public static Builder newBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static Builder newProjectLocationDocumentBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static ProjectLocationReferenceIdBuilder newProjectLocationReferenceIdBuilder() { + return new ProjectLocationReferenceIdBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static DocumentName of(String project, String location, String document) { + return newBuilder().setProject(project).setLocation(location).setDocument(document).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static DocumentName ofProjectLocationDocumentName( + String project, String location, String document) { + return newBuilder().setProject(project).setLocation(location).setDocument(document).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static DocumentName ofProjectLocationReferenceIdName( + String project, String location, String referenceId) { + return newProjectLocationReferenceIdBuilder() + .setProject(project) + .setLocation(location) + .setReferenceId(referenceId) + .build(); + } + + public static String format(String project, String location, String document) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setDocument(document) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatProjectLocationDocumentName( + String project, String location, String document) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setDocument(document) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatProjectLocationReferenceIdName( + String project, String location, String referenceId) { + return newProjectLocationReferenceIdBuilder() + .setProject(project) + .setLocation(location) + .setReferenceId(referenceId) + .build() + .toString(); + } + + public static DocumentName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + if (PROJECT_LOCATION_DOCUMENT.matches(formattedString)) { + Map matchMap = PROJECT_LOCATION_DOCUMENT.match(formattedString); + return ofProjectLocationDocumentName( + matchMap.get("project"), matchMap.get("location"), matchMap.get("document")); + } else if (PROJECT_LOCATION_REFERENCE_ID.matches(formattedString)) { + Map matchMap = PROJECT_LOCATION_REFERENCE_ID.match(formattedString); + return ofProjectLocationReferenceIdName( + matchMap.get("project"), matchMap.get("location"), matchMap.get("reference_id")); + } + throw new ValidationException("DocumentName.parse: formattedString not in valid format"); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (DocumentName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_DOCUMENT.matches(formattedString) + || PROJECT_LOCATION_REFERENCE_ID.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (document != null) { + fieldMapBuilder.put("document", document); + } + if (referenceId != null) { + fieldMapBuilder.put("reference_id", referenceId); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + DocumentName that = ((DocumentName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.document, that.document) + && Objects.equals(this.referenceId, that.referenceId); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(document); + h *= 1000003; + h ^= Objects.hashCode(referenceId); + return h; + } + + /** Builder for projects/{project}/locations/{location}/documents/{document}. */ + public static class Builder { + private String project; + private String location; + private String document; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getDocument() { + return document; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setDocument(String document) { + this.document = document; + return this; + } + + private Builder(DocumentName documentName) { + Preconditions.checkArgument( + Objects.equals(documentName.pathTemplate, PROJECT_LOCATION_DOCUMENT), + "toBuilder is only supported when DocumentName has the pattern of projects/{project}/locations/{location}/documents/{document}"); + this.project = documentName.project; + this.location = documentName.location; + this.document = documentName.document; + } + + public DocumentName build() { + return new DocumentName(this); + } + } + + /** Builder for projects/{project}/locations/{location}/documents/referenceId/{reference_id}. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class ProjectLocationReferenceIdBuilder { + private String project; + private String location; + private String referenceId; + + protected ProjectLocationReferenceIdBuilder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getReferenceId() { + return referenceId; + } + + public ProjectLocationReferenceIdBuilder setProject(String project) { + this.project = project; + return this; + } + + public ProjectLocationReferenceIdBuilder setLocation(String location) { + this.location = location; + return this; + } + + public ProjectLocationReferenceIdBuilder setReferenceId(String referenceId) { + this.referenceId = referenceId; + return this; + } + + public DocumentName build() { + return new DocumentName(this); + } + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentOrBuilder.java new file mode 100644 index 000000000000..87e8d1765855 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentOrBuilder.java @@ -0,0 +1,596 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface DocumentOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.Document) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resource name of the document.
+   * Format:
+   * projects/{project_number}/locations/{location}/documents/{document_id}.
+   * The name is ignored when creating a document.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The resource name of the document.
+   * Format:
+   * projects/{project_number}/locations/{location}/documents/{document_id}.
+   * The name is ignored when creating a document.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The reference ID set by customers. Must be unique per project and location.
+   * 
+ * + * string reference_id = 11; + * + * @return The referenceId. + */ + java.lang.String getReferenceId(); + /** + * + * + *
+   * The reference ID set by customers. Must be unique per project and location.
+   * 
+ * + * string reference_id = 11; + * + * @return The bytes for referenceId. + */ + com.google.protobuf.ByteString getReferenceIdBytes(); + + /** + * + * + *
+   * Required. Display name of the document given by the user. This name will be displayed
+   * in the UI.
+   * Customer can populate this field with the name of the document. This
+   * differs from the 'title' field as 'title' is optional and stores the top
+   * heading in the document.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * Required. Display name of the document given by the user. This name will be displayed
+   * in the UI.
+   * Customer can populate this field with the name of the document. This
+   * differs from the 'title' field as 'title' is optional and stores the top
+   * heading in the document.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Title that describes the document.
+   * This is usually present in the top section of the document, and is a
+   * mandatory field for the question-answering feature.
+   * 
+ * + * string title = 18; + * + * @return The title. + */ + java.lang.String getTitle(); + /** + * + * + *
+   * Title that describes the document.
+   * This is usually present in the top section of the document, and is a
+   * mandatory field for the question-answering feature.
+   * 
+ * + * string title = 18; + * + * @return The bytes for title. + */ + com.google.protobuf.ByteString getTitleBytes(); + + /** + * + * + *
+   * Uri to display the document, for example, in the UI.
+   * 
+ * + * string display_uri = 17; + * + * @return The displayUri. + */ + java.lang.String getDisplayUri(); + /** + * + * + *
+   * Uri to display the document, for example, in the UI.
+   * 
+ * + * string display_uri = 17; + * + * @return The bytes for displayUri. + */ + com.google.protobuf.ByteString getDisplayUriBytes(); + + /** + * + * + *
+   * The Document schema name.
+   * Format:
+   * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
+   * 
+ * + * string document_schema_name = 3 [(.google.api.resource_reference) = { ... } + * + * @return The documentSchemaName. + */ + java.lang.String getDocumentSchemaName(); + /** + * + * + *
+   * The Document schema name.
+   * Format:
+   * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
+   * 
+ * + * string document_schema_name = 3 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for documentSchemaName. + */ + com.google.protobuf.ByteString getDocumentSchemaNameBytes(); + + /** + * + * + *
+   * Other document format, such as PPTX, XLXS
+   * 
+ * + * string plain_text = 15; + * + * @return Whether the plainText field is set. + */ + boolean hasPlainText(); + /** + * + * + *
+   * Other document format, such as PPTX, XLXS
+   * 
+ * + * string plain_text = 15; + * + * @return The plainText. + */ + java.lang.String getPlainText(); + /** + * + * + *
+   * Other document format, such as PPTX, XLXS
+   * 
+ * + * string plain_text = 15; + * + * @return The bytes for plainText. + */ + com.google.protobuf.ByteString getPlainTextBytes(); + + /** + * + * + *
+   * Document AI format to save the structured content, including OCR.
+   * 
+ * + * .google.cloud.documentai.v1.Document cloud_ai_document = 4; + * + * @return Whether the cloudAiDocument field is set. + */ + boolean hasCloudAiDocument(); + /** + * + * + *
+   * Document AI format to save the structured content, including OCR.
+   * 
+ * + * .google.cloud.documentai.v1.Document cloud_ai_document = 4; + * + * @return The cloudAiDocument. + */ + com.google.cloud.documentai.v1.Document getCloudAiDocument(); + /** + * + * + *
+   * Document AI format to save the structured content, including OCR.
+   * 
+ * + * .google.cloud.documentai.v1.Document cloud_ai_document = 4; + */ + com.google.cloud.documentai.v1.DocumentOrBuilder getCloudAiDocumentOrBuilder(); + + /** + * + * + *
+   * A path linked to structured content file.
+   * 
+ * + * string structured_content_uri = 16; + * + * @return The structuredContentUri. + */ + java.lang.String getStructuredContentUri(); + /** + * + * + *
+   * A path linked to structured content file.
+   * 
+ * + * string structured_content_uri = 16; + * + * @return The bytes for structuredContentUri. + */ + com.google.protobuf.ByteString getStructuredContentUriBytes(); + + /** + * + * + *
+   * Raw document file in Cloud Storage path.
+   * 
+ * + * string raw_document_path = 5; + * + * @return Whether the rawDocumentPath field is set. + */ + boolean hasRawDocumentPath(); + /** + * + * + *
+   * Raw document file in Cloud Storage path.
+   * 
+ * + * string raw_document_path = 5; + * + * @return The rawDocumentPath. + */ + java.lang.String getRawDocumentPath(); + /** + * + * + *
+   * Raw document file in Cloud Storage path.
+   * 
+ * + * string raw_document_path = 5; + * + * @return The bytes for rawDocumentPath. + */ + com.google.protobuf.ByteString getRawDocumentPathBytes(); + + /** + * + * + *
+   * Raw document content.
+   * 
+ * + * bytes inline_raw_document = 6; + * + * @return Whether the inlineRawDocument field is set. + */ + boolean hasInlineRawDocument(); + /** + * + * + *
+   * Raw document content.
+   * 
+ * + * bytes inline_raw_document = 6; + * + * @return The inlineRawDocument. + */ + com.google.protobuf.ByteString getInlineRawDocument(); + + /** + * + * + *
+   * List of values that are user supplied metadata.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Property properties = 7; + */ + java.util.List getPropertiesList(); + /** + * + * + *
+   * List of values that are user supplied metadata.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Property properties = 7; + */ + com.google.cloud.contentwarehouse.v1.Property getProperties(int index); + /** + * + * + *
+   * List of values that are user supplied metadata.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Property properties = 7; + */ + int getPropertiesCount(); + /** + * + * + *
+   * List of values that are user supplied metadata.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Property properties = 7; + */ + java.util.List + getPropertiesOrBuilderList(); + /** + * + * + *
+   * List of values that are user supplied metadata.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Property properties = 7; + */ + com.google.cloud.contentwarehouse.v1.PropertyOrBuilder getPropertiesOrBuilder(int index); + + /** + * + * + *
+   * Output only. The time when the document is last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The time when the document is last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The time when the document is last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The time when the document is created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The time when the document is created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The time when the document is created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * This is used when DocAI was not used to load the document and parsing/
+   * extracting is needed for the inline_raw_document.  For example, if
+   * inline_raw_document is the byte representation of a PDF file, then
+   * this should be set to: RAW_DOCUMENT_FILE_TYPE_PDF.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RawDocumentFileType raw_document_file_type = 10; + * + * @return The enum numeric value on the wire for rawDocumentFileType. + */ + int getRawDocumentFileTypeValue(); + /** + * + * + *
+   * This is used when DocAI was not used to load the document and parsing/
+   * extracting is needed for the inline_raw_document.  For example, if
+   * inline_raw_document is the byte representation of a PDF file, then
+   * this should be set to: RAW_DOCUMENT_FILE_TYPE_PDF.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RawDocumentFileType raw_document_file_type = 10; + * + * @return The rawDocumentFileType. + */ + com.google.cloud.contentwarehouse.v1.RawDocumentFileType getRawDocumentFileType(); + + /** + * + * + *
+   * If true, makes the document visible to asynchronous policies and rules.
+   * 
+ * + * bool async_enabled = 12; + * + * @return The asyncEnabled. + */ + boolean getAsyncEnabled(); + + /** + * + * + *
+   * If true, text extraction will not be performed.
+   * 
+ * + * bool text_extraction_disabled = 19; + * + * @return The textExtractionDisabled. + */ + boolean getTextExtractionDisabled(); + + /** + * + * + *
+   * The user who creates the document.
+   * 
+ * + * string creator = 13; + * + * @return The creator. + */ + java.lang.String getCreator(); + /** + * + * + *
+   * The user who creates the document.
+   * 
+ * + * string creator = 13; + * + * @return The bytes for creator. + */ + com.google.protobuf.ByteString getCreatorBytes(); + + /** + * + * + *
+   * The user who lastly updates the document.
+   * 
+ * + * string updater = 14; + * + * @return The updater. + */ + java.lang.String getUpdater(); + /** + * + * + *
+   * The user who lastly updates the document.
+   * 
+ * + * string updater = 14; + * + * @return The bytes for updater. + */ + com.google.protobuf.ByteString getUpdaterBytes(); + + public com.google.cloud.contentwarehouse.v1.Document.StructuredContentCase + getStructuredContentCase(); + + public com.google.cloud.contentwarehouse.v1.Document.RawDocumentCase getRawDocumentCase(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentProto.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentProto.java new file mode 100644 index 000000000000..b4cdd386e17c --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentProto.java @@ -0,0 +1,376 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document.proto + +package com.google.cloud.contentwarehouse.v1; + +public final class DocumentProto { + private DocumentProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_Document_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_Document_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_DocumentReference_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_DocumentReference_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_Property_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_Property_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_IntegerArray_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_IntegerArray_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_FloatArray_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_FloatArray_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_TextArray_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_TextArray_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_EnumArray_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_EnumArray_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_DateTimeArray_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_DateTimeArray_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_TimestampArray_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_TimestampArray_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_TimestampValue_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_TimestampValue_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_PropertyArray_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_PropertyArray_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_MapProperty_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_MapProperty_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_MapProperty_FieldsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_MapProperty_FieldsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_Value_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_Value_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_EnumValue_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_EnumValue_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n/google/cloud/contentwarehouse/v1/docum" + + "ent.proto\022 google.cloud.contentwarehouse" + + ".v1\032\037google/api/field_behavior.proto\032\031go" + + "ogle/api/resource.proto\032)google/cloud/do" + + "cumentai/v1/document.proto\032\037google/proto" + + "buf/timestamp.proto\032\032google/type/datetim" + + "e.proto\"\266\007\n\010Document\022\014\n\004name\030\001 \001(\t\022\024\n\014re" + + "ference_id\030\013 \001(\t\022\031\n\014display_name\030\002 \001(\tB\003" + + "\340A\002\022\r\n\005title\030\022 \001(\t\022\023\n\013display_uri\030\021 \001(\t\022" + + "Q\n\024document_schema_name\030\003 \001(\tB3\372A0\n.cont" + + "entwarehouse.googleapis.com/DocumentSche" + + "ma\022\024\n\nplain_text\030\017 \001(\tH\000\022A\n\021cloud_ai_doc" + + "ument\030\004 \001(\0132$.google.cloud.documentai.v1" + + ".DocumentH\000\022\036\n\026structured_content_uri\030\020 " + + "\001(\t\022\033\n\021raw_document_path\030\005 \001(\tH\001\022\035\n\023inli" + + "ne_raw_document\030\006 \001(\014H\001\022>\n\nproperties\030\007 " + + "\003(\0132*.google.cloud.contentwarehouse.v1.P" + + "roperty\0224\n\013update_time\030\010 \001(\0132\032.google.pr" + + "otobuf.TimestampB\003\340A\003\0224\n\013create_time\030\t \001" + + "(\0132\032.google.protobuf.TimestampB\003\340A\003\022U\n\026r" + + "aw_document_file_type\030\n \001(\01625.google.clo" + + "ud.contentwarehouse.v1.RawDocumentFileTy" + + "pe\022\025\n\rasync_enabled\030\014 \001(\010\022 \n\030text_extrac" + + "tion_disabled\030\023 \001(\010\022\017\n\007creator\030\r \001(\t\022\017\n\007" + + "updater\030\016 \001(\t:\272\001\352A\266\001\n(contentwarehouse.g" + + "oogleapis.com/Document\022\n\nproperties\030\001 \003(\0132*.google.c" + + "loud.contentwarehouse.v1.Property\"\260\001\n\013Ma" + + "pProperty\022I\n\006fields\030\001 \003(\01329.google.cloud" + + ".contentwarehouse.v1.MapProperty.FieldsE" + + "ntry\032V\n\013FieldsEntry\022\013\n\003key\030\001 \001(\t\0226\n\005valu" + + "e\030\002 \001(\0132\'.google.cloud.contentwarehouse." + + "v1.Value:\0028\001\"\255\002\n\005Value\022\025\n\013float_value\030\001 " + + "\001(\002H\000\022\023\n\tint_value\030\002 \001(\005H\000\022\026\n\014string_val" + + "ue\030\003 \001(\tH\000\022A\n\nenum_value\030\004 \001(\0132+.google." + + "cloud.contentwarehouse.v1.EnumValueH\000\022/\n" + + "\016datetime_value\030\005 \001(\0132\025.google.type.Date" + + "TimeH\000\022K\n\017timestamp_value\030\006 \001(\01320.google" + + ".cloud.contentwarehouse.v1.TimestampValu" + + "eH\000\022\027\n\rboolean_value\030\007 \001(\010H\000B\006\n\004kind\"\032\n\t" + + "EnumValue\022\r\n\005value\030\001 \001(\t*\341\001\n\023RawDocument" + + "FileType\022&\n\"RAW_DOCUMENT_FILE_TYPE_UNSPE" + + "CIFIED\020\000\022\036\n\032RAW_DOCUMENT_FILE_TYPE_PDF\020\001" + + "\022\037\n\033RAW_DOCUMENT_FILE_TYPE_DOCX\020\002\022\037\n\033RAW" + + "_DOCUMENT_FILE_TYPE_XLSX\020\003\022\037\n\033RAW_DOCUME" + + "NT_FILE_TYPE_PPTX\020\004\022\037\n\033RAW_DOCUMENT_FILE" + + "_TYPE_TEXT\020\005B\211\001\n$com.google.cloud.conten" + + "twarehouse.v1B\rDocumentProtoP\001ZPgoogle.g" + + "olang.org/genproto/googleapis/cloud/cont" + + "entwarehouse/v1;contentwarehouseb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.documentai.v1.DocumentProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.type.DateTimeProto.getDescriptor(), + }); + internal_static_google_cloud_contentwarehouse_v1_Document_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_contentwarehouse_v1_Document_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_Document_descriptor, + new java.lang.String[] { + "Name", + "ReferenceId", + "DisplayName", + "Title", + "DisplayUri", + "DocumentSchemaName", + "PlainText", + "CloudAiDocument", + "StructuredContentUri", + "RawDocumentPath", + "InlineRawDocument", + "Properties", + "UpdateTime", + "CreateTime", + "RawDocumentFileType", + "AsyncEnabled", + "TextExtractionDisabled", + "Creator", + "Updater", + "StructuredContent", + "RawDocument", + }); + internal_static_google_cloud_contentwarehouse_v1_DocumentReference_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_contentwarehouse_v1_DocumentReference_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_DocumentReference_descriptor, + new java.lang.String[] { + "DocumentName", + "DisplayName", + "Snippet", + "DocumentIsFolder", + "UpdateTime", + "CreateTime", + "DeleteTime", + }); + internal_static_google_cloud_contentwarehouse_v1_Property_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_contentwarehouse_v1_Property_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_Property_descriptor, + new java.lang.String[] { + "Name", + "IntegerValues", + "FloatValues", + "TextValues", + "EnumValues", + "PropertyValues", + "DateTimeValues", + "MapProperty", + "TimestampValues", + "Values", + }); + internal_static_google_cloud_contentwarehouse_v1_IntegerArray_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_contentwarehouse_v1_IntegerArray_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_IntegerArray_descriptor, + new java.lang.String[] { + "Values", + }); + internal_static_google_cloud_contentwarehouse_v1_FloatArray_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_contentwarehouse_v1_FloatArray_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_FloatArray_descriptor, + new java.lang.String[] { + "Values", + }); + internal_static_google_cloud_contentwarehouse_v1_TextArray_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_contentwarehouse_v1_TextArray_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_TextArray_descriptor, + new java.lang.String[] { + "Values", + }); + internal_static_google_cloud_contentwarehouse_v1_EnumArray_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_contentwarehouse_v1_EnumArray_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_EnumArray_descriptor, + new java.lang.String[] { + "Values", + }); + internal_static_google_cloud_contentwarehouse_v1_DateTimeArray_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_contentwarehouse_v1_DateTimeArray_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_DateTimeArray_descriptor, + new java.lang.String[] { + "Values", + }); + internal_static_google_cloud_contentwarehouse_v1_TimestampArray_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_contentwarehouse_v1_TimestampArray_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_TimestampArray_descriptor, + new java.lang.String[] { + "Values", + }); + internal_static_google_cloud_contentwarehouse_v1_TimestampValue_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_contentwarehouse_v1_TimestampValue_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_TimestampValue_descriptor, + new java.lang.String[] { + "TimestampValue", "TextValue", "Value", + }); + internal_static_google_cloud_contentwarehouse_v1_PropertyArray_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_contentwarehouse_v1_PropertyArray_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_PropertyArray_descriptor, + new java.lang.String[] { + "Properties", + }); + internal_static_google_cloud_contentwarehouse_v1_MapProperty_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_contentwarehouse_v1_MapProperty_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_MapProperty_descriptor, + new java.lang.String[] { + "Fields", + }); + internal_static_google_cloud_contentwarehouse_v1_MapProperty_FieldsEntry_descriptor = + internal_static_google_cloud_contentwarehouse_v1_MapProperty_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_contentwarehouse_v1_MapProperty_FieldsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_MapProperty_FieldsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_contentwarehouse_v1_Value_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_contentwarehouse_v1_Value_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_Value_descriptor, + new java.lang.String[] { + "FloatValue", + "IntValue", + "StringValue", + "EnumValue", + "DatetimeValue", + "TimestampValue", + "BooleanValue", + "Kind", + }); + internal_static_google_cloud_contentwarehouse_v1_EnumValue_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_cloud_contentwarehouse_v1_EnumValue_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_EnumValue_descriptor, + new java.lang.String[] { + "Value", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.documentai.v1.DocumentProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.type.DateTimeProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentQuery.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentQuery.java new file mode 100644 index 000000000000..aa02bbefa1bc --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentQuery.java @@ -0,0 +1,3626 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/filters.proto + +package com.google.cloud.contentwarehouse.v1; + +/** Protobuf type {@code google.cloud.contentwarehouse.v1.DocumentQuery} */ +public final class DocumentQuery extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.DocumentQuery) + DocumentQueryOrBuilder { + private static final long serialVersionUID = 0L; + // Use DocumentQuery.newBuilder() to construct. + private DocumentQuery(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DocumentQuery() { + query_ = ""; + customPropertyFilter_ = ""; + timeFilters_ = java.util.Collections.emptyList(); + documentSchemaNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; + propertyFilter_ = java.util.Collections.emptyList(); + folderNameFilter_ = ""; + queryContext_ = com.google.protobuf.LazyStringArrayList.EMPTY; + documentCreatorFilter_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DocumentQuery(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.FiltersProto + .internal_static_google_cloud_contentwarehouse_v1_DocumentQuery_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.FiltersProto + .internal_static_google_cloud_contentwarehouse_v1_DocumentQuery_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.DocumentQuery.class, + com.google.cloud.contentwarehouse.v1.DocumentQuery.Builder.class); + } + + public static final int QUERY_FIELD_NUMBER = 1; + private volatile java.lang.Object query_; + /** + * + * + *
+   * The query string that matches against the full text of the document and
+   * the searchable properties.
+   * The maximum number of allowed characters is 255.
+   * 
+ * + * string query = 1; + * + * @return The query. + */ + @java.lang.Override + public java.lang.String getQuery() { + java.lang.Object ref = query_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + query_ = s; + return s; + } + } + /** + * + * + *
+   * The query string that matches against the full text of the document and
+   * the searchable properties.
+   * The maximum number of allowed characters is 255.
+   * 
+ * + * string query = 1; + * + * @return The bytes for query. + */ + @java.lang.Override + public com.google.protobuf.ByteString getQueryBytes() { + java.lang.Object ref = query_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + query_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IS_NL_QUERY_FIELD_NUMBER = 12; + private boolean isNlQuery_; + /** + * + * + *
+   * Experimental, do not use.
+   * If the query is a natural language question. False by default. If true,
+   * then the question-answering feature will be used instead of search, and
+   * `result_count` in [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest] must be set. In addition, all
+   * other input fields related to search (pagination, histograms, etc.) will be
+   * ignored.
+   * 
+ * + * bool is_nl_query = 12; + * + * @return The isNlQuery. + */ + @java.lang.Override + public boolean getIsNlQuery() { + return isNlQuery_; + } + + public static final int CUSTOM_PROPERTY_FILTER_FIELD_NUMBER = 4; + private volatile java.lang.Object customPropertyFilter_; + /** + * + * + *
+   * This filter specifies a structured syntax to match against the
+   * [PropertyDefinition].[is_filterable][] marked as `true`. The syntax for
+   * this expression is a subset of SQL syntax.
+   * Supported operators are: `=`, `!=`, `<`, `<=`, `>`, and `>=` where the left
+   * of the operator is a property name and the right of the operator is a
+   * number or a quoted string. You must escape backslash (\\) and quote (\")
+   * characters. Supported functions are `LOWER([property_name])` to perform a
+   * case insensitive match and `EMPTY([property_name])` to filter on the
+   * existence of a key.
+   * Boolean expressions (AND/OR/NOT) are supported up to 3 levels of nesting
+   * (for example, "((A AND B AND C) OR NOT D) AND E"), a maximum of 100
+   * comparisons or functions are allowed in the expression. The expression must
+   * be < 6000 bytes in length.
+   * Sample Query:
+   * `(LOWER(driving_license)="class \"a\"" OR EMPTY(driving_license)) AND
+   * driving_years > 10`
+   * 
+ * + * string custom_property_filter = 4 [deprecated = true]; + * + * @deprecated google.cloud.contentwarehouse.v1.DocumentQuery.custom_property_filter is + * deprecated. See google/cloud/contentwarehouse/v1/filters.proto;l=59 + * @return The customPropertyFilter. + */ + @java.lang.Override + @java.lang.Deprecated + public java.lang.String getCustomPropertyFilter() { + java.lang.Object ref = customPropertyFilter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + customPropertyFilter_ = s; + return s; + } + } + /** + * + * + *
+   * This filter specifies a structured syntax to match against the
+   * [PropertyDefinition].[is_filterable][] marked as `true`. The syntax for
+   * this expression is a subset of SQL syntax.
+   * Supported operators are: `=`, `!=`, `<`, `<=`, `>`, and `>=` where the left
+   * of the operator is a property name and the right of the operator is a
+   * number or a quoted string. You must escape backslash (\\) and quote (\")
+   * characters. Supported functions are `LOWER([property_name])` to perform a
+   * case insensitive match and `EMPTY([property_name])` to filter on the
+   * existence of a key.
+   * Boolean expressions (AND/OR/NOT) are supported up to 3 levels of nesting
+   * (for example, "((A AND B AND C) OR NOT D) AND E"), a maximum of 100
+   * comparisons or functions are allowed in the expression. The expression must
+   * be < 6000 bytes in length.
+   * Sample Query:
+   * `(LOWER(driving_license)="class \"a\"" OR EMPTY(driving_license)) AND
+   * driving_years > 10`
+   * 
+ * + * string custom_property_filter = 4 [deprecated = true]; + * + * @deprecated google.cloud.contentwarehouse.v1.DocumentQuery.custom_property_filter is + * deprecated. See google/cloud/contentwarehouse/v1/filters.proto;l=59 + * @return The bytes for customPropertyFilter. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.protobuf.ByteString getCustomPropertyFilterBytes() { + java.lang.Object ref = customPropertyFilter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + customPropertyFilter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TIME_FILTERS_FIELD_NUMBER = 5; + private java.util.List timeFilters_; + /** + * + * + *
+   * Documents created/updated within a range specified by this filter are
+   * searched against.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.TimeFilter time_filters = 5; + */ + @java.lang.Override + public java.util.List getTimeFiltersList() { + return timeFilters_; + } + /** + * + * + *
+   * Documents created/updated within a range specified by this filter are
+   * searched against.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.TimeFilter time_filters = 5; + */ + @java.lang.Override + public java.util.List + getTimeFiltersOrBuilderList() { + return timeFilters_; + } + /** + * + * + *
+   * Documents created/updated within a range specified by this filter are
+   * searched against.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.TimeFilter time_filters = 5; + */ + @java.lang.Override + public int getTimeFiltersCount() { + return timeFilters_.size(); + } + /** + * + * + *
+   * Documents created/updated within a range specified by this filter are
+   * searched against.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.TimeFilter time_filters = 5; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.TimeFilter getTimeFilters(int index) { + return timeFilters_.get(index); + } + /** + * + * + *
+   * Documents created/updated within a range specified by this filter are
+   * searched against.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.TimeFilter time_filters = 5; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.TimeFilterOrBuilder getTimeFiltersOrBuilder( + int index) { + return timeFilters_.get(index); + } + + public static final int DOCUMENT_SCHEMA_NAMES_FIELD_NUMBER = 6; + private com.google.protobuf.LazyStringList documentSchemaNames_; + /** + * + * + *
+   * This filter specifies the exact document schema
+   * [Document.document_schema_name][google.cloud.contentwarehouse.v1.Document.document_schema_name] of the documents to search against.
+   * If a value isn't specified, documents within the search results are
+   * associated with any schema. If multiple values are specified, documents
+   * within the search results may be associated with any of the specified
+   * schemas.
+   * At most 20 document schema names are allowed.
+   * 
+ * + * repeated string document_schema_names = 6; + * + * @return A list containing the documentSchemaNames. + */ + public com.google.protobuf.ProtocolStringList getDocumentSchemaNamesList() { + return documentSchemaNames_; + } + /** + * + * + *
+   * This filter specifies the exact document schema
+   * [Document.document_schema_name][google.cloud.contentwarehouse.v1.Document.document_schema_name] of the documents to search against.
+   * If a value isn't specified, documents within the search results are
+   * associated with any schema. If multiple values are specified, documents
+   * within the search results may be associated with any of the specified
+   * schemas.
+   * At most 20 document schema names are allowed.
+   * 
+ * + * repeated string document_schema_names = 6; + * + * @return The count of documentSchemaNames. + */ + public int getDocumentSchemaNamesCount() { + return documentSchemaNames_.size(); + } + /** + * + * + *
+   * This filter specifies the exact document schema
+   * [Document.document_schema_name][google.cloud.contentwarehouse.v1.Document.document_schema_name] of the documents to search against.
+   * If a value isn't specified, documents within the search results are
+   * associated with any schema. If multiple values are specified, documents
+   * within the search results may be associated with any of the specified
+   * schemas.
+   * At most 20 document schema names are allowed.
+   * 
+ * + * repeated string document_schema_names = 6; + * + * @param index The index of the element to return. + * @return The documentSchemaNames at the given index. + */ + public java.lang.String getDocumentSchemaNames(int index) { + return documentSchemaNames_.get(index); + } + /** + * + * + *
+   * This filter specifies the exact document schema
+   * [Document.document_schema_name][google.cloud.contentwarehouse.v1.Document.document_schema_name] of the documents to search against.
+   * If a value isn't specified, documents within the search results are
+   * associated with any schema. If multiple values are specified, documents
+   * within the search results may be associated with any of the specified
+   * schemas.
+   * At most 20 document schema names are allowed.
+   * 
+ * + * repeated string document_schema_names = 6; + * + * @param index The index of the value to return. + * @return The bytes of the documentSchemaNames at the given index. + */ + public com.google.protobuf.ByteString getDocumentSchemaNamesBytes(int index) { + return documentSchemaNames_.getByteString(index); + } + + public static final int PROPERTY_FILTER_FIELD_NUMBER = 7; + private java.util.List propertyFilter_; + /** + * + * + *
+   * This filter specifies a structured syntax to match against the
+   * [PropertyDefinition.is_filterable][google.cloud.contentwarehouse.v1.PropertyDefinition.is_filterable] marked as `true`. The relationship
+   * between the PropertyFilters is OR.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.PropertyFilter property_filter = 7; + */ + @java.lang.Override + public java.util.List + getPropertyFilterList() { + return propertyFilter_; + } + /** + * + * + *
+   * This filter specifies a structured syntax to match against the
+   * [PropertyDefinition.is_filterable][google.cloud.contentwarehouse.v1.PropertyDefinition.is_filterable] marked as `true`. The relationship
+   * between the PropertyFilters is OR.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.PropertyFilter property_filter = 7; + */ + @java.lang.Override + public java.util.List + getPropertyFilterOrBuilderList() { + return propertyFilter_; + } + /** + * + * + *
+   * This filter specifies a structured syntax to match against the
+   * [PropertyDefinition.is_filterable][google.cloud.contentwarehouse.v1.PropertyDefinition.is_filterable] marked as `true`. The relationship
+   * between the PropertyFilters is OR.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.PropertyFilter property_filter = 7; + */ + @java.lang.Override + public int getPropertyFilterCount() { + return propertyFilter_.size(); + } + /** + * + * + *
+   * This filter specifies a structured syntax to match against the
+   * [PropertyDefinition.is_filterable][google.cloud.contentwarehouse.v1.PropertyDefinition.is_filterable] marked as `true`. The relationship
+   * between the PropertyFilters is OR.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.PropertyFilter property_filter = 7; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.PropertyFilter getPropertyFilter(int index) { + return propertyFilter_.get(index); + } + /** + * + * + *
+   * This filter specifies a structured syntax to match against the
+   * [PropertyDefinition.is_filterable][google.cloud.contentwarehouse.v1.PropertyDefinition.is_filterable] marked as `true`. The relationship
+   * between the PropertyFilters is OR.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.PropertyFilter property_filter = 7; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.PropertyFilterOrBuilder getPropertyFilterOrBuilder( + int index) { + return propertyFilter_.get(index); + } + + public static final int FILE_TYPE_FILTER_FIELD_NUMBER = 8; + private com.google.cloud.contentwarehouse.v1.FileTypeFilter fileTypeFilter_; + /** + * + * + *
+   * This filter specifies the types of files to return: ALL, FOLDER, or FILE.
+   * If FOLDER or FILE is specified, then only either folders or files will be
+   * returned, respectively. If ALL is specified, both folders and files will be
+   * returned.
+   * If no value is specified, ALL files will be returned.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.FileTypeFilter file_type_filter = 8; + * + * @return Whether the fileTypeFilter field is set. + */ + @java.lang.Override + public boolean hasFileTypeFilter() { + return fileTypeFilter_ != null; + } + /** + * + * + *
+   * This filter specifies the types of files to return: ALL, FOLDER, or FILE.
+   * If FOLDER or FILE is specified, then only either folders or files will be
+   * returned, respectively. If ALL is specified, both folders and files will be
+   * returned.
+   * If no value is specified, ALL files will be returned.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.FileTypeFilter file_type_filter = 8; + * + * @return The fileTypeFilter. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.FileTypeFilter getFileTypeFilter() { + return fileTypeFilter_ == null + ? com.google.cloud.contentwarehouse.v1.FileTypeFilter.getDefaultInstance() + : fileTypeFilter_; + } + /** + * + * + *
+   * This filter specifies the types of files to return: ALL, FOLDER, or FILE.
+   * If FOLDER or FILE is specified, then only either folders or files will be
+   * returned, respectively. If ALL is specified, both folders and files will be
+   * returned.
+   * If no value is specified, ALL files will be returned.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.FileTypeFilter file_type_filter = 8; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.FileTypeFilterOrBuilder getFileTypeFilterOrBuilder() { + return getFileTypeFilter(); + } + + public static final int FOLDER_NAME_FILTER_FIELD_NUMBER = 9; + private volatile java.lang.Object folderNameFilter_; + /** + * + * + *
+   * Search all the documents under this specified folder.
+   * Format:
+   * projects/{project_number}/locations/{location}/documents/{document_id}.
+   * 
+ * + * string folder_name_filter = 9; + * + * @return The folderNameFilter. + */ + @java.lang.Override + public java.lang.String getFolderNameFilter() { + java.lang.Object ref = folderNameFilter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + folderNameFilter_ = s; + return s; + } + } + /** + * + * + *
+   * Search all the documents under this specified folder.
+   * Format:
+   * projects/{project_number}/locations/{location}/documents/{document_id}.
+   * 
+ * + * string folder_name_filter = 9; + * + * @return The bytes for folderNameFilter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFolderNameFilterBytes() { + java.lang.Object ref = folderNameFilter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + folderNameFilter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int QUERY_CONTEXT_FIELD_NUMBER = 10; + private com.google.protobuf.LazyStringList queryContext_; + /** + * + * + *
+   * For custom synonyms.
+   * Customers provide the synonyms based on context. One customer can provide
+   * multiple set of synonyms based on different context. The search query will
+   * be expanded based on the custom synonyms of the query context set.
+   * By default, no custom synonyms wll be applied if no query context is
+   * provided.
+   * It is not supported for CMEK compliant deployment.
+   * 
+ * + * repeated string query_context = 10; + * + * @return A list containing the queryContext. + */ + public com.google.protobuf.ProtocolStringList getQueryContextList() { + return queryContext_; + } + /** + * + * + *
+   * For custom synonyms.
+   * Customers provide the synonyms based on context. One customer can provide
+   * multiple set of synonyms based on different context. The search query will
+   * be expanded based on the custom synonyms of the query context set.
+   * By default, no custom synonyms wll be applied if no query context is
+   * provided.
+   * It is not supported for CMEK compliant deployment.
+   * 
+ * + * repeated string query_context = 10; + * + * @return The count of queryContext. + */ + public int getQueryContextCount() { + return queryContext_.size(); + } + /** + * + * + *
+   * For custom synonyms.
+   * Customers provide the synonyms based on context. One customer can provide
+   * multiple set of synonyms based on different context. The search query will
+   * be expanded based on the custom synonyms of the query context set.
+   * By default, no custom synonyms wll be applied if no query context is
+   * provided.
+   * It is not supported for CMEK compliant deployment.
+   * 
+ * + * repeated string query_context = 10; + * + * @param index The index of the element to return. + * @return The queryContext at the given index. + */ + public java.lang.String getQueryContext(int index) { + return queryContext_.get(index); + } + /** + * + * + *
+   * For custom synonyms.
+   * Customers provide the synonyms based on context. One customer can provide
+   * multiple set of synonyms based on different context. The search query will
+   * be expanded based on the custom synonyms of the query context set.
+   * By default, no custom synonyms wll be applied if no query context is
+   * provided.
+   * It is not supported for CMEK compliant deployment.
+   * 
+ * + * repeated string query_context = 10; + * + * @param index The index of the value to return. + * @return The bytes of the queryContext at the given index. + */ + public com.google.protobuf.ByteString getQueryContextBytes(int index) { + return queryContext_.getByteString(index); + } + + public static final int DOCUMENT_CREATOR_FILTER_FIELD_NUMBER = 11; + private com.google.protobuf.LazyStringList documentCreatorFilter_; + /** + * + * + *
+   * The exact creator(s) of the documents to search against.
+   * If a value isn't specified, documents within the search results are
+   * associated with any creator. If multiple values are specified, documents
+   * within the search results may be associated with any of the specified
+   * creators.
+   * 
+ * + * repeated string document_creator_filter = 11; + * + * @return A list containing the documentCreatorFilter. + */ + public com.google.protobuf.ProtocolStringList getDocumentCreatorFilterList() { + return documentCreatorFilter_; + } + /** + * + * + *
+   * The exact creator(s) of the documents to search against.
+   * If a value isn't specified, documents within the search results are
+   * associated with any creator. If multiple values are specified, documents
+   * within the search results may be associated with any of the specified
+   * creators.
+   * 
+ * + * repeated string document_creator_filter = 11; + * + * @return The count of documentCreatorFilter. + */ + public int getDocumentCreatorFilterCount() { + return documentCreatorFilter_.size(); + } + /** + * + * + *
+   * The exact creator(s) of the documents to search against.
+   * If a value isn't specified, documents within the search results are
+   * associated with any creator. If multiple values are specified, documents
+   * within the search results may be associated with any of the specified
+   * creators.
+   * 
+ * + * repeated string document_creator_filter = 11; + * + * @param index The index of the element to return. + * @return The documentCreatorFilter at the given index. + */ + public java.lang.String getDocumentCreatorFilter(int index) { + return documentCreatorFilter_.get(index); + } + /** + * + * + *
+   * The exact creator(s) of the documents to search against.
+   * If a value isn't specified, documents within the search results are
+   * associated with any creator. If multiple values are specified, documents
+   * within the search results may be associated with any of the specified
+   * creators.
+   * 
+ * + * repeated string document_creator_filter = 11; + * + * @param index The index of the value to return. + * @return The bytes of the documentCreatorFilter at the given index. + */ + public com.google.protobuf.ByteString getDocumentCreatorFilterBytes(int index) { + return documentCreatorFilter_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(query_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, query_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(customPropertyFilter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, customPropertyFilter_); + } + for (int i = 0; i < timeFilters_.size(); i++) { + output.writeMessage(5, timeFilters_.get(i)); + } + for (int i = 0; i < documentSchemaNames_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, documentSchemaNames_.getRaw(i)); + } + for (int i = 0; i < propertyFilter_.size(); i++) { + output.writeMessage(7, propertyFilter_.get(i)); + } + if (fileTypeFilter_ != null) { + output.writeMessage(8, getFileTypeFilter()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(folderNameFilter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 9, folderNameFilter_); + } + for (int i = 0; i < queryContext_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, queryContext_.getRaw(i)); + } + for (int i = 0; i < documentCreatorFilter_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 11, documentCreatorFilter_.getRaw(i)); + } + if (isNlQuery_ != false) { + output.writeBool(12, isNlQuery_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(query_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, query_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(customPropertyFilter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, customPropertyFilter_); + } + for (int i = 0; i < timeFilters_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, timeFilters_.get(i)); + } + { + int dataSize = 0; + for (int i = 0; i < documentSchemaNames_.size(); i++) { + dataSize += computeStringSizeNoTag(documentSchemaNames_.getRaw(i)); + } + size += dataSize; + size += 1 * getDocumentSchemaNamesList().size(); + } + for (int i = 0; i < propertyFilter_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, propertyFilter_.get(i)); + } + if (fileTypeFilter_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getFileTypeFilter()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(folderNameFilter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, folderNameFilter_); + } + { + int dataSize = 0; + for (int i = 0; i < queryContext_.size(); i++) { + dataSize += computeStringSizeNoTag(queryContext_.getRaw(i)); + } + size += dataSize; + size += 1 * getQueryContextList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < documentCreatorFilter_.size(); i++) { + dataSize += computeStringSizeNoTag(documentCreatorFilter_.getRaw(i)); + } + size += dataSize; + size += 1 * getDocumentCreatorFilterList().size(); + } + if (isNlQuery_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(12, isNlQuery_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.DocumentQuery)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.DocumentQuery other = + (com.google.cloud.contentwarehouse.v1.DocumentQuery) obj; + + if (!getQuery().equals(other.getQuery())) return false; + if (getIsNlQuery() != other.getIsNlQuery()) return false; + if (!getCustomPropertyFilter().equals(other.getCustomPropertyFilter())) return false; + if (!getTimeFiltersList().equals(other.getTimeFiltersList())) return false; + if (!getDocumentSchemaNamesList().equals(other.getDocumentSchemaNamesList())) return false; + if (!getPropertyFilterList().equals(other.getPropertyFilterList())) return false; + if (hasFileTypeFilter() != other.hasFileTypeFilter()) return false; + if (hasFileTypeFilter()) { + if (!getFileTypeFilter().equals(other.getFileTypeFilter())) return false; + } + if (!getFolderNameFilter().equals(other.getFolderNameFilter())) return false; + if (!getQueryContextList().equals(other.getQueryContextList())) return false; + if (!getDocumentCreatorFilterList().equals(other.getDocumentCreatorFilterList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + QUERY_FIELD_NUMBER; + hash = (53 * hash) + getQuery().hashCode(); + hash = (37 * hash) + IS_NL_QUERY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIsNlQuery()); + hash = (37 * hash) + CUSTOM_PROPERTY_FILTER_FIELD_NUMBER; + hash = (53 * hash) + getCustomPropertyFilter().hashCode(); + if (getTimeFiltersCount() > 0) { + hash = (37 * hash) + TIME_FILTERS_FIELD_NUMBER; + hash = (53 * hash) + getTimeFiltersList().hashCode(); + } + if (getDocumentSchemaNamesCount() > 0) { + hash = (37 * hash) + DOCUMENT_SCHEMA_NAMES_FIELD_NUMBER; + hash = (53 * hash) + getDocumentSchemaNamesList().hashCode(); + } + if (getPropertyFilterCount() > 0) { + hash = (37 * hash) + PROPERTY_FILTER_FIELD_NUMBER; + hash = (53 * hash) + getPropertyFilterList().hashCode(); + } + if (hasFileTypeFilter()) { + hash = (37 * hash) + FILE_TYPE_FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFileTypeFilter().hashCode(); + } + hash = (37 * hash) + FOLDER_NAME_FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFolderNameFilter().hashCode(); + if (getQueryContextCount() > 0) { + hash = (37 * hash) + QUERY_CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + getQueryContextList().hashCode(); + } + if (getDocumentCreatorFilterCount() > 0) { + hash = (37 * hash) + DOCUMENT_CREATOR_FILTER_FIELD_NUMBER; + hash = (53 * hash) + getDocumentCreatorFilterList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.DocumentQuery parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.DocumentQuery parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DocumentQuery parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.DocumentQuery parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DocumentQuery parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.DocumentQuery parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DocumentQuery parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.DocumentQuery parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DocumentQuery parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.DocumentQuery parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DocumentQuery parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.DocumentQuery parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.contentwarehouse.v1.DocumentQuery prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** Protobuf type {@code google.cloud.contentwarehouse.v1.DocumentQuery} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.DocumentQuery) + com.google.cloud.contentwarehouse.v1.DocumentQueryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.FiltersProto + .internal_static_google_cloud_contentwarehouse_v1_DocumentQuery_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.FiltersProto + .internal_static_google_cloud_contentwarehouse_v1_DocumentQuery_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.DocumentQuery.class, + com.google.cloud.contentwarehouse.v1.DocumentQuery.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.DocumentQuery.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + query_ = ""; + + isNlQuery_ = false; + + customPropertyFilter_ = ""; + + if (timeFiltersBuilder_ == null) { + timeFilters_ = java.util.Collections.emptyList(); + } else { + timeFilters_ = null; + timeFiltersBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + documentSchemaNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + if (propertyFilterBuilder_ == null) { + propertyFilter_ = java.util.Collections.emptyList(); + } else { + propertyFilter_ = null; + propertyFilterBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + if (fileTypeFilterBuilder_ == null) { + fileTypeFilter_ = null; + } else { + fileTypeFilter_ = null; + fileTypeFilterBuilder_ = null; + } + folderNameFilter_ = ""; + + queryContext_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000008); + documentCreatorFilter_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000010); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.FiltersProto + .internal_static_google_cloud_contentwarehouse_v1_DocumentQuery_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DocumentQuery getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.DocumentQuery.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DocumentQuery build() { + com.google.cloud.contentwarehouse.v1.DocumentQuery result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DocumentQuery buildPartial() { + com.google.cloud.contentwarehouse.v1.DocumentQuery result = + new com.google.cloud.contentwarehouse.v1.DocumentQuery(this); + int from_bitField0_ = bitField0_; + result.query_ = query_; + result.isNlQuery_ = isNlQuery_; + result.customPropertyFilter_ = customPropertyFilter_; + if (timeFiltersBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + timeFilters_ = java.util.Collections.unmodifiableList(timeFilters_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.timeFilters_ = timeFilters_; + } else { + result.timeFilters_ = timeFiltersBuilder_.build(); + } + if (((bitField0_ & 0x00000002) != 0)) { + documentSchemaNames_ = documentSchemaNames_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.documentSchemaNames_ = documentSchemaNames_; + if (propertyFilterBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + propertyFilter_ = java.util.Collections.unmodifiableList(propertyFilter_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.propertyFilter_ = propertyFilter_; + } else { + result.propertyFilter_ = propertyFilterBuilder_.build(); + } + if (fileTypeFilterBuilder_ == null) { + result.fileTypeFilter_ = fileTypeFilter_; + } else { + result.fileTypeFilter_ = fileTypeFilterBuilder_.build(); + } + result.folderNameFilter_ = folderNameFilter_; + if (((bitField0_ & 0x00000008) != 0)) { + queryContext_ = queryContext_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.queryContext_ = queryContext_; + if (((bitField0_ & 0x00000010) != 0)) { + documentCreatorFilter_ = documentCreatorFilter_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.documentCreatorFilter_ = documentCreatorFilter_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.DocumentQuery) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.DocumentQuery) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.DocumentQuery other) { + if (other == com.google.cloud.contentwarehouse.v1.DocumentQuery.getDefaultInstance()) + return this; + if (!other.getQuery().isEmpty()) { + query_ = other.query_; + onChanged(); + } + if (other.getIsNlQuery() != false) { + setIsNlQuery(other.getIsNlQuery()); + } + if (!other.getCustomPropertyFilter().isEmpty()) { + customPropertyFilter_ = other.customPropertyFilter_; + onChanged(); + } + if (timeFiltersBuilder_ == null) { + if (!other.timeFilters_.isEmpty()) { + if (timeFilters_.isEmpty()) { + timeFilters_ = other.timeFilters_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureTimeFiltersIsMutable(); + timeFilters_.addAll(other.timeFilters_); + } + onChanged(); + } + } else { + if (!other.timeFilters_.isEmpty()) { + if (timeFiltersBuilder_.isEmpty()) { + timeFiltersBuilder_.dispose(); + timeFiltersBuilder_ = null; + timeFilters_ = other.timeFilters_; + bitField0_ = (bitField0_ & ~0x00000001); + timeFiltersBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getTimeFiltersFieldBuilder() + : null; + } else { + timeFiltersBuilder_.addAllMessages(other.timeFilters_); + } + } + } + if (!other.documentSchemaNames_.isEmpty()) { + if (documentSchemaNames_.isEmpty()) { + documentSchemaNames_ = other.documentSchemaNames_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureDocumentSchemaNamesIsMutable(); + documentSchemaNames_.addAll(other.documentSchemaNames_); + } + onChanged(); + } + if (propertyFilterBuilder_ == null) { + if (!other.propertyFilter_.isEmpty()) { + if (propertyFilter_.isEmpty()) { + propertyFilter_ = other.propertyFilter_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensurePropertyFilterIsMutable(); + propertyFilter_.addAll(other.propertyFilter_); + } + onChanged(); + } + } else { + if (!other.propertyFilter_.isEmpty()) { + if (propertyFilterBuilder_.isEmpty()) { + propertyFilterBuilder_.dispose(); + propertyFilterBuilder_ = null; + propertyFilter_ = other.propertyFilter_; + bitField0_ = (bitField0_ & ~0x00000004); + propertyFilterBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getPropertyFilterFieldBuilder() + : null; + } else { + propertyFilterBuilder_.addAllMessages(other.propertyFilter_); + } + } + } + if (other.hasFileTypeFilter()) { + mergeFileTypeFilter(other.getFileTypeFilter()); + } + if (!other.getFolderNameFilter().isEmpty()) { + folderNameFilter_ = other.folderNameFilter_; + onChanged(); + } + if (!other.queryContext_.isEmpty()) { + if (queryContext_.isEmpty()) { + queryContext_ = other.queryContext_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureQueryContextIsMutable(); + queryContext_.addAll(other.queryContext_); + } + onChanged(); + } + if (!other.documentCreatorFilter_.isEmpty()) { + if (documentCreatorFilter_.isEmpty()) { + documentCreatorFilter_ = other.documentCreatorFilter_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureDocumentCreatorFilterIsMutable(); + documentCreatorFilter_.addAll(other.documentCreatorFilter_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + query_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 34: + { + customPropertyFilter_ = input.readStringRequireUtf8(); + + break; + } // case 34 + case 42: + { + com.google.cloud.contentwarehouse.v1.TimeFilter m = + input.readMessage( + com.google.cloud.contentwarehouse.v1.TimeFilter.parser(), + extensionRegistry); + if (timeFiltersBuilder_ == null) { + ensureTimeFiltersIsMutable(); + timeFilters_.add(m); + } else { + timeFiltersBuilder_.addMessage(m); + } + break; + } // case 42 + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureDocumentSchemaNamesIsMutable(); + documentSchemaNames_.add(s); + break; + } // case 50 + case 58: + { + com.google.cloud.contentwarehouse.v1.PropertyFilter m = + input.readMessage( + com.google.cloud.contentwarehouse.v1.PropertyFilter.parser(), + extensionRegistry); + if (propertyFilterBuilder_ == null) { + ensurePropertyFilterIsMutable(); + propertyFilter_.add(m); + } else { + propertyFilterBuilder_.addMessage(m); + } + break; + } // case 58 + case 66: + { + input.readMessage(getFileTypeFilterFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 66 + case 74: + { + folderNameFilter_ = input.readStringRequireUtf8(); + + break; + } // case 74 + case 82: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureQueryContextIsMutable(); + queryContext_.add(s); + break; + } // case 82 + case 90: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureDocumentCreatorFilterIsMutable(); + documentCreatorFilter_.add(s); + break; + } // case 90 + case 96: + { + isNlQuery_ = input.readBool(); + + break; + } // case 96 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object query_ = ""; + /** + * + * + *
+     * The query string that matches against the full text of the document and
+     * the searchable properties.
+     * The maximum number of allowed characters is 255.
+     * 
+ * + * string query = 1; + * + * @return The query. + */ + public java.lang.String getQuery() { + java.lang.Object ref = query_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + query_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The query string that matches against the full text of the document and
+     * the searchable properties.
+     * The maximum number of allowed characters is 255.
+     * 
+ * + * string query = 1; + * + * @return The bytes for query. + */ + public com.google.protobuf.ByteString getQueryBytes() { + java.lang.Object ref = query_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + query_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The query string that matches against the full text of the document and
+     * the searchable properties.
+     * The maximum number of allowed characters is 255.
+     * 
+ * + * string query = 1; + * + * @param value The query to set. + * @return This builder for chaining. + */ + public Builder setQuery(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + query_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The query string that matches against the full text of the document and
+     * the searchable properties.
+     * The maximum number of allowed characters is 255.
+     * 
+ * + * string query = 1; + * + * @return This builder for chaining. + */ + public Builder clearQuery() { + + query_ = getDefaultInstance().getQuery(); + onChanged(); + return this; + } + /** + * + * + *
+     * The query string that matches against the full text of the document and
+     * the searchable properties.
+     * The maximum number of allowed characters is 255.
+     * 
+ * + * string query = 1; + * + * @param value The bytes for query to set. + * @return This builder for chaining. + */ + public Builder setQueryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + query_ = value; + onChanged(); + return this; + } + + private boolean isNlQuery_; + /** + * + * + *
+     * Experimental, do not use.
+     * If the query is a natural language question. False by default. If true,
+     * then the question-answering feature will be used instead of search, and
+     * `result_count` in [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest] must be set. In addition, all
+     * other input fields related to search (pagination, histograms, etc.) will be
+     * ignored.
+     * 
+ * + * bool is_nl_query = 12; + * + * @return The isNlQuery. + */ + @java.lang.Override + public boolean getIsNlQuery() { + return isNlQuery_; + } + /** + * + * + *
+     * Experimental, do not use.
+     * If the query is a natural language question. False by default. If true,
+     * then the question-answering feature will be used instead of search, and
+     * `result_count` in [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest] must be set. In addition, all
+     * other input fields related to search (pagination, histograms, etc.) will be
+     * ignored.
+     * 
+ * + * bool is_nl_query = 12; + * + * @param value The isNlQuery to set. + * @return This builder for chaining. + */ + public Builder setIsNlQuery(boolean value) { + + isNlQuery_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Experimental, do not use.
+     * If the query is a natural language question. False by default. If true,
+     * then the question-answering feature will be used instead of search, and
+     * `result_count` in [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest] must be set. In addition, all
+     * other input fields related to search (pagination, histograms, etc.) will be
+     * ignored.
+     * 
+ * + * bool is_nl_query = 12; + * + * @return This builder for chaining. + */ + public Builder clearIsNlQuery() { + + isNlQuery_ = false; + onChanged(); + return this; + } + + private java.lang.Object customPropertyFilter_ = ""; + /** + * + * + *
+     * This filter specifies a structured syntax to match against the
+     * [PropertyDefinition].[is_filterable][] marked as `true`. The syntax for
+     * this expression is a subset of SQL syntax.
+     * Supported operators are: `=`, `!=`, `<`, `<=`, `>`, and `>=` where the left
+     * of the operator is a property name and the right of the operator is a
+     * number or a quoted string. You must escape backslash (\\) and quote (\")
+     * characters. Supported functions are `LOWER([property_name])` to perform a
+     * case insensitive match and `EMPTY([property_name])` to filter on the
+     * existence of a key.
+     * Boolean expressions (AND/OR/NOT) are supported up to 3 levels of nesting
+     * (for example, "((A AND B AND C) OR NOT D) AND E"), a maximum of 100
+     * comparisons or functions are allowed in the expression. The expression must
+     * be < 6000 bytes in length.
+     * Sample Query:
+     * `(LOWER(driving_license)="class \"a\"" OR EMPTY(driving_license)) AND
+     * driving_years > 10`
+     * 
+ * + * string custom_property_filter = 4 [deprecated = true]; + * + * @deprecated google.cloud.contentwarehouse.v1.DocumentQuery.custom_property_filter is + * deprecated. See google/cloud/contentwarehouse/v1/filters.proto;l=59 + * @return The customPropertyFilter. + */ + @java.lang.Deprecated + public java.lang.String getCustomPropertyFilter() { + java.lang.Object ref = customPropertyFilter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + customPropertyFilter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * This filter specifies a structured syntax to match against the
+     * [PropertyDefinition].[is_filterable][] marked as `true`. The syntax for
+     * this expression is a subset of SQL syntax.
+     * Supported operators are: `=`, `!=`, `<`, `<=`, `>`, and `>=` where the left
+     * of the operator is a property name and the right of the operator is a
+     * number or a quoted string. You must escape backslash (\\) and quote (\")
+     * characters. Supported functions are `LOWER([property_name])` to perform a
+     * case insensitive match and `EMPTY([property_name])` to filter on the
+     * existence of a key.
+     * Boolean expressions (AND/OR/NOT) are supported up to 3 levels of nesting
+     * (for example, "((A AND B AND C) OR NOT D) AND E"), a maximum of 100
+     * comparisons or functions are allowed in the expression. The expression must
+     * be < 6000 bytes in length.
+     * Sample Query:
+     * `(LOWER(driving_license)="class \"a\"" OR EMPTY(driving_license)) AND
+     * driving_years > 10`
+     * 
+ * + * string custom_property_filter = 4 [deprecated = true]; + * + * @deprecated google.cloud.contentwarehouse.v1.DocumentQuery.custom_property_filter is + * deprecated. See google/cloud/contentwarehouse/v1/filters.proto;l=59 + * @return The bytes for customPropertyFilter. + */ + @java.lang.Deprecated + public com.google.protobuf.ByteString getCustomPropertyFilterBytes() { + java.lang.Object ref = customPropertyFilter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + customPropertyFilter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * This filter specifies a structured syntax to match against the
+     * [PropertyDefinition].[is_filterable][] marked as `true`. The syntax for
+     * this expression is a subset of SQL syntax.
+     * Supported operators are: `=`, `!=`, `<`, `<=`, `>`, and `>=` where the left
+     * of the operator is a property name and the right of the operator is a
+     * number or a quoted string. You must escape backslash (\\) and quote (\")
+     * characters. Supported functions are `LOWER([property_name])` to perform a
+     * case insensitive match and `EMPTY([property_name])` to filter on the
+     * existence of a key.
+     * Boolean expressions (AND/OR/NOT) are supported up to 3 levels of nesting
+     * (for example, "((A AND B AND C) OR NOT D) AND E"), a maximum of 100
+     * comparisons or functions are allowed in the expression. The expression must
+     * be < 6000 bytes in length.
+     * Sample Query:
+     * `(LOWER(driving_license)="class \"a\"" OR EMPTY(driving_license)) AND
+     * driving_years > 10`
+     * 
+ * + * string custom_property_filter = 4 [deprecated = true]; + * + * @deprecated google.cloud.contentwarehouse.v1.DocumentQuery.custom_property_filter is + * deprecated. See google/cloud/contentwarehouse/v1/filters.proto;l=59 + * @param value The customPropertyFilter to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setCustomPropertyFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + customPropertyFilter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * This filter specifies a structured syntax to match against the
+     * [PropertyDefinition].[is_filterable][] marked as `true`. The syntax for
+     * this expression is a subset of SQL syntax.
+     * Supported operators are: `=`, `!=`, `<`, `<=`, `>`, and `>=` where the left
+     * of the operator is a property name and the right of the operator is a
+     * number or a quoted string. You must escape backslash (\\) and quote (\")
+     * characters. Supported functions are `LOWER([property_name])` to perform a
+     * case insensitive match and `EMPTY([property_name])` to filter on the
+     * existence of a key.
+     * Boolean expressions (AND/OR/NOT) are supported up to 3 levels of nesting
+     * (for example, "((A AND B AND C) OR NOT D) AND E"), a maximum of 100
+     * comparisons or functions are allowed in the expression. The expression must
+     * be < 6000 bytes in length.
+     * Sample Query:
+     * `(LOWER(driving_license)="class \"a\"" OR EMPTY(driving_license)) AND
+     * driving_years > 10`
+     * 
+ * + * string custom_property_filter = 4 [deprecated = true]; + * + * @deprecated google.cloud.contentwarehouse.v1.DocumentQuery.custom_property_filter is + * deprecated. See google/cloud/contentwarehouse/v1/filters.proto;l=59 + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder clearCustomPropertyFilter() { + + customPropertyFilter_ = getDefaultInstance().getCustomPropertyFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * This filter specifies a structured syntax to match against the
+     * [PropertyDefinition].[is_filterable][] marked as `true`. The syntax for
+     * this expression is a subset of SQL syntax.
+     * Supported operators are: `=`, `!=`, `<`, `<=`, `>`, and `>=` where the left
+     * of the operator is a property name and the right of the operator is a
+     * number or a quoted string. You must escape backslash (\\) and quote (\")
+     * characters. Supported functions are `LOWER([property_name])` to perform a
+     * case insensitive match and `EMPTY([property_name])` to filter on the
+     * existence of a key.
+     * Boolean expressions (AND/OR/NOT) are supported up to 3 levels of nesting
+     * (for example, "((A AND B AND C) OR NOT D) AND E"), a maximum of 100
+     * comparisons or functions are allowed in the expression. The expression must
+     * be < 6000 bytes in length.
+     * Sample Query:
+     * `(LOWER(driving_license)="class \"a\"" OR EMPTY(driving_license)) AND
+     * driving_years > 10`
+     * 
+ * + * string custom_property_filter = 4 [deprecated = true]; + * + * @deprecated google.cloud.contentwarehouse.v1.DocumentQuery.custom_property_filter is + * deprecated. See google/cloud/contentwarehouse/v1/filters.proto;l=59 + * @param value The bytes for customPropertyFilter to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setCustomPropertyFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + customPropertyFilter_ = value; + onChanged(); + return this; + } + + private java.util.List timeFilters_ = + java.util.Collections.emptyList(); + + private void ensureTimeFiltersIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + timeFilters_ = + new java.util.ArrayList(timeFilters_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.TimeFilter, + com.google.cloud.contentwarehouse.v1.TimeFilter.Builder, + com.google.cloud.contentwarehouse.v1.TimeFilterOrBuilder> + timeFiltersBuilder_; + + /** + * + * + *
+     * Documents created/updated within a range specified by this filter are
+     * searched against.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.TimeFilter time_filters = 5; + */ + public java.util.List getTimeFiltersList() { + if (timeFiltersBuilder_ == null) { + return java.util.Collections.unmodifiableList(timeFilters_); + } else { + return timeFiltersBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Documents created/updated within a range specified by this filter are
+     * searched against.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.TimeFilter time_filters = 5; + */ + public int getTimeFiltersCount() { + if (timeFiltersBuilder_ == null) { + return timeFilters_.size(); + } else { + return timeFiltersBuilder_.getCount(); + } + } + /** + * + * + *
+     * Documents created/updated within a range specified by this filter are
+     * searched against.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.TimeFilter time_filters = 5; + */ + public com.google.cloud.contentwarehouse.v1.TimeFilter getTimeFilters(int index) { + if (timeFiltersBuilder_ == null) { + return timeFilters_.get(index); + } else { + return timeFiltersBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Documents created/updated within a range specified by this filter are
+     * searched against.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.TimeFilter time_filters = 5; + */ + public Builder setTimeFilters( + int index, com.google.cloud.contentwarehouse.v1.TimeFilter value) { + if (timeFiltersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTimeFiltersIsMutable(); + timeFilters_.set(index, value); + onChanged(); + } else { + timeFiltersBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Documents created/updated within a range specified by this filter are
+     * searched against.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.TimeFilter time_filters = 5; + */ + public Builder setTimeFilters( + int index, com.google.cloud.contentwarehouse.v1.TimeFilter.Builder builderForValue) { + if (timeFiltersBuilder_ == null) { + ensureTimeFiltersIsMutable(); + timeFilters_.set(index, builderForValue.build()); + onChanged(); + } else { + timeFiltersBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Documents created/updated within a range specified by this filter are
+     * searched against.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.TimeFilter time_filters = 5; + */ + public Builder addTimeFilters(com.google.cloud.contentwarehouse.v1.TimeFilter value) { + if (timeFiltersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTimeFiltersIsMutable(); + timeFilters_.add(value); + onChanged(); + } else { + timeFiltersBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Documents created/updated within a range specified by this filter are
+     * searched against.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.TimeFilter time_filters = 5; + */ + public Builder addTimeFilters( + int index, com.google.cloud.contentwarehouse.v1.TimeFilter value) { + if (timeFiltersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTimeFiltersIsMutable(); + timeFilters_.add(index, value); + onChanged(); + } else { + timeFiltersBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Documents created/updated within a range specified by this filter are
+     * searched against.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.TimeFilter time_filters = 5; + */ + public Builder addTimeFilters( + com.google.cloud.contentwarehouse.v1.TimeFilter.Builder builderForValue) { + if (timeFiltersBuilder_ == null) { + ensureTimeFiltersIsMutable(); + timeFilters_.add(builderForValue.build()); + onChanged(); + } else { + timeFiltersBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Documents created/updated within a range specified by this filter are
+     * searched against.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.TimeFilter time_filters = 5; + */ + public Builder addTimeFilters( + int index, com.google.cloud.contentwarehouse.v1.TimeFilter.Builder builderForValue) { + if (timeFiltersBuilder_ == null) { + ensureTimeFiltersIsMutable(); + timeFilters_.add(index, builderForValue.build()); + onChanged(); + } else { + timeFiltersBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Documents created/updated within a range specified by this filter are
+     * searched against.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.TimeFilter time_filters = 5; + */ + public Builder addAllTimeFilters( + java.lang.Iterable values) { + if (timeFiltersBuilder_ == null) { + ensureTimeFiltersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, timeFilters_); + onChanged(); + } else { + timeFiltersBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Documents created/updated within a range specified by this filter are
+     * searched against.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.TimeFilter time_filters = 5; + */ + public Builder clearTimeFilters() { + if (timeFiltersBuilder_ == null) { + timeFilters_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + timeFiltersBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Documents created/updated within a range specified by this filter are
+     * searched against.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.TimeFilter time_filters = 5; + */ + public Builder removeTimeFilters(int index) { + if (timeFiltersBuilder_ == null) { + ensureTimeFiltersIsMutable(); + timeFilters_.remove(index); + onChanged(); + } else { + timeFiltersBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Documents created/updated within a range specified by this filter are
+     * searched against.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.TimeFilter time_filters = 5; + */ + public com.google.cloud.contentwarehouse.v1.TimeFilter.Builder getTimeFiltersBuilder( + int index) { + return getTimeFiltersFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Documents created/updated within a range specified by this filter are
+     * searched against.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.TimeFilter time_filters = 5; + */ + public com.google.cloud.contentwarehouse.v1.TimeFilterOrBuilder getTimeFiltersOrBuilder( + int index) { + if (timeFiltersBuilder_ == null) { + return timeFilters_.get(index); + } else { + return timeFiltersBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Documents created/updated within a range specified by this filter are
+     * searched against.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.TimeFilter time_filters = 5; + */ + public java.util.List + getTimeFiltersOrBuilderList() { + if (timeFiltersBuilder_ != null) { + return timeFiltersBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(timeFilters_); + } + } + /** + * + * + *
+     * Documents created/updated within a range specified by this filter are
+     * searched against.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.TimeFilter time_filters = 5; + */ + public com.google.cloud.contentwarehouse.v1.TimeFilter.Builder addTimeFiltersBuilder() { + return getTimeFiltersFieldBuilder() + .addBuilder(com.google.cloud.contentwarehouse.v1.TimeFilter.getDefaultInstance()); + } + /** + * + * + *
+     * Documents created/updated within a range specified by this filter are
+     * searched against.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.TimeFilter time_filters = 5; + */ + public com.google.cloud.contentwarehouse.v1.TimeFilter.Builder addTimeFiltersBuilder( + int index) { + return getTimeFiltersFieldBuilder() + .addBuilder(index, com.google.cloud.contentwarehouse.v1.TimeFilter.getDefaultInstance()); + } + /** + * + * + *
+     * Documents created/updated within a range specified by this filter are
+     * searched against.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.TimeFilter time_filters = 5; + */ + public java.util.List + getTimeFiltersBuilderList() { + return getTimeFiltersFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.TimeFilter, + com.google.cloud.contentwarehouse.v1.TimeFilter.Builder, + com.google.cloud.contentwarehouse.v1.TimeFilterOrBuilder> + getTimeFiltersFieldBuilder() { + if (timeFiltersBuilder_ == null) { + timeFiltersBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.TimeFilter, + com.google.cloud.contentwarehouse.v1.TimeFilter.Builder, + com.google.cloud.contentwarehouse.v1.TimeFilterOrBuilder>( + timeFilters_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + timeFilters_ = null; + } + return timeFiltersBuilder_; + } + + private com.google.protobuf.LazyStringList documentSchemaNames_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureDocumentSchemaNamesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + documentSchemaNames_ = new com.google.protobuf.LazyStringArrayList(documentSchemaNames_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * This filter specifies the exact document schema
+     * [Document.document_schema_name][google.cloud.contentwarehouse.v1.Document.document_schema_name] of the documents to search against.
+     * If a value isn't specified, documents within the search results are
+     * associated with any schema. If multiple values are specified, documents
+     * within the search results may be associated with any of the specified
+     * schemas.
+     * At most 20 document schema names are allowed.
+     * 
+ * + * repeated string document_schema_names = 6; + * + * @return A list containing the documentSchemaNames. + */ + public com.google.protobuf.ProtocolStringList getDocumentSchemaNamesList() { + return documentSchemaNames_.getUnmodifiableView(); + } + /** + * + * + *
+     * This filter specifies the exact document schema
+     * [Document.document_schema_name][google.cloud.contentwarehouse.v1.Document.document_schema_name] of the documents to search against.
+     * If a value isn't specified, documents within the search results are
+     * associated with any schema. If multiple values are specified, documents
+     * within the search results may be associated with any of the specified
+     * schemas.
+     * At most 20 document schema names are allowed.
+     * 
+ * + * repeated string document_schema_names = 6; + * + * @return The count of documentSchemaNames. + */ + public int getDocumentSchemaNamesCount() { + return documentSchemaNames_.size(); + } + /** + * + * + *
+     * This filter specifies the exact document schema
+     * [Document.document_schema_name][google.cloud.contentwarehouse.v1.Document.document_schema_name] of the documents to search against.
+     * If a value isn't specified, documents within the search results are
+     * associated with any schema. If multiple values are specified, documents
+     * within the search results may be associated with any of the specified
+     * schemas.
+     * At most 20 document schema names are allowed.
+     * 
+ * + * repeated string document_schema_names = 6; + * + * @param index The index of the element to return. + * @return The documentSchemaNames at the given index. + */ + public java.lang.String getDocumentSchemaNames(int index) { + return documentSchemaNames_.get(index); + } + /** + * + * + *
+     * This filter specifies the exact document schema
+     * [Document.document_schema_name][google.cloud.contentwarehouse.v1.Document.document_schema_name] of the documents to search against.
+     * If a value isn't specified, documents within the search results are
+     * associated with any schema. If multiple values are specified, documents
+     * within the search results may be associated with any of the specified
+     * schemas.
+     * At most 20 document schema names are allowed.
+     * 
+ * + * repeated string document_schema_names = 6; + * + * @param index The index of the value to return. + * @return The bytes of the documentSchemaNames at the given index. + */ + public com.google.protobuf.ByteString getDocumentSchemaNamesBytes(int index) { + return documentSchemaNames_.getByteString(index); + } + /** + * + * + *
+     * This filter specifies the exact document schema
+     * [Document.document_schema_name][google.cloud.contentwarehouse.v1.Document.document_schema_name] of the documents to search against.
+     * If a value isn't specified, documents within the search results are
+     * associated with any schema. If multiple values are specified, documents
+     * within the search results may be associated with any of the specified
+     * schemas.
+     * At most 20 document schema names are allowed.
+     * 
+ * + * repeated string document_schema_names = 6; + * + * @param index The index to set the value at. + * @param value The documentSchemaNames to set. + * @return This builder for chaining. + */ + public Builder setDocumentSchemaNames(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDocumentSchemaNamesIsMutable(); + documentSchemaNames_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * This filter specifies the exact document schema
+     * [Document.document_schema_name][google.cloud.contentwarehouse.v1.Document.document_schema_name] of the documents to search against.
+     * If a value isn't specified, documents within the search results are
+     * associated with any schema. If multiple values are specified, documents
+     * within the search results may be associated with any of the specified
+     * schemas.
+     * At most 20 document schema names are allowed.
+     * 
+ * + * repeated string document_schema_names = 6; + * + * @param value The documentSchemaNames to add. + * @return This builder for chaining. + */ + public Builder addDocumentSchemaNames(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDocumentSchemaNamesIsMutable(); + documentSchemaNames_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * This filter specifies the exact document schema
+     * [Document.document_schema_name][google.cloud.contentwarehouse.v1.Document.document_schema_name] of the documents to search against.
+     * If a value isn't specified, documents within the search results are
+     * associated with any schema. If multiple values are specified, documents
+     * within the search results may be associated with any of the specified
+     * schemas.
+     * At most 20 document schema names are allowed.
+     * 
+ * + * repeated string document_schema_names = 6; + * + * @param values The documentSchemaNames to add. + * @return This builder for chaining. + */ + public Builder addAllDocumentSchemaNames(java.lang.Iterable values) { + ensureDocumentSchemaNamesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, documentSchemaNames_); + onChanged(); + return this; + } + /** + * + * + *
+     * This filter specifies the exact document schema
+     * [Document.document_schema_name][google.cloud.contentwarehouse.v1.Document.document_schema_name] of the documents to search against.
+     * If a value isn't specified, documents within the search results are
+     * associated with any schema. If multiple values are specified, documents
+     * within the search results may be associated with any of the specified
+     * schemas.
+     * At most 20 document schema names are allowed.
+     * 
+ * + * repeated string document_schema_names = 6; + * + * @return This builder for chaining. + */ + public Builder clearDocumentSchemaNames() { + documentSchemaNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * This filter specifies the exact document schema
+     * [Document.document_schema_name][google.cloud.contentwarehouse.v1.Document.document_schema_name] of the documents to search against.
+     * If a value isn't specified, documents within the search results are
+     * associated with any schema. If multiple values are specified, documents
+     * within the search results may be associated with any of the specified
+     * schemas.
+     * At most 20 document schema names are allowed.
+     * 
+ * + * repeated string document_schema_names = 6; + * + * @param value The bytes of the documentSchemaNames to add. + * @return This builder for chaining. + */ + public Builder addDocumentSchemaNamesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureDocumentSchemaNamesIsMutable(); + documentSchemaNames_.add(value); + onChanged(); + return this; + } + + private java.util.List propertyFilter_ = + java.util.Collections.emptyList(); + + private void ensurePropertyFilterIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + propertyFilter_ = + new java.util.ArrayList( + propertyFilter_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.PropertyFilter, + com.google.cloud.contentwarehouse.v1.PropertyFilter.Builder, + com.google.cloud.contentwarehouse.v1.PropertyFilterOrBuilder> + propertyFilterBuilder_; + + /** + * + * + *
+     * This filter specifies a structured syntax to match against the
+     * [PropertyDefinition.is_filterable][google.cloud.contentwarehouse.v1.PropertyDefinition.is_filterable] marked as `true`. The relationship
+     * between the PropertyFilters is OR.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.PropertyFilter property_filter = 7; + */ + public java.util.List + getPropertyFilterList() { + if (propertyFilterBuilder_ == null) { + return java.util.Collections.unmodifiableList(propertyFilter_); + } else { + return propertyFilterBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * This filter specifies a structured syntax to match against the
+     * [PropertyDefinition.is_filterable][google.cloud.contentwarehouse.v1.PropertyDefinition.is_filterable] marked as `true`. The relationship
+     * between the PropertyFilters is OR.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.PropertyFilter property_filter = 7; + */ + public int getPropertyFilterCount() { + if (propertyFilterBuilder_ == null) { + return propertyFilter_.size(); + } else { + return propertyFilterBuilder_.getCount(); + } + } + /** + * + * + *
+     * This filter specifies a structured syntax to match against the
+     * [PropertyDefinition.is_filterable][google.cloud.contentwarehouse.v1.PropertyDefinition.is_filterable] marked as `true`. The relationship
+     * between the PropertyFilters is OR.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.PropertyFilter property_filter = 7; + */ + public com.google.cloud.contentwarehouse.v1.PropertyFilter getPropertyFilter(int index) { + if (propertyFilterBuilder_ == null) { + return propertyFilter_.get(index); + } else { + return propertyFilterBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * This filter specifies a structured syntax to match against the
+     * [PropertyDefinition.is_filterable][google.cloud.contentwarehouse.v1.PropertyDefinition.is_filterable] marked as `true`. The relationship
+     * between the PropertyFilters is OR.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.PropertyFilter property_filter = 7; + */ + public Builder setPropertyFilter( + int index, com.google.cloud.contentwarehouse.v1.PropertyFilter value) { + if (propertyFilterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePropertyFilterIsMutable(); + propertyFilter_.set(index, value); + onChanged(); + } else { + propertyFilterBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * This filter specifies a structured syntax to match against the
+     * [PropertyDefinition.is_filterable][google.cloud.contentwarehouse.v1.PropertyDefinition.is_filterable] marked as `true`. The relationship
+     * between the PropertyFilters is OR.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.PropertyFilter property_filter = 7; + */ + public Builder setPropertyFilter( + int index, com.google.cloud.contentwarehouse.v1.PropertyFilter.Builder builderForValue) { + if (propertyFilterBuilder_ == null) { + ensurePropertyFilterIsMutable(); + propertyFilter_.set(index, builderForValue.build()); + onChanged(); + } else { + propertyFilterBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * This filter specifies a structured syntax to match against the
+     * [PropertyDefinition.is_filterable][google.cloud.contentwarehouse.v1.PropertyDefinition.is_filterable] marked as `true`. The relationship
+     * between the PropertyFilters is OR.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.PropertyFilter property_filter = 7; + */ + public Builder addPropertyFilter(com.google.cloud.contentwarehouse.v1.PropertyFilter value) { + if (propertyFilterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePropertyFilterIsMutable(); + propertyFilter_.add(value); + onChanged(); + } else { + propertyFilterBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * This filter specifies a structured syntax to match against the
+     * [PropertyDefinition.is_filterable][google.cloud.contentwarehouse.v1.PropertyDefinition.is_filterable] marked as `true`. The relationship
+     * between the PropertyFilters is OR.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.PropertyFilter property_filter = 7; + */ + public Builder addPropertyFilter( + int index, com.google.cloud.contentwarehouse.v1.PropertyFilter value) { + if (propertyFilterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePropertyFilterIsMutable(); + propertyFilter_.add(index, value); + onChanged(); + } else { + propertyFilterBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * This filter specifies a structured syntax to match against the
+     * [PropertyDefinition.is_filterable][google.cloud.contentwarehouse.v1.PropertyDefinition.is_filterable] marked as `true`. The relationship
+     * between the PropertyFilters is OR.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.PropertyFilter property_filter = 7; + */ + public Builder addPropertyFilter( + com.google.cloud.contentwarehouse.v1.PropertyFilter.Builder builderForValue) { + if (propertyFilterBuilder_ == null) { + ensurePropertyFilterIsMutable(); + propertyFilter_.add(builderForValue.build()); + onChanged(); + } else { + propertyFilterBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * This filter specifies a structured syntax to match against the
+     * [PropertyDefinition.is_filterable][google.cloud.contentwarehouse.v1.PropertyDefinition.is_filterable] marked as `true`. The relationship
+     * between the PropertyFilters is OR.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.PropertyFilter property_filter = 7; + */ + public Builder addPropertyFilter( + int index, com.google.cloud.contentwarehouse.v1.PropertyFilter.Builder builderForValue) { + if (propertyFilterBuilder_ == null) { + ensurePropertyFilterIsMutable(); + propertyFilter_.add(index, builderForValue.build()); + onChanged(); + } else { + propertyFilterBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * This filter specifies a structured syntax to match against the
+     * [PropertyDefinition.is_filterable][google.cloud.contentwarehouse.v1.PropertyDefinition.is_filterable] marked as `true`. The relationship
+     * between the PropertyFilters is OR.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.PropertyFilter property_filter = 7; + */ + public Builder addAllPropertyFilter( + java.lang.Iterable values) { + if (propertyFilterBuilder_ == null) { + ensurePropertyFilterIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, propertyFilter_); + onChanged(); + } else { + propertyFilterBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * This filter specifies a structured syntax to match against the
+     * [PropertyDefinition.is_filterable][google.cloud.contentwarehouse.v1.PropertyDefinition.is_filterable] marked as `true`. The relationship
+     * between the PropertyFilters is OR.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.PropertyFilter property_filter = 7; + */ + public Builder clearPropertyFilter() { + if (propertyFilterBuilder_ == null) { + propertyFilter_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + propertyFilterBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * This filter specifies a structured syntax to match against the
+     * [PropertyDefinition.is_filterable][google.cloud.contentwarehouse.v1.PropertyDefinition.is_filterable] marked as `true`. The relationship
+     * between the PropertyFilters is OR.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.PropertyFilter property_filter = 7; + */ + public Builder removePropertyFilter(int index) { + if (propertyFilterBuilder_ == null) { + ensurePropertyFilterIsMutable(); + propertyFilter_.remove(index); + onChanged(); + } else { + propertyFilterBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * This filter specifies a structured syntax to match against the
+     * [PropertyDefinition.is_filterable][google.cloud.contentwarehouse.v1.PropertyDefinition.is_filterable] marked as `true`. The relationship
+     * between the PropertyFilters is OR.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.PropertyFilter property_filter = 7; + */ + public com.google.cloud.contentwarehouse.v1.PropertyFilter.Builder getPropertyFilterBuilder( + int index) { + return getPropertyFilterFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * This filter specifies a structured syntax to match against the
+     * [PropertyDefinition.is_filterable][google.cloud.contentwarehouse.v1.PropertyDefinition.is_filterable] marked as `true`. The relationship
+     * between the PropertyFilters is OR.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.PropertyFilter property_filter = 7; + */ + public com.google.cloud.contentwarehouse.v1.PropertyFilterOrBuilder getPropertyFilterOrBuilder( + int index) { + if (propertyFilterBuilder_ == null) { + return propertyFilter_.get(index); + } else { + return propertyFilterBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * This filter specifies a structured syntax to match against the
+     * [PropertyDefinition.is_filterable][google.cloud.contentwarehouse.v1.PropertyDefinition.is_filterable] marked as `true`. The relationship
+     * between the PropertyFilters is OR.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.PropertyFilter property_filter = 7; + */ + public java.util.List + getPropertyFilterOrBuilderList() { + if (propertyFilterBuilder_ != null) { + return propertyFilterBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(propertyFilter_); + } + } + /** + * + * + *
+     * This filter specifies a structured syntax to match against the
+     * [PropertyDefinition.is_filterable][google.cloud.contentwarehouse.v1.PropertyDefinition.is_filterable] marked as `true`. The relationship
+     * between the PropertyFilters is OR.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.PropertyFilter property_filter = 7; + */ + public com.google.cloud.contentwarehouse.v1.PropertyFilter.Builder addPropertyFilterBuilder() { + return getPropertyFilterFieldBuilder() + .addBuilder(com.google.cloud.contentwarehouse.v1.PropertyFilter.getDefaultInstance()); + } + /** + * + * + *
+     * This filter specifies a structured syntax to match against the
+     * [PropertyDefinition.is_filterable][google.cloud.contentwarehouse.v1.PropertyDefinition.is_filterable] marked as `true`. The relationship
+     * between the PropertyFilters is OR.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.PropertyFilter property_filter = 7; + */ + public com.google.cloud.contentwarehouse.v1.PropertyFilter.Builder addPropertyFilterBuilder( + int index) { + return getPropertyFilterFieldBuilder() + .addBuilder( + index, com.google.cloud.contentwarehouse.v1.PropertyFilter.getDefaultInstance()); + } + /** + * + * + *
+     * This filter specifies a structured syntax to match against the
+     * [PropertyDefinition.is_filterable][google.cloud.contentwarehouse.v1.PropertyDefinition.is_filterable] marked as `true`. The relationship
+     * between the PropertyFilters is OR.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.PropertyFilter property_filter = 7; + */ + public java.util.List + getPropertyFilterBuilderList() { + return getPropertyFilterFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.PropertyFilter, + com.google.cloud.contentwarehouse.v1.PropertyFilter.Builder, + com.google.cloud.contentwarehouse.v1.PropertyFilterOrBuilder> + getPropertyFilterFieldBuilder() { + if (propertyFilterBuilder_ == null) { + propertyFilterBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.PropertyFilter, + com.google.cloud.contentwarehouse.v1.PropertyFilter.Builder, + com.google.cloud.contentwarehouse.v1.PropertyFilterOrBuilder>( + propertyFilter_, + ((bitField0_ & 0x00000004) != 0), + getParentForChildren(), + isClean()); + propertyFilter_ = null; + } + return propertyFilterBuilder_; + } + + private com.google.cloud.contentwarehouse.v1.FileTypeFilter fileTypeFilter_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.FileTypeFilter, + com.google.cloud.contentwarehouse.v1.FileTypeFilter.Builder, + com.google.cloud.contentwarehouse.v1.FileTypeFilterOrBuilder> + fileTypeFilterBuilder_; + /** + * + * + *
+     * This filter specifies the types of files to return: ALL, FOLDER, or FILE.
+     * If FOLDER or FILE is specified, then only either folders or files will be
+     * returned, respectively. If ALL is specified, both folders and files will be
+     * returned.
+     * If no value is specified, ALL files will be returned.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.FileTypeFilter file_type_filter = 8; + * + * @return Whether the fileTypeFilter field is set. + */ + public boolean hasFileTypeFilter() { + return fileTypeFilterBuilder_ != null || fileTypeFilter_ != null; + } + /** + * + * + *
+     * This filter specifies the types of files to return: ALL, FOLDER, or FILE.
+     * If FOLDER or FILE is specified, then only either folders or files will be
+     * returned, respectively. If ALL is specified, both folders and files will be
+     * returned.
+     * If no value is specified, ALL files will be returned.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.FileTypeFilter file_type_filter = 8; + * + * @return The fileTypeFilter. + */ + public com.google.cloud.contentwarehouse.v1.FileTypeFilter getFileTypeFilter() { + if (fileTypeFilterBuilder_ == null) { + return fileTypeFilter_ == null + ? com.google.cloud.contentwarehouse.v1.FileTypeFilter.getDefaultInstance() + : fileTypeFilter_; + } else { + return fileTypeFilterBuilder_.getMessage(); + } + } + /** + * + * + *
+     * This filter specifies the types of files to return: ALL, FOLDER, or FILE.
+     * If FOLDER or FILE is specified, then only either folders or files will be
+     * returned, respectively. If ALL is specified, both folders and files will be
+     * returned.
+     * If no value is specified, ALL files will be returned.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.FileTypeFilter file_type_filter = 8; + */ + public Builder setFileTypeFilter(com.google.cloud.contentwarehouse.v1.FileTypeFilter value) { + if (fileTypeFilterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + fileTypeFilter_ = value; + onChanged(); + } else { + fileTypeFilterBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * This filter specifies the types of files to return: ALL, FOLDER, or FILE.
+     * If FOLDER or FILE is specified, then only either folders or files will be
+     * returned, respectively. If ALL is specified, both folders and files will be
+     * returned.
+     * If no value is specified, ALL files will be returned.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.FileTypeFilter file_type_filter = 8; + */ + public Builder setFileTypeFilter( + com.google.cloud.contentwarehouse.v1.FileTypeFilter.Builder builderForValue) { + if (fileTypeFilterBuilder_ == null) { + fileTypeFilter_ = builderForValue.build(); + onChanged(); + } else { + fileTypeFilterBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * This filter specifies the types of files to return: ALL, FOLDER, or FILE.
+     * If FOLDER or FILE is specified, then only either folders or files will be
+     * returned, respectively. If ALL is specified, both folders and files will be
+     * returned.
+     * If no value is specified, ALL files will be returned.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.FileTypeFilter file_type_filter = 8; + */ + public Builder mergeFileTypeFilter(com.google.cloud.contentwarehouse.v1.FileTypeFilter value) { + if (fileTypeFilterBuilder_ == null) { + if (fileTypeFilter_ != null) { + fileTypeFilter_ = + com.google.cloud.contentwarehouse.v1.FileTypeFilter.newBuilder(fileTypeFilter_) + .mergeFrom(value) + .buildPartial(); + } else { + fileTypeFilter_ = value; + } + onChanged(); + } else { + fileTypeFilterBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * This filter specifies the types of files to return: ALL, FOLDER, or FILE.
+     * If FOLDER or FILE is specified, then only either folders or files will be
+     * returned, respectively. If ALL is specified, both folders and files will be
+     * returned.
+     * If no value is specified, ALL files will be returned.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.FileTypeFilter file_type_filter = 8; + */ + public Builder clearFileTypeFilter() { + if (fileTypeFilterBuilder_ == null) { + fileTypeFilter_ = null; + onChanged(); + } else { + fileTypeFilter_ = null; + fileTypeFilterBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * This filter specifies the types of files to return: ALL, FOLDER, or FILE.
+     * If FOLDER or FILE is specified, then only either folders or files will be
+     * returned, respectively. If ALL is specified, both folders and files will be
+     * returned.
+     * If no value is specified, ALL files will be returned.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.FileTypeFilter file_type_filter = 8; + */ + public com.google.cloud.contentwarehouse.v1.FileTypeFilter.Builder getFileTypeFilterBuilder() { + + onChanged(); + return getFileTypeFilterFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * This filter specifies the types of files to return: ALL, FOLDER, or FILE.
+     * If FOLDER or FILE is specified, then only either folders or files will be
+     * returned, respectively. If ALL is specified, both folders and files will be
+     * returned.
+     * If no value is specified, ALL files will be returned.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.FileTypeFilter file_type_filter = 8; + */ + public com.google.cloud.contentwarehouse.v1.FileTypeFilterOrBuilder + getFileTypeFilterOrBuilder() { + if (fileTypeFilterBuilder_ != null) { + return fileTypeFilterBuilder_.getMessageOrBuilder(); + } else { + return fileTypeFilter_ == null + ? com.google.cloud.contentwarehouse.v1.FileTypeFilter.getDefaultInstance() + : fileTypeFilter_; + } + } + /** + * + * + *
+     * This filter specifies the types of files to return: ALL, FOLDER, or FILE.
+     * If FOLDER or FILE is specified, then only either folders or files will be
+     * returned, respectively. If ALL is specified, both folders and files will be
+     * returned.
+     * If no value is specified, ALL files will be returned.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.FileTypeFilter file_type_filter = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.FileTypeFilter, + com.google.cloud.contentwarehouse.v1.FileTypeFilter.Builder, + com.google.cloud.contentwarehouse.v1.FileTypeFilterOrBuilder> + getFileTypeFilterFieldBuilder() { + if (fileTypeFilterBuilder_ == null) { + fileTypeFilterBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.FileTypeFilter, + com.google.cloud.contentwarehouse.v1.FileTypeFilter.Builder, + com.google.cloud.contentwarehouse.v1.FileTypeFilterOrBuilder>( + getFileTypeFilter(), getParentForChildren(), isClean()); + fileTypeFilter_ = null; + } + return fileTypeFilterBuilder_; + } + + private java.lang.Object folderNameFilter_ = ""; + /** + * + * + *
+     * Search all the documents under this specified folder.
+     * Format:
+     * projects/{project_number}/locations/{location}/documents/{document_id}.
+     * 
+ * + * string folder_name_filter = 9; + * + * @return The folderNameFilter. + */ + public java.lang.String getFolderNameFilter() { + java.lang.Object ref = folderNameFilter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + folderNameFilter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Search all the documents under this specified folder.
+     * Format:
+     * projects/{project_number}/locations/{location}/documents/{document_id}.
+     * 
+ * + * string folder_name_filter = 9; + * + * @return The bytes for folderNameFilter. + */ + public com.google.protobuf.ByteString getFolderNameFilterBytes() { + java.lang.Object ref = folderNameFilter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + folderNameFilter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Search all the documents under this specified folder.
+     * Format:
+     * projects/{project_number}/locations/{location}/documents/{document_id}.
+     * 
+ * + * string folder_name_filter = 9; + * + * @param value The folderNameFilter to set. + * @return This builder for chaining. + */ + public Builder setFolderNameFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + folderNameFilter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Search all the documents under this specified folder.
+     * Format:
+     * projects/{project_number}/locations/{location}/documents/{document_id}.
+     * 
+ * + * string folder_name_filter = 9; + * + * @return This builder for chaining. + */ + public Builder clearFolderNameFilter() { + + folderNameFilter_ = getDefaultInstance().getFolderNameFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * Search all the documents under this specified folder.
+     * Format:
+     * projects/{project_number}/locations/{location}/documents/{document_id}.
+     * 
+ * + * string folder_name_filter = 9; + * + * @param value The bytes for folderNameFilter to set. + * @return This builder for chaining. + */ + public Builder setFolderNameFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + folderNameFilter_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList queryContext_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureQueryContextIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + queryContext_ = new com.google.protobuf.LazyStringArrayList(queryContext_); + bitField0_ |= 0x00000008; + } + } + /** + * + * + *
+     * For custom synonyms.
+     * Customers provide the synonyms based on context. One customer can provide
+     * multiple set of synonyms based on different context. The search query will
+     * be expanded based on the custom synonyms of the query context set.
+     * By default, no custom synonyms wll be applied if no query context is
+     * provided.
+     * It is not supported for CMEK compliant deployment.
+     * 
+ * + * repeated string query_context = 10; + * + * @return A list containing the queryContext. + */ + public com.google.protobuf.ProtocolStringList getQueryContextList() { + return queryContext_.getUnmodifiableView(); + } + /** + * + * + *
+     * For custom synonyms.
+     * Customers provide the synonyms based on context. One customer can provide
+     * multiple set of synonyms based on different context. The search query will
+     * be expanded based on the custom synonyms of the query context set.
+     * By default, no custom synonyms wll be applied if no query context is
+     * provided.
+     * It is not supported for CMEK compliant deployment.
+     * 
+ * + * repeated string query_context = 10; + * + * @return The count of queryContext. + */ + public int getQueryContextCount() { + return queryContext_.size(); + } + /** + * + * + *
+     * For custom synonyms.
+     * Customers provide the synonyms based on context. One customer can provide
+     * multiple set of synonyms based on different context. The search query will
+     * be expanded based on the custom synonyms of the query context set.
+     * By default, no custom synonyms wll be applied if no query context is
+     * provided.
+     * It is not supported for CMEK compliant deployment.
+     * 
+ * + * repeated string query_context = 10; + * + * @param index The index of the element to return. + * @return The queryContext at the given index. + */ + public java.lang.String getQueryContext(int index) { + return queryContext_.get(index); + } + /** + * + * + *
+     * For custom synonyms.
+     * Customers provide the synonyms based on context. One customer can provide
+     * multiple set of synonyms based on different context. The search query will
+     * be expanded based on the custom synonyms of the query context set.
+     * By default, no custom synonyms wll be applied if no query context is
+     * provided.
+     * It is not supported for CMEK compliant deployment.
+     * 
+ * + * repeated string query_context = 10; + * + * @param index The index of the value to return. + * @return The bytes of the queryContext at the given index. + */ + public com.google.protobuf.ByteString getQueryContextBytes(int index) { + return queryContext_.getByteString(index); + } + /** + * + * + *
+     * For custom synonyms.
+     * Customers provide the synonyms based on context. One customer can provide
+     * multiple set of synonyms based on different context. The search query will
+     * be expanded based on the custom synonyms of the query context set.
+     * By default, no custom synonyms wll be applied if no query context is
+     * provided.
+     * It is not supported for CMEK compliant deployment.
+     * 
+ * + * repeated string query_context = 10; + * + * @param index The index to set the value at. + * @param value The queryContext to set. + * @return This builder for chaining. + */ + public Builder setQueryContext(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureQueryContextIsMutable(); + queryContext_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * For custom synonyms.
+     * Customers provide the synonyms based on context. One customer can provide
+     * multiple set of synonyms based on different context. The search query will
+     * be expanded based on the custom synonyms of the query context set.
+     * By default, no custom synonyms wll be applied if no query context is
+     * provided.
+     * It is not supported for CMEK compliant deployment.
+     * 
+ * + * repeated string query_context = 10; + * + * @param value The queryContext to add. + * @return This builder for chaining. + */ + public Builder addQueryContext(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureQueryContextIsMutable(); + queryContext_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * For custom synonyms.
+     * Customers provide the synonyms based on context. One customer can provide
+     * multiple set of synonyms based on different context. The search query will
+     * be expanded based on the custom synonyms of the query context set.
+     * By default, no custom synonyms wll be applied if no query context is
+     * provided.
+     * It is not supported for CMEK compliant deployment.
+     * 
+ * + * repeated string query_context = 10; + * + * @param values The queryContext to add. + * @return This builder for chaining. + */ + public Builder addAllQueryContext(java.lang.Iterable values) { + ensureQueryContextIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, queryContext_); + onChanged(); + return this; + } + /** + * + * + *
+     * For custom synonyms.
+     * Customers provide the synonyms based on context. One customer can provide
+     * multiple set of synonyms based on different context. The search query will
+     * be expanded based on the custom synonyms of the query context set.
+     * By default, no custom synonyms wll be applied if no query context is
+     * provided.
+     * It is not supported for CMEK compliant deployment.
+     * 
+ * + * repeated string query_context = 10; + * + * @return This builder for chaining. + */ + public Builder clearQueryContext() { + queryContext_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * For custom synonyms.
+     * Customers provide the synonyms based on context. One customer can provide
+     * multiple set of synonyms based on different context. The search query will
+     * be expanded based on the custom synonyms of the query context set.
+     * By default, no custom synonyms wll be applied if no query context is
+     * provided.
+     * It is not supported for CMEK compliant deployment.
+     * 
+ * + * repeated string query_context = 10; + * + * @param value The bytes of the queryContext to add. + * @return This builder for chaining. + */ + public Builder addQueryContextBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureQueryContextIsMutable(); + queryContext_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList documentCreatorFilter_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureDocumentCreatorFilterIsMutable() { + if (!((bitField0_ & 0x00000010) != 0)) { + documentCreatorFilter_ = + new com.google.protobuf.LazyStringArrayList(documentCreatorFilter_); + bitField0_ |= 0x00000010; + } + } + /** + * + * + *
+     * The exact creator(s) of the documents to search against.
+     * If a value isn't specified, documents within the search results are
+     * associated with any creator. If multiple values are specified, documents
+     * within the search results may be associated with any of the specified
+     * creators.
+     * 
+ * + * repeated string document_creator_filter = 11; + * + * @return A list containing the documentCreatorFilter. + */ + public com.google.protobuf.ProtocolStringList getDocumentCreatorFilterList() { + return documentCreatorFilter_.getUnmodifiableView(); + } + /** + * + * + *
+     * The exact creator(s) of the documents to search against.
+     * If a value isn't specified, documents within the search results are
+     * associated with any creator. If multiple values are specified, documents
+     * within the search results may be associated with any of the specified
+     * creators.
+     * 
+ * + * repeated string document_creator_filter = 11; + * + * @return The count of documentCreatorFilter. + */ + public int getDocumentCreatorFilterCount() { + return documentCreatorFilter_.size(); + } + /** + * + * + *
+     * The exact creator(s) of the documents to search against.
+     * If a value isn't specified, documents within the search results are
+     * associated with any creator. If multiple values are specified, documents
+     * within the search results may be associated with any of the specified
+     * creators.
+     * 
+ * + * repeated string document_creator_filter = 11; + * + * @param index The index of the element to return. + * @return The documentCreatorFilter at the given index. + */ + public java.lang.String getDocumentCreatorFilter(int index) { + return documentCreatorFilter_.get(index); + } + /** + * + * + *
+     * The exact creator(s) of the documents to search against.
+     * If a value isn't specified, documents within the search results are
+     * associated with any creator. If multiple values are specified, documents
+     * within the search results may be associated with any of the specified
+     * creators.
+     * 
+ * + * repeated string document_creator_filter = 11; + * + * @param index The index of the value to return. + * @return The bytes of the documentCreatorFilter at the given index. + */ + public com.google.protobuf.ByteString getDocumentCreatorFilterBytes(int index) { + return documentCreatorFilter_.getByteString(index); + } + /** + * + * + *
+     * The exact creator(s) of the documents to search against.
+     * If a value isn't specified, documents within the search results are
+     * associated with any creator. If multiple values are specified, documents
+     * within the search results may be associated with any of the specified
+     * creators.
+     * 
+ * + * repeated string document_creator_filter = 11; + * + * @param index The index to set the value at. + * @param value The documentCreatorFilter to set. + * @return This builder for chaining. + */ + public Builder setDocumentCreatorFilter(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDocumentCreatorFilterIsMutable(); + documentCreatorFilter_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The exact creator(s) of the documents to search against.
+     * If a value isn't specified, documents within the search results are
+     * associated with any creator. If multiple values are specified, documents
+     * within the search results may be associated with any of the specified
+     * creators.
+     * 
+ * + * repeated string document_creator_filter = 11; + * + * @param value The documentCreatorFilter to add. + * @return This builder for chaining. + */ + public Builder addDocumentCreatorFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDocumentCreatorFilterIsMutable(); + documentCreatorFilter_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The exact creator(s) of the documents to search against.
+     * If a value isn't specified, documents within the search results are
+     * associated with any creator. If multiple values are specified, documents
+     * within the search results may be associated with any of the specified
+     * creators.
+     * 
+ * + * repeated string document_creator_filter = 11; + * + * @param values The documentCreatorFilter to add. + * @return This builder for chaining. + */ + public Builder addAllDocumentCreatorFilter(java.lang.Iterable values) { + ensureDocumentCreatorFilterIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, documentCreatorFilter_); + onChanged(); + return this; + } + /** + * + * + *
+     * The exact creator(s) of the documents to search against.
+     * If a value isn't specified, documents within the search results are
+     * associated with any creator. If multiple values are specified, documents
+     * within the search results may be associated with any of the specified
+     * creators.
+     * 
+ * + * repeated string document_creator_filter = 11; + * + * @return This builder for chaining. + */ + public Builder clearDocumentCreatorFilter() { + documentCreatorFilter_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * The exact creator(s) of the documents to search against.
+     * If a value isn't specified, documents within the search results are
+     * associated with any creator. If multiple values are specified, documents
+     * within the search results may be associated with any of the specified
+     * creators.
+     * 
+ * + * repeated string document_creator_filter = 11; + * + * @param value The bytes of the documentCreatorFilter to add. + * @return This builder for chaining. + */ + public Builder addDocumentCreatorFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureDocumentCreatorFilterIsMutable(); + documentCreatorFilter_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.DocumentQuery) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.DocumentQuery) + private static final com.google.cloud.contentwarehouse.v1.DocumentQuery DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.DocumentQuery(); + } + + public static com.google.cloud.contentwarehouse.v1.DocumentQuery getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DocumentQuery parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DocumentQuery getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentQueryOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentQueryOrBuilder.java new file mode 100644 index 000000000000..11a07f7d49b8 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentQueryOrBuilder.java @@ -0,0 +1,546 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/filters.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface DocumentQueryOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.DocumentQuery) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The query string that matches against the full text of the document and
+   * the searchable properties.
+   * The maximum number of allowed characters is 255.
+   * 
+ * + * string query = 1; + * + * @return The query. + */ + java.lang.String getQuery(); + /** + * + * + *
+   * The query string that matches against the full text of the document and
+   * the searchable properties.
+   * The maximum number of allowed characters is 255.
+   * 
+ * + * string query = 1; + * + * @return The bytes for query. + */ + com.google.protobuf.ByteString getQueryBytes(); + + /** + * + * + *
+   * Experimental, do not use.
+   * If the query is a natural language question. False by default. If true,
+   * then the question-answering feature will be used instead of search, and
+   * `result_count` in [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest] must be set. In addition, all
+   * other input fields related to search (pagination, histograms, etc.) will be
+   * ignored.
+   * 
+ * + * bool is_nl_query = 12; + * + * @return The isNlQuery. + */ + boolean getIsNlQuery(); + + /** + * + * + *
+   * This filter specifies a structured syntax to match against the
+   * [PropertyDefinition].[is_filterable][] marked as `true`. The syntax for
+   * this expression is a subset of SQL syntax.
+   * Supported operators are: `=`, `!=`, `<`, `<=`, `>`, and `>=` where the left
+   * of the operator is a property name and the right of the operator is a
+   * number or a quoted string. You must escape backslash (\\) and quote (\")
+   * characters. Supported functions are `LOWER([property_name])` to perform a
+   * case insensitive match and `EMPTY([property_name])` to filter on the
+   * existence of a key.
+   * Boolean expressions (AND/OR/NOT) are supported up to 3 levels of nesting
+   * (for example, "((A AND B AND C) OR NOT D) AND E"), a maximum of 100
+   * comparisons or functions are allowed in the expression. The expression must
+   * be < 6000 bytes in length.
+   * Sample Query:
+   * `(LOWER(driving_license)="class \"a\"" OR EMPTY(driving_license)) AND
+   * driving_years > 10`
+   * 
+ * + * string custom_property_filter = 4 [deprecated = true]; + * + * @deprecated google.cloud.contentwarehouse.v1.DocumentQuery.custom_property_filter is + * deprecated. See google/cloud/contentwarehouse/v1/filters.proto;l=59 + * @return The customPropertyFilter. + */ + @java.lang.Deprecated + java.lang.String getCustomPropertyFilter(); + /** + * + * + *
+   * This filter specifies a structured syntax to match against the
+   * [PropertyDefinition].[is_filterable][] marked as `true`. The syntax for
+   * this expression is a subset of SQL syntax.
+   * Supported operators are: `=`, `!=`, `<`, `<=`, `>`, and `>=` where the left
+   * of the operator is a property name and the right of the operator is a
+   * number or a quoted string. You must escape backslash (\\) and quote (\")
+   * characters. Supported functions are `LOWER([property_name])` to perform a
+   * case insensitive match and `EMPTY([property_name])` to filter on the
+   * existence of a key.
+   * Boolean expressions (AND/OR/NOT) are supported up to 3 levels of nesting
+   * (for example, "((A AND B AND C) OR NOT D) AND E"), a maximum of 100
+   * comparisons or functions are allowed in the expression. The expression must
+   * be < 6000 bytes in length.
+   * Sample Query:
+   * `(LOWER(driving_license)="class \"a\"" OR EMPTY(driving_license)) AND
+   * driving_years > 10`
+   * 
+ * + * string custom_property_filter = 4 [deprecated = true]; + * + * @deprecated google.cloud.contentwarehouse.v1.DocumentQuery.custom_property_filter is + * deprecated. See google/cloud/contentwarehouse/v1/filters.proto;l=59 + * @return The bytes for customPropertyFilter. + */ + @java.lang.Deprecated + com.google.protobuf.ByteString getCustomPropertyFilterBytes(); + + /** + * + * + *
+   * Documents created/updated within a range specified by this filter are
+   * searched against.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.TimeFilter time_filters = 5; + */ + java.util.List getTimeFiltersList(); + /** + * + * + *
+   * Documents created/updated within a range specified by this filter are
+   * searched against.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.TimeFilter time_filters = 5; + */ + com.google.cloud.contentwarehouse.v1.TimeFilter getTimeFilters(int index); + /** + * + * + *
+   * Documents created/updated within a range specified by this filter are
+   * searched against.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.TimeFilter time_filters = 5; + */ + int getTimeFiltersCount(); + /** + * + * + *
+   * Documents created/updated within a range specified by this filter are
+   * searched against.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.TimeFilter time_filters = 5; + */ + java.util.List + getTimeFiltersOrBuilderList(); + /** + * + * + *
+   * Documents created/updated within a range specified by this filter are
+   * searched against.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.TimeFilter time_filters = 5; + */ + com.google.cloud.contentwarehouse.v1.TimeFilterOrBuilder getTimeFiltersOrBuilder(int index); + + /** + * + * + *
+   * This filter specifies the exact document schema
+   * [Document.document_schema_name][google.cloud.contentwarehouse.v1.Document.document_schema_name] of the documents to search against.
+   * If a value isn't specified, documents within the search results are
+   * associated with any schema. If multiple values are specified, documents
+   * within the search results may be associated with any of the specified
+   * schemas.
+   * At most 20 document schema names are allowed.
+   * 
+ * + * repeated string document_schema_names = 6; + * + * @return A list containing the documentSchemaNames. + */ + java.util.List getDocumentSchemaNamesList(); + /** + * + * + *
+   * This filter specifies the exact document schema
+   * [Document.document_schema_name][google.cloud.contentwarehouse.v1.Document.document_schema_name] of the documents to search against.
+   * If a value isn't specified, documents within the search results are
+   * associated with any schema. If multiple values are specified, documents
+   * within the search results may be associated with any of the specified
+   * schemas.
+   * At most 20 document schema names are allowed.
+   * 
+ * + * repeated string document_schema_names = 6; + * + * @return The count of documentSchemaNames. + */ + int getDocumentSchemaNamesCount(); + /** + * + * + *
+   * This filter specifies the exact document schema
+   * [Document.document_schema_name][google.cloud.contentwarehouse.v1.Document.document_schema_name] of the documents to search against.
+   * If a value isn't specified, documents within the search results are
+   * associated with any schema. If multiple values are specified, documents
+   * within the search results may be associated with any of the specified
+   * schemas.
+   * At most 20 document schema names are allowed.
+   * 
+ * + * repeated string document_schema_names = 6; + * + * @param index The index of the element to return. + * @return The documentSchemaNames at the given index. + */ + java.lang.String getDocumentSchemaNames(int index); + /** + * + * + *
+   * This filter specifies the exact document schema
+   * [Document.document_schema_name][google.cloud.contentwarehouse.v1.Document.document_schema_name] of the documents to search against.
+   * If a value isn't specified, documents within the search results are
+   * associated with any schema. If multiple values are specified, documents
+   * within the search results may be associated with any of the specified
+   * schemas.
+   * At most 20 document schema names are allowed.
+   * 
+ * + * repeated string document_schema_names = 6; + * + * @param index The index of the value to return. + * @return The bytes of the documentSchemaNames at the given index. + */ + com.google.protobuf.ByteString getDocumentSchemaNamesBytes(int index); + + /** + * + * + *
+   * This filter specifies a structured syntax to match against the
+   * [PropertyDefinition.is_filterable][google.cloud.contentwarehouse.v1.PropertyDefinition.is_filterable] marked as `true`. The relationship
+   * between the PropertyFilters is OR.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.PropertyFilter property_filter = 7; + */ + java.util.List getPropertyFilterList(); + /** + * + * + *
+   * This filter specifies a structured syntax to match against the
+   * [PropertyDefinition.is_filterable][google.cloud.contentwarehouse.v1.PropertyDefinition.is_filterable] marked as `true`. The relationship
+   * between the PropertyFilters is OR.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.PropertyFilter property_filter = 7; + */ + com.google.cloud.contentwarehouse.v1.PropertyFilter getPropertyFilter(int index); + /** + * + * + *
+   * This filter specifies a structured syntax to match against the
+   * [PropertyDefinition.is_filterable][google.cloud.contentwarehouse.v1.PropertyDefinition.is_filterable] marked as `true`. The relationship
+   * between the PropertyFilters is OR.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.PropertyFilter property_filter = 7; + */ + int getPropertyFilterCount(); + /** + * + * + *
+   * This filter specifies a structured syntax to match against the
+   * [PropertyDefinition.is_filterable][google.cloud.contentwarehouse.v1.PropertyDefinition.is_filterable] marked as `true`. The relationship
+   * between the PropertyFilters is OR.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.PropertyFilter property_filter = 7; + */ + java.util.List + getPropertyFilterOrBuilderList(); + /** + * + * + *
+   * This filter specifies a structured syntax to match against the
+   * [PropertyDefinition.is_filterable][google.cloud.contentwarehouse.v1.PropertyDefinition.is_filterable] marked as `true`. The relationship
+   * between the PropertyFilters is OR.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.PropertyFilter property_filter = 7; + */ + com.google.cloud.contentwarehouse.v1.PropertyFilterOrBuilder getPropertyFilterOrBuilder( + int index); + + /** + * + * + *
+   * This filter specifies the types of files to return: ALL, FOLDER, or FILE.
+   * If FOLDER or FILE is specified, then only either folders or files will be
+   * returned, respectively. If ALL is specified, both folders and files will be
+   * returned.
+   * If no value is specified, ALL files will be returned.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.FileTypeFilter file_type_filter = 8; + * + * @return Whether the fileTypeFilter field is set. + */ + boolean hasFileTypeFilter(); + /** + * + * + *
+   * This filter specifies the types of files to return: ALL, FOLDER, or FILE.
+   * If FOLDER or FILE is specified, then only either folders or files will be
+   * returned, respectively. If ALL is specified, both folders and files will be
+   * returned.
+   * If no value is specified, ALL files will be returned.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.FileTypeFilter file_type_filter = 8; + * + * @return The fileTypeFilter. + */ + com.google.cloud.contentwarehouse.v1.FileTypeFilter getFileTypeFilter(); + /** + * + * + *
+   * This filter specifies the types of files to return: ALL, FOLDER, or FILE.
+   * If FOLDER or FILE is specified, then only either folders or files will be
+   * returned, respectively. If ALL is specified, both folders and files will be
+   * returned.
+   * If no value is specified, ALL files will be returned.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.FileTypeFilter file_type_filter = 8; + */ + com.google.cloud.contentwarehouse.v1.FileTypeFilterOrBuilder getFileTypeFilterOrBuilder(); + + /** + * + * + *
+   * Search all the documents under this specified folder.
+   * Format:
+   * projects/{project_number}/locations/{location}/documents/{document_id}.
+   * 
+ * + * string folder_name_filter = 9; + * + * @return The folderNameFilter. + */ + java.lang.String getFolderNameFilter(); + /** + * + * + *
+   * Search all the documents under this specified folder.
+   * Format:
+   * projects/{project_number}/locations/{location}/documents/{document_id}.
+   * 
+ * + * string folder_name_filter = 9; + * + * @return The bytes for folderNameFilter. + */ + com.google.protobuf.ByteString getFolderNameFilterBytes(); + + /** + * + * + *
+   * For custom synonyms.
+   * Customers provide the synonyms based on context. One customer can provide
+   * multiple set of synonyms based on different context. The search query will
+   * be expanded based on the custom synonyms of the query context set.
+   * By default, no custom synonyms wll be applied if no query context is
+   * provided.
+   * It is not supported for CMEK compliant deployment.
+   * 
+ * + * repeated string query_context = 10; + * + * @return A list containing the queryContext. + */ + java.util.List getQueryContextList(); + /** + * + * + *
+   * For custom synonyms.
+   * Customers provide the synonyms based on context. One customer can provide
+   * multiple set of synonyms based on different context. The search query will
+   * be expanded based on the custom synonyms of the query context set.
+   * By default, no custom synonyms wll be applied if no query context is
+   * provided.
+   * It is not supported for CMEK compliant deployment.
+   * 
+ * + * repeated string query_context = 10; + * + * @return The count of queryContext. + */ + int getQueryContextCount(); + /** + * + * + *
+   * For custom synonyms.
+   * Customers provide the synonyms based on context. One customer can provide
+   * multiple set of synonyms based on different context. The search query will
+   * be expanded based on the custom synonyms of the query context set.
+   * By default, no custom synonyms wll be applied if no query context is
+   * provided.
+   * It is not supported for CMEK compliant deployment.
+   * 
+ * + * repeated string query_context = 10; + * + * @param index The index of the element to return. + * @return The queryContext at the given index. + */ + java.lang.String getQueryContext(int index); + /** + * + * + *
+   * For custom synonyms.
+   * Customers provide the synonyms based on context. One customer can provide
+   * multiple set of synonyms based on different context. The search query will
+   * be expanded based on the custom synonyms of the query context set.
+   * By default, no custom synonyms wll be applied if no query context is
+   * provided.
+   * It is not supported for CMEK compliant deployment.
+   * 
+ * + * repeated string query_context = 10; + * + * @param index The index of the value to return. + * @return The bytes of the queryContext at the given index. + */ + com.google.protobuf.ByteString getQueryContextBytes(int index); + + /** + * + * + *
+   * The exact creator(s) of the documents to search against.
+   * If a value isn't specified, documents within the search results are
+   * associated with any creator. If multiple values are specified, documents
+   * within the search results may be associated with any of the specified
+   * creators.
+   * 
+ * + * repeated string document_creator_filter = 11; + * + * @return A list containing the documentCreatorFilter. + */ + java.util.List getDocumentCreatorFilterList(); + /** + * + * + *
+   * The exact creator(s) of the documents to search against.
+   * If a value isn't specified, documents within the search results are
+   * associated with any creator. If multiple values are specified, documents
+   * within the search results may be associated with any of the specified
+   * creators.
+   * 
+ * + * repeated string document_creator_filter = 11; + * + * @return The count of documentCreatorFilter. + */ + int getDocumentCreatorFilterCount(); + /** + * + * + *
+   * The exact creator(s) of the documents to search against.
+   * If a value isn't specified, documents within the search results are
+   * associated with any creator. If multiple values are specified, documents
+   * within the search results may be associated with any of the specified
+   * creators.
+   * 
+ * + * repeated string document_creator_filter = 11; + * + * @param index The index of the element to return. + * @return The documentCreatorFilter at the given index. + */ + java.lang.String getDocumentCreatorFilter(int index); + /** + * + * + *
+   * The exact creator(s) of the documents to search against.
+   * If a value isn't specified, documents within the search results are
+   * associated with any creator. If multiple values are specified, documents
+   * within the search results may be associated with any of the specified
+   * creators.
+   * 
+ * + * repeated string document_creator_filter = 11; + * + * @param index The index of the value to return. + * @return The bytes of the documentCreatorFilter at the given index. + */ + com.google.protobuf.ByteString getDocumentCreatorFilterBytes(int index); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentReference.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentReference.java new file mode 100644 index 000000000000..5caa29b7db05 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentReference.java @@ -0,0 +1,1957 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * References to the documents.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.DocumentReference} + */ +public final class DocumentReference extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.DocumentReference) + DocumentReferenceOrBuilder { + private static final long serialVersionUID = 0L; + // Use DocumentReference.newBuilder() to construct. + private DocumentReference(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DocumentReference() { + documentName_ = ""; + displayName_ = ""; + snippet_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DocumentReference(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_DocumentReference_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_DocumentReference_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.DocumentReference.class, + com.google.cloud.contentwarehouse.v1.DocumentReference.Builder.class); + } + + public static final int DOCUMENT_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object documentName_; + /** + * + * + *
+   * Required. Name of the referenced document.
+   * 
+ * + * + * string document_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The documentName. + */ + @java.lang.Override + public java.lang.String getDocumentName() { + java.lang.Object ref = documentName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + documentName_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Name of the referenced document.
+   * 
+ * + * + * string document_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for documentName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDocumentNameBytes() { + java.lang.Object ref = documentName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + documentName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object displayName_; + /** + * + * + *
+   * display_name of the referenced document; this name does not need to be
+   * consistent to the display_name in the Document proto, depending on the ACL
+   * constraint.
+   * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * display_name of the referenced document; this name does not need to be
+   * consistent to the display_name in the Document proto, depending on the ACL
+   * constraint.
+   * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SNIPPET_FIELD_NUMBER = 3; + private volatile java.lang.Object snippet_; + /** + * + * + *
+   * Stores the subset of the referenced document's content.
+   * This is useful to allow user peek the information of the referenced
+   * document.
+   * 
+ * + * string snippet = 3; + * + * @return The snippet. + */ + @java.lang.Override + public java.lang.String getSnippet() { + java.lang.Object ref = snippet_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + snippet_ = s; + return s; + } + } + /** + * + * + *
+   * Stores the subset of the referenced document's content.
+   * This is useful to allow user peek the information of the referenced
+   * document.
+   * 
+ * + * string snippet = 3; + * + * @return The bytes for snippet. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSnippetBytes() { + java.lang.Object ref = snippet_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + snippet_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DOCUMENT_IS_FOLDER_FIELD_NUMBER = 4; + private boolean documentIsFolder_; + /** + * + * + *
+   * The document type of the document being referenced.
+   * 
+ * + * bool document_is_folder = 4; + * + * @return The documentIsFolder. + */ + @java.lang.Override + public boolean getDocumentIsFolder() { + return documentIsFolder_; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The time when the document is last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. The time when the document is last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Output only. The time when the document is last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The time when the document is created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. The time when the document is created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. The time when the document is created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int DELETE_TIME_FIELD_NUMBER = 7; + private com.google.protobuf.Timestamp deleteTime_; + /** + * + * + *
+   * Output only. The time when the document is deleted.
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the deleteTime field is set. + */ + @java.lang.Override + public boolean hasDeleteTime() { + return deleteTime_ != null; + } + /** + * + * + *
+   * Output only. The time when the document is deleted.
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The deleteTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getDeleteTime() { + return deleteTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : deleteTime_; + } + /** + * + * + *
+   * Output only. The time when the document is deleted.
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() { + return getDeleteTime(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(documentName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, documentName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(snippet_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, snippet_); + } + if (documentIsFolder_ != false) { + output.writeBool(4, documentIsFolder_); + } + if (updateTime_ != null) { + output.writeMessage(5, getUpdateTime()); + } + if (createTime_ != null) { + output.writeMessage(6, getCreateTime()); + } + if (deleteTime_ != null) { + output.writeMessage(7, getDeleteTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(documentName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, documentName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(snippet_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, snippet_); + } + if (documentIsFolder_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, documentIsFolder_); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getUpdateTime()); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getCreateTime()); + } + if (deleteTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getDeleteTime()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.DocumentReference)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.DocumentReference other = + (com.google.cloud.contentwarehouse.v1.DocumentReference) obj; + + if (!getDocumentName().equals(other.getDocumentName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getSnippet().equals(other.getSnippet())) return false; + if (getDocumentIsFolder() != other.getDocumentIsFolder()) return false; + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasDeleteTime() != other.hasDeleteTime()) return false; + if (hasDeleteTime()) { + if (!getDeleteTime().equals(other.getDeleteTime())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + DOCUMENT_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDocumentName().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + SNIPPET_FIELD_NUMBER; + hash = (53 * hash) + getSnippet().hashCode(); + hash = (37 * hash) + DOCUMENT_IS_FOLDER_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDocumentIsFolder()); + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasDeleteTime()) { + hash = (37 * hash) + DELETE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getDeleteTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.DocumentReference parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.DocumentReference parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DocumentReference parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.DocumentReference parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DocumentReference parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.DocumentReference parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DocumentReference parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.DocumentReference parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DocumentReference parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.DocumentReference parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DocumentReference parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.DocumentReference parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.DocumentReference prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * References to the documents.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.DocumentReference} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.DocumentReference) + com.google.cloud.contentwarehouse.v1.DocumentReferenceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_DocumentReference_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_DocumentReference_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.DocumentReference.class, + com.google.cloud.contentwarehouse.v1.DocumentReference.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.DocumentReference.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + documentName_ = ""; + + displayName_ = ""; + + snippet_ = ""; + + documentIsFolder_ = false; + + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (deleteTimeBuilder_ == null) { + deleteTime_ = null; + } else { + deleteTime_ = null; + deleteTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_DocumentReference_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DocumentReference getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.DocumentReference.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DocumentReference build() { + com.google.cloud.contentwarehouse.v1.DocumentReference result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DocumentReference buildPartial() { + com.google.cloud.contentwarehouse.v1.DocumentReference result = + new com.google.cloud.contentwarehouse.v1.DocumentReference(this); + result.documentName_ = documentName_; + result.displayName_ = displayName_; + result.snippet_ = snippet_; + result.documentIsFolder_ = documentIsFolder_; + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (deleteTimeBuilder_ == null) { + result.deleteTime_ = deleteTime_; + } else { + result.deleteTime_ = deleteTimeBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.DocumentReference) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.DocumentReference) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.DocumentReference other) { + if (other == com.google.cloud.contentwarehouse.v1.DocumentReference.getDefaultInstance()) + return this; + if (!other.getDocumentName().isEmpty()) { + documentName_ = other.documentName_; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (!other.getSnippet().isEmpty()) { + snippet_ = other.snippet_; + onChanged(); + } + if (other.getDocumentIsFolder() != false) { + setDocumentIsFolder(other.getDocumentIsFolder()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasDeleteTime()) { + mergeDeleteTime(other.getDeleteTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + documentName_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + displayName_ = input.readStringRequireUtf8(); + + break; + } // case 18 + case 26: + { + snippet_ = input.readStringRequireUtf8(); + + break; + } // case 26 + case 32: + { + documentIsFolder_ = input.readBool(); + + break; + } // case 32 + case 42: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 42 + case 50: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 50 + case 58: + { + input.readMessage(getDeleteTimeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 58 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object documentName_ = ""; + /** + * + * + *
+     * Required. Name of the referenced document.
+     * 
+ * + * + * string document_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The documentName. + */ + public java.lang.String getDocumentName() { + java.lang.Object ref = documentName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + documentName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Name of the referenced document.
+     * 
+ * + * + * string document_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for documentName. + */ + public com.google.protobuf.ByteString getDocumentNameBytes() { + java.lang.Object ref = documentName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + documentName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Name of the referenced document.
+     * 
+ * + * + * string document_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The documentName to set. + * @return This builder for chaining. + */ + public Builder setDocumentName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + documentName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the referenced document.
+     * 
+ * + * + * string document_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearDocumentName() { + + documentName_ = getDefaultInstance().getDocumentName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the referenced document.
+     * 
+ * + * + * string document_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for documentName to set. + * @return This builder for chaining. + */ + public Builder setDocumentNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + documentName_ = value; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * display_name of the referenced document; this name does not need to be
+     * consistent to the display_name in the Document proto, depending on the ACL
+     * constraint.
+     * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * display_name of the referenced document; this name does not need to be
+     * consistent to the display_name in the Document proto, depending on the ACL
+     * constraint.
+     * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * display_name of the referenced document; this name does not need to be
+     * consistent to the display_name in the Document proto, depending on the ACL
+     * constraint.
+     * 
+ * + * string display_name = 2; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * display_name of the referenced document; this name does not need to be
+     * consistent to the display_name in the Document proto, depending on the ACL
+     * constraint.
+     * 
+ * + * string display_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+     * display_name of the referenced document; this name does not need to be
+     * consistent to the display_name in the Document proto, depending on the ACL
+     * constraint.
+     * 
+ * + * string display_name = 2; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayName_ = value; + onChanged(); + return this; + } + + private java.lang.Object snippet_ = ""; + /** + * + * + *
+     * Stores the subset of the referenced document's content.
+     * This is useful to allow user peek the information of the referenced
+     * document.
+     * 
+ * + * string snippet = 3; + * + * @return The snippet. + */ + public java.lang.String getSnippet() { + java.lang.Object ref = snippet_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + snippet_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Stores the subset of the referenced document's content.
+     * This is useful to allow user peek the information of the referenced
+     * document.
+     * 
+ * + * string snippet = 3; + * + * @return The bytes for snippet. + */ + public com.google.protobuf.ByteString getSnippetBytes() { + java.lang.Object ref = snippet_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + snippet_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Stores the subset of the referenced document's content.
+     * This is useful to allow user peek the information of the referenced
+     * document.
+     * 
+ * + * string snippet = 3; + * + * @param value The snippet to set. + * @return This builder for chaining. + */ + public Builder setSnippet(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + snippet_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Stores the subset of the referenced document's content.
+     * This is useful to allow user peek the information of the referenced
+     * document.
+     * 
+ * + * string snippet = 3; + * + * @return This builder for chaining. + */ + public Builder clearSnippet() { + + snippet_ = getDefaultInstance().getSnippet(); + onChanged(); + return this; + } + /** + * + * + *
+     * Stores the subset of the referenced document's content.
+     * This is useful to allow user peek the information of the referenced
+     * document.
+     * 
+ * + * string snippet = 3; + * + * @param value The bytes for snippet to set. + * @return This builder for chaining. + */ + public Builder setSnippetBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + snippet_ = value; + onChanged(); + return this; + } + + private boolean documentIsFolder_; + /** + * + * + *
+     * The document type of the document being referenced.
+     * 
+ * + * bool document_is_folder = 4; + * + * @return The documentIsFolder. + */ + @java.lang.Override + public boolean getDocumentIsFolder() { + return documentIsFolder_; + } + /** + * + * + *
+     * The document type of the document being referenced.
+     * 
+ * + * bool document_is_folder = 4; + * + * @param value The documentIsFolder to set. + * @return This builder for chaining. + */ + public Builder setDocumentIsFolder(boolean value) { + + documentIsFolder_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The document type of the document being referenced.
+     * 
+ * + * bool document_is_folder = 4; + * + * @return This builder for chaining. + */ + public Builder clearDocumentIsFolder() { + + documentIsFolder_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. The time when the document is last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * Output only. The time when the document is last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The time when the document is last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + onChanged(); + } else { + updateTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time when the document is last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The time when the document is last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (updateTime_ != null) { + updateTime_ = + com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); + } else { + updateTime_ = value; + } + onChanged(); + } else { + updateTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time when the document is last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The time when the document is last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time when the document is last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Output only. The time when the document is last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. The time when the document is created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Output only. The time when the document is created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The time when the document is created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time when the document is created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The time when the document is created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time when the document is created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The time when the document is created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time when the document is created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. The time when the document is created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp deleteTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + deleteTimeBuilder_; + /** + * + * + *
+     * Output only. The time when the document is deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the deleteTime field is set. + */ + public boolean hasDeleteTime() { + return deleteTimeBuilder_ != null || deleteTime_ != null; + } + /** + * + * + *
+     * Output only. The time when the document is deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The deleteTime. + */ + public com.google.protobuf.Timestamp getDeleteTime() { + if (deleteTimeBuilder_ == null) { + return deleteTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : deleteTime_; + } else { + return deleteTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The time when the document is deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDeleteTime(com.google.protobuf.Timestamp value) { + if (deleteTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + deleteTime_ = value; + onChanged(); + } else { + deleteTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time when the document is deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDeleteTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (deleteTimeBuilder_ == null) { + deleteTime_ = builderForValue.build(); + onChanged(); + } else { + deleteTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The time when the document is deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeDeleteTime(com.google.protobuf.Timestamp value) { + if (deleteTimeBuilder_ == null) { + if (deleteTime_ != null) { + deleteTime_ = + com.google.protobuf.Timestamp.newBuilder(deleteTime_).mergeFrom(value).buildPartial(); + } else { + deleteTime_ = value; + } + onChanged(); + } else { + deleteTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time when the document is deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearDeleteTime() { + if (deleteTimeBuilder_ == null) { + deleteTime_ = null; + onChanged(); + } else { + deleteTime_ = null; + deleteTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The time when the document is deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getDeleteTimeBuilder() { + + onChanged(); + return getDeleteTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time when the document is deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() { + if (deleteTimeBuilder_ != null) { + return deleteTimeBuilder_.getMessageOrBuilder(); + } else { + return deleteTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : deleteTime_; + } + } + /** + * + * + *
+     * Output only. The time when the document is deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getDeleteTimeFieldBuilder() { + if (deleteTimeBuilder_ == null) { + deleteTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getDeleteTime(), getParentForChildren(), isClean()); + deleteTime_ = null; + } + return deleteTimeBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.DocumentReference) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.DocumentReference) + private static final com.google.cloud.contentwarehouse.v1.DocumentReference DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.DocumentReference(); + } + + public static com.google.cloud.contentwarehouse.v1.DocumentReference getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DocumentReference parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DocumentReference getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentReferenceOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentReferenceOrBuilder.java new file mode 100644 index 000000000000..de71ba359516 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentReferenceOrBuilder.java @@ -0,0 +1,239 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface DocumentReferenceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.DocumentReference) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the referenced document.
+   * 
+ * + * + * string document_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The documentName. + */ + java.lang.String getDocumentName(); + /** + * + * + *
+   * Required. Name of the referenced document.
+   * 
+ * + * + * string document_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for documentName. + */ + com.google.protobuf.ByteString getDocumentNameBytes(); + + /** + * + * + *
+   * display_name of the referenced document; this name does not need to be
+   * consistent to the display_name in the Document proto, depending on the ACL
+   * constraint.
+   * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * display_name of the referenced document; this name does not need to be
+   * consistent to the display_name in the Document proto, depending on the ACL
+   * constraint.
+   * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Stores the subset of the referenced document's content.
+   * This is useful to allow user peek the information of the referenced
+   * document.
+   * 
+ * + * string snippet = 3; + * + * @return The snippet. + */ + java.lang.String getSnippet(); + /** + * + * + *
+   * Stores the subset of the referenced document's content.
+   * This is useful to allow user peek the information of the referenced
+   * document.
+   * 
+ * + * string snippet = 3; + * + * @return The bytes for snippet. + */ + com.google.protobuf.ByteString getSnippetBytes(); + + /** + * + * + *
+   * The document type of the document being referenced.
+   * 
+ * + * bool document_is_folder = 4; + * + * @return The documentIsFolder. + */ + boolean getDocumentIsFolder(); + + /** + * + * + *
+   * Output only. The time when the document is last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The time when the document is last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The time when the document is last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The time when the document is created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The time when the document is created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The time when the document is created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The time when the document is deleted.
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the deleteTime field is set. + */ + boolean hasDeleteTime(); + /** + * + * + *
+   * Output only. The time when the document is deleted.
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The deleteTime. + */ + com.google.protobuf.Timestamp getDeleteTime(); + /** + * + * + *
+   * Output only. The time when the document is deleted.
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentSchema.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentSchema.java new file mode 100644 index 000000000000..268118e583af --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentSchema.java @@ -0,0 +1,2192 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_schema.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * A document schema used to define document structure.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.DocumentSchema} + */ +public final class DocumentSchema extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.DocumentSchema) + DocumentSchemaOrBuilder { + private static final long serialVersionUID = 0L; + // Use DocumentSchema.newBuilder() to construct. + private DocumentSchema(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DocumentSchema() { + name_ = ""; + displayName_ = ""; + propertyDefinitions_ = java.util.Collections.emptyList(); + description_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DocumentSchema(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaProto + .internal_static_google_cloud_contentwarehouse_v1_DocumentSchema_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaProto + .internal_static_google_cloud_contentwarehouse_v1_DocumentSchema_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.DocumentSchema.class, + com.google.cloud.contentwarehouse.v1.DocumentSchema.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The resource name of the document schema.
+   * Format:
+   * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
+   * The name is ignored when creating a document schema.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * The resource name of the document schema.
+   * Format:
+   * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
+   * The name is ignored when creating a document schema.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object displayName_; + /** + * + * + *
+   * Required. Name of the schema given by the user. Must be unique per customer.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Name of the schema given by the user. Must be unique per customer.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROPERTY_DEFINITIONS_FIELD_NUMBER = 3; + private java.util.List + propertyDefinitions_; + /** + * + * + *
+   * Document details.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.PropertyDefinition property_definitions = 3; + * + */ + @java.lang.Override + public java.util.List + getPropertyDefinitionsList() { + return propertyDefinitions_; + } + /** + * + * + *
+   * Document details.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.PropertyDefinition property_definitions = 3; + * + */ + @java.lang.Override + public java.util.List + getPropertyDefinitionsOrBuilderList() { + return propertyDefinitions_; + } + /** + * + * + *
+   * Document details.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.PropertyDefinition property_definitions = 3; + * + */ + @java.lang.Override + public int getPropertyDefinitionsCount() { + return propertyDefinitions_.size(); + } + /** + * + * + *
+   * Document details.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.PropertyDefinition property_definitions = 3; + * + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.PropertyDefinition getPropertyDefinitions(int index) { + return propertyDefinitions_.get(index); + } + /** + * + * + *
+   * Document details.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.PropertyDefinition property_definitions = 3; + * + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.PropertyDefinitionOrBuilder + getPropertyDefinitionsOrBuilder(int index) { + return propertyDefinitions_.get(index); + } + + public static final int DOCUMENT_IS_FOLDER_FIELD_NUMBER = 4; + private boolean documentIsFolder_; + /** + * + * + *
+   * Document Type, true refers the document is a folder, otherwise it is
+   * a typical document.
+   * 
+ * + * bool document_is_folder = 4; + * + * @return The documentIsFolder. + */ + @java.lang.Override + public boolean getDocumentIsFolder() { + return documentIsFolder_; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The time when the document schema is last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. The time when the document schema is last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Output only. The time when the document schema is last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The time when the document schema is created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. The time when the document schema is created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. The time when the document schema is created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int DESCRIPTION_FIELD_NUMBER = 7; + private volatile java.lang.Object description_; + /** + * + * + *
+   * Schema description.
+   * 
+ * + * string description = 7; + * + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + /** + * + * + *
+   * Schema description.
+   * 
+ * + * string description = 7; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + for (int i = 0; i < propertyDefinitions_.size(); i++) { + output.writeMessage(3, propertyDefinitions_.get(i)); + } + if (documentIsFolder_ != false) { + output.writeBool(4, documentIsFolder_); + } + if (updateTime_ != null) { + output.writeMessage(5, getUpdateTime()); + } + if (createTime_ != null) { + output.writeMessage(6, getCreateTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, description_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + for (int i = 0; i < propertyDefinitions_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(3, propertyDefinitions_.get(i)); + } + if (documentIsFolder_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, documentIsFolder_); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getUpdateTime()); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getCreateTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, description_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.DocumentSchema)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.DocumentSchema other = + (com.google.cloud.contentwarehouse.v1.DocumentSchema) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getPropertyDefinitionsList().equals(other.getPropertyDefinitionsList())) return false; + if (getDocumentIsFolder() != other.getDocumentIsFolder()) return false; + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (!getDescription().equals(other.getDescription())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + if (getPropertyDefinitionsCount() > 0) { + hash = (37 * hash) + PROPERTY_DEFINITIONS_FIELD_NUMBER; + hash = (53 * hash) + getPropertyDefinitionsList().hashCode(); + } + hash = (37 * hash) + DOCUMENT_IS_FOLDER_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDocumentIsFolder()); + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.DocumentSchema parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.DocumentSchema parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DocumentSchema parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.DocumentSchema parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DocumentSchema parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.DocumentSchema parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DocumentSchema parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.DocumentSchema parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DocumentSchema parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.DocumentSchema parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.DocumentSchema parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.DocumentSchema parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.contentwarehouse.v1.DocumentSchema prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A document schema used to define document structure.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.DocumentSchema} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.DocumentSchema) + com.google.cloud.contentwarehouse.v1.DocumentSchemaOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaProto + .internal_static_google_cloud_contentwarehouse_v1_DocumentSchema_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaProto + .internal_static_google_cloud_contentwarehouse_v1_DocumentSchema_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.DocumentSchema.class, + com.google.cloud.contentwarehouse.v1.DocumentSchema.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.DocumentSchema.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + displayName_ = ""; + + if (propertyDefinitionsBuilder_ == null) { + propertyDefinitions_ = java.util.Collections.emptyList(); + } else { + propertyDefinitions_ = null; + propertyDefinitionsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + documentIsFolder_ = false; + + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + description_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaProto + .internal_static_google_cloud_contentwarehouse_v1_DocumentSchema_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DocumentSchema getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.DocumentSchema.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DocumentSchema build() { + com.google.cloud.contentwarehouse.v1.DocumentSchema result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DocumentSchema buildPartial() { + com.google.cloud.contentwarehouse.v1.DocumentSchema result = + new com.google.cloud.contentwarehouse.v1.DocumentSchema(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.displayName_ = displayName_; + if (propertyDefinitionsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + propertyDefinitions_ = java.util.Collections.unmodifiableList(propertyDefinitions_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.propertyDefinitions_ = propertyDefinitions_; + } else { + result.propertyDefinitions_ = propertyDefinitionsBuilder_.build(); + } + result.documentIsFolder_ = documentIsFolder_; + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + result.description_ = description_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.DocumentSchema) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.DocumentSchema) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.DocumentSchema other) { + if (other == com.google.cloud.contentwarehouse.v1.DocumentSchema.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (propertyDefinitionsBuilder_ == null) { + if (!other.propertyDefinitions_.isEmpty()) { + if (propertyDefinitions_.isEmpty()) { + propertyDefinitions_ = other.propertyDefinitions_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePropertyDefinitionsIsMutable(); + propertyDefinitions_.addAll(other.propertyDefinitions_); + } + onChanged(); + } + } else { + if (!other.propertyDefinitions_.isEmpty()) { + if (propertyDefinitionsBuilder_.isEmpty()) { + propertyDefinitionsBuilder_.dispose(); + propertyDefinitionsBuilder_ = null; + propertyDefinitions_ = other.propertyDefinitions_; + bitField0_ = (bitField0_ & ~0x00000001); + propertyDefinitionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getPropertyDefinitionsFieldBuilder() + : null; + } else { + propertyDefinitionsBuilder_.addAllMessages(other.propertyDefinitions_); + } + } + } + if (other.getDocumentIsFolder() != false) { + setDocumentIsFolder(other.getDocumentIsFolder()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + displayName_ = input.readStringRequireUtf8(); + + break; + } // case 18 + case 26: + { + com.google.cloud.contentwarehouse.v1.PropertyDefinition m = + input.readMessage( + com.google.cloud.contentwarehouse.v1.PropertyDefinition.parser(), + extensionRegistry); + if (propertyDefinitionsBuilder_ == null) { + ensurePropertyDefinitionsIsMutable(); + propertyDefinitions_.add(m); + } else { + propertyDefinitionsBuilder_.addMessage(m); + } + break; + } // case 26 + case 32: + { + documentIsFolder_ = input.readBool(); + + break; + } // case 32 + case 42: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 42 + case 50: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 50 + case 58: + { + description_ = input.readStringRequireUtf8(); + + break; + } // case 58 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The resource name of the document schema.
+     * Format:
+     * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
+     * The name is ignored when creating a document schema.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource name of the document schema.
+     * Format:
+     * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
+     * The name is ignored when creating a document schema.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource name of the document schema.
+     * Format:
+     * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
+     * The name is ignored when creating a document schema.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the document schema.
+     * Format:
+     * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
+     * The name is ignored when creating a document schema.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the document schema.
+     * Format:
+     * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
+     * The name is ignored when creating a document schema.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * Required. Name of the schema given by the user. Must be unique per customer.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Name of the schema given by the user. Must be unique per customer.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Name of the schema given by the user. Must be unique per customer.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the schema given by the user. Must be unique per customer.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the schema given by the user. Must be unique per customer.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayName_ = value; + onChanged(); + return this; + } + + private java.util.List + propertyDefinitions_ = java.util.Collections.emptyList(); + + private void ensurePropertyDefinitionsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + propertyDefinitions_ = + new java.util.ArrayList( + propertyDefinitions_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.PropertyDefinition, + com.google.cloud.contentwarehouse.v1.PropertyDefinition.Builder, + com.google.cloud.contentwarehouse.v1.PropertyDefinitionOrBuilder> + propertyDefinitionsBuilder_; + + /** + * + * + *
+     * Document details.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.PropertyDefinition property_definitions = 3; + * + */ + public java.util.List + getPropertyDefinitionsList() { + if (propertyDefinitionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(propertyDefinitions_); + } else { + return propertyDefinitionsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Document details.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.PropertyDefinition property_definitions = 3; + * + */ + public int getPropertyDefinitionsCount() { + if (propertyDefinitionsBuilder_ == null) { + return propertyDefinitions_.size(); + } else { + return propertyDefinitionsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Document details.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.PropertyDefinition property_definitions = 3; + * + */ + public com.google.cloud.contentwarehouse.v1.PropertyDefinition getPropertyDefinitions( + int index) { + if (propertyDefinitionsBuilder_ == null) { + return propertyDefinitions_.get(index); + } else { + return propertyDefinitionsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Document details.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.PropertyDefinition property_definitions = 3; + * + */ + public Builder setPropertyDefinitions( + int index, com.google.cloud.contentwarehouse.v1.PropertyDefinition value) { + if (propertyDefinitionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePropertyDefinitionsIsMutable(); + propertyDefinitions_.set(index, value); + onChanged(); + } else { + propertyDefinitionsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Document details.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.PropertyDefinition property_definitions = 3; + * + */ + public Builder setPropertyDefinitions( + int index, + com.google.cloud.contentwarehouse.v1.PropertyDefinition.Builder builderForValue) { + if (propertyDefinitionsBuilder_ == null) { + ensurePropertyDefinitionsIsMutable(); + propertyDefinitions_.set(index, builderForValue.build()); + onChanged(); + } else { + propertyDefinitionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Document details.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.PropertyDefinition property_definitions = 3; + * + */ + public Builder addPropertyDefinitions( + com.google.cloud.contentwarehouse.v1.PropertyDefinition value) { + if (propertyDefinitionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePropertyDefinitionsIsMutable(); + propertyDefinitions_.add(value); + onChanged(); + } else { + propertyDefinitionsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Document details.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.PropertyDefinition property_definitions = 3; + * + */ + public Builder addPropertyDefinitions( + int index, com.google.cloud.contentwarehouse.v1.PropertyDefinition value) { + if (propertyDefinitionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePropertyDefinitionsIsMutable(); + propertyDefinitions_.add(index, value); + onChanged(); + } else { + propertyDefinitionsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Document details.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.PropertyDefinition property_definitions = 3; + * + */ + public Builder addPropertyDefinitions( + com.google.cloud.contentwarehouse.v1.PropertyDefinition.Builder builderForValue) { + if (propertyDefinitionsBuilder_ == null) { + ensurePropertyDefinitionsIsMutable(); + propertyDefinitions_.add(builderForValue.build()); + onChanged(); + } else { + propertyDefinitionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Document details.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.PropertyDefinition property_definitions = 3; + * + */ + public Builder addPropertyDefinitions( + int index, + com.google.cloud.contentwarehouse.v1.PropertyDefinition.Builder builderForValue) { + if (propertyDefinitionsBuilder_ == null) { + ensurePropertyDefinitionsIsMutable(); + propertyDefinitions_.add(index, builderForValue.build()); + onChanged(); + } else { + propertyDefinitionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Document details.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.PropertyDefinition property_definitions = 3; + * + */ + public Builder addAllPropertyDefinitions( + java.lang.Iterable + values) { + if (propertyDefinitionsBuilder_ == null) { + ensurePropertyDefinitionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, propertyDefinitions_); + onChanged(); + } else { + propertyDefinitionsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Document details.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.PropertyDefinition property_definitions = 3; + * + */ + public Builder clearPropertyDefinitions() { + if (propertyDefinitionsBuilder_ == null) { + propertyDefinitions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + propertyDefinitionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Document details.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.PropertyDefinition property_definitions = 3; + * + */ + public Builder removePropertyDefinitions(int index) { + if (propertyDefinitionsBuilder_ == null) { + ensurePropertyDefinitionsIsMutable(); + propertyDefinitions_.remove(index); + onChanged(); + } else { + propertyDefinitionsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Document details.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.PropertyDefinition property_definitions = 3; + * + */ + public com.google.cloud.contentwarehouse.v1.PropertyDefinition.Builder + getPropertyDefinitionsBuilder(int index) { + return getPropertyDefinitionsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Document details.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.PropertyDefinition property_definitions = 3; + * + */ + public com.google.cloud.contentwarehouse.v1.PropertyDefinitionOrBuilder + getPropertyDefinitionsOrBuilder(int index) { + if (propertyDefinitionsBuilder_ == null) { + return propertyDefinitions_.get(index); + } else { + return propertyDefinitionsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Document details.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.PropertyDefinition property_definitions = 3; + * + */ + public java.util.List< + ? extends com.google.cloud.contentwarehouse.v1.PropertyDefinitionOrBuilder> + getPropertyDefinitionsOrBuilderList() { + if (propertyDefinitionsBuilder_ != null) { + return propertyDefinitionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(propertyDefinitions_); + } + } + /** + * + * + *
+     * Document details.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.PropertyDefinition property_definitions = 3; + * + */ + public com.google.cloud.contentwarehouse.v1.PropertyDefinition.Builder + addPropertyDefinitionsBuilder() { + return getPropertyDefinitionsFieldBuilder() + .addBuilder(com.google.cloud.contentwarehouse.v1.PropertyDefinition.getDefaultInstance()); + } + /** + * + * + *
+     * Document details.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.PropertyDefinition property_definitions = 3; + * + */ + public com.google.cloud.contentwarehouse.v1.PropertyDefinition.Builder + addPropertyDefinitionsBuilder(int index) { + return getPropertyDefinitionsFieldBuilder() + .addBuilder( + index, com.google.cloud.contentwarehouse.v1.PropertyDefinition.getDefaultInstance()); + } + /** + * + * + *
+     * Document details.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.PropertyDefinition property_definitions = 3; + * + */ + public java.util.List + getPropertyDefinitionsBuilderList() { + return getPropertyDefinitionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.PropertyDefinition, + com.google.cloud.contentwarehouse.v1.PropertyDefinition.Builder, + com.google.cloud.contentwarehouse.v1.PropertyDefinitionOrBuilder> + getPropertyDefinitionsFieldBuilder() { + if (propertyDefinitionsBuilder_ == null) { + propertyDefinitionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.PropertyDefinition, + com.google.cloud.contentwarehouse.v1.PropertyDefinition.Builder, + com.google.cloud.contentwarehouse.v1.PropertyDefinitionOrBuilder>( + propertyDefinitions_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + propertyDefinitions_ = null; + } + return propertyDefinitionsBuilder_; + } + + private boolean documentIsFolder_; + /** + * + * + *
+     * Document Type, true refers the document is a folder, otherwise it is
+     * a typical document.
+     * 
+ * + * bool document_is_folder = 4; + * + * @return The documentIsFolder. + */ + @java.lang.Override + public boolean getDocumentIsFolder() { + return documentIsFolder_; + } + /** + * + * + *
+     * Document Type, true refers the document is a folder, otherwise it is
+     * a typical document.
+     * 
+ * + * bool document_is_folder = 4; + * + * @param value The documentIsFolder to set. + * @return This builder for chaining. + */ + public Builder setDocumentIsFolder(boolean value) { + + documentIsFolder_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Document Type, true refers the document is a folder, otherwise it is
+     * a typical document.
+     * 
+ * + * bool document_is_folder = 4; + * + * @return This builder for chaining. + */ + public Builder clearDocumentIsFolder() { + + documentIsFolder_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. The time when the document schema is last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * Output only. The time when the document schema is last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The time when the document schema is last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + onChanged(); + } else { + updateTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time when the document schema is last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The time when the document schema is last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (updateTime_ != null) { + updateTime_ = + com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); + } else { + updateTime_ = value; + } + onChanged(); + } else { + updateTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time when the document schema is last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The time when the document schema is last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time when the document schema is last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Output only. The time when the document schema is last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. The time when the document schema is created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Output only. The time when the document schema is created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The time when the document schema is created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time when the document schema is created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The time when the document schema is created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time when the document schema is created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The time when the document schema is created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time when the document schema is created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. The time when the document schema is created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * Schema description.
+     * 
+ * + * string description = 7; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Schema description.
+     * 
+ * + * string description = 7; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Schema description.
+     * 
+ * + * string description = 7; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Schema description.
+     * 
+ * + * string description = 7; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+     * Schema description.
+     * 
+ * + * string description = 7; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.DocumentSchema) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.DocumentSchema) + private static final com.google.cloud.contentwarehouse.v1.DocumentSchema DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.DocumentSchema(); + } + + public static com.google.cloud.contentwarehouse.v1.DocumentSchema getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DocumentSchema parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DocumentSchema getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentSchemaName.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentSchemaName.java new file mode 100644 index 000000000000..654d957e00ca --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentSchemaName.java @@ -0,0 +1,227 @@ +/* + * 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; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class DocumentSchemaName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_DOCUMENT_SCHEMA = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/documentSchemas/{document_schema}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String documentSchema; + + @Deprecated + protected DocumentSchemaName() { + project = null; + location = null; + documentSchema = null; + } + + private DocumentSchemaName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + documentSchema = Preconditions.checkNotNull(builder.getDocumentSchema()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getDocumentSchema() { + return documentSchema; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static DocumentSchemaName of(String project, String location, String documentSchema) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setDocumentSchema(documentSchema) + .build(); + } + + public static String format(String project, String location, String documentSchema) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setDocumentSchema(documentSchema) + .build() + .toString(); + } + + public static DocumentSchemaName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_DOCUMENT_SCHEMA.validatedMatch( + formattedString, "DocumentSchemaName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("document_schema")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (DocumentSchemaName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_DOCUMENT_SCHEMA.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (documentSchema != null) { + fieldMapBuilder.put("document_schema", documentSchema); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_DOCUMENT_SCHEMA.instantiate( + "project", project, "location", location, "document_schema", documentSchema); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + DocumentSchemaName that = ((DocumentSchemaName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.documentSchema, that.documentSchema); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(documentSchema); + return h; + } + + /** Builder for projects/{project}/locations/{location}/documentSchemas/{document_schema}. */ + public static class Builder { + private String project; + private String location; + private String documentSchema; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getDocumentSchema() { + return documentSchema; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setDocumentSchema(String documentSchema) { + this.documentSchema = documentSchema; + return this; + } + + private Builder(DocumentSchemaName documentSchemaName) { + this.project = documentSchemaName.project; + this.location = documentSchemaName.location; + this.documentSchema = documentSchemaName.documentSchema; + } + + public DocumentSchemaName build() { + return new DocumentSchemaName(this); + } + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentSchemaOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentSchemaOrBuilder.java new file mode 100644 index 000000000000..7a7528eb8b73 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentSchemaOrBuilder.java @@ -0,0 +1,255 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_schema.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface DocumentSchemaOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.DocumentSchema) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resource name of the document schema.
+   * Format:
+   * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
+   * The name is ignored when creating a document schema.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The resource name of the document schema.
+   * Format:
+   * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
+   * The name is ignored when creating a document schema.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. Name of the schema given by the user. Must be unique per customer.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * Required. Name of the schema given by the user. Must be unique per customer.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Document details.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.PropertyDefinition property_definitions = 3; + * + */ + java.util.List + getPropertyDefinitionsList(); + /** + * + * + *
+   * Document details.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.PropertyDefinition property_definitions = 3; + * + */ + com.google.cloud.contentwarehouse.v1.PropertyDefinition getPropertyDefinitions(int index); + /** + * + * + *
+   * Document details.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.PropertyDefinition property_definitions = 3; + * + */ + int getPropertyDefinitionsCount(); + /** + * + * + *
+   * Document details.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.PropertyDefinition property_definitions = 3; + * + */ + java.util.List + getPropertyDefinitionsOrBuilderList(); + /** + * + * + *
+   * Document details.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.PropertyDefinition property_definitions = 3; + * + */ + com.google.cloud.contentwarehouse.v1.PropertyDefinitionOrBuilder getPropertyDefinitionsOrBuilder( + int index); + + /** + * + * + *
+   * Document Type, true refers the document is a folder, otherwise it is
+   * a typical document.
+   * 
+ * + * bool document_is_folder = 4; + * + * @return The documentIsFolder. + */ + boolean getDocumentIsFolder(); + + /** + * + * + *
+   * Output only. The time when the document schema is last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The time when the document schema is last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The time when the document schema is last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The time when the document schema is created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The time when the document schema is created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The time when the document schema is created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Schema description.
+   * 
+ * + * string description = 7; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * Schema description.
+   * 
+ * + * string description = 7; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentSchemaProto.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentSchemaProto.java new file mode 100644 index 000000000000..414e6c419710 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentSchemaProto.java @@ -0,0 +1,238 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_schema.proto + +package com.google.cloud.contentwarehouse.v1; + +public final class DocumentSchemaProto { + private DocumentSchemaProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_DocumentSchema_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_DocumentSchema_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_PropertyDefinition_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_PropertyDefinition_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_IntegerTypeOptions_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_IntegerTypeOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_FloatTypeOptions_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_FloatTypeOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_TextTypeOptions_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_TextTypeOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_DateTimeTypeOptions_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_DateTimeTypeOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_MapTypeOptions_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_MapTypeOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_TimestampTypeOptions_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_TimestampTypeOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_PropertyTypeOptions_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_PropertyTypeOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_EnumTypeOptions_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_EnumTypeOptions_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n6google/cloud/contentwarehouse/v1/docum" + + "ent_schema.proto\022 google.cloud.contentwa" + + "rehouse.v1\032\037google/api/field_behavior.pr" + + "oto\032\031google/api/resource.proto\032\037google/p" + + "rotobuf/timestamp.proto\"\252\003\n\016DocumentSche" + + "ma\022\014\n\004name\030\001 \001(\t\022\031\n\014display_name\030\002 \001(\tB\003" + + "\340A\002\022R\n\024property_definitions\030\003 \003(\01324.goog" + + "le.cloud.contentwarehouse.v1.PropertyDef" + + "inition\022\032\n\022document_is_folder\030\004 \001(\010\0224\n\013u" + + "pdate_time\030\005 \001(\0132\032.google.protobuf.Times" + + "tampB\003\340A\003\0224\n\013create_time\030\006 \001(\0132\032.google." + + "protobuf.TimestampB\003\340A\003\022\023\n\013description\030\007" + + " \001(\t:~\352A{\n.contentwarehouse.googleapis.c" + + "om/DocumentSchema\022Iprojects/{project}/lo" + + "cations/{location}/documentSchemas/{docu" + + "ment_schema}\"\343\006\n\022PropertyDefinition\022\021\n\004n" + + "ame\030\001 \001(\tB\003\340A\002\022\024\n\014display_name\030\014 \001(\t\022\025\n\r" + + "is_repeatable\030\002 \001(\010\022\025\n\ris_filterable\030\003 \001" + + "(\010\022\025\n\ris_searchable\030\004 \001(\010\022\023\n\013is_metadata" + + "\030\005 \001(\010\022\023\n\013is_required\030\016 \001(\010\022T\n\024integer_t" + + "ype_options\030\007 \001(\01324.google.cloud.content" + + "warehouse.v1.IntegerTypeOptionsH\000\022P\n\022flo" + + "at_type_options\030\010 \001(\01322.google.cloud.con" + + "tentwarehouse.v1.FloatTypeOptionsH\000\022N\n\021t" + + "ext_type_options\030\t \001(\01321.google.cloud.co" + + "ntentwarehouse.v1.TextTypeOptionsH\000\022V\n\025p" + + "roperty_type_options\030\n \001(\01325.google.clou" + + "d.contentwarehouse.v1.PropertyTypeOption" + + "sH\000\022N\n\021enum_type_options\030\013 \001(\01321.google." + + "cloud.contentwarehouse.v1.EnumTypeOption" + + "sH\000\022W\n\026date_time_type_options\030\r \001(\01325.go" + + "ogle.cloud.contentwarehouse.v1.DateTimeT" + + "ypeOptionsH\000\022L\n\020map_type_options\030\017 \001(\01320" + + ".google.cloud.contentwarehouse.v1.MapTyp" + + "eOptionsH\000\022X\n\026timestamp_type_options\030\020 \001" + + "(\01326.google.cloud.contentwarehouse.v1.Ti" + + "mestampTypeOptionsH\000B\024\n\022value_type_optio" + + "ns\"\024\n\022IntegerTypeOptions\"\022\n\020FloatTypeOpt" + + "ions\"\021\n\017TextTypeOptions\"\025\n\023DateTimeTypeO" + + "ptions\"\020\n\016MapTypeOptions\"\026\n\024TimestampTyp" + + "eOptions\"n\n\023PropertyTypeOptions\022W\n\024prope" + + "rty_definitions\030\001 \003(\01324.google.cloud.con" + + "tentwarehouse.v1.PropertyDefinitionB\003\340A\002" + + "\"R\n\017EnumTypeOptions\022\034\n\017possible_values\030\001" + + " \003(\tB\003\340A\002\022!\n\031validation_check_disabled\030\002" + + " \001(\010B\217\001\n$com.google.cloud.contentwarehou" + + "se.v1B\023DocumentSchemaProtoP\001ZPgoogle.gol" + + "ang.org/genproto/googleapis/cloud/conten" + + "twarehouse/v1;contentwarehouseb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_contentwarehouse_v1_DocumentSchema_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_contentwarehouse_v1_DocumentSchema_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_DocumentSchema_descriptor, + new java.lang.String[] { + "Name", + "DisplayName", + "PropertyDefinitions", + "DocumentIsFolder", + "UpdateTime", + "CreateTime", + "Description", + }); + internal_static_google_cloud_contentwarehouse_v1_PropertyDefinition_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_contentwarehouse_v1_PropertyDefinition_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_PropertyDefinition_descriptor, + new java.lang.String[] { + "Name", + "DisplayName", + "IsRepeatable", + "IsFilterable", + "IsSearchable", + "IsMetadata", + "IsRequired", + "IntegerTypeOptions", + "FloatTypeOptions", + "TextTypeOptions", + "PropertyTypeOptions", + "EnumTypeOptions", + "DateTimeTypeOptions", + "MapTypeOptions", + "TimestampTypeOptions", + "ValueTypeOptions", + }); + internal_static_google_cloud_contentwarehouse_v1_IntegerTypeOptions_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_contentwarehouse_v1_IntegerTypeOptions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_IntegerTypeOptions_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_contentwarehouse_v1_FloatTypeOptions_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_contentwarehouse_v1_FloatTypeOptions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_FloatTypeOptions_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_contentwarehouse_v1_TextTypeOptions_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_contentwarehouse_v1_TextTypeOptions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_TextTypeOptions_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_contentwarehouse_v1_DateTimeTypeOptions_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_contentwarehouse_v1_DateTimeTypeOptions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_DateTimeTypeOptions_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_contentwarehouse_v1_MapTypeOptions_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_contentwarehouse_v1_MapTypeOptions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_MapTypeOptions_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_contentwarehouse_v1_TimestampTypeOptions_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_contentwarehouse_v1_TimestampTypeOptions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_TimestampTypeOptions_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_contentwarehouse_v1_PropertyTypeOptions_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_contentwarehouse_v1_PropertyTypeOptions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_PropertyTypeOptions_descriptor, + new java.lang.String[] { + "PropertyDefinitions", + }); + internal_static_google_cloud_contentwarehouse_v1_EnumTypeOptions_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_contentwarehouse_v1_EnumTypeOptions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_EnumTypeOptions_descriptor, + new java.lang.String[] { + "PossibleValues", "ValidationCheckDisabled", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resource); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentSchemaServiceProto.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentSchemaServiceProto.java new file mode 100644 index 000000000000..3edabc18c1ce --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentSchemaServiceProto.java @@ -0,0 +1,204 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_schema_service.proto + +package com.google.cloud.contentwarehouse.v1; + +public final class DocumentSchemaServiceProto { + private DocumentSchemaServiceProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_CreateDocumentSchemaRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_CreateDocumentSchemaRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_GetDocumentSchemaRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_GetDocumentSchemaRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_UpdateDocumentSchemaRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_UpdateDocumentSchemaRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_DeleteDocumentSchemaRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_DeleteDocumentSchemaRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_ListDocumentSchemasRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_ListDocumentSchemasRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_ListDocumentSchemasResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_ListDocumentSchemasResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n>google/cloud/contentwarehouse/v1/docum" + + "ent_schema_service.proto\022 google.cloud.c" + + "ontentwarehouse.v1\032\034google/api/annotatio" + + "ns.proto\032\027google/api/client.proto\032\037googl" + + "e/api/field_behavior.proto\032\031google/api/r" + + "esource.proto\0326google/cloud/contentwareh" + + "ouse/v1/document_schema.proto\032\033google/pr" + + "otobuf/empty.proto\"\257\001\n\033CreateDocumentSch" + + "emaRequest\022@\n\006parent\030\001 \001(\tB0\340A\002\372A*\n(cont" + + "entwarehouse.googleapis.com/Location\022N\n\017" + + "document_schema\030\002 \001(\01320.google.cloud.con" + + "tentwarehouse.v1.DocumentSchemaB\003\340A\002\"`\n\030" + + "GetDocumentSchemaRequest\022D\n\004name\030\001 \001(\tB6" + + "\340A\002\372A0\n.contentwarehouse.googleapis.com/" + + "DocumentSchema\"\263\001\n\033UpdateDocumentSchemaR" + + "equest\022D\n\004name\030\001 \001(\tB6\340A\002\372A0\n.contentwar" + + "ehouse.googleapis.com/DocumentSchema\022N\n\017" + + "document_schema\030\002 \001(\01320.google.cloud.con" + + "tentwarehouse.v1.DocumentSchemaB\003\340A\002\"c\n\033" + + "DeleteDocumentSchemaRequest\022D\n\004name\030\001 \001(" + + "\tB6\340A\002\372A0\n.contentwarehouse.googleapis.c" + + "om/DocumentSchema\"\205\001\n\032ListDocumentSchema" + + "sRequest\022@\n\006parent\030\001 \001(\tB0\340A\002\372A*\n(conten" + + "twarehouse.googleapis.com/Location\022\021\n\tpa" + + "ge_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"\202\001\n\033Li" + + "stDocumentSchemasResponse\022J\n\020document_sc" + + "hemas\030\001 \003(\01320.google.cloud.contentwareho" + + "use.v1.DocumentSchema\022\027\n\017next_page_token" + + "\030\002 \001(\t2\225\t\n\025DocumentSchemaService\022\356\001\n\024Cre" + + "ateDocumentSchema\022=.google.cloud.content" + + "warehouse.v1.CreateDocumentSchemaRequest" + + "\0320.google.cloud.contentwarehouse.v1.Docu" + + "mentSchema\"e\202\323\344\223\002F\"3/v1/{parent=projects" + + "/*/locations/*}/documentSchemas:\017documen" + + "t_schema\332A\026parent,document_schema\022\336\001\n\024Up" + + "dateDocumentSchema\022=.google.cloud.conten" + + "twarehouse.v1.UpdateDocumentSchemaReques" + + "t\0320.google.cloud.contentwarehouse.v1.Doc" + + "umentSchema\"U\202\323\344\223\002823/v1/{name=projects/" + + "*/locations/*/documentSchemas/*}:\001*\332A\024na" + + "me,document_schema\022\305\001\n\021GetDocumentSchema" + + "\022:.google.cloud.contentwarehouse.v1.GetD" + + "ocumentSchemaRequest\0320.google.cloud.cont" + + "entwarehouse.v1.DocumentSchema\"B\202\323\344\223\0025\0223" + + "/v1/{name=projects/*/locations/*/documen" + + "tSchemas/*}\332A\004name\022\261\001\n\024DeleteDocumentSch" + + "ema\022=.google.cloud.contentwarehouse.v1.D" + + "eleteDocumentSchemaRequest\032\026.google.prot" + + "obuf.Empty\"B\202\323\344\223\0025*3/v1/{name=projects/*" + + "/locations/*/documentSchemas/*}\332A\004name\022\330" + + "\001\n\023ListDocumentSchemas\022<.google.cloud.co" + + "ntentwarehouse.v1.ListDocumentSchemasReq" + + "uest\032=.google.cloud.contentwarehouse.v1." + + "ListDocumentSchemasResponse\"D\202\323\344\223\0025\0223/v1" + + "/{parent=projects/*/locations/*}/documen" + + "tSchemas\332A\006parent\032S\312A\037contentwarehouse.g" + + "oogleapis.com\322A.https://www.googleapis.c" + + "om/auth/cloud-platformB\226\001\n$com.google.cl" + + "oud.contentwarehouse.v1B\032DocumentSchemaS" + + "erviceProtoP\001ZPgoogle.golang.org/genprot" + + "o/googleapis/cloud/contentwarehouse/v1;c" + + "ontentwarehouseb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.contentwarehouse.v1.DocumentSchemaProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + }); + internal_static_google_cloud_contentwarehouse_v1_CreateDocumentSchemaRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_contentwarehouse_v1_CreateDocumentSchemaRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_CreateDocumentSchemaRequest_descriptor, + new java.lang.String[] { + "Parent", "DocumentSchema", + }); + internal_static_google_cloud_contentwarehouse_v1_GetDocumentSchemaRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_contentwarehouse_v1_GetDocumentSchemaRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_GetDocumentSchemaRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_contentwarehouse_v1_UpdateDocumentSchemaRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_contentwarehouse_v1_UpdateDocumentSchemaRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_UpdateDocumentSchemaRequest_descriptor, + new java.lang.String[] { + "Name", "DocumentSchema", + }); + internal_static_google_cloud_contentwarehouse_v1_DeleteDocumentSchemaRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_contentwarehouse_v1_DeleteDocumentSchemaRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_DeleteDocumentSchemaRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_contentwarehouse_v1_ListDocumentSchemasRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_contentwarehouse_v1_ListDocumentSchemasRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_ListDocumentSchemasRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_cloud_contentwarehouse_v1_ListDocumentSchemasResponse_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_contentwarehouse_v1_ListDocumentSchemasResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_ListDocumentSchemasResponse_descriptor, + new java.lang.String[] { + "DocumentSchemas", "NextPageToken", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.contentwarehouse.v1.DocumentSchemaProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentServiceProto.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentServiceProto.java new file mode 100644 index 000000000000..cb3cda5854be --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentServiceProto.java @@ -0,0 +1,276 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_service.proto + +package com.google.cloud.contentwarehouse.v1; + +public final class DocumentServiceProto { + private DocumentServiceProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_CreateDocumentResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_CreateDocumentResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_UpdateDocumentResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_UpdateDocumentResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_QAResult_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_QAResult_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_QAResult_Highlight_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_QAResult_Highlight_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_SearchDocumentsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_SearchDocumentsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_SearchDocumentsResponse_MatchingDocument_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_SearchDocumentsResponse_MatchingDocument_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_FetchAclResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_FetchAclResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_SetAclResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_SetAclResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n7google/cloud/contentwarehouse/v1/docum" + + "ent_service.proto\022 google.cloud.contentw" + + "arehouse.v1\032\034google/api/annotations.prot" + + "o\032\027google/api/client.proto\032\031google/api/r" + + "esource.proto\032-google/cloud/contentwareh" + + "ouse/v1/common.proto\032/google/cloud/conte" + + "ntwarehouse/v1/document.proto\032?google/cl" + + "oud/contentwarehouse/v1/document_service" + + "_request.proto\0320google/cloud/contentware" + + "house/v1/histogram.proto\0322google/cloud/c" + + "ontentwarehouse/v1/rule_engine.proto\032\032go" + + "ogle/iam/v1/policy.proto\032\033google/protobu" + + "f/empty.proto\"\354\001\n\026CreateDocumentResponse" + + "\022<\n\010document\030\001 \001(\0132*.google.cloud.conten" + + "twarehouse.v1.Document\022N\n\022rule_engine_ou" + + "tput\030\002 \001(\01322.google.cloud.contentwarehou" + + "se.v1.RuleEngineOutput\022D\n\010metadata\030\003 \001(\013" + + "22.google.cloud.contentwarehouse.v1.Resp" + + "onseMetadata\"\354\001\n\026UpdateDocumentResponse\022" + + "<\n\010document\030\001 \001(\0132*.google.cloud.content" + + "warehouse.v1.Document\022N\n\022rule_engine_out" + + "put\030\002 \001(\01322.google.cloud.contentwarehous" + + "e.v1.RuleEngineOutput\022D\n\010metadata\030\003 \001(\0132" + + "2.google.cloud.contentwarehouse.v1.Respo" + + "nseMetadata\"\243\001\n\010QAResult\022H\n\nhighlights\030\001" + + " \003(\01324.google.cloud.contentwarehouse.v1." + + "QAResult.Highlight\022\030\n\020confidence_score\030\002" + + " \001(\002\0323\n\tHighlight\022\023\n\013start_index\030\001 \001(\005\022\021" + + "\n\tend_index\030\002 \001(\005\"\374\003\n\027SearchDocumentsRes" + + "ponse\022f\n\022matching_documents\030\001 \003(\0132J.goog" + + "le.cloud.contentwarehouse.v1.SearchDocum" + + "entsResponse.MatchingDocument\022\027\n\017next_pa" + + "ge_token\030\002 \001(\t\022\022\n\ntotal_size\030\003 \001(\005\022D\n\010me" + + "tadata\030\004 \001(\01322.google.cloud.contentwareh" + + "ouse.v1.ResponseMetadata\022W\n\027histogram_qu" + + "ery_results\030\006 \003(\01326.google.cloud.content" + + "warehouse.v1.HistogramQueryResult\032\254\001\n\020Ma" + + "tchingDocument\022<\n\010document\030\001 \001(\0132*.googl" + + "e.cloud.contentwarehouse.v1.Document\022\033\n\023" + + "search_text_snippet\030\002 \001(\t\022=\n\tqa_result\030\003" + + " \001(\0132*.google.cloud.contentwarehouse.v1." + + "QAResult\"\177\n\020FetchAclResponse\022%\n\006policy\030\001" + + " \001(\0132\025.google.iam.v1.Policy\022D\n\010metadata\030" + + "\002 \001(\01322.google.cloud.contentwarehouse.v1" + + ".ResponseMetadata\"}\n\016SetAclResponse\022%\n\006p" + + "olicy\030\001 \001(\0132\025.google.iam.v1.Policy\022D\n\010me" + + "tadata\030\002 \001(\01322.google.cloud.contentwareh" + + "ouse.v1.ResponseMetadata2\350\r\n\017DocumentSer" + + "vice\022\317\001\n\016CreateDocument\0227.google.cloud.c" + + "ontentwarehouse.v1.CreateDocumentRequest" + + "\0328.google.cloud.contentwarehouse.v1.Crea" + + "teDocumentResponse\"J\202\323\344\223\0022\"-/v1/{parent=" + + "projects/*/locations/*}/documents:\001*\332A\017p" + + "arent,document\022\371\001\n\013GetDocument\0224.google." + + "cloud.contentwarehouse.v1.GetDocumentReq" + + "uest\032*.google.cloud.contentwarehouse.v1." + + "Document\"\207\001\202\323\344\223\002z\"1/v1/{name=projects/*/" + + "locations/*/documents/*}:get:\001*ZB\"=/v1/{" + + "name=projects/*/locations/*/documents/re" + + "ferenceId/*}:get:\001*\332A\004name\022\216\002\n\016UpdateDoc" + + "ument\0227.google.cloud.contentwarehouse.v1" + + ".UpdateDocumentRequest\0328.google.cloud.co" + + "ntentwarehouse.v1.UpdateDocumentResponse" + + "\"\210\001\202\323\344\223\002r2-/v1/{name=projects/*/location" + + "s/*/documents/*}:\001*Z>29/v1/{name=project" + + "s/*/locations/*/documents/referenceId/*}" + + ":\001*\332A\rname,document\022\362\001\n\016DeleteDocument\0227" + + ".google.cloud.contentwarehouse.v1.Delete" + + "DocumentRequest\032\026.google.protobuf.Empty\"" + + "\216\001\202\323\344\223\002\200\001\"4/v1/{name=projects/*/location" + + "s/*/documents/*}:delete:\001*ZE\"@/v1/{name=" + + "projects/*/locations/*/documents/referen" + + "ceId/*}:delete:\001*\332A\004name\022\320\001\n\017SearchDocum" + + "ents\0228.google.cloud.contentwarehouse.v1." + + "SearchDocumentsRequest\0329.google.cloud.co" + + "ntentwarehouse.v1.SearchDocumentsRespons" + + "e\"H\202\323\344\223\0029\"4/v1/{parent=projects/*/locati" + + "ons/*}/documents:search:\001*\332A\006parent\022\354\001\n\010" + + "FetchAcl\0221.google.cloud.contentwarehouse" + + ".v1.FetchAclRequest\0322.google.cloud.conte" + + "ntwarehouse.v1.FetchAclResponse\"y\202\323\344\223\002h\"" + + ":/v1/{resource=projects/*/locations/*/do" + + "cuments/*}:fetchAcl:\001*Z\'\"\"/v1/{resource=" + + "projects/*}:fetchAcl:\001*\332A\010resource\022\351\001\n\006S" + + "etAcl\022/.google.cloud.contentwarehouse.v1" + + ".SetAclRequest\0320.google.cloud.contentwar" + + "ehouse.v1.SetAclResponse\"|\202\323\344\223\002d\"8/v1/{r" + + "esource=projects/*/locations/*/documents" + + "/*}:setAcl:\001*Z%\" /v1/{resource=projects/" + + "*}:setAcl:\001*\332A\017resource,policy\032S\312A\037conte" + + "ntwarehouse.googleapis.com\322A.https://www" + + ".googleapis.com/auth/cloud-platformB\220\001\n$" + + "com.google.cloud.contentwarehouse.v1B\024Do" + + "cumentServiceProtoP\001ZPgoogle.golang.org/" + + "genproto/googleapis/cloud/contentwarehou" + + "se/v1;contentwarehouseb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.contentwarehouse.v1.CommonProto.getDescriptor(), + com.google.cloud.contentwarehouse.v1.DocumentProto.getDescriptor(), + com.google.cloud.contentwarehouse.v1.DocumentServiceRequestProto.getDescriptor(), + com.google.cloud.contentwarehouse.v1.HistogramProto.getDescriptor(), + com.google.cloud.contentwarehouse.v1.RuleEngineProto.getDescriptor(), + com.google.iam.v1.PolicyProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + }); + internal_static_google_cloud_contentwarehouse_v1_CreateDocumentResponse_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_contentwarehouse_v1_CreateDocumentResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_CreateDocumentResponse_descriptor, + new java.lang.String[] { + "Document", "RuleEngineOutput", "Metadata", + }); + internal_static_google_cloud_contentwarehouse_v1_UpdateDocumentResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_contentwarehouse_v1_UpdateDocumentResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_UpdateDocumentResponse_descriptor, + new java.lang.String[] { + "Document", "RuleEngineOutput", "Metadata", + }); + internal_static_google_cloud_contentwarehouse_v1_QAResult_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_contentwarehouse_v1_QAResult_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_QAResult_descriptor, + new java.lang.String[] { + "Highlights", "ConfidenceScore", + }); + internal_static_google_cloud_contentwarehouse_v1_QAResult_Highlight_descriptor = + internal_static_google_cloud_contentwarehouse_v1_QAResult_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_contentwarehouse_v1_QAResult_Highlight_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_QAResult_Highlight_descriptor, + new java.lang.String[] { + "StartIndex", "EndIndex", + }); + internal_static_google_cloud_contentwarehouse_v1_SearchDocumentsResponse_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_contentwarehouse_v1_SearchDocumentsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_SearchDocumentsResponse_descriptor, + new java.lang.String[] { + "MatchingDocuments", + "NextPageToken", + "TotalSize", + "Metadata", + "HistogramQueryResults", + }); + internal_static_google_cloud_contentwarehouse_v1_SearchDocumentsResponse_MatchingDocument_descriptor = + internal_static_google_cloud_contentwarehouse_v1_SearchDocumentsResponse_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_contentwarehouse_v1_SearchDocumentsResponse_MatchingDocument_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_SearchDocumentsResponse_MatchingDocument_descriptor, + new java.lang.String[] { + "Document", "SearchTextSnippet", "QaResult", + }); + internal_static_google_cloud_contentwarehouse_v1_FetchAclResponse_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_contentwarehouse_v1_FetchAclResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_FetchAclResponse_descriptor, + new java.lang.String[] { + "Policy", "Metadata", + }); + internal_static_google_cloud_contentwarehouse_v1_SetAclResponse_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_contentwarehouse_v1_SetAclResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_SetAclResponse_descriptor, + new java.lang.String[] { + "Policy", "Metadata", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.contentwarehouse.v1.CommonProto.getDescriptor(); + com.google.cloud.contentwarehouse.v1.DocumentProto.getDescriptor(); + com.google.cloud.contentwarehouse.v1.DocumentServiceRequestProto.getDescriptor(); + com.google.cloud.contentwarehouse.v1.HistogramProto.getDescriptor(); + com.google.cloud.contentwarehouse.v1.RuleEngineProto.getDescriptor(); + com.google.iam.v1.PolicyProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentServiceRequestProto.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentServiceRequestProto.java new file mode 100644 index 000000000000..32cccbe95280 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/DocumentServiceRequestProto.java @@ -0,0 +1,264 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_service_request.proto + +package com.google.cloud.contentwarehouse.v1; + +public final class DocumentServiceRequestProto { + private DocumentServiceRequestProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_CloudAIDocumentOption_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_CloudAIDocumentOption_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_CloudAIDocumentOption_CustomizedEntitiesPropertiesConversionsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_CloudAIDocumentOption_CustomizedEntitiesPropertiesConversionsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_CreateDocumentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_CreateDocumentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_GetDocumentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_GetDocumentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_UpdateDocumentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_UpdateDocumentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_DeleteDocumentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_DeleteDocumentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_SearchDocumentsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_SearchDocumentsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_FetchAclRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_FetchAclRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_SetAclRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_SetAclRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n?google/cloud/contentwarehouse/v1/docum" + + "ent_service_request.proto\022 google.cloud." + + "contentwarehouse.v1\032\037google/api/field_be" + + "havior.proto\032\031google/api/resource.proto\032" + + "-google/cloud/contentwarehouse/v1/common" + + ".proto\032/google/cloud/contentwarehouse/v1" + + "/document.proto\032.google/cloud/contentwar" + + "ehouse/v1/filters.proto\0320google/cloud/co" + + "ntentwarehouse/v1/histogram.proto\032\032googl" + + "e/iam/v1/policy.proto\032 google/protobuf/f" + + "ield_mask.proto\"\247\002\n\025CloudAIDocumentOptio" + + "n\022#\n\033enable_entities_conversions\030\001 \001(\010\022\230" + + "\001\n*customized_entities_properties_conver" + + "sions\030\002 \003(\0132d.google.cloud.contentwareho" + + "use.v1.CloudAIDocumentOption.CustomizedE" + + "ntitiesPropertiesConversionsEntry\032N\n,Cus" + + "tomizedEntitiesPropertiesConversionsEntr" + + "y\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\234\003\n\025Cr" + + "eateDocumentRequest\022@\n\006parent\030\001 \001(\tB0\340A\002" + + "\372A*\n(contentwarehouse.googleapis.com/Loc" + + "ation\022A\n\010document\030\002 \001(\0132*.google.cloud.c" + + "ontentwarehouse.v1.DocumentB\003\340A\002\022K\n\020requ" + + "est_metadata\030\003 \001(\01321.google.cloud.conten" + + "twarehouse.v1.RequestMetadata\022%\n\006policy\030" + + "\004 \001(\0132\025.google.iam.v1.Policy\022Y\n\030cloud_ai" + + "_document_option\030\005 \001(\01327.google.cloud.co" + + "ntentwarehouse.v1.CloudAIDocumentOption\022" + + "/\n\013create_mask\030\006 \001(\0132\032.google.protobuf.F" + + "ieldMask\"\241\001\n\022GetDocumentRequest\022>\n\004name\030" + + "\001 \001(\tB0\340A\002\372A*\n(contentwarehouse.googleap" + + "is.com/Document\022K\n\020request_metadata\030\002 \001(" + + "\01321.google.cloud.contentwarehouse.v1.Req" + + "uestMetadata\"\213\003\n\025UpdateDocumentRequest\022>" + + "\n\004name\030\001 \001(\tB0\340A\002\372A*\n(contentwarehouse.g" + + "oogleapis.com/Document\022A\n\010document\030\002 \001(\013" + + "2*.google.cloud.contentwarehouse.v1.Docu" + + "mentB\003\340A\002\022K\n\020request_metadata\030\003 \001(\01321.go" + + "ogle.cloud.contentwarehouse.v1.RequestMe" + + "tadata\022Y\n\030cloud_ai_document_option\030\005 \001(\013" + + "27.google.cloud.contentwarehouse.v1.Clou" + + "dAIDocumentOption\022G\n\016update_options\030\006 \001(" + + "\0132/.google.cloud.contentwarehouse.v1.Upd" + + "ateOptions\"\244\001\n\025DeleteDocumentRequest\022>\n\004" + + "name\030\001 \001(\tB0\340A\002\372A*\n(contentwarehouse.goo" + + "gleapis.com/Document\022K\n\020request_metadata" + + "\030\002 \001(\01321.google.cloud.contentwarehouse.v" + + "1.RequestMetadata\"\271\003\n\026SearchDocumentsReq" + + "uest\022@\n\006parent\030\001 \001(\tB0\340A\002\372A*\n(contentwar" + + "ehouse.googleapis.com/Location\022K\n\020reques" + + "t_metadata\030\003 \001(\01321.google.cloud.contentw" + + "arehouse.v1.RequestMetadata\022G\n\016document_" + + "query\030\004 \001(\0132/.google.cloud.contentwareho" + + "use.v1.DocumentQuery\022\016\n\006offset\030\005 \001(\005\022\021\n\t" + + "page_size\030\006 \001(\005\022\022\n\npage_token\030\007 \001(\t\022\020\n\010o" + + "rder_by\030\010 \001(\t\022K\n\021histogram_queries\030\t \003(\013" + + "20.google.cloud.contentwarehouse.v1.Hist" + + "ogramQuery\022\032\n\022require_total_size\030\n \001(\010\022\025" + + "\n\rqa_size_limit\030\013 \001(\005\"\214\001\n\017FetchAclReques" + + "t\022\025\n\010resource\030\001 \001(\tB\003\340A\002\022K\n\020request_meta" + + "data\030\002 \001(\01321.google.cloud.contentwarehou" + + "se.v1.RequestMetadata\022\025\n\rproject_owner\030\003" + + " \001(\010\"\266\001\n\rSetAclRequest\022\025\n\010resource\030\001 \001(\t" + + "B\003\340A\002\022*\n\006policy\030\002 \001(\0132\025.google.iam.v1.Po" + + "licyB\003\340A\002\022K\n\020request_metadata\030\003 \001(\01321.go" + + "ogle.cloud.contentwarehouse.v1.RequestMe" + + "tadata\022\025\n\rproject_owner\030\004 \001(\010B\227\001\n$com.go" + + "ogle.cloud.contentwarehouse.v1B\033Document" + + "ServiceRequestProtoP\001ZPgoogle.golang.org" + + "/genproto/googleapis/cloud/contentwareho" + + "use/v1;contentwarehouseb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.contentwarehouse.v1.CommonProto.getDescriptor(), + com.google.cloud.contentwarehouse.v1.DocumentProto.getDescriptor(), + com.google.cloud.contentwarehouse.v1.FiltersProto.getDescriptor(), + com.google.cloud.contentwarehouse.v1.HistogramProto.getDescriptor(), + com.google.iam.v1.PolicyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + }); + internal_static_google_cloud_contentwarehouse_v1_CloudAIDocumentOption_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_contentwarehouse_v1_CloudAIDocumentOption_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_CloudAIDocumentOption_descriptor, + new java.lang.String[] { + "EnableEntitiesConversions", "CustomizedEntitiesPropertiesConversions", + }); + internal_static_google_cloud_contentwarehouse_v1_CloudAIDocumentOption_CustomizedEntitiesPropertiesConversionsEntry_descriptor = + internal_static_google_cloud_contentwarehouse_v1_CloudAIDocumentOption_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_contentwarehouse_v1_CloudAIDocumentOption_CustomizedEntitiesPropertiesConversionsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_CloudAIDocumentOption_CustomizedEntitiesPropertiesConversionsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_contentwarehouse_v1_CreateDocumentRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_contentwarehouse_v1_CreateDocumentRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_CreateDocumentRequest_descriptor, + new java.lang.String[] { + "Parent", + "Document", + "RequestMetadata", + "Policy", + "CloudAiDocumentOption", + "CreateMask", + }); + internal_static_google_cloud_contentwarehouse_v1_GetDocumentRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_contentwarehouse_v1_GetDocumentRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_GetDocumentRequest_descriptor, + new java.lang.String[] { + "Name", "RequestMetadata", + }); + internal_static_google_cloud_contentwarehouse_v1_UpdateDocumentRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_contentwarehouse_v1_UpdateDocumentRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_UpdateDocumentRequest_descriptor, + new java.lang.String[] { + "Name", "Document", "RequestMetadata", "CloudAiDocumentOption", "UpdateOptions", + }); + internal_static_google_cloud_contentwarehouse_v1_DeleteDocumentRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_contentwarehouse_v1_DeleteDocumentRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_DeleteDocumentRequest_descriptor, + new java.lang.String[] { + "Name", "RequestMetadata", + }); + internal_static_google_cloud_contentwarehouse_v1_SearchDocumentsRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_contentwarehouse_v1_SearchDocumentsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_SearchDocumentsRequest_descriptor, + new java.lang.String[] { + "Parent", + "RequestMetadata", + "DocumentQuery", + "Offset", + "PageSize", + "PageToken", + "OrderBy", + "HistogramQueries", + "RequireTotalSize", + "QaSizeLimit", + }); + internal_static_google_cloud_contentwarehouse_v1_FetchAclRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_contentwarehouse_v1_FetchAclRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_FetchAclRequest_descriptor, + new java.lang.String[] { + "Resource", "RequestMetadata", "ProjectOwner", + }); + internal_static_google_cloud_contentwarehouse_v1_SetAclRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_contentwarehouse_v1_SetAclRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_SetAclRequest_descriptor, + new java.lang.String[] { + "Resource", "Policy", "RequestMetadata", "ProjectOwner", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.contentwarehouse.v1.CommonProto.getDescriptor(); + com.google.cloud.contentwarehouse.v1.DocumentProto.getDescriptor(); + com.google.cloud.contentwarehouse.v1.FiltersProto.getDescriptor(); + com.google.cloud.contentwarehouse.v1.HistogramProto.getDescriptor(); + com.google.iam.v1.PolicyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/EnumArray.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/EnumArray.java new file mode 100644 index 000000000000..cd222931fec7 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/EnumArray.java @@ -0,0 +1,709 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Enum values.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.EnumArray} + */ +public final class EnumArray extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.EnumArray) + EnumArrayOrBuilder { + private static final long serialVersionUID = 0L; + // Use EnumArray.newBuilder() to construct. + private EnumArray(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EnumArray() { + values_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EnumArray(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_EnumArray_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_EnumArray_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.EnumArray.class, + com.google.cloud.contentwarehouse.v1.EnumArray.Builder.class); + } + + public static final int VALUES_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList values_; + /** + * + * + *
+   * List of enum values.
+   * 
+ * + * repeated string values = 1; + * + * @return A list containing the values. + */ + public com.google.protobuf.ProtocolStringList getValuesList() { + return values_; + } + /** + * + * + *
+   * List of enum values.
+   * 
+ * + * repeated string values = 1; + * + * @return The count of values. + */ + public int getValuesCount() { + return values_.size(); + } + /** + * + * + *
+   * List of enum values.
+   * 
+ * + * repeated string values = 1; + * + * @param index The index of the element to return. + * @return The values at the given index. + */ + public java.lang.String getValues(int index) { + return values_.get(index); + } + /** + * + * + *
+   * List of enum values.
+   * 
+ * + * repeated string values = 1; + * + * @param index The index of the value to return. + * @return The bytes of the values at the given index. + */ + public com.google.protobuf.ByteString getValuesBytes(int index) { + return values_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < values_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, values_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < values_.size(); i++) { + dataSize += computeStringSizeNoTag(values_.getRaw(i)); + } + size += dataSize; + size += 1 * getValuesList().size(); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.EnumArray)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.EnumArray other = + (com.google.cloud.contentwarehouse.v1.EnumArray) obj; + + if (!getValuesList().equals(other.getValuesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getValuesCount() > 0) { + hash = (37 * hash) + VALUES_FIELD_NUMBER; + hash = (53 * hash) + getValuesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.EnumArray parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.EnumArray parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.EnumArray parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.EnumArray parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.EnumArray parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.EnumArray parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.EnumArray parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.EnumArray parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.EnumArray parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.EnumArray parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.EnumArray parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.EnumArray parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.contentwarehouse.v1.EnumArray prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Enum values.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.EnumArray} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.EnumArray) + com.google.cloud.contentwarehouse.v1.EnumArrayOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_EnumArray_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_EnumArray_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.EnumArray.class, + com.google.cloud.contentwarehouse.v1.EnumArray.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.EnumArray.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + values_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_EnumArray_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.EnumArray getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.EnumArray.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.EnumArray build() { + com.google.cloud.contentwarehouse.v1.EnumArray result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.EnumArray buildPartial() { + com.google.cloud.contentwarehouse.v1.EnumArray result = + new com.google.cloud.contentwarehouse.v1.EnumArray(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + values_ = values_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.values_ = values_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.EnumArray) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.EnumArray) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.EnumArray other) { + if (other == com.google.cloud.contentwarehouse.v1.EnumArray.getDefaultInstance()) return this; + if (!other.values_.isEmpty()) { + if (values_.isEmpty()) { + values_ = other.values_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureValuesIsMutable(); + values_.addAll(other.values_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureValuesIsMutable(); + values_.add(s); + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList values_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureValuesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + values_ = new com.google.protobuf.LazyStringArrayList(values_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * List of enum values.
+     * 
+ * + * repeated string values = 1; + * + * @return A list containing the values. + */ + public com.google.protobuf.ProtocolStringList getValuesList() { + return values_.getUnmodifiableView(); + } + /** + * + * + *
+     * List of enum values.
+     * 
+ * + * repeated string values = 1; + * + * @return The count of values. + */ + public int getValuesCount() { + return values_.size(); + } + /** + * + * + *
+     * List of enum values.
+     * 
+ * + * repeated string values = 1; + * + * @param index The index of the element to return. + * @return The values at the given index. + */ + public java.lang.String getValues(int index) { + return values_.get(index); + } + /** + * + * + *
+     * List of enum values.
+     * 
+ * + * repeated string values = 1; + * + * @param index The index of the value to return. + * @return The bytes of the values at the given index. + */ + public com.google.protobuf.ByteString getValuesBytes(int index) { + return values_.getByteString(index); + } + /** + * + * + *
+     * List of enum values.
+     * 
+ * + * repeated string values = 1; + * + * @param index The index to set the value at. + * @param value The values to set. + * @return This builder for chaining. + */ + public Builder setValues(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * List of enum values.
+     * 
+ * + * repeated string values = 1; + * + * @param value The values to add. + * @return This builder for chaining. + */ + public Builder addValues(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * List of enum values.
+     * 
+ * + * repeated string values = 1; + * + * @param values The values to add. + * @return This builder for chaining. + */ + public Builder addAllValues(java.lang.Iterable values) { + ensureValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, values_); + onChanged(); + return this; + } + /** + * + * + *
+     * List of enum values.
+     * 
+ * + * repeated string values = 1; + * + * @return This builder for chaining. + */ + public Builder clearValues() { + values_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * List of enum values.
+     * 
+ * + * repeated string values = 1; + * + * @param value The bytes of the values to add. + * @return This builder for chaining. + */ + public Builder addValuesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureValuesIsMutable(); + values_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.EnumArray) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.EnumArray) + private static final com.google.cloud.contentwarehouse.v1.EnumArray DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.EnumArray(); + } + + public static com.google.cloud.contentwarehouse.v1.EnumArray getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EnumArray parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.EnumArray getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/EnumArrayOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/EnumArrayOrBuilder.java new file mode 100644 index 000000000000..19bd9c8ec58b --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/EnumArrayOrBuilder.java @@ -0,0 +1,76 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface EnumArrayOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.EnumArray) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of enum values.
+   * 
+ * + * repeated string values = 1; + * + * @return A list containing the values. + */ + java.util.List getValuesList(); + /** + * + * + *
+   * List of enum values.
+   * 
+ * + * repeated string values = 1; + * + * @return The count of values. + */ + int getValuesCount(); + /** + * + * + *
+   * List of enum values.
+   * 
+ * + * repeated string values = 1; + * + * @param index The index of the element to return. + * @return The values at the given index. + */ + java.lang.String getValues(int index); + /** + * + * + *
+   * List of enum values.
+   * 
+ * + * repeated string values = 1; + * + * @param index The index of the value to return. + * @return The bytes of the values at the given index. + */ + com.google.protobuf.ByteString getValuesBytes(int index); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/EnumTypeOptions.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/EnumTypeOptions.java new file mode 100644 index 000000000000..89f9791e6582 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/EnumTypeOptions.java @@ -0,0 +1,809 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_schema.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Configurations for an enum/categorical property.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.EnumTypeOptions} + */ +public final class EnumTypeOptions extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.EnumTypeOptions) + EnumTypeOptionsOrBuilder { + private static final long serialVersionUID = 0L; + // Use EnumTypeOptions.newBuilder() to construct. + private EnumTypeOptions(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EnumTypeOptions() { + possibleValues_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EnumTypeOptions(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaProto + .internal_static_google_cloud_contentwarehouse_v1_EnumTypeOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaProto + .internal_static_google_cloud_contentwarehouse_v1_EnumTypeOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.EnumTypeOptions.class, + com.google.cloud.contentwarehouse.v1.EnumTypeOptions.Builder.class); + } + + public static final int POSSIBLE_VALUES_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList possibleValues_; + /** + * + * + *
+   * Required. List of possible enum values.
+   * 
+ * + * repeated string possible_values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the possibleValues. + */ + public com.google.protobuf.ProtocolStringList getPossibleValuesList() { + return possibleValues_; + } + /** + * + * + *
+   * Required. List of possible enum values.
+   * 
+ * + * repeated string possible_values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of possibleValues. + */ + public int getPossibleValuesCount() { + return possibleValues_.size(); + } + /** + * + * + *
+   * Required. List of possible enum values.
+   * 
+ * + * repeated string possible_values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The possibleValues at the given index. + */ + public java.lang.String getPossibleValues(int index) { + return possibleValues_.get(index); + } + /** + * + * + *
+   * Required. List of possible enum values.
+   * 
+ * + * repeated string possible_values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the possibleValues at the given index. + */ + public com.google.protobuf.ByteString getPossibleValuesBytes(int index) { + return possibleValues_.getByteString(index); + } + + public static final int VALIDATION_CHECK_DISABLED_FIELD_NUMBER = 2; + private boolean validationCheckDisabled_; + /** + * + * + *
+   * Make sure the Enum property value provided in the document is in the
+   * possile value list during document creation. The validation check runs by
+   * default.
+   * 
+ * + * bool validation_check_disabled = 2; + * + * @return The validationCheckDisabled. + */ + @java.lang.Override + public boolean getValidationCheckDisabled() { + return validationCheckDisabled_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < possibleValues_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, possibleValues_.getRaw(i)); + } + if (validationCheckDisabled_ != false) { + output.writeBool(2, validationCheckDisabled_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < possibleValues_.size(); i++) { + dataSize += computeStringSizeNoTag(possibleValues_.getRaw(i)); + } + size += dataSize; + size += 1 * getPossibleValuesList().size(); + } + if (validationCheckDisabled_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, validationCheckDisabled_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.EnumTypeOptions)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.EnumTypeOptions other = + (com.google.cloud.contentwarehouse.v1.EnumTypeOptions) obj; + + if (!getPossibleValuesList().equals(other.getPossibleValuesList())) return false; + if (getValidationCheckDisabled() != other.getValidationCheckDisabled()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getPossibleValuesCount() > 0) { + hash = (37 * hash) + POSSIBLE_VALUES_FIELD_NUMBER; + hash = (53 * hash) + getPossibleValuesList().hashCode(); + } + hash = (37 * hash) + VALIDATION_CHECK_DISABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidationCheckDisabled()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.EnumTypeOptions parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.EnumTypeOptions parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.EnumTypeOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.EnumTypeOptions parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.EnumTypeOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.EnumTypeOptions parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.EnumTypeOptions parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.EnumTypeOptions parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.EnumTypeOptions parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.EnumTypeOptions parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.EnumTypeOptions parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.EnumTypeOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.contentwarehouse.v1.EnumTypeOptions prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Configurations for an enum/categorical property.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.EnumTypeOptions} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.EnumTypeOptions) + com.google.cloud.contentwarehouse.v1.EnumTypeOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaProto + .internal_static_google_cloud_contentwarehouse_v1_EnumTypeOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaProto + .internal_static_google_cloud_contentwarehouse_v1_EnumTypeOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.EnumTypeOptions.class, + com.google.cloud.contentwarehouse.v1.EnumTypeOptions.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.EnumTypeOptions.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + possibleValues_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + validationCheckDisabled_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaProto + .internal_static_google_cloud_contentwarehouse_v1_EnumTypeOptions_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.EnumTypeOptions getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.EnumTypeOptions.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.EnumTypeOptions build() { + com.google.cloud.contentwarehouse.v1.EnumTypeOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.EnumTypeOptions buildPartial() { + com.google.cloud.contentwarehouse.v1.EnumTypeOptions result = + new com.google.cloud.contentwarehouse.v1.EnumTypeOptions(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + possibleValues_ = possibleValues_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.possibleValues_ = possibleValues_; + result.validationCheckDisabled_ = validationCheckDisabled_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.EnumTypeOptions) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.EnumTypeOptions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.EnumTypeOptions other) { + if (other == com.google.cloud.contentwarehouse.v1.EnumTypeOptions.getDefaultInstance()) + return this; + if (!other.possibleValues_.isEmpty()) { + if (possibleValues_.isEmpty()) { + possibleValues_ = other.possibleValues_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePossibleValuesIsMutable(); + possibleValues_.addAll(other.possibleValues_); + } + onChanged(); + } + if (other.getValidationCheckDisabled() != false) { + setValidationCheckDisabled(other.getValidationCheckDisabled()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + ensurePossibleValuesIsMutable(); + possibleValues_.add(s); + break; + } // case 10 + case 16: + { + validationCheckDisabled_ = input.readBool(); + + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList possibleValues_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensurePossibleValuesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + possibleValues_ = new com.google.protobuf.LazyStringArrayList(possibleValues_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * Required. List of possible enum values.
+     * 
+ * + * repeated string possible_values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the possibleValues. + */ + public com.google.protobuf.ProtocolStringList getPossibleValuesList() { + return possibleValues_.getUnmodifiableView(); + } + /** + * + * + *
+     * Required. List of possible enum values.
+     * 
+ * + * repeated string possible_values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of possibleValues. + */ + public int getPossibleValuesCount() { + return possibleValues_.size(); + } + /** + * + * + *
+     * Required. List of possible enum values.
+     * 
+ * + * repeated string possible_values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The possibleValues at the given index. + */ + public java.lang.String getPossibleValues(int index) { + return possibleValues_.get(index); + } + /** + * + * + *
+     * Required. List of possible enum values.
+     * 
+ * + * repeated string possible_values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the possibleValues at the given index. + */ + public com.google.protobuf.ByteString getPossibleValuesBytes(int index) { + return possibleValues_.getByteString(index); + } + /** + * + * + *
+     * Required. List of possible enum values.
+     * 
+ * + * repeated string possible_values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index to set the value at. + * @param value The possibleValues to set. + * @return This builder for chaining. + */ + public Builder setPossibleValues(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePossibleValuesIsMutable(); + possibleValues_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. List of possible enum values.
+     * 
+ * + * repeated string possible_values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The possibleValues to add. + * @return This builder for chaining. + */ + public Builder addPossibleValues(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePossibleValuesIsMutable(); + possibleValues_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. List of possible enum values.
+     * 
+ * + * repeated string possible_values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param values The possibleValues to add. + * @return This builder for chaining. + */ + public Builder addAllPossibleValues(java.lang.Iterable values) { + ensurePossibleValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, possibleValues_); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. List of possible enum values.
+     * 
+ * + * repeated string possible_values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearPossibleValues() { + possibleValues_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. List of possible enum values.
+     * 
+ * + * repeated string possible_values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes of the possibleValues to add. + * @return This builder for chaining. + */ + public Builder addPossibleValuesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensurePossibleValuesIsMutable(); + possibleValues_.add(value); + onChanged(); + return this; + } + + private boolean validationCheckDisabled_; + /** + * + * + *
+     * Make sure the Enum property value provided in the document is in the
+     * possile value list during document creation. The validation check runs by
+     * default.
+     * 
+ * + * bool validation_check_disabled = 2; + * + * @return The validationCheckDisabled. + */ + @java.lang.Override + public boolean getValidationCheckDisabled() { + return validationCheckDisabled_; + } + /** + * + * + *
+     * Make sure the Enum property value provided in the document is in the
+     * possile value list during document creation. The validation check runs by
+     * default.
+     * 
+ * + * bool validation_check_disabled = 2; + * + * @param value The validationCheckDisabled to set. + * @return This builder for chaining. + */ + public Builder setValidationCheckDisabled(boolean value) { + + validationCheckDisabled_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Make sure the Enum property value provided in the document is in the
+     * possile value list during document creation. The validation check runs by
+     * default.
+     * 
+ * + * bool validation_check_disabled = 2; + * + * @return This builder for chaining. + */ + public Builder clearValidationCheckDisabled() { + + validationCheckDisabled_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.EnumTypeOptions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.EnumTypeOptions) + private static final com.google.cloud.contentwarehouse.v1.EnumTypeOptions DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.EnumTypeOptions(); + } + + public static com.google.cloud.contentwarehouse.v1.EnumTypeOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EnumTypeOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.EnumTypeOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/EnumTypeOptionsOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/EnumTypeOptionsOrBuilder.java new file mode 100644 index 000000000000..5137a7bdc732 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/EnumTypeOptionsOrBuilder.java @@ -0,0 +1,91 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_schema.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface EnumTypeOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.EnumTypeOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. List of possible enum values.
+   * 
+ * + * repeated string possible_values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the possibleValues. + */ + java.util.List getPossibleValuesList(); + /** + * + * + *
+   * Required. List of possible enum values.
+   * 
+ * + * repeated string possible_values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of possibleValues. + */ + int getPossibleValuesCount(); + /** + * + * + *
+   * Required. List of possible enum values.
+   * 
+ * + * repeated string possible_values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The possibleValues at the given index. + */ + java.lang.String getPossibleValues(int index); + /** + * + * + *
+   * Required. List of possible enum values.
+   * 
+ * + * repeated string possible_values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the possibleValues at the given index. + */ + com.google.protobuf.ByteString getPossibleValuesBytes(int index); + + /** + * + * + *
+   * Make sure the Enum property value provided in the document is in the
+   * possile value list during document creation. The validation check runs by
+   * default.
+   * 
+ * + * bool validation_check_disabled = 2; + * + * @return The validationCheckDisabled. + */ + boolean getValidationCheckDisabled(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/EnumValue.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/EnumValue.java new file mode 100644 index 000000000000..e3615bc8aa61 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/EnumValue.java @@ -0,0 +1,621 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Represents the string value of the enum field.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.EnumValue} + */ +public final class EnumValue extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.EnumValue) + EnumValueOrBuilder { + private static final long serialVersionUID = 0L; + // Use EnumValue.newBuilder() to construct. + private EnumValue(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EnumValue() { + value_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EnumValue(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_EnumValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_EnumValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.EnumValue.class, + com.google.cloud.contentwarehouse.v1.EnumValue.Builder.class); + } + + public static final int VALUE_FIELD_NUMBER = 1; + private volatile java.lang.Object value_; + /** + * + * + *
+   * String value of the enum field. This must match defined set of enums
+   * in document schema using EnumTypeOptions.
+   * 
+ * + * string value = 1; + * + * @return The value. + */ + @java.lang.Override + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } + } + /** + * + * + *
+   * String value of the enum field. This must match defined set of enums
+   * in document schema using EnumTypeOptions.
+   * 
+ * + * string value = 1; + * + * @return The bytes for value. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(value_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, value_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(value_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, value_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.EnumValue)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.EnumValue other = + (com.google.cloud.contentwarehouse.v1.EnumValue) obj; + + if (!getValue().equals(other.getValue())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.EnumValue parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.EnumValue parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.EnumValue parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.EnumValue parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.EnumValue parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.EnumValue parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.EnumValue parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.EnumValue parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.EnumValue parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.EnumValue parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.EnumValue parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.EnumValue parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.contentwarehouse.v1.EnumValue prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Represents the string value of the enum field.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.EnumValue} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.EnumValue) + com.google.cloud.contentwarehouse.v1.EnumValueOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_EnumValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_EnumValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.EnumValue.class, + com.google.cloud.contentwarehouse.v1.EnumValue.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.EnumValue.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + value_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_EnumValue_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.EnumValue getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.EnumValue.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.EnumValue build() { + com.google.cloud.contentwarehouse.v1.EnumValue result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.EnumValue buildPartial() { + com.google.cloud.contentwarehouse.v1.EnumValue result = + new com.google.cloud.contentwarehouse.v1.EnumValue(this); + result.value_ = value_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.EnumValue) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.EnumValue) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.EnumValue other) { + if (other == com.google.cloud.contentwarehouse.v1.EnumValue.getDefaultInstance()) return this; + if (!other.getValue().isEmpty()) { + value_ = other.value_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + value_ = input.readStringRequireUtf8(); + + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object value_ = ""; + /** + * + * + *
+     * String value of the enum field. This must match defined set of enums
+     * in document schema using EnumTypeOptions.
+     * 
+ * + * string value = 1; + * + * @return The value. + */ + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * String value of the enum field. This must match defined set of enums
+     * in document schema using EnumTypeOptions.
+     * 
+ * + * string value = 1; + * + * @return The bytes for value. + */ + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * String value of the enum field. This must match defined set of enums
+     * in document schema using EnumTypeOptions.
+     * 
+ * + * string value = 1; + * + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + value_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * String value of the enum field. This must match defined set of enums
+     * in document schema using EnumTypeOptions.
+     * 
+ * + * string value = 1; + * + * @return This builder for chaining. + */ + public Builder clearValue() { + + value_ = getDefaultInstance().getValue(); + onChanged(); + return this; + } + /** + * + * + *
+     * String value of the enum field. This must match defined set of enums
+     * in document schema using EnumTypeOptions.
+     * 
+ * + * string value = 1; + * + * @param value The bytes for value to set. + * @return This builder for chaining. + */ + public Builder setValueBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + value_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.EnumValue) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.EnumValue) + private static final com.google.cloud.contentwarehouse.v1.EnumValue DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.EnumValue(); + } + + public static com.google.cloud.contentwarehouse.v1.EnumValue getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EnumValue parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.EnumValue getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/EnumValueOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/EnumValueOrBuilder.java new file mode 100644 index 000000000000..15b36d6be203 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/EnumValueOrBuilder.java @@ -0,0 +1,52 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface EnumValueOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.EnumValue) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * String value of the enum field. This must match defined set of enums
+   * in document schema using EnumTypeOptions.
+   * 
+ * + * string value = 1; + * + * @return The value. + */ + java.lang.String getValue(); + /** + * + * + *
+   * String value of the enum field. This must match defined set of enums
+   * in document schema using EnumTypeOptions.
+   * 
+ * + * string value = 1; + * + * @return The bytes for value. + */ + com.google.protobuf.ByteString getValueBytes(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/FetchAclRequest.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/FetchAclRequest.java new file mode 100644 index 000000000000..e55f3c156a1d --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/FetchAclRequest.java @@ -0,0 +1,1015 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_service_request.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Request message for DocumentService.FetchAcl
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.FetchAclRequest} + */ +public final class FetchAclRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.FetchAclRequest) + FetchAclRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use FetchAclRequest.newBuilder() to construct. + private FetchAclRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FetchAclRequest() { + resource_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FetchAclRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_FetchAclRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_FetchAclRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.FetchAclRequest.class, + com.google.cloud.contentwarehouse.v1.FetchAclRequest.Builder.class); + } + + public static final int RESOURCE_FIELD_NUMBER = 1; + private volatile java.lang.Object 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}.
+   * 
+ * + * string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The resource. + */ + @java.lang.Override + public java.lang.String getResource() { + java.lang.Object ref = resource_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resource_ = s; + return s; + } + } + /** + * + * + *
+   * 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}.
+   * 
+ * + * string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for resource. + */ + @java.lang.Override + public com.google.protobuf.ByteString getResourceBytes() { + java.lang.Object ref = resource_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resource_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUEST_METADATA_FIELD_NUMBER = 2; + private com.google.cloud.contentwarehouse.v1.RequestMetadata requestMetadata_; + /** + * + * + *
+   * The meta information collected about the end user, used to enforce access
+   * control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + * + * @return Whether the requestMetadata field is set. + */ + @java.lang.Override + public boolean hasRequestMetadata() { + return requestMetadata_ != null; + } + /** + * + * + *
+   * The meta information collected about the end user, used to enforce access
+   * control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + * + * @return The requestMetadata. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RequestMetadata getRequestMetadata() { + return requestMetadata_ == null + ? com.google.cloud.contentwarehouse.v1.RequestMetadata.getDefaultInstance() + : requestMetadata_; + } + /** + * + * + *
+   * The meta information collected about the end user, used to enforce access
+   * control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder + getRequestMetadataOrBuilder() { + return getRequestMetadata(); + } + + public static final int PROJECT_OWNER_FIELD_NUMBER = 3; + private boolean projectOwner_; + /** + * + * + *
+   * For Get Project ACL only. Authorization check for end user will be ignored
+   * when project_owner=true.
+   * 
+ * + * bool project_owner = 3; + * + * @return The projectOwner. + */ + @java.lang.Override + public boolean getProjectOwner() { + return projectOwner_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resource_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, resource_); + } + if (requestMetadata_ != null) { + output.writeMessage(2, getRequestMetadata()); + } + if (projectOwner_ != false) { + output.writeBool(3, projectOwner_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resource_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, resource_); + } + if (requestMetadata_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getRequestMetadata()); + } + if (projectOwner_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, projectOwner_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.FetchAclRequest)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.FetchAclRequest other = + (com.google.cloud.contentwarehouse.v1.FetchAclRequest) obj; + + if (!getResource().equals(other.getResource())) return false; + if (hasRequestMetadata() != other.hasRequestMetadata()) return false; + if (hasRequestMetadata()) { + if (!getRequestMetadata().equals(other.getRequestMetadata())) return false; + } + if (getProjectOwner() != other.getProjectOwner()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + RESOURCE_FIELD_NUMBER; + hash = (53 * hash) + getResource().hashCode(); + if (hasRequestMetadata()) { + hash = (37 * hash) + REQUEST_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getRequestMetadata().hashCode(); + } + hash = (37 * hash) + PROJECT_OWNER_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getProjectOwner()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.FetchAclRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.FetchAclRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.FetchAclRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.FetchAclRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.FetchAclRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.FetchAclRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.FetchAclRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.FetchAclRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.FetchAclRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.FetchAclRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.FetchAclRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.FetchAclRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.contentwarehouse.v1.FetchAclRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for DocumentService.FetchAcl
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.FetchAclRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.FetchAclRequest) + com.google.cloud.contentwarehouse.v1.FetchAclRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_FetchAclRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_FetchAclRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.FetchAclRequest.class, + com.google.cloud.contentwarehouse.v1.FetchAclRequest.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.FetchAclRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + resource_ = ""; + + if (requestMetadataBuilder_ == null) { + requestMetadata_ = null; + } else { + requestMetadata_ = null; + requestMetadataBuilder_ = null; + } + projectOwner_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_FetchAclRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.FetchAclRequest getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.FetchAclRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.FetchAclRequest build() { + com.google.cloud.contentwarehouse.v1.FetchAclRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.FetchAclRequest buildPartial() { + com.google.cloud.contentwarehouse.v1.FetchAclRequest result = + new com.google.cloud.contentwarehouse.v1.FetchAclRequest(this); + result.resource_ = resource_; + if (requestMetadataBuilder_ == null) { + result.requestMetadata_ = requestMetadata_; + } else { + result.requestMetadata_ = requestMetadataBuilder_.build(); + } + result.projectOwner_ = projectOwner_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.FetchAclRequest) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.FetchAclRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.FetchAclRequest other) { + if (other == com.google.cloud.contentwarehouse.v1.FetchAclRequest.getDefaultInstance()) + return this; + if (!other.getResource().isEmpty()) { + resource_ = other.resource_; + onChanged(); + } + if (other.hasRequestMetadata()) { + mergeRequestMetadata(other.getRequestMetadata()); + } + if (other.getProjectOwner() != false) { + setProjectOwner(other.getProjectOwner()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + resource_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + input.readMessage(getRequestMetadataFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + case 24: + { + projectOwner_ = input.readBool(); + + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object 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}.
+     * 
+ * + * string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The resource. + */ + public java.lang.String getResource() { + java.lang.Object ref = resource_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resource_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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}.
+     * 
+ * + * string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for resource. + */ + public com.google.protobuf.ByteString getResourceBytes() { + java.lang.Object ref = resource_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resource_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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}.
+     * 
+ * + * string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The resource to set. + * @return This builder for chaining. + */ + public Builder setResource(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + resource_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 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}.
+     * 
+ * + * string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearResource() { + + resource_ = getDefaultInstance().getResource(); + onChanged(); + return this; + } + /** + * + * + *
+     * 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}.
+     * 
+ * + * string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for resource to set. + * @return This builder for chaining. + */ + public Builder setResourceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + resource_ = value; + onChanged(); + return this; + } + + private com.google.cloud.contentwarehouse.v1.RequestMetadata requestMetadata_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.RequestMetadata, + com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder, + com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder> + requestMetadataBuilder_; + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + * + * @return Whether the requestMetadata field is set. + */ + public boolean hasRequestMetadata() { + return requestMetadataBuilder_ != null || requestMetadata_ != null; + } + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + * + * @return The requestMetadata. + */ + public com.google.cloud.contentwarehouse.v1.RequestMetadata getRequestMetadata() { + if (requestMetadataBuilder_ == null) { + return requestMetadata_ == null + ? com.google.cloud.contentwarehouse.v1.RequestMetadata.getDefaultInstance() + : requestMetadata_; + } else { + return requestMetadataBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + */ + public Builder setRequestMetadata(com.google.cloud.contentwarehouse.v1.RequestMetadata value) { + if (requestMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + requestMetadata_ = value; + onChanged(); + } else { + requestMetadataBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + */ + public Builder setRequestMetadata( + com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder builderForValue) { + if (requestMetadataBuilder_ == null) { + requestMetadata_ = builderForValue.build(); + onChanged(); + } else { + requestMetadataBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + */ + public Builder mergeRequestMetadata( + com.google.cloud.contentwarehouse.v1.RequestMetadata value) { + if (requestMetadataBuilder_ == null) { + if (requestMetadata_ != null) { + requestMetadata_ = + com.google.cloud.contentwarehouse.v1.RequestMetadata.newBuilder(requestMetadata_) + .mergeFrom(value) + .buildPartial(); + } else { + requestMetadata_ = value; + } + onChanged(); + } else { + requestMetadataBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + */ + public Builder clearRequestMetadata() { + if (requestMetadataBuilder_ == null) { + requestMetadata_ = null; + onChanged(); + } else { + requestMetadata_ = null; + requestMetadataBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + */ + public com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder + getRequestMetadataBuilder() { + + onChanged(); + return getRequestMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + */ + public com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder + getRequestMetadataOrBuilder() { + if (requestMetadataBuilder_ != null) { + return requestMetadataBuilder_.getMessageOrBuilder(); + } else { + return requestMetadata_ == null + ? com.google.cloud.contentwarehouse.v1.RequestMetadata.getDefaultInstance() + : requestMetadata_; + } + } + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.RequestMetadata, + com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder, + com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder> + getRequestMetadataFieldBuilder() { + if (requestMetadataBuilder_ == null) { + requestMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.RequestMetadata, + com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder, + com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder>( + getRequestMetadata(), getParentForChildren(), isClean()); + requestMetadata_ = null; + } + return requestMetadataBuilder_; + } + + private boolean projectOwner_; + /** + * + * + *
+     * For Get Project ACL only. Authorization check for end user will be ignored
+     * when project_owner=true.
+     * 
+ * + * bool project_owner = 3; + * + * @return The projectOwner. + */ + @java.lang.Override + public boolean getProjectOwner() { + return projectOwner_; + } + /** + * + * + *
+     * For Get Project ACL only. Authorization check for end user will be ignored
+     * when project_owner=true.
+     * 
+ * + * bool project_owner = 3; + * + * @param value The projectOwner to set. + * @return This builder for chaining. + */ + public Builder setProjectOwner(boolean value) { + + projectOwner_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * For Get Project ACL only. Authorization check for end user will be ignored
+     * when project_owner=true.
+     * 
+ * + * bool project_owner = 3; + * + * @return This builder for chaining. + */ + public Builder clearProjectOwner() { + + projectOwner_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.FetchAclRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.FetchAclRequest) + private static final com.google.cloud.contentwarehouse.v1.FetchAclRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.FetchAclRequest(); + } + + public static com.google.cloud.contentwarehouse.v1.FetchAclRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FetchAclRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.FetchAclRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/FetchAclRequestOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/FetchAclRequestOrBuilder.java new file mode 100644 index 000000000000..a6182fb31c13 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/FetchAclRequestOrBuilder.java @@ -0,0 +1,108 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_service_request.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface FetchAclRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.FetchAclRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * 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}.
+   * 
+ * + * string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The resource. + */ + java.lang.String getResource(); + /** + * + * + *
+   * 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}.
+   * 
+ * + * string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for resource. + */ + com.google.protobuf.ByteString getResourceBytes(); + + /** + * + * + *
+   * The meta information collected about the end user, used to enforce access
+   * control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + * + * @return Whether the requestMetadata field is set. + */ + boolean hasRequestMetadata(); + /** + * + * + *
+   * The meta information collected about the end user, used to enforce access
+   * control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + * + * @return The requestMetadata. + */ + com.google.cloud.contentwarehouse.v1.RequestMetadata getRequestMetadata(); + /** + * + * + *
+   * The meta information collected about the end user, used to enforce access
+   * control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + */ + com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder getRequestMetadataOrBuilder(); + + /** + * + * + *
+   * For Get Project ACL only. Authorization check for end user will be ignored
+   * when project_owner=true.
+   * 
+ * + * bool project_owner = 3; + * + * @return The projectOwner. + */ + boolean getProjectOwner(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/FetchAclResponse.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/FetchAclResponse.java new file mode 100644 index 000000000000..d1cbc34d7e65 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/FetchAclResponse.java @@ -0,0 +1,974 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_service.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Response message for DocumentService.FetchAcl.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.FetchAclResponse} + */ +public final class FetchAclResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.FetchAclResponse) + FetchAclResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use FetchAclResponse.newBuilder() to construct. + private FetchAclResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FetchAclResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FetchAclResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceProto + .internal_static_google_cloud_contentwarehouse_v1_FetchAclResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceProto + .internal_static_google_cloud_contentwarehouse_v1_FetchAclResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.FetchAclResponse.class, + com.google.cloud.contentwarehouse.v1.FetchAclResponse.Builder.class); + } + + public static final int POLICY_FIELD_NUMBER = 1; + private com.google.iam.v1.Policy policy_; + /** + * + * + *
+   * The IAM policy.
+   * 
+ * + * .google.iam.v1.Policy policy = 1; + * + * @return Whether the policy field is set. + */ + @java.lang.Override + public boolean hasPolicy() { + return policy_ != null; + } + /** + * + * + *
+   * The IAM policy.
+   * 
+ * + * .google.iam.v1.Policy policy = 1; + * + * @return The policy. + */ + @java.lang.Override + public com.google.iam.v1.Policy getPolicy() { + return policy_ == null ? com.google.iam.v1.Policy.getDefaultInstance() : policy_; + } + /** + * + * + *
+   * The IAM policy.
+   * 
+ * + * .google.iam.v1.Policy policy = 1; + */ + @java.lang.Override + public com.google.iam.v1.PolicyOrBuilder getPolicyOrBuilder() { + return getPolicy(); + } + + public static final int METADATA_FIELD_NUMBER = 2; + private com.google.cloud.contentwarehouse.v1.ResponseMetadata metadata_; + /** + * + * + *
+   * Additional information for the API invocation, such as the request tracking
+   * id.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 2; + * + * @return Whether the metadata field is set. + */ + @java.lang.Override + public boolean hasMetadata() { + return metadata_ != null; + } + /** + * + * + *
+   * Additional information for the API invocation, such as the request tracking
+   * id.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 2; + * + * @return The metadata. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ResponseMetadata getMetadata() { + return metadata_ == null + ? com.google.cloud.contentwarehouse.v1.ResponseMetadata.getDefaultInstance() + : metadata_; + } + /** + * + * + *
+   * Additional information for the API invocation, such as the request tracking
+   * id.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 2; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ResponseMetadataOrBuilder getMetadataOrBuilder() { + return getMetadata(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (policy_ != null) { + output.writeMessage(1, getPolicy()); + } + if (metadata_ != null) { + output.writeMessage(2, getMetadata()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (policy_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getPolicy()); + } + if (metadata_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getMetadata()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.FetchAclResponse)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.FetchAclResponse other = + (com.google.cloud.contentwarehouse.v1.FetchAclResponse) obj; + + if (hasPolicy() != other.hasPolicy()) return false; + if (hasPolicy()) { + if (!getPolicy().equals(other.getPolicy())) return false; + } + if (hasMetadata() != other.hasMetadata()) return false; + if (hasMetadata()) { + if (!getMetadata().equals(other.getMetadata())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasPolicy()) { + hash = (37 * hash) + POLICY_FIELD_NUMBER; + hash = (53 * hash) + getPolicy().hashCode(); + } + if (hasMetadata()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + getMetadata().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.FetchAclResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.FetchAclResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.FetchAclResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.FetchAclResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.FetchAclResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.FetchAclResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.FetchAclResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.FetchAclResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.FetchAclResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.FetchAclResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.FetchAclResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.FetchAclResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.FetchAclResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for DocumentService.FetchAcl.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.FetchAclResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.FetchAclResponse) + com.google.cloud.contentwarehouse.v1.FetchAclResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceProto + .internal_static_google_cloud_contentwarehouse_v1_FetchAclResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceProto + .internal_static_google_cloud_contentwarehouse_v1_FetchAclResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.FetchAclResponse.class, + com.google.cloud.contentwarehouse.v1.FetchAclResponse.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.FetchAclResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (policyBuilder_ == null) { + policy_ = null; + } else { + policy_ = null; + policyBuilder_ = null; + } + if (metadataBuilder_ == null) { + metadata_ = null; + } else { + metadata_ = null; + metadataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceProto + .internal_static_google_cloud_contentwarehouse_v1_FetchAclResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.FetchAclResponse getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.FetchAclResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.FetchAclResponse build() { + com.google.cloud.contentwarehouse.v1.FetchAclResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.FetchAclResponse buildPartial() { + com.google.cloud.contentwarehouse.v1.FetchAclResponse result = + new com.google.cloud.contentwarehouse.v1.FetchAclResponse(this); + if (policyBuilder_ == null) { + result.policy_ = policy_; + } else { + result.policy_ = policyBuilder_.build(); + } + if (metadataBuilder_ == null) { + result.metadata_ = metadata_; + } else { + result.metadata_ = metadataBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.FetchAclResponse) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.FetchAclResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.FetchAclResponse other) { + if (other == com.google.cloud.contentwarehouse.v1.FetchAclResponse.getDefaultInstance()) + return this; + if (other.hasPolicy()) { + mergePolicy(other.getPolicy()); + } + if (other.hasMetadata()) { + mergeMetadata(other.getMetadata()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getPolicyFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 18: + { + input.readMessage(getMetadataFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private com.google.iam.v1.Policy policy_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.iam.v1.Policy, + com.google.iam.v1.Policy.Builder, + com.google.iam.v1.PolicyOrBuilder> + policyBuilder_; + /** + * + * + *
+     * The IAM policy.
+     * 
+ * + * .google.iam.v1.Policy policy = 1; + * + * @return Whether the policy field is set. + */ + public boolean hasPolicy() { + return policyBuilder_ != null || policy_ != null; + } + /** + * + * + *
+     * The IAM policy.
+     * 
+ * + * .google.iam.v1.Policy policy = 1; + * + * @return The policy. + */ + public com.google.iam.v1.Policy getPolicy() { + if (policyBuilder_ == null) { + return policy_ == null ? com.google.iam.v1.Policy.getDefaultInstance() : policy_; + } else { + return policyBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The IAM policy.
+     * 
+ * + * .google.iam.v1.Policy policy = 1; + */ + public Builder setPolicy(com.google.iam.v1.Policy value) { + if (policyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + policy_ = value; + onChanged(); + } else { + policyBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The IAM policy.
+     * 
+ * + * .google.iam.v1.Policy policy = 1; + */ + public Builder setPolicy(com.google.iam.v1.Policy.Builder builderForValue) { + if (policyBuilder_ == null) { + policy_ = builderForValue.build(); + onChanged(); + } else { + policyBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The IAM policy.
+     * 
+ * + * .google.iam.v1.Policy policy = 1; + */ + public Builder mergePolicy(com.google.iam.v1.Policy value) { + if (policyBuilder_ == null) { + if (policy_ != null) { + policy_ = com.google.iam.v1.Policy.newBuilder(policy_).mergeFrom(value).buildPartial(); + } else { + policy_ = value; + } + onChanged(); + } else { + policyBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The IAM policy.
+     * 
+ * + * .google.iam.v1.Policy policy = 1; + */ + public Builder clearPolicy() { + if (policyBuilder_ == null) { + policy_ = null; + onChanged(); + } else { + policy_ = null; + policyBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The IAM policy.
+     * 
+ * + * .google.iam.v1.Policy policy = 1; + */ + public com.google.iam.v1.Policy.Builder getPolicyBuilder() { + + onChanged(); + return getPolicyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The IAM policy.
+     * 
+ * + * .google.iam.v1.Policy policy = 1; + */ + public com.google.iam.v1.PolicyOrBuilder getPolicyOrBuilder() { + if (policyBuilder_ != null) { + return policyBuilder_.getMessageOrBuilder(); + } else { + return policy_ == null ? com.google.iam.v1.Policy.getDefaultInstance() : policy_; + } + } + /** + * + * + *
+     * The IAM policy.
+     * 
+ * + * .google.iam.v1.Policy policy = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.iam.v1.Policy, + com.google.iam.v1.Policy.Builder, + com.google.iam.v1.PolicyOrBuilder> + getPolicyFieldBuilder() { + if (policyBuilder_ == null) { + policyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.iam.v1.Policy, + com.google.iam.v1.Policy.Builder, + com.google.iam.v1.PolicyOrBuilder>(getPolicy(), getParentForChildren(), isClean()); + policy_ = null; + } + return policyBuilder_; + } + + private com.google.cloud.contentwarehouse.v1.ResponseMetadata metadata_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.ResponseMetadata, + com.google.cloud.contentwarehouse.v1.ResponseMetadata.Builder, + com.google.cloud.contentwarehouse.v1.ResponseMetadataOrBuilder> + metadataBuilder_; + /** + * + * + *
+     * Additional information for the API invocation, such as the request tracking
+     * id.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 2; + * + * @return Whether the metadata field is set. + */ + public boolean hasMetadata() { + return metadataBuilder_ != null || metadata_ != null; + } + /** + * + * + *
+     * Additional information for the API invocation, such as the request tracking
+     * id.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 2; + * + * @return The metadata. + */ + public com.google.cloud.contentwarehouse.v1.ResponseMetadata getMetadata() { + if (metadataBuilder_ == null) { + return metadata_ == null + ? com.google.cloud.contentwarehouse.v1.ResponseMetadata.getDefaultInstance() + : metadata_; + } else { + return metadataBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Additional information for the API invocation, such as the request tracking
+     * id.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 2; + */ + public Builder setMetadata(com.google.cloud.contentwarehouse.v1.ResponseMetadata value) { + if (metadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metadata_ = value; + onChanged(); + } else { + metadataBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Additional information for the API invocation, such as the request tracking
+     * id.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 2; + */ + public Builder setMetadata( + com.google.cloud.contentwarehouse.v1.ResponseMetadata.Builder builderForValue) { + if (metadataBuilder_ == null) { + metadata_ = builderForValue.build(); + onChanged(); + } else { + metadataBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Additional information for the API invocation, such as the request tracking
+     * id.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 2; + */ + public Builder mergeMetadata(com.google.cloud.contentwarehouse.v1.ResponseMetadata value) { + if (metadataBuilder_ == null) { + if (metadata_ != null) { + metadata_ = + com.google.cloud.contentwarehouse.v1.ResponseMetadata.newBuilder(metadata_) + .mergeFrom(value) + .buildPartial(); + } else { + metadata_ = value; + } + onChanged(); + } else { + metadataBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Additional information for the API invocation, such as the request tracking
+     * id.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 2; + */ + public Builder clearMetadata() { + if (metadataBuilder_ == null) { + metadata_ = null; + onChanged(); + } else { + metadata_ = null; + metadataBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Additional information for the API invocation, such as the request tracking
+     * id.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 2; + */ + public com.google.cloud.contentwarehouse.v1.ResponseMetadata.Builder getMetadataBuilder() { + + onChanged(); + return getMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Additional information for the API invocation, such as the request tracking
+     * id.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 2; + */ + public com.google.cloud.contentwarehouse.v1.ResponseMetadataOrBuilder getMetadataOrBuilder() { + if (metadataBuilder_ != null) { + return metadataBuilder_.getMessageOrBuilder(); + } else { + return metadata_ == null + ? com.google.cloud.contentwarehouse.v1.ResponseMetadata.getDefaultInstance() + : metadata_; + } + } + /** + * + * + *
+     * Additional information for the API invocation, such as the request tracking
+     * id.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.ResponseMetadata, + com.google.cloud.contentwarehouse.v1.ResponseMetadata.Builder, + com.google.cloud.contentwarehouse.v1.ResponseMetadataOrBuilder> + getMetadataFieldBuilder() { + if (metadataBuilder_ == null) { + metadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.ResponseMetadata, + com.google.cloud.contentwarehouse.v1.ResponseMetadata.Builder, + com.google.cloud.contentwarehouse.v1.ResponseMetadataOrBuilder>( + getMetadata(), getParentForChildren(), isClean()); + metadata_ = null; + } + return metadataBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.FetchAclResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.FetchAclResponse) + private static final com.google.cloud.contentwarehouse.v1.FetchAclResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.FetchAclResponse(); + } + + public static com.google.cloud.contentwarehouse.v1.FetchAclResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FetchAclResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.FetchAclResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/FetchAclResponseOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/FetchAclResponseOrBuilder.java new file mode 100644 index 000000000000..fad6ccd7fcc8 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/FetchAclResponseOrBuilder.java @@ -0,0 +1,98 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_service.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface FetchAclResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.FetchAclResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The IAM policy.
+   * 
+ * + * .google.iam.v1.Policy policy = 1; + * + * @return Whether the policy field is set. + */ + boolean hasPolicy(); + /** + * + * + *
+   * The IAM policy.
+   * 
+ * + * .google.iam.v1.Policy policy = 1; + * + * @return The policy. + */ + com.google.iam.v1.Policy getPolicy(); + /** + * + * + *
+   * The IAM policy.
+   * 
+ * + * .google.iam.v1.Policy policy = 1; + */ + com.google.iam.v1.PolicyOrBuilder getPolicyOrBuilder(); + + /** + * + * + *
+   * Additional information for the API invocation, such as the request tracking
+   * id.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 2; + * + * @return Whether the metadata field is set. + */ + boolean hasMetadata(); + /** + * + * + *
+   * Additional information for the API invocation, such as the request tracking
+   * id.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 2; + * + * @return The metadata. + */ + com.google.cloud.contentwarehouse.v1.ResponseMetadata getMetadata(); + /** + * + * + *
+   * Additional information for the API invocation, such as the request tracking
+   * id.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 2; + */ + com.google.cloud.contentwarehouse.v1.ResponseMetadataOrBuilder getMetadataOrBuilder(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/FileTypeFilter.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/FileTypeFilter.java new file mode 100644 index 000000000000..545637abeaef --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/FileTypeFilter.java @@ -0,0 +1,775 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/filters.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Filter for the specific types of documents returned.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.FileTypeFilter} + */ +public final class FileTypeFilter extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.FileTypeFilter) + FileTypeFilterOrBuilder { + private static final long serialVersionUID = 0L; + // Use FileTypeFilter.newBuilder() to construct. + private FileTypeFilter(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FileTypeFilter() { + fileType_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FileTypeFilter(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.FiltersProto + .internal_static_google_cloud_contentwarehouse_v1_FileTypeFilter_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.FiltersProto + .internal_static_google_cloud_contentwarehouse_v1_FileTypeFilter_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.FileTypeFilter.class, + com.google.cloud.contentwarehouse.v1.FileTypeFilter.Builder.class); + } + + /** + * + * + *
+   * Representation of the types of files.
+   * 
+ * + * Protobuf enum {@code google.cloud.contentwarehouse.v1.FileTypeFilter.FileType} + */ + public enum FileType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Default document type. If set, disables the filter.
+     * 
+ * + * FILE_TYPE_UNSPECIFIED = 0; + */ + FILE_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * Returns all document types, including folders.
+     * 
+ * + * ALL = 1; + */ + ALL(1), + /** + * + * + *
+     * Returns only folders.
+     * 
+ * + * FOLDER = 2; + */ + FOLDER(2), + /** + * + * + *
+     * Returns only non-folder documents.
+     * 
+ * + * DOCUMENT = 3; + */ + DOCUMENT(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Default document type. If set, disables the filter.
+     * 
+ * + * FILE_TYPE_UNSPECIFIED = 0; + */ + public static final int FILE_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Returns all document types, including folders.
+     * 
+ * + * ALL = 1; + */ + public static final int ALL_VALUE = 1; + /** + * + * + *
+     * Returns only folders.
+     * 
+ * + * FOLDER = 2; + */ + public static final int FOLDER_VALUE = 2; + /** + * + * + *
+     * Returns only non-folder documents.
+     * 
+ * + * DOCUMENT = 3; + */ + public static final int DOCUMENT_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static FileType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static FileType forNumber(int value) { + switch (value) { + case 0: + return FILE_TYPE_UNSPECIFIED; + case 1: + return ALL; + case 2: + return FOLDER; + case 3: + return DOCUMENT; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public FileType findValueByNumber(int number) { + return FileType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.FileTypeFilter.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final FileType[] VALUES = values(); + + public static FileType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private FileType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.contentwarehouse.v1.FileTypeFilter.FileType) + } + + public static final int FILE_TYPE_FIELD_NUMBER = 1; + private int fileType_; + /** + * + * + *
+   * The type of files to return.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.FileTypeFilter.FileType file_type = 1; + * + * @return The enum numeric value on the wire for fileType. + */ + @java.lang.Override + public int getFileTypeValue() { + return fileType_; + } + /** + * + * + *
+   * The type of files to return.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.FileTypeFilter.FileType file_type = 1; + * + * @return The fileType. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.FileTypeFilter.FileType getFileType() { + @SuppressWarnings("deprecation") + com.google.cloud.contentwarehouse.v1.FileTypeFilter.FileType result = + com.google.cloud.contentwarehouse.v1.FileTypeFilter.FileType.valueOf(fileType_); + return result == null + ? com.google.cloud.contentwarehouse.v1.FileTypeFilter.FileType.UNRECOGNIZED + : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (fileType_ + != com.google.cloud.contentwarehouse.v1.FileTypeFilter.FileType.FILE_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, fileType_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (fileType_ + != com.google.cloud.contentwarehouse.v1.FileTypeFilter.FileType.FILE_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, fileType_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.FileTypeFilter)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.FileTypeFilter other = + (com.google.cloud.contentwarehouse.v1.FileTypeFilter) obj; + + if (fileType_ != other.fileType_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + FILE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + fileType_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.FileTypeFilter parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.FileTypeFilter parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.FileTypeFilter parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.FileTypeFilter parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.FileTypeFilter parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.FileTypeFilter parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.FileTypeFilter parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.FileTypeFilter parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.FileTypeFilter parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.FileTypeFilter parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.FileTypeFilter parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.FileTypeFilter parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.contentwarehouse.v1.FileTypeFilter prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Filter for the specific types of documents returned.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.FileTypeFilter} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.FileTypeFilter) + com.google.cloud.contentwarehouse.v1.FileTypeFilterOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.FiltersProto + .internal_static_google_cloud_contentwarehouse_v1_FileTypeFilter_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.FiltersProto + .internal_static_google_cloud_contentwarehouse_v1_FileTypeFilter_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.FileTypeFilter.class, + com.google.cloud.contentwarehouse.v1.FileTypeFilter.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.FileTypeFilter.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + fileType_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.FiltersProto + .internal_static_google_cloud_contentwarehouse_v1_FileTypeFilter_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.FileTypeFilter getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.FileTypeFilter.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.FileTypeFilter build() { + com.google.cloud.contentwarehouse.v1.FileTypeFilter result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.FileTypeFilter buildPartial() { + com.google.cloud.contentwarehouse.v1.FileTypeFilter result = + new com.google.cloud.contentwarehouse.v1.FileTypeFilter(this); + result.fileType_ = fileType_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.FileTypeFilter) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.FileTypeFilter) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.FileTypeFilter other) { + if (other == com.google.cloud.contentwarehouse.v1.FileTypeFilter.getDefaultInstance()) + return this; + if (other.fileType_ != 0) { + setFileTypeValue(other.getFileTypeValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + fileType_ = input.readEnum(); + + break; + } // case 8 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int fileType_ = 0; + /** + * + * + *
+     * The type of files to return.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.FileTypeFilter.FileType file_type = 1; + * + * @return The enum numeric value on the wire for fileType. + */ + @java.lang.Override + public int getFileTypeValue() { + return fileType_; + } + /** + * + * + *
+     * The type of files to return.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.FileTypeFilter.FileType file_type = 1; + * + * @param value The enum numeric value on the wire for fileType to set. + * @return This builder for chaining. + */ + public Builder setFileTypeValue(int value) { + + fileType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The type of files to return.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.FileTypeFilter.FileType file_type = 1; + * + * @return The fileType. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.FileTypeFilter.FileType getFileType() { + @SuppressWarnings("deprecation") + com.google.cloud.contentwarehouse.v1.FileTypeFilter.FileType result = + com.google.cloud.contentwarehouse.v1.FileTypeFilter.FileType.valueOf(fileType_); + return result == null + ? com.google.cloud.contentwarehouse.v1.FileTypeFilter.FileType.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The type of files to return.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.FileTypeFilter.FileType file_type = 1; + * + * @param value The fileType to set. + * @return This builder for chaining. + */ + public Builder setFileType(com.google.cloud.contentwarehouse.v1.FileTypeFilter.FileType value) { + if (value == null) { + throw new NullPointerException(); + } + + fileType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The type of files to return.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.FileTypeFilter.FileType file_type = 1; + * + * @return This builder for chaining. + */ + public Builder clearFileType() { + + fileType_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.FileTypeFilter) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.FileTypeFilter) + private static final com.google.cloud.contentwarehouse.v1.FileTypeFilter DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.FileTypeFilter(); + } + + public static com.google.cloud.contentwarehouse.v1.FileTypeFilter getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FileTypeFilter parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.FileTypeFilter getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/FileTypeFilterOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/FileTypeFilterOrBuilder.java new file mode 100644 index 000000000000..e3f0c2c8fd9a --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/FileTypeFilterOrBuilder.java @@ -0,0 +1,50 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/filters.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface FileTypeFilterOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.FileTypeFilter) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The type of files to return.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.FileTypeFilter.FileType file_type = 1; + * + * @return The enum numeric value on the wire for fileType. + */ + int getFileTypeValue(); + /** + * + * + *
+   * The type of files to return.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.FileTypeFilter.FileType file_type = 1; + * + * @return The fileType. + */ + com.google.cloud.contentwarehouse.v1.FileTypeFilter.FileType getFileType(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/FiltersProto.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/FiltersProto.java new file mode 100644 index 000000000000..394ff4784780 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/FiltersProto.java @@ -0,0 +1,145 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/filters.proto + +package com.google.cloud.contentwarehouse.v1; + +public final class FiltersProto { + private FiltersProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_DocumentQuery_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_DocumentQuery_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_TimeFilter_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_TimeFilter_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_PropertyFilter_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_PropertyFilter_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_FileTypeFilter_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_FileTypeFilter_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n.google/cloud/contentwarehouse/v1/filte" + + "rs.proto\022 google.cloud.contentwarehouse." + + "v1\032\031google/api/resource.proto\032\032google/ty" + + "pe/interval.proto\"\245\003\n\rDocumentQuery\022\r\n\005q" + + "uery\030\001 \001(\t\022\023\n\013is_nl_query\030\014 \001(\010\022\"\n\026custo" + + "m_property_filter\030\004 \001(\tB\002\030\001\022B\n\014time_filt" + + "ers\030\005 \003(\0132,.google.cloud.contentwarehous" + + "e.v1.TimeFilter\022\035\n\025document_schema_names" + + "\030\006 \003(\t\022I\n\017property_filter\030\007 \003(\01320.google" + + ".cloud.contentwarehouse.v1.PropertyFilte" + + "r\022J\n\020file_type_filter\030\010 \001(\01320.google.clo" + + "ud.contentwarehouse.v1.FileTypeFilter\022\032\n" + + "\022folder_name_filter\030\t \001(\t\022\025\n\rquery_conte" + + "xt\030\n \003(\t\022\037\n\027document_creator_filter\030\013 \003(" + + "\t\"\316\001\n\nTimeFilter\022)\n\ntime_range\030\001 \001(\0132\025.g" + + "oogle.type.Interval\022J\n\ntime_field\030\002 \001(\0162" + + "6.google.cloud.contentwarehouse.v1.TimeF" + + "ilter.TimeField\"I\n\tTimeField\022\032\n\026TIME_FIE" + + "LD_UNSPECIFIED\020\000\022\017\n\013CREATE_TIME\020\001\022\017\n\013UPD" + + "ATE_TIME\020\002\"v\n\016PropertyFilter\022Q\n\024document" + + "_schema_name\030\001 \001(\tB3\372A0\n.contentwarehous" + + "e.googleapis.com/DocumentSchema\022\021\n\tcondi" + + "tion\030\002 \001(\t\"\250\001\n\016FileTypeFilter\022L\n\tfile_ty" + + "pe\030\001 \001(\01629.google.cloud.contentwarehouse" + + ".v1.FileTypeFilter.FileType\"H\n\010FileType\022" + + "\031\n\025FILE_TYPE_UNSPECIFIED\020\000\022\007\n\003ALL\020\001\022\n\n\006F" + + "OLDER\020\002\022\014\n\010DOCUMENT\020\003B\210\001\n$com.google.clo" + + "ud.contentwarehouse.v1B\014FiltersProtoP\001ZP" + + "google.golang.org/genproto/googleapis/cl" + + "oud/contentwarehouse/v1;contentwarehouse" + + "b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.ResourceProto.getDescriptor(), + com.google.type.IntervalProto.getDescriptor(), + }); + internal_static_google_cloud_contentwarehouse_v1_DocumentQuery_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_contentwarehouse_v1_DocumentQuery_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_DocumentQuery_descriptor, + new java.lang.String[] { + "Query", + "IsNlQuery", + "CustomPropertyFilter", + "TimeFilters", + "DocumentSchemaNames", + "PropertyFilter", + "FileTypeFilter", + "FolderNameFilter", + "QueryContext", + "DocumentCreatorFilter", + }); + internal_static_google_cloud_contentwarehouse_v1_TimeFilter_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_contentwarehouse_v1_TimeFilter_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_TimeFilter_descriptor, + new java.lang.String[] { + "TimeRange", "TimeField", + }); + internal_static_google_cloud_contentwarehouse_v1_PropertyFilter_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_contentwarehouse_v1_PropertyFilter_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_PropertyFilter_descriptor, + new java.lang.String[] { + "DocumentSchemaName", "Condition", + }); + internal_static_google_cloud_contentwarehouse_v1_FileTypeFilter_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_contentwarehouse_v1_FileTypeFilter_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_FileTypeFilter_descriptor, + new java.lang.String[] { + "FileType", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.ResourceProto.getDescriptor(); + com.google.type.IntervalProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/FloatArray.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/FloatArray.java new file mode 100644 index 000000000000..fbafb30b4ef4 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/FloatArray.java @@ -0,0 +1,674 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Float values.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.FloatArray} + */ +public final class FloatArray extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.FloatArray) + FloatArrayOrBuilder { + private static final long serialVersionUID = 0L; + // Use FloatArray.newBuilder() to construct. + private FloatArray(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FloatArray() { + values_ = emptyFloatList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FloatArray(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_FloatArray_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_FloatArray_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.FloatArray.class, + com.google.cloud.contentwarehouse.v1.FloatArray.Builder.class); + } + + public static final int VALUES_FIELD_NUMBER = 1; + private com.google.protobuf.Internal.FloatList values_; + /** + * + * + *
+   * List of float values.
+   * 
+ * + * repeated float values = 1; + * + * @return A list containing the values. + */ + @java.lang.Override + public java.util.List getValuesList() { + return values_; + } + /** + * + * + *
+   * List of float values.
+   * 
+ * + * repeated float values = 1; + * + * @return The count of values. + */ + public int getValuesCount() { + return values_.size(); + } + /** + * + * + *
+   * List of float values.
+   * 
+ * + * repeated float values = 1; + * + * @param index The index of the element to return. + * @return The values at the given index. + */ + public float getValues(int index) { + return values_.getFloat(index); + } + + private int valuesMemoizedSerializedSize = -1; + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getSerializedSize(); + if (getValuesList().size() > 0) { + output.writeUInt32NoTag(10); + output.writeUInt32NoTag(valuesMemoizedSerializedSize); + } + for (int i = 0; i < values_.size(); i++) { + output.writeFloatNoTag(values_.getFloat(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + dataSize = 4 * getValuesList().size(); + size += dataSize; + if (!getValuesList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); + } + valuesMemoizedSerializedSize = dataSize; + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.FloatArray)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.FloatArray other = + (com.google.cloud.contentwarehouse.v1.FloatArray) obj; + + if (!getValuesList().equals(other.getValuesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getValuesCount() > 0) { + hash = (37 * hash) + VALUES_FIELD_NUMBER; + hash = (53 * hash) + getValuesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.FloatArray parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.FloatArray parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.FloatArray parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.FloatArray parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.FloatArray parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.FloatArray parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.FloatArray parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.FloatArray parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.FloatArray parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.FloatArray parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.FloatArray parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.FloatArray parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.contentwarehouse.v1.FloatArray prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Float values.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.FloatArray} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.FloatArray) + com.google.cloud.contentwarehouse.v1.FloatArrayOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_FloatArray_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_FloatArray_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.FloatArray.class, + com.google.cloud.contentwarehouse.v1.FloatArray.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.FloatArray.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + values_ = emptyFloatList(); + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_FloatArray_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.FloatArray getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.FloatArray.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.FloatArray build() { + com.google.cloud.contentwarehouse.v1.FloatArray result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.FloatArray buildPartial() { + com.google.cloud.contentwarehouse.v1.FloatArray result = + new com.google.cloud.contentwarehouse.v1.FloatArray(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + values_.makeImmutable(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.values_ = values_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.FloatArray) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.FloatArray) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.FloatArray other) { + if (other == com.google.cloud.contentwarehouse.v1.FloatArray.getDefaultInstance()) + return this; + if (!other.values_.isEmpty()) { + if (values_.isEmpty()) { + values_ = other.values_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureValuesIsMutable(); + values_.addAll(other.values_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 13: + { + float v = input.readFloat(); + ensureValuesIsMutable(); + values_.addFloat(v); + break; + } // case 13 + case 10: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureValuesIsMutable(); + while (input.getBytesUntilLimit() > 0) { + values_.addFloat(input.readFloat()); + } + input.popLimit(limit); + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.Internal.FloatList values_ = emptyFloatList(); + + private void ensureValuesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + values_ = mutableCopy(values_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * List of float values.
+     * 
+ * + * repeated float values = 1; + * + * @return A list containing the values. + */ + public java.util.List getValuesList() { + return ((bitField0_ & 0x00000001) != 0) + ? java.util.Collections.unmodifiableList(values_) + : values_; + } + /** + * + * + *
+     * List of float values.
+     * 
+ * + * repeated float values = 1; + * + * @return The count of values. + */ + public int getValuesCount() { + return values_.size(); + } + /** + * + * + *
+     * List of float values.
+     * 
+ * + * repeated float values = 1; + * + * @param index The index of the element to return. + * @return The values at the given index. + */ + public float getValues(int index) { + return values_.getFloat(index); + } + /** + * + * + *
+     * List of float values.
+     * 
+ * + * repeated float values = 1; + * + * @param index The index to set the value at. + * @param value The values to set. + * @return This builder for chaining. + */ + public Builder setValues(int index, float value) { + ensureValuesIsMutable(); + values_.setFloat(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * List of float values.
+     * 
+ * + * repeated float values = 1; + * + * @param value The values to add. + * @return This builder for chaining. + */ + public Builder addValues(float value) { + ensureValuesIsMutable(); + values_.addFloat(value); + onChanged(); + return this; + } + /** + * + * + *
+     * List of float values.
+     * 
+ * + * repeated float values = 1; + * + * @param values The values to add. + * @return This builder for chaining. + */ + public Builder addAllValues(java.lang.Iterable values) { + ensureValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, values_); + onChanged(); + return this; + } + /** + * + * + *
+     * List of float values.
+     * 
+ * + * repeated float values = 1; + * + * @return This builder for chaining. + */ + public Builder clearValues() { + values_ = emptyFloatList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.FloatArray) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.FloatArray) + private static final com.google.cloud.contentwarehouse.v1.FloatArray DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.FloatArray(); + } + + public static com.google.cloud.contentwarehouse.v1.FloatArray getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FloatArray parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.FloatArray getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/FloatArrayOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/FloatArrayOrBuilder.java new file mode 100644 index 000000000000..af018fae596f --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/FloatArrayOrBuilder.java @@ -0,0 +1,63 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface FloatArrayOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.FloatArray) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of float values.
+   * 
+ * + * repeated float values = 1; + * + * @return A list containing the values. + */ + java.util.List getValuesList(); + /** + * + * + *
+   * List of float values.
+   * 
+ * + * repeated float values = 1; + * + * @return The count of values. + */ + int getValuesCount(); + /** + * + * + *
+   * List of float values.
+   * 
+ * + * repeated float values = 1; + * + * @param index The index of the element to return. + * @return The values at the given index. + */ + float getValues(int index); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/FloatTypeOptions.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/FloatTypeOptions.java new file mode 100644 index 000000000000..63e8a563faee --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/FloatTypeOptions.java @@ -0,0 +1,437 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_schema.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Configurations for a float property.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.FloatTypeOptions} + */ +public final class FloatTypeOptions extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.FloatTypeOptions) + FloatTypeOptionsOrBuilder { + private static final long serialVersionUID = 0L; + // Use FloatTypeOptions.newBuilder() to construct. + private FloatTypeOptions(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FloatTypeOptions() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FloatTypeOptions(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaProto + .internal_static_google_cloud_contentwarehouse_v1_FloatTypeOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaProto + .internal_static_google_cloud_contentwarehouse_v1_FloatTypeOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.FloatTypeOptions.class, + com.google.cloud.contentwarehouse.v1.FloatTypeOptions.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.FloatTypeOptions)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.FloatTypeOptions other = + (com.google.cloud.contentwarehouse.v1.FloatTypeOptions) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.FloatTypeOptions parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.FloatTypeOptions parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.FloatTypeOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.FloatTypeOptions parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.FloatTypeOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.FloatTypeOptions parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.FloatTypeOptions parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.FloatTypeOptions parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.FloatTypeOptions parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.FloatTypeOptions parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.FloatTypeOptions parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.FloatTypeOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.FloatTypeOptions prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Configurations for a float property.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.FloatTypeOptions} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.FloatTypeOptions) + com.google.cloud.contentwarehouse.v1.FloatTypeOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaProto + .internal_static_google_cloud_contentwarehouse_v1_FloatTypeOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaProto + .internal_static_google_cloud_contentwarehouse_v1_FloatTypeOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.FloatTypeOptions.class, + com.google.cloud.contentwarehouse.v1.FloatTypeOptions.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.FloatTypeOptions.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaProto + .internal_static_google_cloud_contentwarehouse_v1_FloatTypeOptions_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.FloatTypeOptions getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.FloatTypeOptions.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.FloatTypeOptions build() { + com.google.cloud.contentwarehouse.v1.FloatTypeOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.FloatTypeOptions buildPartial() { + com.google.cloud.contentwarehouse.v1.FloatTypeOptions result = + new com.google.cloud.contentwarehouse.v1.FloatTypeOptions(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.FloatTypeOptions) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.FloatTypeOptions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.FloatTypeOptions other) { + if (other == com.google.cloud.contentwarehouse.v1.FloatTypeOptions.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.FloatTypeOptions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.FloatTypeOptions) + private static final com.google.cloud.contentwarehouse.v1.FloatTypeOptions DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.FloatTypeOptions(); + } + + public static com.google.cloud.contentwarehouse.v1.FloatTypeOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FloatTypeOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.FloatTypeOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/FloatTypeOptionsOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/FloatTypeOptionsOrBuilder.java new file mode 100644 index 000000000000..a722cfa80710 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/FloatTypeOptionsOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_schema.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface FloatTypeOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.FloatTypeOptions) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/GetDocumentRequest.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/GetDocumentRequest.java new file mode 100644 index 000000000000..6ed24e58154d --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/GetDocumentRequest.java @@ -0,0 +1,935 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_service_request.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Request message for DocumentService.GetDocument.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.GetDocumentRequest} + */ +public final class GetDocumentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.GetDocumentRequest) + GetDocumentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetDocumentRequest.newBuilder() to construct. + private GetDocumentRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetDocumentRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetDocumentRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_GetDocumentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_GetDocumentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.GetDocumentRequest.class, + com.google.cloud.contentwarehouse.v1.GetDocumentRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object 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}.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * 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}.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUEST_METADATA_FIELD_NUMBER = 2; + private com.google.cloud.contentwarehouse.v1.RequestMetadata requestMetadata_; + /** + * + * + *
+   * The meta information collected about the end user, used to enforce access
+   * control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + * + * @return Whether the requestMetadata field is set. + */ + @java.lang.Override + public boolean hasRequestMetadata() { + return requestMetadata_ != null; + } + /** + * + * + *
+   * The meta information collected about the end user, used to enforce access
+   * control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + * + * @return The requestMetadata. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RequestMetadata getRequestMetadata() { + return requestMetadata_ == null + ? com.google.cloud.contentwarehouse.v1.RequestMetadata.getDefaultInstance() + : requestMetadata_; + } + /** + * + * + *
+   * The meta information collected about the end user, used to enforce access
+   * control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder + getRequestMetadataOrBuilder() { + return getRequestMetadata(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (requestMetadata_ != null) { + output.writeMessage(2, getRequestMetadata()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (requestMetadata_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getRequestMetadata()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.GetDocumentRequest)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.GetDocumentRequest other = + (com.google.cloud.contentwarehouse.v1.GetDocumentRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (hasRequestMetadata() != other.hasRequestMetadata()) return false; + if (hasRequestMetadata()) { + if (!getRequestMetadata().equals(other.getRequestMetadata())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasRequestMetadata()) { + hash = (37 * hash) + REQUEST_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getRequestMetadata().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.GetDocumentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.GetDocumentRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.GetDocumentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.GetDocumentRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.GetDocumentRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.GetDocumentRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.GetDocumentRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.GetDocumentRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.GetDocumentRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.GetDocumentRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.GetDocumentRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.GetDocumentRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.GetDocumentRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for DocumentService.GetDocument.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.GetDocumentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.GetDocumentRequest) + com.google.cloud.contentwarehouse.v1.GetDocumentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_GetDocumentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_GetDocumentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.GetDocumentRequest.class, + com.google.cloud.contentwarehouse.v1.GetDocumentRequest.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.GetDocumentRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (requestMetadataBuilder_ == null) { + requestMetadata_ = null; + } else { + requestMetadata_ = null; + requestMetadataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_GetDocumentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.GetDocumentRequest getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.GetDocumentRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.GetDocumentRequest build() { + com.google.cloud.contentwarehouse.v1.GetDocumentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.GetDocumentRequest buildPartial() { + com.google.cloud.contentwarehouse.v1.GetDocumentRequest result = + new com.google.cloud.contentwarehouse.v1.GetDocumentRequest(this); + result.name_ = name_; + if (requestMetadataBuilder_ == null) { + result.requestMetadata_ = requestMetadata_; + } else { + result.requestMetadata_ = requestMetadataBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.GetDocumentRequest) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.GetDocumentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.GetDocumentRequest other) { + if (other == com.google.cloud.contentwarehouse.v1.GetDocumentRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasRequestMetadata()) { + mergeRequestMetadata(other.getRequestMetadata()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + input.readMessage(getRequestMetadataFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object 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}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 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}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * 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}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.cloud.contentwarehouse.v1.RequestMetadata requestMetadata_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.RequestMetadata, + com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder, + com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder> + requestMetadataBuilder_; + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + * + * @return Whether the requestMetadata field is set. + */ + public boolean hasRequestMetadata() { + return requestMetadataBuilder_ != null || requestMetadata_ != null; + } + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + * + * @return The requestMetadata. + */ + public com.google.cloud.contentwarehouse.v1.RequestMetadata getRequestMetadata() { + if (requestMetadataBuilder_ == null) { + return requestMetadata_ == null + ? com.google.cloud.contentwarehouse.v1.RequestMetadata.getDefaultInstance() + : requestMetadata_; + } else { + return requestMetadataBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + */ + public Builder setRequestMetadata(com.google.cloud.contentwarehouse.v1.RequestMetadata value) { + if (requestMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + requestMetadata_ = value; + onChanged(); + } else { + requestMetadataBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + */ + public Builder setRequestMetadata( + com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder builderForValue) { + if (requestMetadataBuilder_ == null) { + requestMetadata_ = builderForValue.build(); + onChanged(); + } else { + requestMetadataBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + */ + public Builder mergeRequestMetadata( + com.google.cloud.contentwarehouse.v1.RequestMetadata value) { + if (requestMetadataBuilder_ == null) { + if (requestMetadata_ != null) { + requestMetadata_ = + com.google.cloud.contentwarehouse.v1.RequestMetadata.newBuilder(requestMetadata_) + .mergeFrom(value) + .buildPartial(); + } else { + requestMetadata_ = value; + } + onChanged(); + } else { + requestMetadataBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + */ + public Builder clearRequestMetadata() { + if (requestMetadataBuilder_ == null) { + requestMetadata_ = null; + onChanged(); + } else { + requestMetadata_ = null; + requestMetadataBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + */ + public com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder + getRequestMetadataBuilder() { + + onChanged(); + return getRequestMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + */ + public com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder + getRequestMetadataOrBuilder() { + if (requestMetadataBuilder_ != null) { + return requestMetadataBuilder_.getMessageOrBuilder(); + } else { + return requestMetadata_ == null + ? com.google.cloud.contentwarehouse.v1.RequestMetadata.getDefaultInstance() + : requestMetadata_; + } + } + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.RequestMetadata, + com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder, + com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder> + getRequestMetadataFieldBuilder() { + if (requestMetadataBuilder_ == null) { + requestMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.RequestMetadata, + com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder, + com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder>( + getRequestMetadata(), getParentForChildren(), isClean()); + requestMetadata_ = null; + } + return requestMetadataBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.GetDocumentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.GetDocumentRequest) + private static final com.google.cloud.contentwarehouse.v1.GetDocumentRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.GetDocumentRequest(); + } + + public static com.google.cloud.contentwarehouse.v1.GetDocumentRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetDocumentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.GetDocumentRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/GetDocumentRequestOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/GetDocumentRequestOrBuilder.java new file mode 100644 index 000000000000..77601bcd6d7d --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/GetDocumentRequestOrBuilder.java @@ -0,0 +1,98 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_service_request.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface GetDocumentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.GetDocumentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * 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}.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * 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}.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The meta information collected about the end user, used to enforce access
+   * control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + * + * @return Whether the requestMetadata field is set. + */ + boolean hasRequestMetadata(); + /** + * + * + *
+   * The meta information collected about the end user, used to enforce access
+   * control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + * + * @return The requestMetadata. + */ + com.google.cloud.contentwarehouse.v1.RequestMetadata getRequestMetadata(); + /** + * + * + *
+   * The meta information collected about the end user, used to enforce access
+   * control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + */ + com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder getRequestMetadataOrBuilder(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/GetDocumentSchemaRequest.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/GetDocumentSchemaRequest.java new file mode 100644 index 000000000000..f8cb7433527f --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/GetDocumentSchemaRequest.java @@ -0,0 +1,633 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_schema_service.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Request message for DocumentSchemaService.GetDocumentSchema.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest} + */ +public final class GetDocumentSchemaRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest) + GetDocumentSchemaRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetDocumentSchemaRequest.newBuilder() to construct. + private GetDocumentSchemaRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetDocumentSchemaRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetDocumentSchemaRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaServiceProto + .internal_static_google_cloud_contentwarehouse_v1_GetDocumentSchemaRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaServiceProto + .internal_static_google_cloud_contentwarehouse_v1_GetDocumentSchemaRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest.class, + com.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the document schema to retrieve.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the document schema to retrieve.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest other = + (com.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for DocumentSchemaService.GetDocumentSchema.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest) + com.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaServiceProto + .internal_static_google_cloud_contentwarehouse_v1_GetDocumentSchemaRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaServiceProto + .internal_static_google_cloud_contentwarehouse_v1_GetDocumentSchemaRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest.class, + com.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaServiceProto + .internal_static_google_cloud_contentwarehouse_v1_GetDocumentSchemaRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest + getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest build() { + com.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest buildPartial() { + com.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest result = + new com.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest other) { + if (other + == com.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the document schema to retrieve.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the document schema to retrieve.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the document schema to retrieve.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the document schema to retrieve.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the document schema to retrieve.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest) + private static final com.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest(); + } + + public static com.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetDocumentSchemaRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/GetDocumentSchemaRequestOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/GetDocumentSchemaRequestOrBuilder.java new file mode 100644 index 000000000000..b8225b49517c --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/GetDocumentSchemaRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_schema_service.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface GetDocumentSchemaRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the document schema to retrieve.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the document schema to retrieve.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/GetRuleSetRequest.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/GetRuleSetRequest.java new file mode 100644 index 000000000000..108b6f777fa8 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/GetRuleSetRequest.java @@ -0,0 +1,644 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/ruleset_service_request.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Request message for RuleSetService.GetRuleSet.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.GetRuleSetRequest} + */ +public final class GetRuleSetRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.GetRuleSetRequest) + GetRuleSetRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetRuleSetRequest.newBuilder() to construct. + private GetRuleSetRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetRuleSetRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetRuleSetRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.RuleSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_GetRuleSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.RuleSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_GetRuleSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.GetRuleSetRequest.class, + com.google.cloud.contentwarehouse.v1.GetRuleSetRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the rule set to retrieve.
+   * Format:
+   * projects/{project_number}/locations/{location}/ruleSets/{rule_set_id}.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the rule set to retrieve.
+   * Format:
+   * projects/{project_number}/locations/{location}/ruleSets/{rule_set_id}.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.GetRuleSetRequest)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.GetRuleSetRequest other = + (com.google.cloud.contentwarehouse.v1.GetRuleSetRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.GetRuleSetRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.GetRuleSetRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.GetRuleSetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.GetRuleSetRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.GetRuleSetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.GetRuleSetRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.GetRuleSetRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.GetRuleSetRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.GetRuleSetRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.GetRuleSetRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.GetRuleSetRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.GetRuleSetRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.GetRuleSetRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for RuleSetService.GetRuleSet.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.GetRuleSetRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.GetRuleSetRequest) + com.google.cloud.contentwarehouse.v1.GetRuleSetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.RuleSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_GetRuleSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.RuleSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_GetRuleSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.GetRuleSetRequest.class, + com.google.cloud.contentwarehouse.v1.GetRuleSetRequest.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.GetRuleSetRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.RuleSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_GetRuleSetRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.GetRuleSetRequest getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.GetRuleSetRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.GetRuleSetRequest build() { + com.google.cloud.contentwarehouse.v1.GetRuleSetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.GetRuleSetRequest buildPartial() { + com.google.cloud.contentwarehouse.v1.GetRuleSetRequest result = + new com.google.cloud.contentwarehouse.v1.GetRuleSetRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.GetRuleSetRequest) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.GetRuleSetRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.GetRuleSetRequest other) { + if (other == com.google.cloud.contentwarehouse.v1.GetRuleSetRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the rule set to retrieve.
+     * Format:
+     * projects/{project_number}/locations/{location}/ruleSets/{rule_set_id}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the rule set to retrieve.
+     * Format:
+     * projects/{project_number}/locations/{location}/ruleSets/{rule_set_id}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the rule set to retrieve.
+     * Format:
+     * projects/{project_number}/locations/{location}/ruleSets/{rule_set_id}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the rule set to retrieve.
+     * Format:
+     * projects/{project_number}/locations/{location}/ruleSets/{rule_set_id}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the rule set to retrieve.
+     * Format:
+     * projects/{project_number}/locations/{location}/ruleSets/{rule_set_id}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.GetRuleSetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.GetRuleSetRequest) + private static final com.google.cloud.contentwarehouse.v1.GetRuleSetRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.GetRuleSetRequest(); + } + + public static com.google.cloud.contentwarehouse.v1.GetRuleSetRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetRuleSetRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.GetRuleSetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/GetRuleSetRequestOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/GetRuleSetRequestOrBuilder.java new file mode 100644 index 000000000000..d08e79caf0b0 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/GetRuleSetRequestOrBuilder.java @@ -0,0 +1,58 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/ruleset_service_request.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface GetRuleSetRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.GetRuleSetRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the rule set to retrieve.
+   * Format:
+   * projects/{project_number}/locations/{location}/ruleSets/{rule_set_id}.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the rule set to retrieve.
+   * Format:
+   * projects/{project_number}/locations/{location}/ruleSets/{rule_set_id}.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/GetSynonymSetRequest.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/GetSynonymSetRequest.java new file mode 100644 index 000000000000..2b508f9582fe --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/GetSynonymSetRequest.java @@ -0,0 +1,646 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/synonymset_service_request.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Request message for SynonymSetService.GetSynonymSet.
+ * Will return synonymSet for a certain context.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.GetSynonymSetRequest} + */ +public final class GetSynonymSetRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.GetSynonymSetRequest) + GetSynonymSetRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetSynonymSetRequest.newBuilder() to construct. + private GetSynonymSetRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetSynonymSetRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetSynonymSetRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.SynonymSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_GetSynonymSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.SynonymSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_GetSynonymSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.GetSynonymSetRequest.class, + com.google.cloud.contentwarehouse.v1.GetSynonymSetRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the synonymSet to retrieve
+   * Format:
+   * projects/{project_number}/locations/{location}/synonymSets/{context}.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the synonymSet to retrieve
+   * Format:
+   * projects/{project_number}/locations/{location}/synonymSets/{context}.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.GetSynonymSetRequest)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.GetSynonymSetRequest other = + (com.google.cloud.contentwarehouse.v1.GetSynonymSetRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.GetSynonymSetRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.GetSynonymSetRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.GetSynonymSetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.GetSynonymSetRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.GetSynonymSetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.GetSynonymSetRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.GetSynonymSetRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.GetSynonymSetRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.GetSynonymSetRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.GetSynonymSetRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.GetSynonymSetRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.GetSynonymSetRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.GetSynonymSetRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for SynonymSetService.GetSynonymSet.
+   * Will return synonymSet for a certain context.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.GetSynonymSetRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.GetSynonymSetRequest) + com.google.cloud.contentwarehouse.v1.GetSynonymSetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.SynonymSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_GetSynonymSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.SynonymSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_GetSynonymSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.GetSynonymSetRequest.class, + com.google.cloud.contentwarehouse.v1.GetSynonymSetRequest.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.GetSynonymSetRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.SynonymSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_GetSynonymSetRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.GetSynonymSetRequest getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.GetSynonymSetRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.GetSynonymSetRequest build() { + com.google.cloud.contentwarehouse.v1.GetSynonymSetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.GetSynonymSetRequest buildPartial() { + com.google.cloud.contentwarehouse.v1.GetSynonymSetRequest result = + new com.google.cloud.contentwarehouse.v1.GetSynonymSetRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.GetSynonymSetRequest) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.GetSynonymSetRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.GetSynonymSetRequest other) { + if (other == com.google.cloud.contentwarehouse.v1.GetSynonymSetRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the synonymSet to retrieve
+     * Format:
+     * projects/{project_number}/locations/{location}/synonymSets/{context}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the synonymSet to retrieve
+     * Format:
+     * projects/{project_number}/locations/{location}/synonymSets/{context}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the synonymSet to retrieve
+     * Format:
+     * projects/{project_number}/locations/{location}/synonymSets/{context}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the synonymSet to retrieve
+     * Format:
+     * projects/{project_number}/locations/{location}/synonymSets/{context}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the synonymSet to retrieve
+     * Format:
+     * projects/{project_number}/locations/{location}/synonymSets/{context}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.GetSynonymSetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.GetSynonymSetRequest) + private static final com.google.cloud.contentwarehouse.v1.GetSynonymSetRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.GetSynonymSetRequest(); + } + + public static com.google.cloud.contentwarehouse.v1.GetSynonymSetRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetSynonymSetRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.GetSynonymSetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/GetSynonymSetRequestOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/GetSynonymSetRequestOrBuilder.java new file mode 100644 index 000000000000..a89bccabfe12 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/GetSynonymSetRequestOrBuilder.java @@ -0,0 +1,58 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/synonymset_service_request.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface GetSynonymSetRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.GetSynonymSetRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the synonymSet to retrieve
+   * Format:
+   * projects/{project_number}/locations/{location}/synonymSets/{context}.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the synonymSet to retrieve
+   * Format:
+   * projects/{project_number}/locations/{location}/synonymSets/{context}.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/HistogramProto.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/HistogramProto.java new file mode 100644 index 000000000000..90e8fd1c7ee2 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/HistogramProto.java @@ -0,0 +1,133 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/histogram.proto + +package com.google.cloud.contentwarehouse.v1; + +public final class HistogramProto { + private HistogramProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_HistogramQuery_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_HistogramQuery_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_HistogramQueryPropertyNameFilter_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_HistogramQueryPropertyNameFilter_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_HistogramQueryResult_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_HistogramQueryResult_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_HistogramQueryResult_HistogramEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_HistogramQueryResult_HistogramEntry_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n0google/cloud/contentwarehouse/v1/histo" + + "gram.proto\022 google.cloud.contentwarehous" + + "e.v1\032\037google/api/field_behavior.proto\032\031g" + + "oogle/api/resource.proto\"\250\001\n\016HistogramQu" + + "ery\022\027\n\017histogram_query\030\001 \001(\t\022#\n\033require_" + + "precise_result_size\030\002 \001(\010\022X\n\007filters\030\003 \001" + + "(\0132B.google.cloud.contentwarehouse.v1.Hi" + + "stogramQueryPropertyNameFilterB\003\340A\001\"\272\002\n " + + "HistogramQueryPropertyNameFilter\022M\n\020docu" + + "ment_schemas\030\001 \003(\tB3\372A0\n.contentwarehous" + + "e.googleapis.com/DocumentSchema\022\026\n\016prope" + + "rty_names\030\002 \003(\t\022a\n\006y_axis\030\003 \001(\0162Q.google" + + ".cloud.contentwarehouse.v1.HistogramQuer" + + "yPropertyNameFilter.HistogramYAxis\"L\n\016Hi" + + "stogramYAxis\022\034\n\030HISTOGRAM_YAXIS_DOCUMENT" + + "\020\000\022\034\n\030HISTOGRAM_YAXIS_PROPERTY\020\001\"\273\001\n\024His" + + "togramQueryResult\022\027\n\017histogram_query\030\001 \001" + + "(\t\022X\n\thistogram\030\002 \003(\0132E.google.cloud.con" + + "tentwarehouse.v1.HistogramQueryResult.Hi" + + "stogramEntry\0320\n\016HistogramEntry\022\013\n\003key\030\001 " + + "\001(\t\022\r\n\005value\030\002 \001(\003:\0028\001B\212\001\n$com.google.cl" + + "oud.contentwarehouse.v1B\016HistogramProtoP" + + "\001ZPgoogle.golang.org/genproto/googleapis" + + "/cloud/contentwarehouse/v1;contentwareho" + + "useb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + }); + internal_static_google_cloud_contentwarehouse_v1_HistogramQuery_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_contentwarehouse_v1_HistogramQuery_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_HistogramQuery_descriptor, + new java.lang.String[] { + "HistogramQuery", "RequirePreciseResultSize", "Filters", + }); + internal_static_google_cloud_contentwarehouse_v1_HistogramQueryPropertyNameFilter_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_contentwarehouse_v1_HistogramQueryPropertyNameFilter_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_HistogramQueryPropertyNameFilter_descriptor, + new java.lang.String[] { + "DocumentSchemas", "PropertyNames", "YAxis", + }); + internal_static_google_cloud_contentwarehouse_v1_HistogramQueryResult_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_contentwarehouse_v1_HistogramQueryResult_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_HistogramQueryResult_descriptor, + new java.lang.String[] { + "HistogramQuery", "Histogram", + }); + internal_static_google_cloud_contentwarehouse_v1_HistogramQueryResult_HistogramEntry_descriptor = + internal_static_google_cloud_contentwarehouse_v1_HistogramQueryResult_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_contentwarehouse_v1_HistogramQueryResult_HistogramEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_HistogramQueryResult_HistogramEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/HistogramQuery.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/HistogramQuery.java new file mode 100644 index 000000000000..d3ac69487154 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/HistogramQuery.java @@ -0,0 +1,1077 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/histogram.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * The histogram request.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.HistogramQuery} + */ +public final class HistogramQuery extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.HistogramQuery) + HistogramQueryOrBuilder { + private static final long serialVersionUID = 0L; + // Use HistogramQuery.newBuilder() to construct. + private HistogramQuery(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private HistogramQuery() { + histogramQuery_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new HistogramQuery(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.HistogramProto + .internal_static_google_cloud_contentwarehouse_v1_HistogramQuery_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.HistogramProto + .internal_static_google_cloud_contentwarehouse_v1_HistogramQuery_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.HistogramQuery.class, + com.google.cloud.contentwarehouse.v1.HistogramQuery.Builder.class); + } + + public static final int HISTOGRAM_QUERY_FIELD_NUMBER = 1; + private volatile java.lang.Object histogramQuery_; + /** + * + * + *
+   * An expression specifies a histogram request against matching documents for
+   * searches.
+   * See [SearchDocumentsRequest.histogram_queries][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.histogram_queries] for details about syntax.
+   * 
+ * + * string histogram_query = 1; + * + * @return The histogramQuery. + */ + @java.lang.Override + public java.lang.String getHistogramQuery() { + java.lang.Object ref = histogramQuery_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + histogramQuery_ = s; + return s; + } + } + /** + * + * + *
+   * An expression specifies a histogram request against matching documents for
+   * searches.
+   * See [SearchDocumentsRequest.histogram_queries][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.histogram_queries] for details about syntax.
+   * 
+ * + * string histogram_query = 1; + * + * @return The bytes for histogramQuery. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHistogramQueryBytes() { + java.lang.Object ref = histogramQuery_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + histogramQuery_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUIRE_PRECISE_RESULT_SIZE_FIELD_NUMBER = 2; + private boolean requirePreciseResultSize_; + /** + * + * + *
+   * Controls if the histogram query requires the return of a precise count.
+   * Enable this flag may adversely impact performance.
+   * Defaults to true.
+   * 
+ * + * bool require_precise_result_size = 2; + * + * @return The requirePreciseResultSize. + */ + @java.lang.Override + public boolean getRequirePreciseResultSize() { + return requirePreciseResultSize_; + } + + public static final int FILTERS_FIELD_NUMBER = 3; + private com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter filters_; + /** + * + * + *
+   * Optional. Filter the result of histogram query by the property names. It only works
+   * with histogram query count('FilterableProperties').
+   * It is an optional. It will perform histogram on all the property names for
+   * all the document schemas. Setting this field will have a better
+   * performance.
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter filters = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the filters field is set. + */ + @java.lang.Override + public boolean hasFilters() { + return filters_ != null; + } + /** + * + * + *
+   * Optional. Filter the result of histogram query by the property names. It only works
+   * with histogram query count('FilterableProperties').
+   * It is an optional. It will perform histogram on all the property names for
+   * all the document schemas. Setting this field will have a better
+   * performance.
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter filters = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The filters. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter getFilters() { + return filters_ == null + ? com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.getDefaultInstance() + : filters_; + } + /** + * + * + *
+   * Optional. Filter the result of histogram query by the property names. It only works
+   * with histogram query count('FilterableProperties').
+   * It is an optional. It will perform histogram on all the property names for
+   * all the document schemas. Setting this field will have a better
+   * performance.
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter filters = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilterOrBuilder + getFiltersOrBuilder() { + return getFilters(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(histogramQuery_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, histogramQuery_); + } + if (requirePreciseResultSize_ != false) { + output.writeBool(2, requirePreciseResultSize_); + } + if (filters_ != null) { + output.writeMessage(3, getFilters()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(histogramQuery_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, histogramQuery_); + } + if (requirePreciseResultSize_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, requirePreciseResultSize_); + } + if (filters_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getFilters()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.HistogramQuery)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.HistogramQuery other = + (com.google.cloud.contentwarehouse.v1.HistogramQuery) obj; + + if (!getHistogramQuery().equals(other.getHistogramQuery())) return false; + if (getRequirePreciseResultSize() != other.getRequirePreciseResultSize()) return false; + if (hasFilters() != other.hasFilters()) return false; + if (hasFilters()) { + if (!getFilters().equals(other.getFilters())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + HISTOGRAM_QUERY_FIELD_NUMBER; + hash = (53 * hash) + getHistogramQuery().hashCode(); + hash = (37 * hash) + REQUIRE_PRECISE_RESULT_SIZE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getRequirePreciseResultSize()); + if (hasFilters()) { + hash = (37 * hash) + FILTERS_FIELD_NUMBER; + hash = (53 * hash) + getFilters().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.HistogramQuery parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.HistogramQuery parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.HistogramQuery parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.HistogramQuery parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.HistogramQuery parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.HistogramQuery parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.HistogramQuery parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.HistogramQuery parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.HistogramQuery parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.HistogramQuery parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.HistogramQuery parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.HistogramQuery parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.contentwarehouse.v1.HistogramQuery prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The histogram request.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.HistogramQuery} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.HistogramQuery) + com.google.cloud.contentwarehouse.v1.HistogramQueryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.HistogramProto + .internal_static_google_cloud_contentwarehouse_v1_HistogramQuery_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.HistogramProto + .internal_static_google_cloud_contentwarehouse_v1_HistogramQuery_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.HistogramQuery.class, + com.google.cloud.contentwarehouse.v1.HistogramQuery.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.HistogramQuery.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + histogramQuery_ = ""; + + requirePreciseResultSize_ = false; + + if (filtersBuilder_ == null) { + filters_ = null; + } else { + filters_ = null; + filtersBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.HistogramProto + .internal_static_google_cloud_contentwarehouse_v1_HistogramQuery_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.HistogramQuery getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.HistogramQuery.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.HistogramQuery build() { + com.google.cloud.contentwarehouse.v1.HistogramQuery result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.HistogramQuery buildPartial() { + com.google.cloud.contentwarehouse.v1.HistogramQuery result = + new com.google.cloud.contentwarehouse.v1.HistogramQuery(this); + result.histogramQuery_ = histogramQuery_; + result.requirePreciseResultSize_ = requirePreciseResultSize_; + if (filtersBuilder_ == null) { + result.filters_ = filters_; + } else { + result.filters_ = filtersBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.HistogramQuery) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.HistogramQuery) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.HistogramQuery other) { + if (other == com.google.cloud.contentwarehouse.v1.HistogramQuery.getDefaultInstance()) + return this; + if (!other.getHistogramQuery().isEmpty()) { + histogramQuery_ = other.histogramQuery_; + onChanged(); + } + if (other.getRequirePreciseResultSize() != false) { + setRequirePreciseResultSize(other.getRequirePreciseResultSize()); + } + if (other.hasFilters()) { + mergeFilters(other.getFilters()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + histogramQuery_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 16: + { + requirePreciseResultSize_ = input.readBool(); + + break; + } // case 16 + case 26: + { + input.readMessage(getFiltersFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object histogramQuery_ = ""; + /** + * + * + *
+     * An expression specifies a histogram request against matching documents for
+     * searches.
+     * See [SearchDocumentsRequest.histogram_queries][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.histogram_queries] for details about syntax.
+     * 
+ * + * string histogram_query = 1; + * + * @return The histogramQuery. + */ + public java.lang.String getHistogramQuery() { + java.lang.Object ref = histogramQuery_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + histogramQuery_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * An expression specifies a histogram request against matching documents for
+     * searches.
+     * See [SearchDocumentsRequest.histogram_queries][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.histogram_queries] for details about syntax.
+     * 
+ * + * string histogram_query = 1; + * + * @return The bytes for histogramQuery. + */ + public com.google.protobuf.ByteString getHistogramQueryBytes() { + java.lang.Object ref = histogramQuery_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + histogramQuery_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * An expression specifies a histogram request against matching documents for
+     * searches.
+     * See [SearchDocumentsRequest.histogram_queries][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.histogram_queries] for details about syntax.
+     * 
+ * + * string histogram_query = 1; + * + * @param value The histogramQuery to set. + * @return This builder for chaining. + */ + public Builder setHistogramQuery(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + histogramQuery_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * An expression specifies a histogram request against matching documents for
+     * searches.
+     * See [SearchDocumentsRequest.histogram_queries][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.histogram_queries] for details about syntax.
+     * 
+ * + * string histogram_query = 1; + * + * @return This builder for chaining. + */ + public Builder clearHistogramQuery() { + + histogramQuery_ = getDefaultInstance().getHistogramQuery(); + onChanged(); + return this; + } + /** + * + * + *
+     * An expression specifies a histogram request against matching documents for
+     * searches.
+     * See [SearchDocumentsRequest.histogram_queries][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.histogram_queries] for details about syntax.
+     * 
+ * + * string histogram_query = 1; + * + * @param value The bytes for histogramQuery to set. + * @return This builder for chaining. + */ + public Builder setHistogramQueryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + histogramQuery_ = value; + onChanged(); + return this; + } + + private boolean requirePreciseResultSize_; + /** + * + * + *
+     * Controls if the histogram query requires the return of a precise count.
+     * Enable this flag may adversely impact performance.
+     * Defaults to true.
+     * 
+ * + * bool require_precise_result_size = 2; + * + * @return The requirePreciseResultSize. + */ + @java.lang.Override + public boolean getRequirePreciseResultSize() { + return requirePreciseResultSize_; + } + /** + * + * + *
+     * Controls if the histogram query requires the return of a precise count.
+     * Enable this flag may adversely impact performance.
+     * Defaults to true.
+     * 
+ * + * bool require_precise_result_size = 2; + * + * @param value The requirePreciseResultSize to set. + * @return This builder for chaining. + */ + public Builder setRequirePreciseResultSize(boolean value) { + + requirePreciseResultSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Controls if the histogram query requires the return of a precise count.
+     * Enable this flag may adversely impact performance.
+     * Defaults to true.
+     * 
+ * + * bool require_precise_result_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearRequirePreciseResultSize() { + + requirePreciseResultSize_ = false; + onChanged(); + return this; + } + + private com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter filters_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter, + com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.Builder, + com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilterOrBuilder> + filtersBuilder_; + /** + * + * + *
+     * Optional. Filter the result of histogram query by the property names. It only works
+     * with histogram query count('FilterableProperties').
+     * It is an optional. It will perform histogram on all the property names for
+     * all the document schemas. Setting this field will have a better
+     * performance.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter filters = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the filters field is set. + */ + public boolean hasFilters() { + return filtersBuilder_ != null || filters_ != null; + } + /** + * + * + *
+     * Optional. Filter the result of histogram query by the property names. It only works
+     * with histogram query count('FilterableProperties').
+     * It is an optional. It will perform histogram on all the property names for
+     * all the document schemas. Setting this field will have a better
+     * performance.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter filters = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The filters. + */ + public com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter getFilters() { + if (filtersBuilder_ == null) { + return filters_ == null + ? com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter + .getDefaultInstance() + : filters_; + } else { + return filtersBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Filter the result of histogram query by the property names. It only works
+     * with histogram query count('FilterableProperties').
+     * It is an optional. It will perform histogram on all the property names for
+     * all the document schemas. Setting this field will have a better
+     * performance.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter filters = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setFilters( + com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter value) { + if (filtersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + filters_ = value; + onChanged(); + } else { + filtersBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Filter the result of histogram query by the property names. It only works
+     * with histogram query count('FilterableProperties').
+     * It is an optional. It will perform histogram on all the property names for
+     * all the document schemas. Setting this field will have a better
+     * performance.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter filters = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setFilters( + com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.Builder + builderForValue) { + if (filtersBuilder_ == null) { + filters_ = builderForValue.build(); + onChanged(); + } else { + filtersBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Optional. Filter the result of histogram query by the property names. It only works
+     * with histogram query count('FilterableProperties').
+     * It is an optional. It will perform histogram on all the property names for
+     * all the document schemas. Setting this field will have a better
+     * performance.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter filters = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeFilters( + com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter value) { + if (filtersBuilder_ == null) { + if (filters_ != null) { + filters_ = + com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.newBuilder( + filters_) + .mergeFrom(value) + .buildPartial(); + } else { + filters_ = value; + } + onChanged(); + } else { + filtersBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Filter the result of histogram query by the property names. It only works
+     * with histogram query count('FilterableProperties').
+     * It is an optional. It will perform histogram on all the property names for
+     * all the document schemas. Setting this field will have a better
+     * performance.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter filters = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearFilters() { + if (filtersBuilder_ == null) { + filters_ = null; + onChanged(); + } else { + filters_ = null; + filtersBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Optional. Filter the result of histogram query by the property names. It only works
+     * with histogram query count('FilterableProperties').
+     * It is an optional. It will perform histogram on all the property names for
+     * all the document schemas. Setting this field will have a better
+     * performance.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter filters = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.Builder + getFiltersBuilder() { + + onChanged(); + return getFiltersFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Filter the result of histogram query by the property names. It only works
+     * with histogram query count('FilterableProperties').
+     * It is an optional. It will perform histogram on all the property names for
+     * all the document schemas. Setting this field will have a better
+     * performance.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter filters = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilterOrBuilder + getFiltersOrBuilder() { + if (filtersBuilder_ != null) { + return filtersBuilder_.getMessageOrBuilder(); + } else { + return filters_ == null + ? com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter + .getDefaultInstance() + : filters_; + } + } + /** + * + * + *
+     * Optional. Filter the result of histogram query by the property names. It only works
+     * with histogram query count('FilterableProperties').
+     * It is an optional. It will perform histogram on all the property names for
+     * all the document schemas. Setting this field will have a better
+     * performance.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter filters = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter, + com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.Builder, + com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilterOrBuilder> + getFiltersFieldBuilder() { + if (filtersBuilder_ == null) { + filtersBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter, + com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.Builder, + com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilterOrBuilder>( + getFilters(), getParentForChildren(), isClean()); + filters_ = null; + } + return filtersBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.HistogramQuery) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.HistogramQuery) + private static final com.google.cloud.contentwarehouse.v1.HistogramQuery DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.HistogramQuery(); + } + + public static com.google.cloud.contentwarehouse.v1.HistogramQuery getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public HistogramQuery parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.HistogramQuery getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/HistogramQueryOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/HistogramQueryOrBuilder.java new file mode 100644 index 000000000000..d37ebc01ecbb --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/HistogramQueryOrBuilder.java @@ -0,0 +1,123 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/histogram.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface HistogramQueryOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.HistogramQuery) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * An expression specifies a histogram request against matching documents for
+   * searches.
+   * See [SearchDocumentsRequest.histogram_queries][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.histogram_queries] for details about syntax.
+   * 
+ * + * string histogram_query = 1; + * + * @return The histogramQuery. + */ + java.lang.String getHistogramQuery(); + /** + * + * + *
+   * An expression specifies a histogram request against matching documents for
+   * searches.
+   * See [SearchDocumentsRequest.histogram_queries][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.histogram_queries] for details about syntax.
+   * 
+ * + * string histogram_query = 1; + * + * @return The bytes for histogramQuery. + */ + com.google.protobuf.ByteString getHistogramQueryBytes(); + + /** + * + * + *
+   * Controls if the histogram query requires the return of a precise count.
+   * Enable this flag may adversely impact performance.
+   * Defaults to true.
+   * 
+ * + * bool require_precise_result_size = 2; + * + * @return The requirePreciseResultSize. + */ + boolean getRequirePreciseResultSize(); + + /** + * + * + *
+   * Optional. Filter the result of histogram query by the property names. It only works
+   * with histogram query count('FilterableProperties').
+   * It is an optional. It will perform histogram on all the property names for
+   * all the document schemas. Setting this field will have a better
+   * performance.
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter filters = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the filters field is set. + */ + boolean hasFilters(); + /** + * + * + *
+   * Optional. Filter the result of histogram query by the property names. It only works
+   * with histogram query count('FilterableProperties').
+   * It is an optional. It will perform histogram on all the property names for
+   * all the document schemas. Setting this field will have a better
+   * performance.
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter filters = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The filters. + */ + com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter getFilters(); + /** + * + * + *
+   * Optional. Filter the result of histogram query by the property names. It only works
+   * with histogram query count('FilterableProperties').
+   * It is an optional. It will perform histogram on all the property names for
+   * all the document schemas. Setting this field will have a better
+   * performance.
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter filters = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilterOrBuilder + getFiltersOrBuilder(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/HistogramQueryPropertyNameFilter.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/HistogramQueryPropertyNameFilter.java new file mode 100644 index 000000000000..f43c2dda5eec --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/HistogramQueryPropertyNameFilter.java @@ -0,0 +1,1463 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/histogram.proto + +package com.google.cloud.contentwarehouse.v1; + +/** Protobuf type {@code google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter} */ +public final class HistogramQueryPropertyNameFilter extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter) + HistogramQueryPropertyNameFilterOrBuilder { + private static final long serialVersionUID = 0L; + // Use HistogramQueryPropertyNameFilter.newBuilder() to construct. + private HistogramQueryPropertyNameFilter( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private HistogramQueryPropertyNameFilter() { + documentSchemas_ = com.google.protobuf.LazyStringArrayList.EMPTY; + propertyNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; + yAxis_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new HistogramQueryPropertyNameFilter(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.HistogramProto + .internal_static_google_cloud_contentwarehouse_v1_HistogramQueryPropertyNameFilter_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.HistogramProto + .internal_static_google_cloud_contentwarehouse_v1_HistogramQueryPropertyNameFilter_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.class, + com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.Builder.class); + } + + /** + * + * + *
+   * The result of the histogram query count('FilterableProperties') using
+   * HISTOGRAM_YAXIS_DOCUMENT will be:
+   * invoice_id: 2
+   * address: 1
+   * payment_method: 2
+   * line_item_description: 1
+   * 
+ * + * Protobuf enum {@code + * google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.HistogramYAxis} + */ + public enum HistogramYAxis implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Count the documents per property name.
+     * 
+ * + * HISTOGRAM_YAXIS_DOCUMENT = 0; + */ + HISTOGRAM_YAXIS_DOCUMENT(0), + /** + * + * + *
+     * Count the properties per property name.
+     * 
+ * + * HISTOGRAM_YAXIS_PROPERTY = 1; + */ + HISTOGRAM_YAXIS_PROPERTY(1), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Count the documents per property name.
+     * 
+ * + * HISTOGRAM_YAXIS_DOCUMENT = 0; + */ + public static final int HISTOGRAM_YAXIS_DOCUMENT_VALUE = 0; + /** + * + * + *
+     * Count the properties per property name.
+     * 
+ * + * HISTOGRAM_YAXIS_PROPERTY = 1; + */ + public static final int HISTOGRAM_YAXIS_PROPERTY_VALUE = 1; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static HistogramYAxis valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static HistogramYAxis forNumber(int value) { + switch (value) { + case 0: + return HISTOGRAM_YAXIS_DOCUMENT; + case 1: + return HISTOGRAM_YAXIS_PROPERTY; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public HistogramYAxis findValueByNumber(int number) { + return HistogramYAxis.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final HistogramYAxis[] VALUES = values(); + + public static HistogramYAxis valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private HistogramYAxis(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.HistogramYAxis) + } + + public static final int DOCUMENT_SCHEMAS_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList documentSchemas_; + /** + * + * + *
+   * This filter specifies the exact document schema(s)
+   * [Document.document_schema_name][google.cloud.contentwarehouse.v1.Document.document_schema_name] to run histogram query against.
+   * It is optional. It will perform histogram for property names for all the
+   * document schemas if it is not set.
+   * At most 10 document schema names are allowed.
+   * Format:
+   * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
+   * 
+ * + * repeated string document_schemas = 1 [(.google.api.resource_reference) = { ... } + * + * @return A list containing the documentSchemas. + */ + public com.google.protobuf.ProtocolStringList getDocumentSchemasList() { + return documentSchemas_; + } + /** + * + * + *
+   * This filter specifies the exact document schema(s)
+   * [Document.document_schema_name][google.cloud.contentwarehouse.v1.Document.document_schema_name] to run histogram query against.
+   * It is optional. It will perform histogram for property names for all the
+   * document schemas if it is not set.
+   * At most 10 document schema names are allowed.
+   * Format:
+   * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
+   * 
+ * + * repeated string document_schemas = 1 [(.google.api.resource_reference) = { ... } + * + * @return The count of documentSchemas. + */ + public int getDocumentSchemasCount() { + return documentSchemas_.size(); + } + /** + * + * + *
+   * This filter specifies the exact document schema(s)
+   * [Document.document_schema_name][google.cloud.contentwarehouse.v1.Document.document_schema_name] to run histogram query against.
+   * It is optional. It will perform histogram for property names for all the
+   * document schemas if it is not set.
+   * At most 10 document schema names are allowed.
+   * Format:
+   * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
+   * 
+ * + * repeated string document_schemas = 1 [(.google.api.resource_reference) = { ... } + * + * @param index The index of the element to return. + * @return The documentSchemas at the given index. + */ + public java.lang.String getDocumentSchemas(int index) { + return documentSchemas_.get(index); + } + /** + * + * + *
+   * This filter specifies the exact document schema(s)
+   * [Document.document_schema_name][google.cloud.contentwarehouse.v1.Document.document_schema_name] to run histogram query against.
+   * It is optional. It will perform histogram for property names for all the
+   * document schemas if it is not set.
+   * At most 10 document schema names are allowed.
+   * Format:
+   * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
+   * 
+ * + * repeated string document_schemas = 1 [(.google.api.resource_reference) = { ... } + * + * @param index The index of the value to return. + * @return The bytes of the documentSchemas at the given index. + */ + public com.google.protobuf.ByteString getDocumentSchemasBytes(int index) { + return documentSchemas_.getByteString(index); + } + + public static final int PROPERTY_NAMES_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList propertyNames_; + /** + * + * + *
+   * It is optional. It will perform histogram for all the property names if it
+   * is not set.
+   * The properties need to be defined with the is_filterable flag set to
+   * true and the name of the property should be in the format:
+   * "schemaId.propertyName". The property needs to be defined in the schema.
+   * Example: the schema id is abc. Then the name of property for property
+   * MORTGAGE_TYPE will be "abc.MORTGAGE_TYPE".
+   * 
+ * + * repeated string property_names = 2; + * + * @return A list containing the propertyNames. + */ + public com.google.protobuf.ProtocolStringList getPropertyNamesList() { + return propertyNames_; + } + /** + * + * + *
+   * It is optional. It will perform histogram for all the property names if it
+   * is not set.
+   * The properties need to be defined with the is_filterable flag set to
+   * true and the name of the property should be in the format:
+   * "schemaId.propertyName". The property needs to be defined in the schema.
+   * Example: the schema id is abc. Then the name of property for property
+   * MORTGAGE_TYPE will be "abc.MORTGAGE_TYPE".
+   * 
+ * + * repeated string property_names = 2; + * + * @return The count of propertyNames. + */ + public int getPropertyNamesCount() { + return propertyNames_.size(); + } + /** + * + * + *
+   * It is optional. It will perform histogram for all the property names if it
+   * is not set.
+   * The properties need to be defined with the is_filterable flag set to
+   * true and the name of the property should be in the format:
+   * "schemaId.propertyName". The property needs to be defined in the schema.
+   * Example: the schema id is abc. Then the name of property for property
+   * MORTGAGE_TYPE will be "abc.MORTGAGE_TYPE".
+   * 
+ * + * repeated string property_names = 2; + * + * @param index The index of the element to return. + * @return The propertyNames at the given index. + */ + public java.lang.String getPropertyNames(int index) { + return propertyNames_.get(index); + } + /** + * + * + *
+   * It is optional. It will perform histogram for all the property names if it
+   * is not set.
+   * The properties need to be defined with the is_filterable flag set to
+   * true and the name of the property should be in the format:
+   * "schemaId.propertyName". The property needs to be defined in the schema.
+   * Example: the schema id is abc. Then the name of property for property
+   * MORTGAGE_TYPE will be "abc.MORTGAGE_TYPE".
+   * 
+ * + * repeated string property_names = 2; + * + * @param index The index of the value to return. + * @return The bytes of the propertyNames at the given index. + */ + public com.google.protobuf.ByteString getPropertyNamesBytes(int index) { + return propertyNames_.getByteString(index); + } + + public static final int Y_AXIS_FIELD_NUMBER = 3; + private int yAxis_; + /** + * + * + *
+   * By default, the y_axis is HISTOGRAM_YAXIS_DOCUMENT if this field is not
+   * set.
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.HistogramYAxis y_axis = 3; + * + * + * @return The enum numeric value on the wire for yAxis. + */ + @java.lang.Override + public int getYAxisValue() { + return yAxis_; + } + /** + * + * + *
+   * By default, the y_axis is HISTOGRAM_YAXIS_DOCUMENT if this field is not
+   * set.
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.HistogramYAxis y_axis = 3; + * + * + * @return The yAxis. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.HistogramYAxis + getYAxis() { + @SuppressWarnings("deprecation") + com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.HistogramYAxis result = + com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.HistogramYAxis + .valueOf(yAxis_); + return result == null + ? com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.HistogramYAxis + .UNRECOGNIZED + : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < documentSchemas_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, documentSchemas_.getRaw(i)); + } + for (int i = 0; i < propertyNames_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, propertyNames_.getRaw(i)); + } + if (yAxis_ + != com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.HistogramYAxis + .HISTOGRAM_YAXIS_DOCUMENT + .getNumber()) { + output.writeEnum(3, yAxis_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < documentSchemas_.size(); i++) { + dataSize += computeStringSizeNoTag(documentSchemas_.getRaw(i)); + } + size += dataSize; + size += 1 * getDocumentSchemasList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < propertyNames_.size(); i++) { + dataSize += computeStringSizeNoTag(propertyNames_.getRaw(i)); + } + size += dataSize; + size += 1 * getPropertyNamesList().size(); + } + if (yAxis_ + != com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.HistogramYAxis + .HISTOGRAM_YAXIS_DOCUMENT + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, yAxis_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter other = + (com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter) obj; + + if (!getDocumentSchemasList().equals(other.getDocumentSchemasList())) return false; + if (!getPropertyNamesList().equals(other.getPropertyNamesList())) return false; + if (yAxis_ != other.yAxis_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getDocumentSchemasCount() > 0) { + hash = (37 * hash) + DOCUMENT_SCHEMAS_FIELD_NUMBER; + hash = (53 * hash) + getDocumentSchemasList().hashCode(); + } + if (getPropertyNamesCount() > 0) { + hash = (37 * hash) + PROPERTY_NAMES_FIELD_NUMBER; + hash = (53 * hash) + getPropertyNamesList().hashCode(); + } + hash = (37 * hash) + Y_AXIS_FIELD_NUMBER; + hash = (53 * hash) + yAxis_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** Protobuf type {@code google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter) + com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilterOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.HistogramProto + .internal_static_google_cloud_contentwarehouse_v1_HistogramQueryPropertyNameFilter_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.HistogramProto + .internal_static_google_cloud_contentwarehouse_v1_HistogramQueryPropertyNameFilter_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.class, + com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.Builder.class); + } + + // Construct using + // com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + documentSchemas_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + propertyNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + yAxis_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.HistogramProto + .internal_static_google_cloud_contentwarehouse_v1_HistogramQueryPropertyNameFilter_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter + getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter build() { + com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter buildPartial() { + com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter result = + new com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + documentSchemas_ = documentSchemas_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.documentSchemas_ = documentSchemas_; + if (((bitField0_ & 0x00000002) != 0)) { + propertyNames_ = propertyNames_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.propertyNames_ = propertyNames_; + result.yAxis_ = yAxis_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter) { + return mergeFrom( + (com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter other) { + if (other + == com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter + .getDefaultInstance()) return this; + if (!other.documentSchemas_.isEmpty()) { + if (documentSchemas_.isEmpty()) { + documentSchemas_ = other.documentSchemas_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureDocumentSchemasIsMutable(); + documentSchemas_.addAll(other.documentSchemas_); + } + onChanged(); + } + if (!other.propertyNames_.isEmpty()) { + if (propertyNames_.isEmpty()) { + propertyNames_ = other.propertyNames_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensurePropertyNamesIsMutable(); + propertyNames_.addAll(other.propertyNames_); + } + onChanged(); + } + if (other.yAxis_ != 0) { + setYAxisValue(other.getYAxisValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureDocumentSchemasIsMutable(); + documentSchemas_.add(s); + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + ensurePropertyNamesIsMutable(); + propertyNames_.add(s); + break; + } // case 18 + case 24: + { + yAxis_ = input.readEnum(); + + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList documentSchemas_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureDocumentSchemasIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + documentSchemas_ = new com.google.protobuf.LazyStringArrayList(documentSchemas_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * This filter specifies the exact document schema(s)
+     * [Document.document_schema_name][google.cloud.contentwarehouse.v1.Document.document_schema_name] to run histogram query against.
+     * It is optional. It will perform histogram for property names for all the
+     * document schemas if it is not set.
+     * At most 10 document schema names are allowed.
+     * Format:
+     * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
+     * 
+ * + * repeated string document_schemas = 1 [(.google.api.resource_reference) = { ... } + * + * @return A list containing the documentSchemas. + */ + public com.google.protobuf.ProtocolStringList getDocumentSchemasList() { + return documentSchemas_.getUnmodifiableView(); + } + /** + * + * + *
+     * This filter specifies the exact document schema(s)
+     * [Document.document_schema_name][google.cloud.contentwarehouse.v1.Document.document_schema_name] to run histogram query against.
+     * It is optional. It will perform histogram for property names for all the
+     * document schemas if it is not set.
+     * At most 10 document schema names are allowed.
+     * Format:
+     * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
+     * 
+ * + * repeated string document_schemas = 1 [(.google.api.resource_reference) = { ... } + * + * @return The count of documentSchemas. + */ + public int getDocumentSchemasCount() { + return documentSchemas_.size(); + } + /** + * + * + *
+     * This filter specifies the exact document schema(s)
+     * [Document.document_schema_name][google.cloud.contentwarehouse.v1.Document.document_schema_name] to run histogram query against.
+     * It is optional. It will perform histogram for property names for all the
+     * document schemas if it is not set.
+     * At most 10 document schema names are allowed.
+     * Format:
+     * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
+     * 
+ * + * repeated string document_schemas = 1 [(.google.api.resource_reference) = { ... } + * + * @param index The index of the element to return. + * @return The documentSchemas at the given index. + */ + public java.lang.String getDocumentSchemas(int index) { + return documentSchemas_.get(index); + } + /** + * + * + *
+     * This filter specifies the exact document schema(s)
+     * [Document.document_schema_name][google.cloud.contentwarehouse.v1.Document.document_schema_name] to run histogram query against.
+     * It is optional. It will perform histogram for property names for all the
+     * document schemas if it is not set.
+     * At most 10 document schema names are allowed.
+     * Format:
+     * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
+     * 
+ * + * repeated string document_schemas = 1 [(.google.api.resource_reference) = { ... } + * + * @param index The index of the value to return. + * @return The bytes of the documentSchemas at the given index. + */ + public com.google.protobuf.ByteString getDocumentSchemasBytes(int index) { + return documentSchemas_.getByteString(index); + } + /** + * + * + *
+     * This filter specifies the exact document schema(s)
+     * [Document.document_schema_name][google.cloud.contentwarehouse.v1.Document.document_schema_name] to run histogram query against.
+     * It is optional. It will perform histogram for property names for all the
+     * document schemas if it is not set.
+     * At most 10 document schema names are allowed.
+     * Format:
+     * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
+     * 
+ * + * repeated string document_schemas = 1 [(.google.api.resource_reference) = { ... } + * + * @param index The index to set the value at. + * @param value The documentSchemas to set. + * @return This builder for chaining. + */ + public Builder setDocumentSchemas(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDocumentSchemasIsMutable(); + documentSchemas_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * This filter specifies the exact document schema(s)
+     * [Document.document_schema_name][google.cloud.contentwarehouse.v1.Document.document_schema_name] to run histogram query against.
+     * It is optional. It will perform histogram for property names for all the
+     * document schemas if it is not set.
+     * At most 10 document schema names are allowed.
+     * Format:
+     * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
+     * 
+ * + * repeated string document_schemas = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The documentSchemas to add. + * @return This builder for chaining. + */ + public Builder addDocumentSchemas(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDocumentSchemasIsMutable(); + documentSchemas_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * This filter specifies the exact document schema(s)
+     * [Document.document_schema_name][google.cloud.contentwarehouse.v1.Document.document_schema_name] to run histogram query against.
+     * It is optional. It will perform histogram for property names for all the
+     * document schemas if it is not set.
+     * At most 10 document schema names are allowed.
+     * Format:
+     * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
+     * 
+ * + * repeated string document_schemas = 1 [(.google.api.resource_reference) = { ... } + * + * @param values The documentSchemas to add. + * @return This builder for chaining. + */ + public Builder addAllDocumentSchemas(java.lang.Iterable values) { + ensureDocumentSchemasIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, documentSchemas_); + onChanged(); + return this; + } + /** + * + * + *
+     * This filter specifies the exact document schema(s)
+     * [Document.document_schema_name][google.cloud.contentwarehouse.v1.Document.document_schema_name] to run histogram query against.
+     * It is optional. It will perform histogram for property names for all the
+     * document schemas if it is not set.
+     * At most 10 document schema names are allowed.
+     * Format:
+     * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
+     * 
+ * + * repeated string document_schemas = 1 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearDocumentSchemas() { + documentSchemas_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * This filter specifies the exact document schema(s)
+     * [Document.document_schema_name][google.cloud.contentwarehouse.v1.Document.document_schema_name] to run histogram query against.
+     * It is optional. It will perform histogram for property names for all the
+     * document schemas if it is not set.
+     * At most 10 document schema names are allowed.
+     * Format:
+     * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
+     * 
+ * + * repeated string document_schemas = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes of the documentSchemas to add. + * @return This builder for chaining. + */ + public Builder addDocumentSchemasBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureDocumentSchemasIsMutable(); + documentSchemas_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList propertyNames_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensurePropertyNamesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + propertyNames_ = new com.google.protobuf.LazyStringArrayList(propertyNames_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * It is optional. It will perform histogram for all the property names if it
+     * is not set.
+     * The properties need to be defined with the is_filterable flag set to
+     * true and the name of the property should be in the format:
+     * "schemaId.propertyName". The property needs to be defined in the schema.
+     * Example: the schema id is abc. Then the name of property for property
+     * MORTGAGE_TYPE will be "abc.MORTGAGE_TYPE".
+     * 
+ * + * repeated string property_names = 2; + * + * @return A list containing the propertyNames. + */ + public com.google.protobuf.ProtocolStringList getPropertyNamesList() { + return propertyNames_.getUnmodifiableView(); + } + /** + * + * + *
+     * It is optional. It will perform histogram for all the property names if it
+     * is not set.
+     * The properties need to be defined with the is_filterable flag set to
+     * true and the name of the property should be in the format:
+     * "schemaId.propertyName". The property needs to be defined in the schema.
+     * Example: the schema id is abc. Then the name of property for property
+     * MORTGAGE_TYPE will be "abc.MORTGAGE_TYPE".
+     * 
+ * + * repeated string property_names = 2; + * + * @return The count of propertyNames. + */ + public int getPropertyNamesCount() { + return propertyNames_.size(); + } + /** + * + * + *
+     * It is optional. It will perform histogram for all the property names if it
+     * is not set.
+     * The properties need to be defined with the is_filterable flag set to
+     * true and the name of the property should be in the format:
+     * "schemaId.propertyName". The property needs to be defined in the schema.
+     * Example: the schema id is abc. Then the name of property for property
+     * MORTGAGE_TYPE will be "abc.MORTGAGE_TYPE".
+     * 
+ * + * repeated string property_names = 2; + * + * @param index The index of the element to return. + * @return The propertyNames at the given index. + */ + public java.lang.String getPropertyNames(int index) { + return propertyNames_.get(index); + } + /** + * + * + *
+     * It is optional. It will perform histogram for all the property names if it
+     * is not set.
+     * The properties need to be defined with the is_filterable flag set to
+     * true and the name of the property should be in the format:
+     * "schemaId.propertyName". The property needs to be defined in the schema.
+     * Example: the schema id is abc. Then the name of property for property
+     * MORTGAGE_TYPE will be "abc.MORTGAGE_TYPE".
+     * 
+ * + * repeated string property_names = 2; + * + * @param index The index of the value to return. + * @return The bytes of the propertyNames at the given index. + */ + public com.google.protobuf.ByteString getPropertyNamesBytes(int index) { + return propertyNames_.getByteString(index); + } + /** + * + * + *
+     * It is optional. It will perform histogram for all the property names if it
+     * is not set.
+     * The properties need to be defined with the is_filterable flag set to
+     * true and the name of the property should be in the format:
+     * "schemaId.propertyName". The property needs to be defined in the schema.
+     * Example: the schema id is abc. Then the name of property for property
+     * MORTGAGE_TYPE will be "abc.MORTGAGE_TYPE".
+     * 
+ * + * repeated string property_names = 2; + * + * @param index The index to set the value at. + * @param value The propertyNames to set. + * @return This builder for chaining. + */ + public Builder setPropertyNames(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePropertyNamesIsMutable(); + propertyNames_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * It is optional. It will perform histogram for all the property names if it
+     * is not set.
+     * The properties need to be defined with the is_filterable flag set to
+     * true and the name of the property should be in the format:
+     * "schemaId.propertyName". The property needs to be defined in the schema.
+     * Example: the schema id is abc. Then the name of property for property
+     * MORTGAGE_TYPE will be "abc.MORTGAGE_TYPE".
+     * 
+ * + * repeated string property_names = 2; + * + * @param value The propertyNames to add. + * @return This builder for chaining. + */ + public Builder addPropertyNames(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePropertyNamesIsMutable(); + propertyNames_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * It is optional. It will perform histogram for all the property names if it
+     * is not set.
+     * The properties need to be defined with the is_filterable flag set to
+     * true and the name of the property should be in the format:
+     * "schemaId.propertyName". The property needs to be defined in the schema.
+     * Example: the schema id is abc. Then the name of property for property
+     * MORTGAGE_TYPE will be "abc.MORTGAGE_TYPE".
+     * 
+ * + * repeated string property_names = 2; + * + * @param values The propertyNames to add. + * @return This builder for chaining. + */ + public Builder addAllPropertyNames(java.lang.Iterable values) { + ensurePropertyNamesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, propertyNames_); + onChanged(); + return this; + } + /** + * + * + *
+     * It is optional. It will perform histogram for all the property names if it
+     * is not set.
+     * The properties need to be defined with the is_filterable flag set to
+     * true and the name of the property should be in the format:
+     * "schemaId.propertyName". The property needs to be defined in the schema.
+     * Example: the schema id is abc. Then the name of property for property
+     * MORTGAGE_TYPE will be "abc.MORTGAGE_TYPE".
+     * 
+ * + * repeated string property_names = 2; + * + * @return This builder for chaining. + */ + public Builder clearPropertyNames() { + propertyNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * It is optional. It will perform histogram for all the property names if it
+     * is not set.
+     * The properties need to be defined with the is_filterable flag set to
+     * true and the name of the property should be in the format:
+     * "schemaId.propertyName". The property needs to be defined in the schema.
+     * Example: the schema id is abc. Then the name of property for property
+     * MORTGAGE_TYPE will be "abc.MORTGAGE_TYPE".
+     * 
+ * + * repeated string property_names = 2; + * + * @param value The bytes of the propertyNames to add. + * @return This builder for chaining. + */ + public Builder addPropertyNamesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensurePropertyNamesIsMutable(); + propertyNames_.add(value); + onChanged(); + return this; + } + + private int yAxis_ = 0; + /** + * + * + *
+     * By default, the y_axis is HISTOGRAM_YAXIS_DOCUMENT if this field is not
+     * set.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.HistogramYAxis y_axis = 3; + * + * + * @return The enum numeric value on the wire for yAxis. + */ + @java.lang.Override + public int getYAxisValue() { + return yAxis_; + } + /** + * + * + *
+     * By default, the y_axis is HISTOGRAM_YAXIS_DOCUMENT if this field is not
+     * set.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.HistogramYAxis y_axis = 3; + * + * + * @param value The enum numeric value on the wire for yAxis to set. + * @return This builder for chaining. + */ + public Builder setYAxisValue(int value) { + + yAxis_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * By default, the y_axis is HISTOGRAM_YAXIS_DOCUMENT if this field is not
+     * set.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.HistogramYAxis y_axis = 3; + * + * + * @return The yAxis. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.HistogramYAxis + getYAxis() { + @SuppressWarnings("deprecation") + com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.HistogramYAxis result = + com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.HistogramYAxis + .valueOf(yAxis_); + return result == null + ? com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.HistogramYAxis + .UNRECOGNIZED + : result; + } + /** + * + * + *
+     * By default, the y_axis is HISTOGRAM_YAXIS_DOCUMENT if this field is not
+     * set.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.HistogramYAxis y_axis = 3; + * + * + * @param value The yAxis to set. + * @return This builder for chaining. + */ + public Builder setYAxis( + com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.HistogramYAxis + value) { + if (value == null) { + throw new NullPointerException(); + } + + yAxis_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * By default, the y_axis is HISTOGRAM_YAXIS_DOCUMENT if this field is not
+     * set.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.HistogramYAxis y_axis = 3; + * + * + * @return This builder for chaining. + */ + public Builder clearYAxis() { + + yAxis_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter) + private static final com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter(); + } + + public static com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public HistogramQueryPropertyNameFilter parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/HistogramQueryPropertyNameFilterOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/HistogramQueryPropertyNameFilterOrBuilder.java new file mode 100644 index 000000000000..c9aaa8c2e93c --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/HistogramQueryPropertyNameFilterOrBuilder.java @@ -0,0 +1,206 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/histogram.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface HistogramQueryPropertyNameFilterOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This filter specifies the exact document schema(s)
+   * [Document.document_schema_name][google.cloud.contentwarehouse.v1.Document.document_schema_name] to run histogram query against.
+   * It is optional. It will perform histogram for property names for all the
+   * document schemas if it is not set.
+   * At most 10 document schema names are allowed.
+   * Format:
+   * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
+   * 
+ * + * repeated string document_schemas = 1 [(.google.api.resource_reference) = { ... } + * + * @return A list containing the documentSchemas. + */ + java.util.List getDocumentSchemasList(); + /** + * + * + *
+   * This filter specifies the exact document schema(s)
+   * [Document.document_schema_name][google.cloud.contentwarehouse.v1.Document.document_schema_name] to run histogram query against.
+   * It is optional. It will perform histogram for property names for all the
+   * document schemas if it is not set.
+   * At most 10 document schema names are allowed.
+   * Format:
+   * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
+   * 
+ * + * repeated string document_schemas = 1 [(.google.api.resource_reference) = { ... } + * + * @return The count of documentSchemas. + */ + int getDocumentSchemasCount(); + /** + * + * + *
+   * This filter specifies the exact document schema(s)
+   * [Document.document_schema_name][google.cloud.contentwarehouse.v1.Document.document_schema_name] to run histogram query against.
+   * It is optional. It will perform histogram for property names for all the
+   * document schemas if it is not set.
+   * At most 10 document schema names are allowed.
+   * Format:
+   * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
+   * 
+ * + * repeated string document_schemas = 1 [(.google.api.resource_reference) = { ... } + * + * @param index The index of the element to return. + * @return The documentSchemas at the given index. + */ + java.lang.String getDocumentSchemas(int index); + /** + * + * + *
+   * This filter specifies the exact document schema(s)
+   * [Document.document_schema_name][google.cloud.contentwarehouse.v1.Document.document_schema_name] to run histogram query against.
+   * It is optional. It will perform histogram for property names for all the
+   * document schemas if it is not set.
+   * At most 10 document schema names are allowed.
+   * Format:
+   * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
+   * 
+ * + * repeated string document_schemas = 1 [(.google.api.resource_reference) = { ... } + * + * @param index The index of the value to return. + * @return The bytes of the documentSchemas at the given index. + */ + com.google.protobuf.ByteString getDocumentSchemasBytes(int index); + + /** + * + * + *
+   * It is optional. It will perform histogram for all the property names if it
+   * is not set.
+   * The properties need to be defined with the is_filterable flag set to
+   * true and the name of the property should be in the format:
+   * "schemaId.propertyName". The property needs to be defined in the schema.
+   * Example: the schema id is abc. Then the name of property for property
+   * MORTGAGE_TYPE will be "abc.MORTGAGE_TYPE".
+   * 
+ * + * repeated string property_names = 2; + * + * @return A list containing the propertyNames. + */ + java.util.List getPropertyNamesList(); + /** + * + * + *
+   * It is optional. It will perform histogram for all the property names if it
+   * is not set.
+   * The properties need to be defined with the is_filterable flag set to
+   * true and the name of the property should be in the format:
+   * "schemaId.propertyName". The property needs to be defined in the schema.
+   * Example: the schema id is abc. Then the name of property for property
+   * MORTGAGE_TYPE will be "abc.MORTGAGE_TYPE".
+   * 
+ * + * repeated string property_names = 2; + * + * @return The count of propertyNames. + */ + int getPropertyNamesCount(); + /** + * + * + *
+   * It is optional. It will perform histogram for all the property names if it
+   * is not set.
+   * The properties need to be defined with the is_filterable flag set to
+   * true and the name of the property should be in the format:
+   * "schemaId.propertyName". The property needs to be defined in the schema.
+   * Example: the schema id is abc. Then the name of property for property
+   * MORTGAGE_TYPE will be "abc.MORTGAGE_TYPE".
+   * 
+ * + * repeated string property_names = 2; + * + * @param index The index of the element to return. + * @return The propertyNames at the given index. + */ + java.lang.String getPropertyNames(int index); + /** + * + * + *
+   * It is optional. It will perform histogram for all the property names if it
+   * is not set.
+   * The properties need to be defined with the is_filterable flag set to
+   * true and the name of the property should be in the format:
+   * "schemaId.propertyName". The property needs to be defined in the schema.
+   * Example: the schema id is abc. Then the name of property for property
+   * MORTGAGE_TYPE will be "abc.MORTGAGE_TYPE".
+   * 
+ * + * repeated string property_names = 2; + * + * @param index The index of the value to return. + * @return The bytes of the propertyNames at the given index. + */ + com.google.protobuf.ByteString getPropertyNamesBytes(int index); + + /** + * + * + *
+   * By default, the y_axis is HISTOGRAM_YAXIS_DOCUMENT if this field is not
+   * set.
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.HistogramYAxis y_axis = 3; + * + * + * @return The enum numeric value on the wire for yAxis. + */ + int getYAxisValue(); + /** + * + * + *
+   * By default, the y_axis is HISTOGRAM_YAXIS_DOCUMENT if this field is not
+   * set.
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.HistogramYAxis y_axis = 3; + * + * + * @return The yAxis. + */ + com.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.HistogramYAxis getYAxis(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/HistogramQueryResult.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/HistogramQueryResult.java new file mode 100644 index 000000000000..22d2314e3cbb --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/HistogramQueryResult.java @@ -0,0 +1,968 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/histogram.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Histogram result that matches [HistogramQuery][google.cloud.contentwarehouse.v1.HistogramQuery] specified in searches.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.HistogramQueryResult} + */ +public final class HistogramQueryResult extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.HistogramQueryResult) + HistogramQueryResultOrBuilder { + private static final long serialVersionUID = 0L; + // Use HistogramQueryResult.newBuilder() to construct. + private HistogramQueryResult(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private HistogramQueryResult() { + histogramQuery_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new HistogramQueryResult(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.HistogramProto + .internal_static_google_cloud_contentwarehouse_v1_HistogramQueryResult_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetHistogram(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.HistogramProto + .internal_static_google_cloud_contentwarehouse_v1_HistogramQueryResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.HistogramQueryResult.class, + com.google.cloud.contentwarehouse.v1.HistogramQueryResult.Builder.class); + } + + public static final int HISTOGRAM_QUERY_FIELD_NUMBER = 1; + private volatile java.lang.Object histogramQuery_; + /** + * + * + *
+   * Requested histogram expression.
+   * 
+ * + * string histogram_query = 1; + * + * @return The histogramQuery. + */ + @java.lang.Override + public java.lang.String getHistogramQuery() { + java.lang.Object ref = histogramQuery_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + histogramQuery_ = s; + return s; + } + } + /** + * + * + *
+   * Requested histogram expression.
+   * 
+ * + * string histogram_query = 1; + * + * @return The bytes for histogramQuery. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHistogramQueryBytes() { + java.lang.Object ref = histogramQuery_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + histogramQuery_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int HISTOGRAM_FIELD_NUMBER = 2; + + private static final class HistogramDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.contentwarehouse.v1.HistogramProto + .internal_static_google_cloud_contentwarehouse_v1_HistogramQueryResult_HistogramEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.INT64, + 0L); + } + + private com.google.protobuf.MapField histogram_; + + private com.google.protobuf.MapField internalGetHistogram() { + if (histogram_ == null) { + return com.google.protobuf.MapField.emptyMapField(HistogramDefaultEntryHolder.defaultEntry); + } + return histogram_; + } + + public int getHistogramCount() { + return internalGetHistogram().getMap().size(); + } + /** + * + * + *
+   * A map from the values of the facet associated with distinct values to the
+   * number of matching entries with corresponding value.
+   * The key format is:
+   * * (for string histogram) string values stored in the field.
+   * 
+ * + * map<string, int64> histogram = 2; + */ + @java.lang.Override + public boolean containsHistogram(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetHistogram().getMap().containsKey(key); + } + /** Use {@link #getHistogramMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getHistogram() { + return getHistogramMap(); + } + /** + * + * + *
+   * A map from the values of the facet associated with distinct values to the
+   * number of matching entries with corresponding value.
+   * The key format is:
+   * * (for string histogram) string values stored in the field.
+   * 
+ * + * map<string, int64> histogram = 2; + */ + @java.lang.Override + public java.util.Map getHistogramMap() { + return internalGetHistogram().getMap(); + } + /** + * + * + *
+   * A map from the values of the facet associated with distinct values to the
+   * number of matching entries with corresponding value.
+   * The key format is:
+   * * (for string histogram) string values stored in the field.
+   * 
+ * + * map<string, int64> histogram = 2; + */ + @java.lang.Override + public long getHistogramOrDefault(java.lang.String key, long defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetHistogram().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * A map from the values of the facet associated with distinct values to the
+   * number of matching entries with corresponding value.
+   * The key format is:
+   * * (for string histogram) string values stored in the field.
+   * 
+ * + * map<string, int64> histogram = 2; + */ + @java.lang.Override + public long getHistogramOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetHistogram().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(histogramQuery_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, histogramQuery_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetHistogram(), HistogramDefaultEntryHolder.defaultEntry, 2); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(histogramQuery_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, histogramQuery_); + } + for (java.util.Map.Entry entry : + internalGetHistogram().getMap().entrySet()) { + com.google.protobuf.MapEntry histogram__ = + HistogramDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, histogram__); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.HistogramQueryResult)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.HistogramQueryResult other = + (com.google.cloud.contentwarehouse.v1.HistogramQueryResult) obj; + + if (!getHistogramQuery().equals(other.getHistogramQuery())) return false; + if (!internalGetHistogram().equals(other.internalGetHistogram())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + HISTOGRAM_QUERY_FIELD_NUMBER; + hash = (53 * hash) + getHistogramQuery().hashCode(); + if (!internalGetHistogram().getMap().isEmpty()) { + hash = (37 * hash) + HISTOGRAM_FIELD_NUMBER; + hash = (53 * hash) + internalGetHistogram().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.HistogramQueryResult parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.HistogramQueryResult parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.HistogramQueryResult parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.HistogramQueryResult parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.HistogramQueryResult parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.HistogramQueryResult parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.HistogramQueryResult parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.HistogramQueryResult parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.HistogramQueryResult parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.HistogramQueryResult parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.HistogramQueryResult parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.HistogramQueryResult parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.HistogramQueryResult prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Histogram result that matches [HistogramQuery][google.cloud.contentwarehouse.v1.HistogramQuery] specified in searches.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.HistogramQueryResult} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.HistogramQueryResult) + com.google.cloud.contentwarehouse.v1.HistogramQueryResultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.HistogramProto + .internal_static_google_cloud_contentwarehouse_v1_HistogramQueryResult_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetHistogram(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 2: + return internalGetMutableHistogram(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.HistogramProto + .internal_static_google_cloud_contentwarehouse_v1_HistogramQueryResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.HistogramQueryResult.class, + com.google.cloud.contentwarehouse.v1.HistogramQueryResult.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.HistogramQueryResult.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + histogramQuery_ = ""; + + internalGetMutableHistogram().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.HistogramProto + .internal_static_google_cloud_contentwarehouse_v1_HistogramQueryResult_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.HistogramQueryResult getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.HistogramQueryResult.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.HistogramQueryResult build() { + com.google.cloud.contentwarehouse.v1.HistogramQueryResult result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.HistogramQueryResult buildPartial() { + com.google.cloud.contentwarehouse.v1.HistogramQueryResult result = + new com.google.cloud.contentwarehouse.v1.HistogramQueryResult(this); + int from_bitField0_ = bitField0_; + result.histogramQuery_ = histogramQuery_; + result.histogram_ = internalGetHistogram(); + result.histogram_.makeImmutable(); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.HistogramQueryResult) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.HistogramQueryResult) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.HistogramQueryResult other) { + if (other == com.google.cloud.contentwarehouse.v1.HistogramQueryResult.getDefaultInstance()) + return this; + if (!other.getHistogramQuery().isEmpty()) { + histogramQuery_ = other.histogramQuery_; + onChanged(); + } + internalGetMutableHistogram().mergeFrom(other.internalGetHistogram()); + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + histogramQuery_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + com.google.protobuf.MapEntry histogram__ = + input.readMessage( + HistogramDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableHistogram() + .getMutableMap() + .put(histogram__.getKey(), histogram__.getValue()); + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object histogramQuery_ = ""; + /** + * + * + *
+     * Requested histogram expression.
+     * 
+ * + * string histogram_query = 1; + * + * @return The histogramQuery. + */ + public java.lang.String getHistogramQuery() { + java.lang.Object ref = histogramQuery_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + histogramQuery_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Requested histogram expression.
+     * 
+ * + * string histogram_query = 1; + * + * @return The bytes for histogramQuery. + */ + public com.google.protobuf.ByteString getHistogramQueryBytes() { + java.lang.Object ref = histogramQuery_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + histogramQuery_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Requested histogram expression.
+     * 
+ * + * string histogram_query = 1; + * + * @param value The histogramQuery to set. + * @return This builder for chaining. + */ + public Builder setHistogramQuery(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + histogramQuery_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Requested histogram expression.
+     * 
+ * + * string histogram_query = 1; + * + * @return This builder for chaining. + */ + public Builder clearHistogramQuery() { + + histogramQuery_ = getDefaultInstance().getHistogramQuery(); + onChanged(); + return this; + } + /** + * + * + *
+     * Requested histogram expression.
+     * 
+ * + * string histogram_query = 1; + * + * @param value The bytes for histogramQuery to set. + * @return This builder for chaining. + */ + public Builder setHistogramQueryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + histogramQuery_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField histogram_; + + private com.google.protobuf.MapField internalGetHistogram() { + if (histogram_ == null) { + return com.google.protobuf.MapField.emptyMapField(HistogramDefaultEntryHolder.defaultEntry); + } + return histogram_; + } + + private com.google.protobuf.MapField + internalGetMutableHistogram() { + onChanged(); + ; + if (histogram_ == null) { + histogram_ = + com.google.protobuf.MapField.newMapField(HistogramDefaultEntryHolder.defaultEntry); + } + if (!histogram_.isMutable()) { + histogram_ = histogram_.copy(); + } + return histogram_; + } + + public int getHistogramCount() { + return internalGetHistogram().getMap().size(); + } + /** + * + * + *
+     * A map from the values of the facet associated with distinct values to the
+     * number of matching entries with corresponding value.
+     * The key format is:
+     * * (for string histogram) string values stored in the field.
+     * 
+ * + * map<string, int64> histogram = 2; + */ + @java.lang.Override + public boolean containsHistogram(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetHistogram().getMap().containsKey(key); + } + /** Use {@link #getHistogramMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getHistogram() { + return getHistogramMap(); + } + /** + * + * + *
+     * A map from the values of the facet associated with distinct values to the
+     * number of matching entries with corresponding value.
+     * The key format is:
+     * * (for string histogram) string values stored in the field.
+     * 
+ * + * map<string, int64> histogram = 2; + */ + @java.lang.Override + public java.util.Map getHistogramMap() { + return internalGetHistogram().getMap(); + } + /** + * + * + *
+     * A map from the values of the facet associated with distinct values to the
+     * number of matching entries with corresponding value.
+     * The key format is:
+     * * (for string histogram) string values stored in the field.
+     * 
+ * + * map<string, int64> histogram = 2; + */ + @java.lang.Override + public long getHistogramOrDefault(java.lang.String key, long defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetHistogram().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * A map from the values of the facet associated with distinct values to the
+     * number of matching entries with corresponding value.
+     * The key format is:
+     * * (for string histogram) string values stored in the field.
+     * 
+ * + * map<string, int64> histogram = 2; + */ + @java.lang.Override + public long getHistogramOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetHistogram().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearHistogram() { + internalGetMutableHistogram().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * A map from the values of the facet associated with distinct values to the
+     * number of matching entries with corresponding value.
+     * The key format is:
+     * * (for string histogram) string values stored in the field.
+     * 
+ * + * map<string, int64> histogram = 2; + */ + public Builder removeHistogram(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableHistogram().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableHistogram() { + return internalGetMutableHistogram().getMutableMap(); + } + /** + * + * + *
+     * A map from the values of the facet associated with distinct values to the
+     * number of matching entries with corresponding value.
+     * The key format is:
+     * * (for string histogram) string values stored in the field.
+     * 
+ * + * map<string, int64> histogram = 2; + */ + public Builder putHistogram(java.lang.String key, long value) { + if (key == null) { + throw new NullPointerException("map key"); + } + + internalGetMutableHistogram().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * A map from the values of the facet associated with distinct values to the
+     * number of matching entries with corresponding value.
+     * The key format is:
+     * * (for string histogram) string values stored in the field.
+     * 
+ * + * map<string, int64> histogram = 2; + */ + public Builder putAllHistogram(java.util.Map values) { + internalGetMutableHistogram().getMutableMap().putAll(values); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.HistogramQueryResult) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.HistogramQueryResult) + private static final com.google.cloud.contentwarehouse.v1.HistogramQueryResult DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.HistogramQueryResult(); + } + + public static com.google.cloud.contentwarehouse.v1.HistogramQueryResult getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public HistogramQueryResult parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.HistogramQueryResult getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/HistogramQueryResultOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/HistogramQueryResultOrBuilder.java new file mode 100644 index 000000000000..dbd1a338b84f --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/HistogramQueryResultOrBuilder.java @@ -0,0 +1,119 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/histogram.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface HistogramQueryResultOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.HistogramQueryResult) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Requested histogram expression.
+   * 
+ * + * string histogram_query = 1; + * + * @return The histogramQuery. + */ + java.lang.String getHistogramQuery(); + /** + * + * + *
+   * Requested histogram expression.
+   * 
+ * + * string histogram_query = 1; + * + * @return The bytes for histogramQuery. + */ + com.google.protobuf.ByteString getHistogramQueryBytes(); + + /** + * + * + *
+   * A map from the values of the facet associated with distinct values to the
+   * number of matching entries with corresponding value.
+   * The key format is:
+   * * (for string histogram) string values stored in the field.
+   * 
+ * + * map<string, int64> histogram = 2; + */ + int getHistogramCount(); + /** + * + * + *
+   * A map from the values of the facet associated with distinct values to the
+   * number of matching entries with corresponding value.
+   * The key format is:
+   * * (for string histogram) string values stored in the field.
+   * 
+ * + * map<string, int64> histogram = 2; + */ + boolean containsHistogram(java.lang.String key); + /** Use {@link #getHistogramMap()} instead. */ + @java.lang.Deprecated + java.util.Map getHistogram(); + /** + * + * + *
+   * A map from the values of the facet associated with distinct values to the
+   * number of matching entries with corresponding value.
+   * The key format is:
+   * * (for string histogram) string values stored in the field.
+   * 
+ * + * map<string, int64> histogram = 2; + */ + java.util.Map getHistogramMap(); + /** + * + * + *
+   * A map from the values of the facet associated with distinct values to the
+   * number of matching entries with corresponding value.
+   * The key format is:
+   * * (for string histogram) string values stored in the field.
+   * 
+ * + * map<string, int64> histogram = 2; + */ + long getHistogramOrDefault(java.lang.String key, long defaultValue); + /** + * + * + *
+   * A map from the values of the facet associated with distinct values to the
+   * number of matching entries with corresponding value.
+   * The key format is:
+   * * (for string histogram) string values stored in the field.
+   * 
+ * + * map<string, int64> histogram = 2; + */ + long getHistogramOrThrow(java.lang.String key); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/IntegerArray.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/IntegerArray.java new file mode 100644 index 000000000000..64d0659c23f5 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/IntegerArray.java @@ -0,0 +1,676 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Integer values.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.IntegerArray} + */ +public final class IntegerArray extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.IntegerArray) + IntegerArrayOrBuilder { + private static final long serialVersionUID = 0L; + // Use IntegerArray.newBuilder() to construct. + private IntegerArray(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private IntegerArray() { + values_ = emptyIntList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new IntegerArray(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_IntegerArray_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_IntegerArray_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.IntegerArray.class, + com.google.cloud.contentwarehouse.v1.IntegerArray.Builder.class); + } + + public static final int VALUES_FIELD_NUMBER = 1; + private com.google.protobuf.Internal.IntList values_; + /** + * + * + *
+   * List of integer values.
+   * 
+ * + * repeated int32 values = 1; + * + * @return A list containing the values. + */ + @java.lang.Override + public java.util.List getValuesList() { + return values_; + } + /** + * + * + *
+   * List of integer values.
+   * 
+ * + * repeated int32 values = 1; + * + * @return The count of values. + */ + public int getValuesCount() { + return values_.size(); + } + /** + * + * + *
+   * List of integer values.
+   * 
+ * + * repeated int32 values = 1; + * + * @param index The index of the element to return. + * @return The values at the given index. + */ + public int getValues(int index) { + return values_.getInt(index); + } + + private int valuesMemoizedSerializedSize = -1; + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getSerializedSize(); + if (getValuesList().size() > 0) { + output.writeUInt32NoTag(10); + output.writeUInt32NoTag(valuesMemoizedSerializedSize); + } + for (int i = 0; i < values_.size(); i++) { + output.writeInt32NoTag(values_.getInt(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < values_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(values_.getInt(i)); + } + size += dataSize; + if (!getValuesList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); + } + valuesMemoizedSerializedSize = dataSize; + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.IntegerArray)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.IntegerArray other = + (com.google.cloud.contentwarehouse.v1.IntegerArray) obj; + + if (!getValuesList().equals(other.getValuesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getValuesCount() > 0) { + hash = (37 * hash) + VALUES_FIELD_NUMBER; + hash = (53 * hash) + getValuesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.IntegerArray parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.IntegerArray parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.IntegerArray parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.IntegerArray parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.IntegerArray parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.IntegerArray parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.IntegerArray parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.IntegerArray parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.IntegerArray parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.IntegerArray parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.IntegerArray parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.IntegerArray parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.contentwarehouse.v1.IntegerArray prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Integer values.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.IntegerArray} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.IntegerArray) + com.google.cloud.contentwarehouse.v1.IntegerArrayOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_IntegerArray_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_IntegerArray_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.IntegerArray.class, + com.google.cloud.contentwarehouse.v1.IntegerArray.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.IntegerArray.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + values_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_IntegerArray_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.IntegerArray getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.IntegerArray.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.IntegerArray build() { + com.google.cloud.contentwarehouse.v1.IntegerArray result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.IntegerArray buildPartial() { + com.google.cloud.contentwarehouse.v1.IntegerArray result = + new com.google.cloud.contentwarehouse.v1.IntegerArray(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + values_.makeImmutable(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.values_ = values_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.IntegerArray) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.IntegerArray) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.IntegerArray other) { + if (other == com.google.cloud.contentwarehouse.v1.IntegerArray.getDefaultInstance()) + return this; + if (!other.values_.isEmpty()) { + if (values_.isEmpty()) { + values_ = other.values_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureValuesIsMutable(); + values_.addAll(other.values_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + int v = input.readInt32(); + ensureValuesIsMutable(); + values_.addInt(v); + break; + } // case 8 + case 10: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureValuesIsMutable(); + while (input.getBytesUntilLimit() > 0) { + values_.addInt(input.readInt32()); + } + input.popLimit(limit); + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.Internal.IntList values_ = emptyIntList(); + + private void ensureValuesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + values_ = mutableCopy(values_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * List of integer values.
+     * 
+ * + * repeated int32 values = 1; + * + * @return A list containing the values. + */ + public java.util.List getValuesList() { + return ((bitField0_ & 0x00000001) != 0) + ? java.util.Collections.unmodifiableList(values_) + : values_; + } + /** + * + * + *
+     * List of integer values.
+     * 
+ * + * repeated int32 values = 1; + * + * @return The count of values. + */ + public int getValuesCount() { + return values_.size(); + } + /** + * + * + *
+     * List of integer values.
+     * 
+ * + * repeated int32 values = 1; + * + * @param index The index of the element to return. + * @return The values at the given index. + */ + public int getValues(int index) { + return values_.getInt(index); + } + /** + * + * + *
+     * List of integer values.
+     * 
+ * + * repeated int32 values = 1; + * + * @param index The index to set the value at. + * @param value The values to set. + * @return This builder for chaining. + */ + public Builder setValues(int index, int value) { + ensureValuesIsMutable(); + values_.setInt(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * List of integer values.
+     * 
+ * + * repeated int32 values = 1; + * + * @param value The values to add. + * @return This builder for chaining. + */ + public Builder addValues(int value) { + ensureValuesIsMutable(); + values_.addInt(value); + onChanged(); + return this; + } + /** + * + * + *
+     * List of integer values.
+     * 
+ * + * repeated int32 values = 1; + * + * @param values The values to add. + * @return This builder for chaining. + */ + public Builder addAllValues(java.lang.Iterable values) { + ensureValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, values_); + onChanged(); + return this; + } + /** + * + * + *
+     * List of integer values.
+     * 
+ * + * repeated int32 values = 1; + * + * @return This builder for chaining. + */ + public Builder clearValues() { + values_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.IntegerArray) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.IntegerArray) + private static final com.google.cloud.contentwarehouse.v1.IntegerArray DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.IntegerArray(); + } + + public static com.google.cloud.contentwarehouse.v1.IntegerArray getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public IntegerArray parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.IntegerArray getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/IntegerArrayOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/IntegerArrayOrBuilder.java new file mode 100644 index 000000000000..61d09b105dda --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/IntegerArrayOrBuilder.java @@ -0,0 +1,63 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface IntegerArrayOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.IntegerArray) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of integer values.
+   * 
+ * + * repeated int32 values = 1; + * + * @return A list containing the values. + */ + java.util.List getValuesList(); + /** + * + * + *
+   * List of integer values.
+   * 
+ * + * repeated int32 values = 1; + * + * @return The count of values. + */ + int getValuesCount(); + /** + * + * + *
+   * List of integer values.
+   * 
+ * + * repeated int32 values = 1; + * + * @param index The index of the element to return. + * @return The values at the given index. + */ + int getValues(int index); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/IntegerTypeOptions.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/IntegerTypeOptions.java new file mode 100644 index 000000000000..de4fdb6aaaa9 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/IntegerTypeOptions.java @@ -0,0 +1,437 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_schema.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Configurations for an integer property.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.IntegerTypeOptions} + */ +public final class IntegerTypeOptions extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.IntegerTypeOptions) + IntegerTypeOptionsOrBuilder { + private static final long serialVersionUID = 0L; + // Use IntegerTypeOptions.newBuilder() to construct. + private IntegerTypeOptions(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private IntegerTypeOptions() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new IntegerTypeOptions(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaProto + .internal_static_google_cloud_contentwarehouse_v1_IntegerTypeOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaProto + .internal_static_google_cloud_contentwarehouse_v1_IntegerTypeOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.IntegerTypeOptions.class, + com.google.cloud.contentwarehouse.v1.IntegerTypeOptions.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.IntegerTypeOptions)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.IntegerTypeOptions other = + (com.google.cloud.contentwarehouse.v1.IntegerTypeOptions) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.IntegerTypeOptions parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.IntegerTypeOptions parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.IntegerTypeOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.IntegerTypeOptions parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.IntegerTypeOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.IntegerTypeOptions parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.IntegerTypeOptions parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.IntegerTypeOptions parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.IntegerTypeOptions parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.IntegerTypeOptions parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.IntegerTypeOptions parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.IntegerTypeOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.IntegerTypeOptions prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Configurations for an integer property.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.IntegerTypeOptions} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.IntegerTypeOptions) + com.google.cloud.contentwarehouse.v1.IntegerTypeOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaProto + .internal_static_google_cloud_contentwarehouse_v1_IntegerTypeOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaProto + .internal_static_google_cloud_contentwarehouse_v1_IntegerTypeOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.IntegerTypeOptions.class, + com.google.cloud.contentwarehouse.v1.IntegerTypeOptions.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.IntegerTypeOptions.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaProto + .internal_static_google_cloud_contentwarehouse_v1_IntegerTypeOptions_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.IntegerTypeOptions getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.IntegerTypeOptions.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.IntegerTypeOptions build() { + com.google.cloud.contentwarehouse.v1.IntegerTypeOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.IntegerTypeOptions buildPartial() { + com.google.cloud.contentwarehouse.v1.IntegerTypeOptions result = + new com.google.cloud.contentwarehouse.v1.IntegerTypeOptions(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.IntegerTypeOptions) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.IntegerTypeOptions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.IntegerTypeOptions other) { + if (other == com.google.cloud.contentwarehouse.v1.IntegerTypeOptions.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.IntegerTypeOptions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.IntegerTypeOptions) + private static final com.google.cloud.contentwarehouse.v1.IntegerTypeOptions DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.IntegerTypeOptions(); + } + + public static com.google.cloud.contentwarehouse.v1.IntegerTypeOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public IntegerTypeOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.IntegerTypeOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/IntegerTypeOptionsOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/IntegerTypeOptionsOrBuilder.java new file mode 100644 index 000000000000..630818e60f7c --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/IntegerTypeOptionsOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_schema.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface IntegerTypeOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.IntegerTypeOptions) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/InvalidRule.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/InvalidRule.java new file mode 100644 index 000000000000..7f2ebc21c07c --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/InvalidRule.java @@ -0,0 +1,880 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/rule_engine.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * A triggered rule that failed the validation check(s) after parsing.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.InvalidRule} + */ +public final class InvalidRule extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.InvalidRule) + InvalidRuleOrBuilder { + private static final long serialVersionUID = 0L; + // Use InvalidRule.newBuilder() to construct. + private InvalidRule(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private InvalidRule() { + error_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new InvalidRule(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_InvalidRule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_InvalidRule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.InvalidRule.class, + com.google.cloud.contentwarehouse.v1.InvalidRule.Builder.class); + } + + public static final int RULE_FIELD_NUMBER = 1; + private com.google.cloud.contentwarehouse.v1.Rule rule_; + /** + * + * + *
+   * Triggered rule.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.Rule rule = 1; + * + * @return Whether the rule field is set. + */ + @java.lang.Override + public boolean hasRule() { + return rule_ != null; + } + /** + * + * + *
+   * Triggered rule.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.Rule rule = 1; + * + * @return The rule. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.Rule getRule() { + return rule_ == null ? com.google.cloud.contentwarehouse.v1.Rule.getDefaultInstance() : rule_; + } + /** + * + * + *
+   * Triggered rule.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.Rule rule = 1; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RuleOrBuilder getRuleOrBuilder() { + return getRule(); + } + + public static final int ERROR_FIELD_NUMBER = 2; + private volatile java.lang.Object error_; + /** + * + * + *
+   * Validation error on a parsed expression.
+   * 
+ * + * string error = 2; + * + * @return The error. + */ + @java.lang.Override + public java.lang.String getError() { + java.lang.Object ref = error_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + error_ = s; + return s; + } + } + /** + * + * + *
+   * Validation error on a parsed expression.
+   * 
+ * + * string error = 2; + * + * @return The bytes for error. + */ + @java.lang.Override + public com.google.protobuf.ByteString getErrorBytes() { + java.lang.Object ref = error_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + error_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (rule_ != null) { + output.writeMessage(1, getRule()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(error_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, error_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (rule_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getRule()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(error_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, error_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.InvalidRule)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.InvalidRule other = + (com.google.cloud.contentwarehouse.v1.InvalidRule) obj; + + if (hasRule() != other.hasRule()) return false; + if (hasRule()) { + if (!getRule().equals(other.getRule())) return false; + } + if (!getError().equals(other.getError())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasRule()) { + hash = (37 * hash) + RULE_FIELD_NUMBER; + hash = (53 * hash) + getRule().hashCode(); + } + hash = (37 * hash) + ERROR_FIELD_NUMBER; + hash = (53 * hash) + getError().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.InvalidRule parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.InvalidRule parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.InvalidRule parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.InvalidRule parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.InvalidRule parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.InvalidRule parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.InvalidRule parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.InvalidRule parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.InvalidRule parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.InvalidRule parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.InvalidRule parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.InvalidRule parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.contentwarehouse.v1.InvalidRule prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A triggered rule that failed the validation check(s) after parsing.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.InvalidRule} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.InvalidRule) + com.google.cloud.contentwarehouse.v1.InvalidRuleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_InvalidRule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_InvalidRule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.InvalidRule.class, + com.google.cloud.contentwarehouse.v1.InvalidRule.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.InvalidRule.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (ruleBuilder_ == null) { + rule_ = null; + } else { + rule_ = null; + ruleBuilder_ = null; + } + error_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_InvalidRule_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.InvalidRule getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.InvalidRule.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.InvalidRule build() { + com.google.cloud.contentwarehouse.v1.InvalidRule result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.InvalidRule buildPartial() { + com.google.cloud.contentwarehouse.v1.InvalidRule result = + new com.google.cloud.contentwarehouse.v1.InvalidRule(this); + if (ruleBuilder_ == null) { + result.rule_ = rule_; + } else { + result.rule_ = ruleBuilder_.build(); + } + result.error_ = error_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.InvalidRule) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.InvalidRule) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.InvalidRule other) { + if (other == com.google.cloud.contentwarehouse.v1.InvalidRule.getDefaultInstance()) + return this; + if (other.hasRule()) { + mergeRule(other.getRule()); + } + if (!other.getError().isEmpty()) { + error_ = other.error_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getRuleFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 18: + { + error_ = input.readStringRequireUtf8(); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private com.google.cloud.contentwarehouse.v1.Rule rule_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.Rule, + com.google.cloud.contentwarehouse.v1.Rule.Builder, + com.google.cloud.contentwarehouse.v1.RuleOrBuilder> + ruleBuilder_; + /** + * + * + *
+     * Triggered rule.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.Rule rule = 1; + * + * @return Whether the rule field is set. + */ + public boolean hasRule() { + return ruleBuilder_ != null || rule_ != null; + } + /** + * + * + *
+     * Triggered rule.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.Rule rule = 1; + * + * @return The rule. + */ + public com.google.cloud.contentwarehouse.v1.Rule getRule() { + if (ruleBuilder_ == null) { + return rule_ == null + ? com.google.cloud.contentwarehouse.v1.Rule.getDefaultInstance() + : rule_; + } else { + return ruleBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Triggered rule.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.Rule rule = 1; + */ + public Builder setRule(com.google.cloud.contentwarehouse.v1.Rule value) { + if (ruleBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + rule_ = value; + onChanged(); + } else { + ruleBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Triggered rule.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.Rule rule = 1; + */ + public Builder setRule(com.google.cloud.contentwarehouse.v1.Rule.Builder builderForValue) { + if (ruleBuilder_ == null) { + rule_ = builderForValue.build(); + onChanged(); + } else { + ruleBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Triggered rule.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.Rule rule = 1; + */ + public Builder mergeRule(com.google.cloud.contentwarehouse.v1.Rule value) { + if (ruleBuilder_ == null) { + if (rule_ != null) { + rule_ = + com.google.cloud.contentwarehouse.v1.Rule.newBuilder(rule_) + .mergeFrom(value) + .buildPartial(); + } else { + rule_ = value; + } + onChanged(); + } else { + ruleBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Triggered rule.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.Rule rule = 1; + */ + public Builder clearRule() { + if (ruleBuilder_ == null) { + rule_ = null; + onChanged(); + } else { + rule_ = null; + ruleBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Triggered rule.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.Rule rule = 1; + */ + public com.google.cloud.contentwarehouse.v1.Rule.Builder getRuleBuilder() { + + onChanged(); + return getRuleFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Triggered rule.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.Rule rule = 1; + */ + public com.google.cloud.contentwarehouse.v1.RuleOrBuilder getRuleOrBuilder() { + if (ruleBuilder_ != null) { + return ruleBuilder_.getMessageOrBuilder(); + } else { + return rule_ == null + ? com.google.cloud.contentwarehouse.v1.Rule.getDefaultInstance() + : rule_; + } + } + /** + * + * + *
+     * Triggered rule.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.Rule rule = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.Rule, + com.google.cloud.contentwarehouse.v1.Rule.Builder, + com.google.cloud.contentwarehouse.v1.RuleOrBuilder> + getRuleFieldBuilder() { + if (ruleBuilder_ == null) { + ruleBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.Rule, + com.google.cloud.contentwarehouse.v1.Rule.Builder, + com.google.cloud.contentwarehouse.v1.RuleOrBuilder>( + getRule(), getParentForChildren(), isClean()); + rule_ = null; + } + return ruleBuilder_; + } + + private java.lang.Object error_ = ""; + /** + * + * + *
+     * Validation error on a parsed expression.
+     * 
+ * + * string error = 2; + * + * @return The error. + */ + public java.lang.String getError() { + java.lang.Object ref = error_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + error_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Validation error on a parsed expression.
+     * 
+ * + * string error = 2; + * + * @return The bytes for error. + */ + public com.google.protobuf.ByteString getErrorBytes() { + java.lang.Object ref = error_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + error_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Validation error on a parsed expression.
+     * 
+ * + * string error = 2; + * + * @param value The error to set. + * @return This builder for chaining. + */ + public Builder setError(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + error_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Validation error on a parsed expression.
+     * 
+ * + * string error = 2; + * + * @return This builder for chaining. + */ + public Builder clearError() { + + error_ = getDefaultInstance().getError(); + onChanged(); + return this; + } + /** + * + * + *
+     * Validation error on a parsed expression.
+     * 
+ * + * string error = 2; + * + * @param value The bytes for error to set. + * @return This builder for chaining. + */ + public Builder setErrorBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + error_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.InvalidRule) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.InvalidRule) + private static final com.google.cloud.contentwarehouse.v1.InvalidRule DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.InvalidRule(); + } + + public static com.google.cloud.contentwarehouse.v1.InvalidRule getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InvalidRule parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.InvalidRule getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/InvalidRuleOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/InvalidRuleOrBuilder.java new file mode 100644 index 000000000000..adf3deea7f4d --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/InvalidRuleOrBuilder.java @@ -0,0 +1,85 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/rule_engine.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface InvalidRuleOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.InvalidRule) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Triggered rule.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.Rule rule = 1; + * + * @return Whether the rule field is set. + */ + boolean hasRule(); + /** + * + * + *
+   * Triggered rule.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.Rule rule = 1; + * + * @return The rule. + */ + com.google.cloud.contentwarehouse.v1.Rule getRule(); + /** + * + * + *
+   * Triggered rule.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.Rule rule = 1; + */ + com.google.cloud.contentwarehouse.v1.RuleOrBuilder getRuleOrBuilder(); + + /** + * + * + *
+   * Validation error on a parsed expression.
+   * 
+ * + * string error = 2; + * + * @return The error. + */ + java.lang.String getError(); + /** + * + * + *
+   * Validation error on a parsed expression.
+   * 
+ * + * string error = 2; + * + * @return The bytes for error. + */ + com.google.protobuf.ByteString getErrorBytes(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListDocumentSchemasRequest.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListDocumentSchemasRequest.java new file mode 100644 index 000000000000..6ef5a00c5543 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListDocumentSchemasRequest.java @@ -0,0 +1,945 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_schema_service.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Request message for DocumentSchemaService.ListDocumentSchemas.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest} + */ +public final class ListDocumentSchemasRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest) + ListDocumentSchemasRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListDocumentSchemasRequest.newBuilder() to construct. + private ListDocumentSchemasRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListDocumentSchemasRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListDocumentSchemasRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaServiceProto + .internal_static_google_cloud_contentwarehouse_v1_ListDocumentSchemasRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaServiceProto + .internal_static_google_cloud_contentwarehouse_v1_ListDocumentSchemasRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest.class, + com.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent, which owns this collection of document schemas.
+   * Format: projects/{project_number}/locations/{location}.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent, which owns this collection of document schemas.
+   * Format: projects/{project_number}/locations/{location}.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * + * + *
+   * The maximum number of document schemas to return. The service may return
+   * fewer than this value.
+   * If unspecified, at most 50 document schemas will be returned.
+   * The maximum value is 1000; values above 1000 will be coerced to 1000.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * A page token, received from a previous `ListDocumentSchemas` call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to `ListDocumentSchemas`
+   * must match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A page token, received from a previous `ListDocumentSchemas` call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to `ListDocumentSchemas`
+   * must match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest other = + (com.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for DocumentSchemaService.ListDocumentSchemas.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest) + com.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaServiceProto + .internal_static_google_cloud_contentwarehouse_v1_ListDocumentSchemasRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaServiceProto + .internal_static_google_cloud_contentwarehouse_v1_ListDocumentSchemasRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest.class, + com.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaServiceProto + .internal_static_google_cloud_contentwarehouse_v1_ListDocumentSchemasRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest + getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest build() { + com.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest buildPartial() { + com.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest result = + new com.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest other) { + if (other + == com.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent, which owns this collection of document schemas.
+     * Format: projects/{project_number}/locations/{location}.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent, which owns this collection of document schemas.
+     * Format: projects/{project_number}/locations/{location}.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent, which owns this collection of document schemas.
+     * Format: projects/{project_number}/locations/{location}.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent, which owns this collection of document schemas.
+     * Format: projects/{project_number}/locations/{location}.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent, which owns this collection of document schemas.
+     * Format: projects/{project_number}/locations/{location}.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * The maximum number of document schemas to return. The service may return
+     * fewer than this value.
+     * If unspecified, at most 50 document schemas will be returned.
+     * The maximum value is 1000; values above 1000 will be coerced to 1000.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of document schemas to return. The service may return
+     * fewer than this value.
+     * If unspecified, at most 50 document schemas will be returned.
+     * The maximum value is 1000; values above 1000 will be coerced to 1000.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of document schemas to return. The service may return
+     * fewer than this value.
+     * If unspecified, at most 50 document schemas will be returned.
+     * The maximum value is 1000; values above 1000 will be coerced to 1000.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A page token, received from a previous `ListDocumentSchemas` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListDocumentSchemas`
+     * must match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A page token, received from a previous `ListDocumentSchemas` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListDocumentSchemas`
+     * must match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A page token, received from a previous `ListDocumentSchemas` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListDocumentSchemas`
+     * must match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A page token, received from a previous `ListDocumentSchemas` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListDocumentSchemas`
+     * must match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A page token, received from a previous `ListDocumentSchemas` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListDocumentSchemas`
+     * must match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest) + private static final com.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest(); + } + + public static com.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListDocumentSchemasRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListDocumentSchemasRequestOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListDocumentSchemasRequestOrBuilder.java new file mode 100644 index 000000000000..0518e51e622e --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListDocumentSchemasRequestOrBuilder.java @@ -0,0 +1,103 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_schema_service.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface ListDocumentSchemasRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent, which owns this collection of document schemas.
+   * Format: projects/{project_number}/locations/{location}.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent, which owns this collection of document schemas.
+   * Format: projects/{project_number}/locations/{location}.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The maximum number of document schemas to return. The service may return
+   * fewer than this value.
+   * If unspecified, at most 50 document schemas will be returned.
+   * The maximum value is 1000; values above 1000 will be coerced to 1000.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * A page token, received from a previous `ListDocumentSchemas` call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to `ListDocumentSchemas`
+   * must match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A page token, received from a previous `ListDocumentSchemas` call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to `ListDocumentSchemas`
+   * must match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListDocumentSchemasResponse.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListDocumentSchemasResponse.java new file mode 100644 index 000000000000..daca930a48e8 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListDocumentSchemasResponse.java @@ -0,0 +1,1134 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_schema_service.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Response message for DocumentSchemaService.ListDocumentSchemas.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse} + */ +public final class ListDocumentSchemasResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse) + ListDocumentSchemasResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListDocumentSchemasResponse.newBuilder() to construct. + private ListDocumentSchemasResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListDocumentSchemasResponse() { + documentSchemas_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListDocumentSchemasResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaServiceProto + .internal_static_google_cloud_contentwarehouse_v1_ListDocumentSchemasResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaServiceProto + .internal_static_google_cloud_contentwarehouse_v1_ListDocumentSchemasResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse.class, + com.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse.Builder.class); + } + + public static final int DOCUMENT_SCHEMAS_FIELD_NUMBER = 1; + private java.util.List documentSchemas_; + /** + * + * + *
+   * The document schemas from the specified parent.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentSchema document_schemas = 1; + */ + @java.lang.Override + public java.util.List + getDocumentSchemasList() { + return documentSchemas_; + } + /** + * + * + *
+   * The document schemas from the specified parent.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentSchema document_schemas = 1; + */ + @java.lang.Override + public java.util.List + getDocumentSchemasOrBuilderList() { + return documentSchemas_; + } + /** + * + * + *
+   * The document schemas from the specified parent.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentSchema document_schemas = 1; + */ + @java.lang.Override + public int getDocumentSchemasCount() { + return documentSchemas_.size(); + } + /** + * + * + *
+   * The document schemas from the specified parent.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentSchema document_schemas = 1; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DocumentSchema getDocumentSchemas(int index) { + return documentSchemas_.get(index); + } + /** + * + * + *
+   * The document schemas from the specified parent.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentSchema document_schemas = 1; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DocumentSchemaOrBuilder getDocumentSchemasOrBuilder( + int index) { + return documentSchemas_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < documentSchemas_.size(); i++) { + output.writeMessage(1, documentSchemas_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < documentSchemas_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, documentSchemas_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse other = + (com.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse) obj; + + if (!getDocumentSchemasList().equals(other.getDocumentSchemasList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getDocumentSchemasCount() > 0) { + hash = (37 * hash) + DOCUMENT_SCHEMAS_FIELD_NUMBER; + hash = (53 * hash) + getDocumentSchemasList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for DocumentSchemaService.ListDocumentSchemas.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse) + com.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaServiceProto + .internal_static_google_cloud_contentwarehouse_v1_ListDocumentSchemasResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaServiceProto + .internal_static_google_cloud_contentwarehouse_v1_ListDocumentSchemasResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse.class, + com.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (documentSchemasBuilder_ == null) { + documentSchemas_ = java.util.Collections.emptyList(); + } else { + documentSchemas_ = null; + documentSchemasBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaServiceProto + .internal_static_google_cloud_contentwarehouse_v1_ListDocumentSchemasResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse + getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse build() { + com.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse buildPartial() { + com.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse result = + new com.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse(this); + int from_bitField0_ = bitField0_; + if (documentSchemasBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + documentSchemas_ = java.util.Collections.unmodifiableList(documentSchemas_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.documentSchemas_ = documentSchemas_; + } else { + result.documentSchemas_ = documentSchemasBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse other) { + if (other + == com.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse.getDefaultInstance()) + return this; + if (documentSchemasBuilder_ == null) { + if (!other.documentSchemas_.isEmpty()) { + if (documentSchemas_.isEmpty()) { + documentSchemas_ = other.documentSchemas_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureDocumentSchemasIsMutable(); + documentSchemas_.addAll(other.documentSchemas_); + } + onChanged(); + } + } else { + if (!other.documentSchemas_.isEmpty()) { + if (documentSchemasBuilder_.isEmpty()) { + documentSchemasBuilder_.dispose(); + documentSchemasBuilder_ = null; + documentSchemas_ = other.documentSchemas_; + bitField0_ = (bitField0_ & ~0x00000001); + documentSchemasBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getDocumentSchemasFieldBuilder() + : null; + } else { + documentSchemasBuilder_.addAllMessages(other.documentSchemas_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.contentwarehouse.v1.DocumentSchema m = + input.readMessage( + com.google.cloud.contentwarehouse.v1.DocumentSchema.parser(), + extensionRegistry); + if (documentSchemasBuilder_ == null) { + ensureDocumentSchemasIsMutable(); + documentSchemas_.add(m); + } else { + documentSchemasBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List documentSchemas_ = + java.util.Collections.emptyList(); + + private void ensureDocumentSchemasIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + documentSchemas_ = + new java.util.ArrayList( + documentSchemas_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.DocumentSchema, + com.google.cloud.contentwarehouse.v1.DocumentSchema.Builder, + com.google.cloud.contentwarehouse.v1.DocumentSchemaOrBuilder> + documentSchemasBuilder_; + + /** + * + * + *
+     * The document schemas from the specified parent.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentSchema document_schemas = 1; + */ + public java.util.List + getDocumentSchemasList() { + if (documentSchemasBuilder_ == null) { + return java.util.Collections.unmodifiableList(documentSchemas_); + } else { + return documentSchemasBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The document schemas from the specified parent.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentSchema document_schemas = 1; + */ + public int getDocumentSchemasCount() { + if (documentSchemasBuilder_ == null) { + return documentSchemas_.size(); + } else { + return documentSchemasBuilder_.getCount(); + } + } + /** + * + * + *
+     * The document schemas from the specified parent.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentSchema document_schemas = 1; + */ + public com.google.cloud.contentwarehouse.v1.DocumentSchema getDocumentSchemas(int index) { + if (documentSchemasBuilder_ == null) { + return documentSchemas_.get(index); + } else { + return documentSchemasBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The document schemas from the specified parent.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentSchema document_schemas = 1; + */ + public Builder setDocumentSchemas( + int index, com.google.cloud.contentwarehouse.v1.DocumentSchema value) { + if (documentSchemasBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDocumentSchemasIsMutable(); + documentSchemas_.set(index, value); + onChanged(); + } else { + documentSchemasBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The document schemas from the specified parent.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentSchema document_schemas = 1; + */ + public Builder setDocumentSchemas( + int index, com.google.cloud.contentwarehouse.v1.DocumentSchema.Builder builderForValue) { + if (documentSchemasBuilder_ == null) { + ensureDocumentSchemasIsMutable(); + documentSchemas_.set(index, builderForValue.build()); + onChanged(); + } else { + documentSchemasBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The document schemas from the specified parent.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentSchema document_schemas = 1; + */ + public Builder addDocumentSchemas(com.google.cloud.contentwarehouse.v1.DocumentSchema value) { + if (documentSchemasBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDocumentSchemasIsMutable(); + documentSchemas_.add(value); + onChanged(); + } else { + documentSchemasBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The document schemas from the specified parent.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentSchema document_schemas = 1; + */ + public Builder addDocumentSchemas( + int index, com.google.cloud.contentwarehouse.v1.DocumentSchema value) { + if (documentSchemasBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDocumentSchemasIsMutable(); + documentSchemas_.add(index, value); + onChanged(); + } else { + documentSchemasBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The document schemas from the specified parent.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentSchema document_schemas = 1; + */ + public Builder addDocumentSchemas( + com.google.cloud.contentwarehouse.v1.DocumentSchema.Builder builderForValue) { + if (documentSchemasBuilder_ == null) { + ensureDocumentSchemasIsMutable(); + documentSchemas_.add(builderForValue.build()); + onChanged(); + } else { + documentSchemasBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The document schemas from the specified parent.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentSchema document_schemas = 1; + */ + public Builder addDocumentSchemas( + int index, com.google.cloud.contentwarehouse.v1.DocumentSchema.Builder builderForValue) { + if (documentSchemasBuilder_ == null) { + ensureDocumentSchemasIsMutable(); + documentSchemas_.add(index, builderForValue.build()); + onChanged(); + } else { + documentSchemasBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The document schemas from the specified parent.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentSchema document_schemas = 1; + */ + public Builder addAllDocumentSchemas( + java.lang.Iterable values) { + if (documentSchemasBuilder_ == null) { + ensureDocumentSchemasIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, documentSchemas_); + onChanged(); + } else { + documentSchemasBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The document schemas from the specified parent.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentSchema document_schemas = 1; + */ + public Builder clearDocumentSchemas() { + if (documentSchemasBuilder_ == null) { + documentSchemas_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + documentSchemasBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The document schemas from the specified parent.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentSchema document_schemas = 1; + */ + public Builder removeDocumentSchemas(int index) { + if (documentSchemasBuilder_ == null) { + ensureDocumentSchemasIsMutable(); + documentSchemas_.remove(index); + onChanged(); + } else { + documentSchemasBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The document schemas from the specified parent.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentSchema document_schemas = 1; + */ + public com.google.cloud.contentwarehouse.v1.DocumentSchema.Builder getDocumentSchemasBuilder( + int index) { + return getDocumentSchemasFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The document schemas from the specified parent.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentSchema document_schemas = 1; + */ + public com.google.cloud.contentwarehouse.v1.DocumentSchemaOrBuilder getDocumentSchemasOrBuilder( + int index) { + if (documentSchemasBuilder_ == null) { + return documentSchemas_.get(index); + } else { + return documentSchemasBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The document schemas from the specified parent.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentSchema document_schemas = 1; + */ + public java.util.List + getDocumentSchemasOrBuilderList() { + if (documentSchemasBuilder_ != null) { + return documentSchemasBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(documentSchemas_); + } + } + /** + * + * + *
+     * The document schemas from the specified parent.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentSchema document_schemas = 1; + */ + public com.google.cloud.contentwarehouse.v1.DocumentSchema.Builder addDocumentSchemasBuilder() { + return getDocumentSchemasFieldBuilder() + .addBuilder(com.google.cloud.contentwarehouse.v1.DocumentSchema.getDefaultInstance()); + } + /** + * + * + *
+     * The document schemas from the specified parent.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentSchema document_schemas = 1; + */ + public com.google.cloud.contentwarehouse.v1.DocumentSchema.Builder addDocumentSchemasBuilder( + int index) { + return getDocumentSchemasFieldBuilder() + .addBuilder( + index, com.google.cloud.contentwarehouse.v1.DocumentSchema.getDefaultInstance()); + } + /** + * + * + *
+     * The document schemas from the specified parent.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentSchema document_schemas = 1; + */ + public java.util.List + getDocumentSchemasBuilderList() { + return getDocumentSchemasFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.DocumentSchema, + com.google.cloud.contentwarehouse.v1.DocumentSchema.Builder, + com.google.cloud.contentwarehouse.v1.DocumentSchemaOrBuilder> + getDocumentSchemasFieldBuilder() { + if (documentSchemasBuilder_ == null) { + documentSchemasBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.DocumentSchema, + com.google.cloud.contentwarehouse.v1.DocumentSchema.Builder, + com.google.cloud.contentwarehouse.v1.DocumentSchemaOrBuilder>( + documentSchemas_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + documentSchemas_ = null; + } + return documentSchemasBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse) + private static final com.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse(); + } + + public static com.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListDocumentSchemasResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListDocumentSchemasResponseOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListDocumentSchemasResponseOrBuilder.java new file mode 100644 index 000000000000..65061d15f453 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListDocumentSchemasResponseOrBuilder.java @@ -0,0 +1,105 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_schema_service.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface ListDocumentSchemasResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The document schemas from the specified parent.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentSchema document_schemas = 1; + */ + java.util.List getDocumentSchemasList(); + /** + * + * + *
+   * The document schemas from the specified parent.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentSchema document_schemas = 1; + */ + com.google.cloud.contentwarehouse.v1.DocumentSchema getDocumentSchemas(int index); + /** + * + * + *
+   * The document schemas from the specified parent.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentSchema document_schemas = 1; + */ + int getDocumentSchemasCount(); + /** + * + * + *
+   * The document schemas from the specified parent.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentSchema document_schemas = 1; + */ + java.util.List + getDocumentSchemasOrBuilderList(); + /** + * + * + *
+   * The document schemas from the specified parent.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentSchema document_schemas = 1; + */ + com.google.cloud.contentwarehouse.v1.DocumentSchemaOrBuilder getDocumentSchemasOrBuilder( + int index); + + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListLinkedSourcesRequest.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListLinkedSourcesRequest.java new file mode 100644 index 000000000000..6aab82ad8067 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListLinkedSourcesRequest.java @@ -0,0 +1,1233 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_link_service.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Response message for DocumentLinkService.ListLinkedSources.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest} + */ +public final class ListLinkedSourcesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest) + ListLinkedSourcesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListLinkedSourcesRequest.newBuilder() to construct. + private ListLinkedSourcesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListLinkedSourcesRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListLinkedSourcesRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentLinkServiceProto + .internal_static_google_cloud_contentwarehouse_v1_ListLinkedSourcesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentLinkServiceProto + .internal_static_google_cloud_contentwarehouse_v1_ListLinkedSourcesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest.class, + com.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The name of the document, for which all source links are returned.
+   * Format:
+   * projects/{project_number}/locations/{location}/documents/{source_document_id}.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the document, for which all source links are returned.
+   * Format:
+   * projects/{project_number}/locations/{location}/documents/{source_document_id}.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_; + /** + * + * + *
+   * The maximum number of document-links to return. The service may return
+   * fewer than this value.
+   * If unspecified, at most 50 document-links will be returned.
+   * The maximum value is 1000; values above 1000 will be coerced to 1000.
+   * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 4; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * A page token, received from a previous `ListLinkedSources` call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to `ListLinkedSources`
+   * must match the call that provided the page token.
+   * 
+ * + * string page_token = 4; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A page token, received from a previous `ListLinkedSources` call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to `ListLinkedSources`
+   * must match the call that provided the page token.
+   * 
+ * + * string page_token = 4; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUEST_METADATA_FIELD_NUMBER = 2; + private com.google.cloud.contentwarehouse.v1.RequestMetadata requestMetadata_; + /** + * + * + *
+   * The meta information collected about the document creator, used to enforce
+   * access control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + * + * @return Whether the requestMetadata field is set. + */ + @java.lang.Override + public boolean hasRequestMetadata() { + return requestMetadata_ != null; + } + /** + * + * + *
+   * The meta information collected about the document creator, used to enforce
+   * access control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + * + * @return The requestMetadata. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RequestMetadata getRequestMetadata() { + return requestMetadata_ == null + ? com.google.cloud.contentwarehouse.v1.RequestMetadata.getDefaultInstance() + : requestMetadata_; + } + /** + * + * + *
+   * The meta information collected about the document creator, used to enforce
+   * access control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder + getRequestMetadataOrBuilder() { + return getRequestMetadata(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (requestMetadata_ != null) { + output.writeMessage(2, getRequestMetadata()); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, pageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (requestMetadata_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getRequestMetadata()); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, pageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest other = + (com.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (hasRequestMetadata() != other.hasRequestMetadata()) return false; + if (hasRequestMetadata()) { + if (!getRequestMetadata().equals(other.getRequestMetadata())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + if (hasRequestMetadata()) { + hash = (37 * hash) + REQUEST_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getRequestMetadata().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for DocumentLinkService.ListLinkedSources.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest) + com.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentLinkServiceProto + .internal_static_google_cloud_contentwarehouse_v1_ListLinkedSourcesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentLinkServiceProto + .internal_static_google_cloud_contentwarehouse_v1_ListLinkedSourcesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest.class, + com.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + if (requestMetadataBuilder_ == null) { + requestMetadata_ = null; + } else { + requestMetadata_ = null; + requestMetadataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.DocumentLinkServiceProto + .internal_static_google_cloud_contentwarehouse_v1_ListLinkedSourcesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest + getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest build() { + com.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest buildPartial() { + com.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest result = + new com.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + if (requestMetadataBuilder_ == null) { + result.requestMetadata_ = requestMetadata_; + } else { + result.requestMetadata_ = requestMetadataBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest other) { + if (other + == com.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (other.hasRequestMetadata()) { + mergeRequestMetadata(other.getRequestMetadata()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + input.readMessage(getRequestMetadataFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + case 24: + { + pageSize_ = input.readInt32(); + + break; + } // case 24 + case 34: + { + pageToken_ = input.readStringRequireUtf8(); + + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The name of the document, for which all source links are returned.
+     * Format:
+     * projects/{project_number}/locations/{location}/documents/{source_document_id}.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the document, for which all source links are returned.
+     * Format:
+     * projects/{project_number}/locations/{location}/documents/{source_document_id}.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the document, for which all source links are returned.
+     * Format:
+     * projects/{project_number}/locations/{location}/documents/{source_document_id}.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the document, for which all source links are returned.
+     * Format:
+     * projects/{project_number}/locations/{location}/documents/{source_document_id}.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the document, for which all source links are returned.
+     * Format:
+     * projects/{project_number}/locations/{location}/documents/{source_document_id}.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * The maximum number of document-links to return. The service may return
+     * fewer than this value.
+     * If unspecified, at most 50 document-links will be returned.
+     * The maximum value is 1000; values above 1000 will be coerced to 1000.
+     * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of document-links to return. The service may return
+     * fewer than this value.
+     * If unspecified, at most 50 document-links will be returned.
+     * The maximum value is 1000; values above 1000 will be coerced to 1000.
+     * 
+ * + * int32 page_size = 3; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of document-links to return. The service may return
+     * fewer than this value.
+     * If unspecified, at most 50 document-links will be returned.
+     * The maximum value is 1000; values above 1000 will be coerced to 1000.
+     * 
+ * + * int32 page_size = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A page token, received from a previous `ListLinkedSources` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListLinkedSources`
+     * must match the call that provided the page token.
+     * 
+ * + * string page_token = 4; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A page token, received from a previous `ListLinkedSources` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListLinkedSources`
+     * must match the call that provided the page token.
+     * 
+ * + * string page_token = 4; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A page token, received from a previous `ListLinkedSources` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListLinkedSources`
+     * must match the call that provided the page token.
+     * 
+ * + * string page_token = 4; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A page token, received from a previous `ListLinkedSources` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListLinkedSources`
+     * must match the call that provided the page token.
+     * 
+ * + * string page_token = 4; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A page token, received from a previous `ListLinkedSources` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListLinkedSources`
+     * must match the call that provided the page token.
+     * 
+ * + * string page_token = 4; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + private com.google.cloud.contentwarehouse.v1.RequestMetadata requestMetadata_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.RequestMetadata, + com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder, + com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder> + requestMetadataBuilder_; + /** + * + * + *
+     * The meta information collected about the document creator, used to enforce
+     * access control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + * + * @return Whether the requestMetadata field is set. + */ + public boolean hasRequestMetadata() { + return requestMetadataBuilder_ != null || requestMetadata_ != null; + } + /** + * + * + *
+     * The meta information collected about the document creator, used to enforce
+     * access control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + * + * @return The requestMetadata. + */ + public com.google.cloud.contentwarehouse.v1.RequestMetadata getRequestMetadata() { + if (requestMetadataBuilder_ == null) { + return requestMetadata_ == null + ? com.google.cloud.contentwarehouse.v1.RequestMetadata.getDefaultInstance() + : requestMetadata_; + } else { + return requestMetadataBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The meta information collected about the document creator, used to enforce
+     * access control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + */ + public Builder setRequestMetadata(com.google.cloud.contentwarehouse.v1.RequestMetadata value) { + if (requestMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + requestMetadata_ = value; + onChanged(); + } else { + requestMetadataBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The meta information collected about the document creator, used to enforce
+     * access control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + */ + public Builder setRequestMetadata( + com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder builderForValue) { + if (requestMetadataBuilder_ == null) { + requestMetadata_ = builderForValue.build(); + onChanged(); + } else { + requestMetadataBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The meta information collected about the document creator, used to enforce
+     * access control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + */ + public Builder mergeRequestMetadata( + com.google.cloud.contentwarehouse.v1.RequestMetadata value) { + if (requestMetadataBuilder_ == null) { + if (requestMetadata_ != null) { + requestMetadata_ = + com.google.cloud.contentwarehouse.v1.RequestMetadata.newBuilder(requestMetadata_) + .mergeFrom(value) + .buildPartial(); + } else { + requestMetadata_ = value; + } + onChanged(); + } else { + requestMetadataBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The meta information collected about the document creator, used to enforce
+     * access control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + */ + public Builder clearRequestMetadata() { + if (requestMetadataBuilder_ == null) { + requestMetadata_ = null; + onChanged(); + } else { + requestMetadata_ = null; + requestMetadataBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The meta information collected about the document creator, used to enforce
+     * access control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + */ + public com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder + getRequestMetadataBuilder() { + + onChanged(); + return getRequestMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The meta information collected about the document creator, used to enforce
+     * access control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + */ + public com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder + getRequestMetadataOrBuilder() { + if (requestMetadataBuilder_ != null) { + return requestMetadataBuilder_.getMessageOrBuilder(); + } else { + return requestMetadata_ == null + ? com.google.cloud.contentwarehouse.v1.RequestMetadata.getDefaultInstance() + : requestMetadata_; + } + } + /** + * + * + *
+     * The meta information collected about the document creator, used to enforce
+     * access control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.RequestMetadata, + com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder, + com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder> + getRequestMetadataFieldBuilder() { + if (requestMetadataBuilder_ == null) { + requestMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.RequestMetadata, + com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder, + com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder>( + getRequestMetadata(), getParentForChildren(), isClean()); + requestMetadata_ = null; + } + return requestMetadataBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest) + private static final com.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest(); + } + + public static com.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListLinkedSourcesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListLinkedSourcesRequestOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListLinkedSourcesRequestOrBuilder.java new file mode 100644 index 000000000000..14c5da35ec00 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListLinkedSourcesRequestOrBuilder.java @@ -0,0 +1,143 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_link_service.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface ListLinkedSourcesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the document, for which all source links are returned.
+   * Format:
+   * projects/{project_number}/locations/{location}/documents/{source_document_id}.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The name of the document, for which all source links are returned.
+   * Format:
+   * projects/{project_number}/locations/{location}/documents/{source_document_id}.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The maximum number of document-links to return. The service may return
+   * fewer than this value.
+   * If unspecified, at most 50 document-links will be returned.
+   * The maximum value is 1000; values above 1000 will be coerced to 1000.
+   * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * A page token, received from a previous `ListLinkedSources` call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to `ListLinkedSources`
+   * must match the call that provided the page token.
+   * 
+ * + * string page_token = 4; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A page token, received from a previous `ListLinkedSources` call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to `ListLinkedSources`
+   * must match the call that provided the page token.
+   * 
+ * + * string page_token = 4; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * The meta information collected about the document creator, used to enforce
+   * access control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + * + * @return Whether the requestMetadata field is set. + */ + boolean hasRequestMetadata(); + /** + * + * + *
+   * The meta information collected about the document creator, used to enforce
+   * access control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + * + * @return The requestMetadata. + */ + com.google.cloud.contentwarehouse.v1.RequestMetadata getRequestMetadata(); + /** + * + * + *
+   * The meta information collected about the document creator, used to enforce
+   * access control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + */ + com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder getRequestMetadataOrBuilder(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListLinkedSourcesResponse.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListLinkedSourcesResponse.java new file mode 100644 index 000000000000..2bcb0957c644 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListLinkedSourcesResponse.java @@ -0,0 +1,1132 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_link_service.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Response message for DocumentLinkService.ListLinkedSources.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse} + */ +public final class ListLinkedSourcesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse) + ListLinkedSourcesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListLinkedSourcesResponse.newBuilder() to construct. + private ListLinkedSourcesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListLinkedSourcesResponse() { + documentLinks_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListLinkedSourcesResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentLinkServiceProto + .internal_static_google_cloud_contentwarehouse_v1_ListLinkedSourcesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentLinkServiceProto + .internal_static_google_cloud_contentwarehouse_v1_ListLinkedSourcesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse.class, + com.google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse.Builder.class); + } + + public static final int DOCUMENT_LINKS_FIELD_NUMBER = 1; + private java.util.List documentLinks_; + /** + * + * + *
+   * Source document-links.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentLink document_links = 1; + */ + @java.lang.Override + public java.util.List getDocumentLinksList() { + return documentLinks_; + } + /** + * + * + *
+   * Source document-links.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentLink document_links = 1; + */ + @java.lang.Override + public java.util.List + getDocumentLinksOrBuilderList() { + return documentLinks_; + } + /** + * + * + *
+   * Source document-links.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentLink document_links = 1; + */ + @java.lang.Override + public int getDocumentLinksCount() { + return documentLinks_.size(); + } + /** + * + * + *
+   * Source document-links.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentLink document_links = 1; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DocumentLink getDocumentLinks(int index) { + return documentLinks_.get(index); + } + /** + * + * + *
+   * Source document-links.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentLink document_links = 1; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DocumentLinkOrBuilder getDocumentLinksOrBuilder( + int index) { + return documentLinks_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < documentLinks_.size(); i++) { + output.writeMessage(1, documentLinks_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < documentLinks_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, documentLinks_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse other = + (com.google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse) obj; + + if (!getDocumentLinksList().equals(other.getDocumentLinksList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getDocumentLinksCount() > 0) { + hash = (37 * hash) + DOCUMENT_LINKS_FIELD_NUMBER; + hash = (53 * hash) + getDocumentLinksList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for DocumentLinkService.ListLinkedSources.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse) + com.google.cloud.contentwarehouse.v1.ListLinkedSourcesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentLinkServiceProto + .internal_static_google_cloud_contentwarehouse_v1_ListLinkedSourcesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentLinkServiceProto + .internal_static_google_cloud_contentwarehouse_v1_ListLinkedSourcesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse.class, + com.google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (documentLinksBuilder_ == null) { + documentLinks_ = java.util.Collections.emptyList(); + } else { + documentLinks_ = null; + documentLinksBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.DocumentLinkServiceProto + .internal_static_google_cloud_contentwarehouse_v1_ListLinkedSourcesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse + getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse build() { + com.google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse buildPartial() { + com.google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse result = + new com.google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse(this); + int from_bitField0_ = bitField0_; + if (documentLinksBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + documentLinks_ = java.util.Collections.unmodifiableList(documentLinks_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.documentLinks_ = documentLinks_; + } else { + result.documentLinks_ = documentLinksBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse other) { + if (other + == com.google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse.getDefaultInstance()) + return this; + if (documentLinksBuilder_ == null) { + if (!other.documentLinks_.isEmpty()) { + if (documentLinks_.isEmpty()) { + documentLinks_ = other.documentLinks_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureDocumentLinksIsMutable(); + documentLinks_.addAll(other.documentLinks_); + } + onChanged(); + } + } else { + if (!other.documentLinks_.isEmpty()) { + if (documentLinksBuilder_.isEmpty()) { + documentLinksBuilder_.dispose(); + documentLinksBuilder_ = null; + documentLinks_ = other.documentLinks_; + bitField0_ = (bitField0_ & ~0x00000001); + documentLinksBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getDocumentLinksFieldBuilder() + : null; + } else { + documentLinksBuilder_.addAllMessages(other.documentLinks_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.contentwarehouse.v1.DocumentLink m = + input.readMessage( + com.google.cloud.contentwarehouse.v1.DocumentLink.parser(), + extensionRegistry); + if (documentLinksBuilder_ == null) { + ensureDocumentLinksIsMutable(); + documentLinks_.add(m); + } else { + documentLinksBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List documentLinks_ = + java.util.Collections.emptyList(); + + private void ensureDocumentLinksIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + documentLinks_ = + new java.util.ArrayList( + documentLinks_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.DocumentLink, + com.google.cloud.contentwarehouse.v1.DocumentLink.Builder, + com.google.cloud.contentwarehouse.v1.DocumentLinkOrBuilder> + documentLinksBuilder_; + + /** + * + * + *
+     * Source document-links.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentLink document_links = 1; + */ + public java.util.List + getDocumentLinksList() { + if (documentLinksBuilder_ == null) { + return java.util.Collections.unmodifiableList(documentLinks_); + } else { + return documentLinksBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Source document-links.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentLink document_links = 1; + */ + public int getDocumentLinksCount() { + if (documentLinksBuilder_ == null) { + return documentLinks_.size(); + } else { + return documentLinksBuilder_.getCount(); + } + } + /** + * + * + *
+     * Source document-links.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentLink document_links = 1; + */ + public com.google.cloud.contentwarehouse.v1.DocumentLink getDocumentLinks(int index) { + if (documentLinksBuilder_ == null) { + return documentLinks_.get(index); + } else { + return documentLinksBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Source document-links.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentLink document_links = 1; + */ + public Builder setDocumentLinks( + int index, com.google.cloud.contentwarehouse.v1.DocumentLink value) { + if (documentLinksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDocumentLinksIsMutable(); + documentLinks_.set(index, value); + onChanged(); + } else { + documentLinksBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Source document-links.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentLink document_links = 1; + */ + public Builder setDocumentLinks( + int index, com.google.cloud.contentwarehouse.v1.DocumentLink.Builder builderForValue) { + if (documentLinksBuilder_ == null) { + ensureDocumentLinksIsMutable(); + documentLinks_.set(index, builderForValue.build()); + onChanged(); + } else { + documentLinksBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Source document-links.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentLink document_links = 1; + */ + public Builder addDocumentLinks(com.google.cloud.contentwarehouse.v1.DocumentLink value) { + if (documentLinksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDocumentLinksIsMutable(); + documentLinks_.add(value); + onChanged(); + } else { + documentLinksBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Source document-links.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentLink document_links = 1; + */ + public Builder addDocumentLinks( + int index, com.google.cloud.contentwarehouse.v1.DocumentLink value) { + if (documentLinksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDocumentLinksIsMutable(); + documentLinks_.add(index, value); + onChanged(); + } else { + documentLinksBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Source document-links.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentLink document_links = 1; + */ + public Builder addDocumentLinks( + com.google.cloud.contentwarehouse.v1.DocumentLink.Builder builderForValue) { + if (documentLinksBuilder_ == null) { + ensureDocumentLinksIsMutable(); + documentLinks_.add(builderForValue.build()); + onChanged(); + } else { + documentLinksBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Source document-links.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentLink document_links = 1; + */ + public Builder addDocumentLinks( + int index, com.google.cloud.contentwarehouse.v1.DocumentLink.Builder builderForValue) { + if (documentLinksBuilder_ == null) { + ensureDocumentLinksIsMutable(); + documentLinks_.add(index, builderForValue.build()); + onChanged(); + } else { + documentLinksBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Source document-links.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentLink document_links = 1; + */ + public Builder addAllDocumentLinks( + java.lang.Iterable values) { + if (documentLinksBuilder_ == null) { + ensureDocumentLinksIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, documentLinks_); + onChanged(); + } else { + documentLinksBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Source document-links.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentLink document_links = 1; + */ + public Builder clearDocumentLinks() { + if (documentLinksBuilder_ == null) { + documentLinks_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + documentLinksBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Source document-links.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentLink document_links = 1; + */ + public Builder removeDocumentLinks(int index) { + if (documentLinksBuilder_ == null) { + ensureDocumentLinksIsMutable(); + documentLinks_.remove(index); + onChanged(); + } else { + documentLinksBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Source document-links.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentLink document_links = 1; + */ + public com.google.cloud.contentwarehouse.v1.DocumentLink.Builder getDocumentLinksBuilder( + int index) { + return getDocumentLinksFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Source document-links.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentLink document_links = 1; + */ + public com.google.cloud.contentwarehouse.v1.DocumentLinkOrBuilder getDocumentLinksOrBuilder( + int index) { + if (documentLinksBuilder_ == null) { + return documentLinks_.get(index); + } else { + return documentLinksBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Source document-links.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentLink document_links = 1; + */ + public java.util.List + getDocumentLinksOrBuilderList() { + if (documentLinksBuilder_ != null) { + return documentLinksBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(documentLinks_); + } + } + /** + * + * + *
+     * Source document-links.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentLink document_links = 1; + */ + public com.google.cloud.contentwarehouse.v1.DocumentLink.Builder addDocumentLinksBuilder() { + return getDocumentLinksFieldBuilder() + .addBuilder(com.google.cloud.contentwarehouse.v1.DocumentLink.getDefaultInstance()); + } + /** + * + * + *
+     * Source document-links.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentLink document_links = 1; + */ + public com.google.cloud.contentwarehouse.v1.DocumentLink.Builder addDocumentLinksBuilder( + int index) { + return getDocumentLinksFieldBuilder() + .addBuilder( + index, com.google.cloud.contentwarehouse.v1.DocumentLink.getDefaultInstance()); + } + /** + * + * + *
+     * Source document-links.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentLink document_links = 1; + */ + public java.util.List + getDocumentLinksBuilderList() { + return getDocumentLinksFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.DocumentLink, + com.google.cloud.contentwarehouse.v1.DocumentLink.Builder, + com.google.cloud.contentwarehouse.v1.DocumentLinkOrBuilder> + getDocumentLinksFieldBuilder() { + if (documentLinksBuilder_ == null) { + documentLinksBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.DocumentLink, + com.google.cloud.contentwarehouse.v1.DocumentLink.Builder, + com.google.cloud.contentwarehouse.v1.DocumentLinkOrBuilder>( + documentLinks_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + documentLinks_ = null; + } + return documentLinksBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse) + private static final com.google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse(); + } + + public static com.google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListLinkedSourcesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListLinkedSourcesResponseOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListLinkedSourcesResponseOrBuilder.java new file mode 100644 index 000000000000..0142fc34bb3d --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListLinkedSourcesResponseOrBuilder.java @@ -0,0 +1,104 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_link_service.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface ListLinkedSourcesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Source document-links.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentLink document_links = 1; + */ + java.util.List getDocumentLinksList(); + /** + * + * + *
+   * Source document-links.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentLink document_links = 1; + */ + com.google.cloud.contentwarehouse.v1.DocumentLink getDocumentLinks(int index); + /** + * + * + *
+   * Source document-links.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentLink document_links = 1; + */ + int getDocumentLinksCount(); + /** + * + * + *
+   * Source document-links.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentLink document_links = 1; + */ + java.util.List + getDocumentLinksOrBuilderList(); + /** + * + * + *
+   * Source document-links.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentLink document_links = 1; + */ + com.google.cloud.contentwarehouse.v1.DocumentLinkOrBuilder getDocumentLinksOrBuilder(int index); + + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListLinkedTargetsRequest.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListLinkedTargetsRequest.java new file mode 100644 index 000000000000..6373b02ae0d1 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListLinkedTargetsRequest.java @@ -0,0 +1,931 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_link_service.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Request message for DocumentLinkService.ListLinkedTargets.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest} + */ +public final class ListLinkedTargetsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest) + ListLinkedTargetsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListLinkedTargetsRequest.newBuilder() to construct. + private ListLinkedTargetsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListLinkedTargetsRequest() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListLinkedTargetsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentLinkServiceProto + .internal_static_google_cloud_contentwarehouse_v1_ListLinkedTargetsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentLinkServiceProto + .internal_static_google_cloud_contentwarehouse_v1_ListLinkedTargetsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest.class, + com.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The name of the document, for which all target links are returned.
+   * Format:
+   * projects/{project_number}/locations/{location}/documents/{target_document_id}.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the document, for which all target links are returned.
+   * Format:
+   * projects/{project_number}/locations/{location}/documents/{target_document_id}.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUEST_METADATA_FIELD_NUMBER = 2; + private com.google.cloud.contentwarehouse.v1.RequestMetadata requestMetadata_; + /** + * + * + *
+   * The meta information collected about the document creator, used to enforce
+   * access control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + * + * @return Whether the requestMetadata field is set. + */ + @java.lang.Override + public boolean hasRequestMetadata() { + return requestMetadata_ != null; + } + /** + * + * + *
+   * The meta information collected about the document creator, used to enforce
+   * access control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + * + * @return The requestMetadata. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RequestMetadata getRequestMetadata() { + return requestMetadata_ == null + ? com.google.cloud.contentwarehouse.v1.RequestMetadata.getDefaultInstance() + : requestMetadata_; + } + /** + * + * + *
+   * The meta information collected about the document creator, used to enforce
+   * access control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder + getRequestMetadataOrBuilder() { + return getRequestMetadata(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (requestMetadata_ != null) { + output.writeMessage(2, getRequestMetadata()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (requestMetadata_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getRequestMetadata()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest other = + (com.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasRequestMetadata() != other.hasRequestMetadata()) return false; + if (hasRequestMetadata()) { + if (!getRequestMetadata().equals(other.getRequestMetadata())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasRequestMetadata()) { + hash = (37 * hash) + REQUEST_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getRequestMetadata().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for DocumentLinkService.ListLinkedTargets.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest) + com.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentLinkServiceProto + .internal_static_google_cloud_contentwarehouse_v1_ListLinkedTargetsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentLinkServiceProto + .internal_static_google_cloud_contentwarehouse_v1_ListLinkedTargetsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest.class, + com.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + if (requestMetadataBuilder_ == null) { + requestMetadata_ = null; + } else { + requestMetadata_ = null; + requestMetadataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.DocumentLinkServiceProto + .internal_static_google_cloud_contentwarehouse_v1_ListLinkedTargetsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest + getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest build() { + com.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest buildPartial() { + com.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest result = + new com.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest(this); + result.parent_ = parent_; + if (requestMetadataBuilder_ == null) { + result.requestMetadata_ = requestMetadata_; + } else { + result.requestMetadata_ = requestMetadataBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest other) { + if (other + == com.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasRequestMetadata()) { + mergeRequestMetadata(other.getRequestMetadata()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + input.readMessage(getRequestMetadataFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The name of the document, for which all target links are returned.
+     * Format:
+     * projects/{project_number}/locations/{location}/documents/{target_document_id}.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the document, for which all target links are returned.
+     * Format:
+     * projects/{project_number}/locations/{location}/documents/{target_document_id}.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the document, for which all target links are returned.
+     * Format:
+     * projects/{project_number}/locations/{location}/documents/{target_document_id}.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the document, for which all target links are returned.
+     * Format:
+     * projects/{project_number}/locations/{location}/documents/{target_document_id}.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the document, for which all target links are returned.
+     * Format:
+     * projects/{project_number}/locations/{location}/documents/{target_document_id}.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private com.google.cloud.contentwarehouse.v1.RequestMetadata requestMetadata_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.RequestMetadata, + com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder, + com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder> + requestMetadataBuilder_; + /** + * + * + *
+     * The meta information collected about the document creator, used to enforce
+     * access control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + * + * @return Whether the requestMetadata field is set. + */ + public boolean hasRequestMetadata() { + return requestMetadataBuilder_ != null || requestMetadata_ != null; + } + /** + * + * + *
+     * The meta information collected about the document creator, used to enforce
+     * access control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + * + * @return The requestMetadata. + */ + public com.google.cloud.contentwarehouse.v1.RequestMetadata getRequestMetadata() { + if (requestMetadataBuilder_ == null) { + return requestMetadata_ == null + ? com.google.cloud.contentwarehouse.v1.RequestMetadata.getDefaultInstance() + : requestMetadata_; + } else { + return requestMetadataBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The meta information collected about the document creator, used to enforce
+     * access control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + */ + public Builder setRequestMetadata(com.google.cloud.contentwarehouse.v1.RequestMetadata value) { + if (requestMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + requestMetadata_ = value; + onChanged(); + } else { + requestMetadataBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The meta information collected about the document creator, used to enforce
+     * access control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + */ + public Builder setRequestMetadata( + com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder builderForValue) { + if (requestMetadataBuilder_ == null) { + requestMetadata_ = builderForValue.build(); + onChanged(); + } else { + requestMetadataBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The meta information collected about the document creator, used to enforce
+     * access control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + */ + public Builder mergeRequestMetadata( + com.google.cloud.contentwarehouse.v1.RequestMetadata value) { + if (requestMetadataBuilder_ == null) { + if (requestMetadata_ != null) { + requestMetadata_ = + com.google.cloud.contentwarehouse.v1.RequestMetadata.newBuilder(requestMetadata_) + .mergeFrom(value) + .buildPartial(); + } else { + requestMetadata_ = value; + } + onChanged(); + } else { + requestMetadataBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The meta information collected about the document creator, used to enforce
+     * access control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + */ + public Builder clearRequestMetadata() { + if (requestMetadataBuilder_ == null) { + requestMetadata_ = null; + onChanged(); + } else { + requestMetadata_ = null; + requestMetadataBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The meta information collected about the document creator, used to enforce
+     * access control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + */ + public com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder + getRequestMetadataBuilder() { + + onChanged(); + return getRequestMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The meta information collected about the document creator, used to enforce
+     * access control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + */ + public com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder + getRequestMetadataOrBuilder() { + if (requestMetadataBuilder_ != null) { + return requestMetadataBuilder_.getMessageOrBuilder(); + } else { + return requestMetadata_ == null + ? com.google.cloud.contentwarehouse.v1.RequestMetadata.getDefaultInstance() + : requestMetadata_; + } + } + /** + * + * + *
+     * The meta information collected about the document creator, used to enforce
+     * access control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.RequestMetadata, + com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder, + com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder> + getRequestMetadataFieldBuilder() { + if (requestMetadataBuilder_ == null) { + requestMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.RequestMetadata, + com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder, + com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder>( + getRequestMetadata(), getParentForChildren(), isClean()); + requestMetadata_ = null; + } + return requestMetadataBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest) + private static final com.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest(); + } + + public static com.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListLinkedTargetsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListLinkedTargetsRequestOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListLinkedTargetsRequestOrBuilder.java new file mode 100644 index 000000000000..02c51051cf14 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListLinkedTargetsRequestOrBuilder.java @@ -0,0 +1,96 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_link_service.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface ListLinkedTargetsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the document, for which all target links are returned.
+   * Format:
+   * projects/{project_number}/locations/{location}/documents/{target_document_id}.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The name of the document, for which all target links are returned.
+   * Format:
+   * projects/{project_number}/locations/{location}/documents/{target_document_id}.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The meta information collected about the document creator, used to enforce
+   * access control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + * + * @return Whether the requestMetadata field is set. + */ + boolean hasRequestMetadata(); + /** + * + * + *
+   * The meta information collected about the document creator, used to enforce
+   * access control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + * + * @return The requestMetadata. + */ + com.google.cloud.contentwarehouse.v1.RequestMetadata getRequestMetadata(); + /** + * + * + *
+   * The meta information collected about the document creator, used to enforce
+   * access control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 2; + */ + com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder getRequestMetadataOrBuilder(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListLinkedTargetsResponse.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListLinkedTargetsResponse.java new file mode 100644 index 000000000000..fec866dbc310 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListLinkedTargetsResponse.java @@ -0,0 +1,1132 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_link_service.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Response message for DocumentLinkService.ListLinkedTargets.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse} + */ +public final class ListLinkedTargetsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse) + ListLinkedTargetsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListLinkedTargetsResponse.newBuilder() to construct. + private ListLinkedTargetsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListLinkedTargetsResponse() { + documentLinks_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListLinkedTargetsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentLinkServiceProto + .internal_static_google_cloud_contentwarehouse_v1_ListLinkedTargetsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentLinkServiceProto + .internal_static_google_cloud_contentwarehouse_v1_ListLinkedTargetsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse.class, + com.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse.Builder.class); + } + + public static final int DOCUMENT_LINKS_FIELD_NUMBER = 1; + private java.util.List documentLinks_; + /** + * + * + *
+   * Target document-links.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentLink document_links = 1; + */ + @java.lang.Override + public java.util.List getDocumentLinksList() { + return documentLinks_; + } + /** + * + * + *
+   * Target document-links.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentLink document_links = 1; + */ + @java.lang.Override + public java.util.List + getDocumentLinksOrBuilderList() { + return documentLinks_; + } + /** + * + * + *
+   * Target document-links.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentLink document_links = 1; + */ + @java.lang.Override + public int getDocumentLinksCount() { + return documentLinks_.size(); + } + /** + * + * + *
+   * Target document-links.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentLink document_links = 1; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DocumentLink getDocumentLinks(int index) { + return documentLinks_.get(index); + } + /** + * + * + *
+   * Target document-links.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentLink document_links = 1; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DocumentLinkOrBuilder getDocumentLinksOrBuilder( + int index) { + return documentLinks_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < documentLinks_.size(); i++) { + output.writeMessage(1, documentLinks_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < documentLinks_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, documentLinks_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse other = + (com.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse) obj; + + if (!getDocumentLinksList().equals(other.getDocumentLinksList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getDocumentLinksCount() > 0) { + hash = (37 * hash) + DOCUMENT_LINKS_FIELD_NUMBER; + hash = (53 * hash) + getDocumentLinksList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for DocumentLinkService.ListLinkedTargets.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse) + com.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentLinkServiceProto + .internal_static_google_cloud_contentwarehouse_v1_ListLinkedTargetsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentLinkServiceProto + .internal_static_google_cloud_contentwarehouse_v1_ListLinkedTargetsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse.class, + com.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (documentLinksBuilder_ == null) { + documentLinks_ = java.util.Collections.emptyList(); + } else { + documentLinks_ = null; + documentLinksBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.DocumentLinkServiceProto + .internal_static_google_cloud_contentwarehouse_v1_ListLinkedTargetsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse + getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse build() { + com.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse buildPartial() { + com.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse result = + new com.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse(this); + int from_bitField0_ = bitField0_; + if (documentLinksBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + documentLinks_ = java.util.Collections.unmodifiableList(documentLinks_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.documentLinks_ = documentLinks_; + } else { + result.documentLinks_ = documentLinksBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse other) { + if (other + == com.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse.getDefaultInstance()) + return this; + if (documentLinksBuilder_ == null) { + if (!other.documentLinks_.isEmpty()) { + if (documentLinks_.isEmpty()) { + documentLinks_ = other.documentLinks_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureDocumentLinksIsMutable(); + documentLinks_.addAll(other.documentLinks_); + } + onChanged(); + } + } else { + if (!other.documentLinks_.isEmpty()) { + if (documentLinksBuilder_.isEmpty()) { + documentLinksBuilder_.dispose(); + documentLinksBuilder_ = null; + documentLinks_ = other.documentLinks_; + bitField0_ = (bitField0_ & ~0x00000001); + documentLinksBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getDocumentLinksFieldBuilder() + : null; + } else { + documentLinksBuilder_.addAllMessages(other.documentLinks_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.contentwarehouse.v1.DocumentLink m = + input.readMessage( + com.google.cloud.contentwarehouse.v1.DocumentLink.parser(), + extensionRegistry); + if (documentLinksBuilder_ == null) { + ensureDocumentLinksIsMutable(); + documentLinks_.add(m); + } else { + documentLinksBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List documentLinks_ = + java.util.Collections.emptyList(); + + private void ensureDocumentLinksIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + documentLinks_ = + new java.util.ArrayList( + documentLinks_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.DocumentLink, + com.google.cloud.contentwarehouse.v1.DocumentLink.Builder, + com.google.cloud.contentwarehouse.v1.DocumentLinkOrBuilder> + documentLinksBuilder_; + + /** + * + * + *
+     * Target document-links.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentLink document_links = 1; + */ + public java.util.List + getDocumentLinksList() { + if (documentLinksBuilder_ == null) { + return java.util.Collections.unmodifiableList(documentLinks_); + } else { + return documentLinksBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Target document-links.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentLink document_links = 1; + */ + public int getDocumentLinksCount() { + if (documentLinksBuilder_ == null) { + return documentLinks_.size(); + } else { + return documentLinksBuilder_.getCount(); + } + } + /** + * + * + *
+     * Target document-links.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentLink document_links = 1; + */ + public com.google.cloud.contentwarehouse.v1.DocumentLink getDocumentLinks(int index) { + if (documentLinksBuilder_ == null) { + return documentLinks_.get(index); + } else { + return documentLinksBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Target document-links.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentLink document_links = 1; + */ + public Builder setDocumentLinks( + int index, com.google.cloud.contentwarehouse.v1.DocumentLink value) { + if (documentLinksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDocumentLinksIsMutable(); + documentLinks_.set(index, value); + onChanged(); + } else { + documentLinksBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Target document-links.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentLink document_links = 1; + */ + public Builder setDocumentLinks( + int index, com.google.cloud.contentwarehouse.v1.DocumentLink.Builder builderForValue) { + if (documentLinksBuilder_ == null) { + ensureDocumentLinksIsMutable(); + documentLinks_.set(index, builderForValue.build()); + onChanged(); + } else { + documentLinksBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Target document-links.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentLink document_links = 1; + */ + public Builder addDocumentLinks(com.google.cloud.contentwarehouse.v1.DocumentLink value) { + if (documentLinksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDocumentLinksIsMutable(); + documentLinks_.add(value); + onChanged(); + } else { + documentLinksBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Target document-links.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentLink document_links = 1; + */ + public Builder addDocumentLinks( + int index, com.google.cloud.contentwarehouse.v1.DocumentLink value) { + if (documentLinksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDocumentLinksIsMutable(); + documentLinks_.add(index, value); + onChanged(); + } else { + documentLinksBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Target document-links.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentLink document_links = 1; + */ + public Builder addDocumentLinks( + com.google.cloud.contentwarehouse.v1.DocumentLink.Builder builderForValue) { + if (documentLinksBuilder_ == null) { + ensureDocumentLinksIsMutable(); + documentLinks_.add(builderForValue.build()); + onChanged(); + } else { + documentLinksBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Target document-links.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentLink document_links = 1; + */ + public Builder addDocumentLinks( + int index, com.google.cloud.contentwarehouse.v1.DocumentLink.Builder builderForValue) { + if (documentLinksBuilder_ == null) { + ensureDocumentLinksIsMutable(); + documentLinks_.add(index, builderForValue.build()); + onChanged(); + } else { + documentLinksBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Target document-links.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentLink document_links = 1; + */ + public Builder addAllDocumentLinks( + java.lang.Iterable values) { + if (documentLinksBuilder_ == null) { + ensureDocumentLinksIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, documentLinks_); + onChanged(); + } else { + documentLinksBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Target document-links.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentLink document_links = 1; + */ + public Builder clearDocumentLinks() { + if (documentLinksBuilder_ == null) { + documentLinks_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + documentLinksBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Target document-links.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentLink document_links = 1; + */ + public Builder removeDocumentLinks(int index) { + if (documentLinksBuilder_ == null) { + ensureDocumentLinksIsMutable(); + documentLinks_.remove(index); + onChanged(); + } else { + documentLinksBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Target document-links.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentLink document_links = 1; + */ + public com.google.cloud.contentwarehouse.v1.DocumentLink.Builder getDocumentLinksBuilder( + int index) { + return getDocumentLinksFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Target document-links.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentLink document_links = 1; + */ + public com.google.cloud.contentwarehouse.v1.DocumentLinkOrBuilder getDocumentLinksOrBuilder( + int index) { + if (documentLinksBuilder_ == null) { + return documentLinks_.get(index); + } else { + return documentLinksBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Target document-links.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentLink document_links = 1; + */ + public java.util.List + getDocumentLinksOrBuilderList() { + if (documentLinksBuilder_ != null) { + return documentLinksBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(documentLinks_); + } + } + /** + * + * + *
+     * Target document-links.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentLink document_links = 1; + */ + public com.google.cloud.contentwarehouse.v1.DocumentLink.Builder addDocumentLinksBuilder() { + return getDocumentLinksFieldBuilder() + .addBuilder(com.google.cloud.contentwarehouse.v1.DocumentLink.getDefaultInstance()); + } + /** + * + * + *
+     * Target document-links.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentLink document_links = 1; + */ + public com.google.cloud.contentwarehouse.v1.DocumentLink.Builder addDocumentLinksBuilder( + int index) { + return getDocumentLinksFieldBuilder() + .addBuilder( + index, com.google.cloud.contentwarehouse.v1.DocumentLink.getDefaultInstance()); + } + /** + * + * + *
+     * Target document-links.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentLink document_links = 1; + */ + public java.util.List + getDocumentLinksBuilderList() { + return getDocumentLinksFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.DocumentLink, + com.google.cloud.contentwarehouse.v1.DocumentLink.Builder, + com.google.cloud.contentwarehouse.v1.DocumentLinkOrBuilder> + getDocumentLinksFieldBuilder() { + if (documentLinksBuilder_ == null) { + documentLinksBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.DocumentLink, + com.google.cloud.contentwarehouse.v1.DocumentLink.Builder, + com.google.cloud.contentwarehouse.v1.DocumentLinkOrBuilder>( + documentLinks_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + documentLinks_ = null; + } + return documentLinksBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse) + private static final com.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse(); + } + + public static com.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListLinkedTargetsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListLinkedTargetsResponseOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListLinkedTargetsResponseOrBuilder.java new file mode 100644 index 000000000000..a1106ea2e029 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListLinkedTargetsResponseOrBuilder.java @@ -0,0 +1,104 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_link_service.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface ListLinkedTargetsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Target document-links.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentLink document_links = 1; + */ + java.util.List getDocumentLinksList(); + /** + * + * + *
+   * Target document-links.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentLink document_links = 1; + */ + com.google.cloud.contentwarehouse.v1.DocumentLink getDocumentLinks(int index); + /** + * + * + *
+   * Target document-links.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentLink document_links = 1; + */ + int getDocumentLinksCount(); + /** + * + * + *
+   * Target document-links.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentLink document_links = 1; + */ + java.util.List + getDocumentLinksOrBuilderList(); + /** + * + * + *
+   * Target document-links.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.DocumentLink document_links = 1; + */ + com.google.cloud.contentwarehouse.v1.DocumentLinkOrBuilder getDocumentLinksOrBuilder(int index); + + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListRuleSetsRequest.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListRuleSetsRequest.java new file mode 100644 index 000000000000..ea5d5498a540 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListRuleSetsRequest.java @@ -0,0 +1,939 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/ruleset_service_request.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Request message for RuleSetService.ListRuleSets.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.ListRuleSetsRequest} + */ +public final class ListRuleSetsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.ListRuleSetsRequest) + ListRuleSetsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListRuleSetsRequest.newBuilder() to construct. + private ListRuleSetsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListRuleSetsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListRuleSetsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.RuleSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_ListRuleSetsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.RuleSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_ListRuleSetsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.ListRuleSetsRequest.class, + com.google.cloud.contentwarehouse.v1.ListRuleSetsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent, which owns this collection of document.
+   * Format: projects/{project_number}/locations/{location}.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent, which owns this collection of document.
+   * Format: projects/{project_number}/locations/{location}.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * + * + *
+   * The maximum number of rule sets to return. The service may return
+   * fewer than this value.
+   * If unspecified, at most 50 rule sets will be returned.
+   * The maximum value is 1000; values above 1000 will be coerced to 1000.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * A page token, received from a previous `ListRuleSets` call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to `ListRuleSets`
+   * must match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A page token, received from a previous `ListRuleSets` call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to `ListRuleSets`
+   * must match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.ListRuleSetsRequest)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.ListRuleSetsRequest other = + (com.google.cloud.contentwarehouse.v1.ListRuleSetsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.ListRuleSetsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.ListRuleSetsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ListRuleSetsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.ListRuleSetsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ListRuleSetsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.ListRuleSetsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ListRuleSetsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.ListRuleSetsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ListRuleSetsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.ListRuleSetsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ListRuleSetsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.ListRuleSetsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.ListRuleSetsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for RuleSetService.ListRuleSets.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.ListRuleSetsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.ListRuleSetsRequest) + com.google.cloud.contentwarehouse.v1.ListRuleSetsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.RuleSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_ListRuleSetsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.RuleSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_ListRuleSetsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.ListRuleSetsRequest.class, + com.google.cloud.contentwarehouse.v1.ListRuleSetsRequest.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.ListRuleSetsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.RuleSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_ListRuleSetsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ListRuleSetsRequest getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.ListRuleSetsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ListRuleSetsRequest build() { + com.google.cloud.contentwarehouse.v1.ListRuleSetsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ListRuleSetsRequest buildPartial() { + com.google.cloud.contentwarehouse.v1.ListRuleSetsRequest result = + new com.google.cloud.contentwarehouse.v1.ListRuleSetsRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.ListRuleSetsRequest) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.ListRuleSetsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.ListRuleSetsRequest other) { + if (other == com.google.cloud.contentwarehouse.v1.ListRuleSetsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent, which owns this collection of document.
+     * Format: projects/{project_number}/locations/{location}.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent, which owns this collection of document.
+     * Format: projects/{project_number}/locations/{location}.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent, which owns this collection of document.
+     * Format: projects/{project_number}/locations/{location}.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent, which owns this collection of document.
+     * Format: projects/{project_number}/locations/{location}.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent, which owns this collection of document.
+     * Format: projects/{project_number}/locations/{location}.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * The maximum number of rule sets to return. The service may return
+     * fewer than this value.
+     * If unspecified, at most 50 rule sets will be returned.
+     * The maximum value is 1000; values above 1000 will be coerced to 1000.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of rule sets to return. The service may return
+     * fewer than this value.
+     * If unspecified, at most 50 rule sets will be returned.
+     * The maximum value is 1000; values above 1000 will be coerced to 1000.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of rule sets to return. The service may return
+     * fewer than this value.
+     * If unspecified, at most 50 rule sets will be returned.
+     * The maximum value is 1000; values above 1000 will be coerced to 1000.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A page token, received from a previous `ListRuleSets` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListRuleSets`
+     * must match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A page token, received from a previous `ListRuleSets` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListRuleSets`
+     * must match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A page token, received from a previous `ListRuleSets` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListRuleSets`
+     * must match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A page token, received from a previous `ListRuleSets` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListRuleSets`
+     * must match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A page token, received from a previous `ListRuleSets` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListRuleSets`
+     * must match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.ListRuleSetsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.ListRuleSetsRequest) + private static final com.google.cloud.contentwarehouse.v1.ListRuleSetsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.ListRuleSetsRequest(); + } + + public static com.google.cloud.contentwarehouse.v1.ListRuleSetsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListRuleSetsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ListRuleSetsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListRuleSetsRequestOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListRuleSetsRequestOrBuilder.java new file mode 100644 index 000000000000..b1a5ce3fc7cd --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListRuleSetsRequestOrBuilder.java @@ -0,0 +1,103 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/ruleset_service_request.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface ListRuleSetsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.ListRuleSetsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent, which owns this collection of document.
+   * Format: projects/{project_number}/locations/{location}.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent, which owns this collection of document.
+   * Format: projects/{project_number}/locations/{location}.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The maximum number of rule sets to return. The service may return
+   * fewer than this value.
+   * If unspecified, at most 50 rule sets will be returned.
+   * The maximum value is 1000; values above 1000 will be coerced to 1000.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * A page token, received from a previous `ListRuleSets` call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to `ListRuleSets`
+   * must match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A page token, received from a previous `ListRuleSets` call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to `ListRuleSets`
+   * must match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListRuleSetsResponse.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListRuleSetsResponse.java new file mode 100644 index 000000000000..85e03555fc5d --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListRuleSetsResponse.java @@ -0,0 +1,1114 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/ruleset_service_request.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Response message for RuleSetService.ListRuleSets.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.ListRuleSetsResponse} + */ +public final class ListRuleSetsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.ListRuleSetsResponse) + ListRuleSetsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListRuleSetsResponse.newBuilder() to construct. + private ListRuleSetsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListRuleSetsResponse() { + ruleSets_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListRuleSetsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.RuleSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_ListRuleSetsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.RuleSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_ListRuleSetsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.ListRuleSetsResponse.class, + com.google.cloud.contentwarehouse.v1.ListRuleSetsResponse.Builder.class); + } + + public static final int RULE_SETS_FIELD_NUMBER = 1; + private java.util.List ruleSets_; + /** + * + * + *
+   * The rule sets from the specified parent.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.RuleSet rule_sets = 1; + */ + @java.lang.Override + public java.util.List getRuleSetsList() { + return ruleSets_; + } + /** + * + * + *
+   * The rule sets from the specified parent.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.RuleSet rule_sets = 1; + */ + @java.lang.Override + public java.util.List + getRuleSetsOrBuilderList() { + return ruleSets_; + } + /** + * + * + *
+   * The rule sets from the specified parent.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.RuleSet rule_sets = 1; + */ + @java.lang.Override + public int getRuleSetsCount() { + return ruleSets_.size(); + } + /** + * + * + *
+   * The rule sets from the specified parent.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.RuleSet rule_sets = 1; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RuleSet getRuleSets(int index) { + return ruleSets_.get(index); + } + /** + * + * + *
+   * The rule sets from the specified parent.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.RuleSet rule_sets = 1; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RuleSetOrBuilder getRuleSetsOrBuilder(int index) { + return ruleSets_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < ruleSets_.size(); i++) { + output.writeMessage(1, ruleSets_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < ruleSets_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, ruleSets_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.ListRuleSetsResponse)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.ListRuleSetsResponse other = + (com.google.cloud.contentwarehouse.v1.ListRuleSetsResponse) obj; + + if (!getRuleSetsList().equals(other.getRuleSetsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getRuleSetsCount() > 0) { + hash = (37 * hash) + RULE_SETS_FIELD_NUMBER; + hash = (53 * hash) + getRuleSetsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.ListRuleSetsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.ListRuleSetsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ListRuleSetsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.ListRuleSetsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ListRuleSetsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.ListRuleSetsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ListRuleSetsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.ListRuleSetsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ListRuleSetsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.ListRuleSetsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ListRuleSetsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.ListRuleSetsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.ListRuleSetsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for RuleSetService.ListRuleSets.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.ListRuleSetsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.ListRuleSetsResponse) + com.google.cloud.contentwarehouse.v1.ListRuleSetsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.RuleSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_ListRuleSetsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.RuleSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_ListRuleSetsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.ListRuleSetsResponse.class, + com.google.cloud.contentwarehouse.v1.ListRuleSetsResponse.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.ListRuleSetsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (ruleSetsBuilder_ == null) { + ruleSets_ = java.util.Collections.emptyList(); + } else { + ruleSets_ = null; + ruleSetsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.RuleSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_ListRuleSetsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ListRuleSetsResponse getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.ListRuleSetsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ListRuleSetsResponse build() { + com.google.cloud.contentwarehouse.v1.ListRuleSetsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ListRuleSetsResponse buildPartial() { + com.google.cloud.contentwarehouse.v1.ListRuleSetsResponse result = + new com.google.cloud.contentwarehouse.v1.ListRuleSetsResponse(this); + int from_bitField0_ = bitField0_; + if (ruleSetsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + ruleSets_ = java.util.Collections.unmodifiableList(ruleSets_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.ruleSets_ = ruleSets_; + } else { + result.ruleSets_ = ruleSetsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.ListRuleSetsResponse) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.ListRuleSetsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.ListRuleSetsResponse other) { + if (other == com.google.cloud.contentwarehouse.v1.ListRuleSetsResponse.getDefaultInstance()) + return this; + if (ruleSetsBuilder_ == null) { + if (!other.ruleSets_.isEmpty()) { + if (ruleSets_.isEmpty()) { + ruleSets_ = other.ruleSets_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureRuleSetsIsMutable(); + ruleSets_.addAll(other.ruleSets_); + } + onChanged(); + } + } else { + if (!other.ruleSets_.isEmpty()) { + if (ruleSetsBuilder_.isEmpty()) { + ruleSetsBuilder_.dispose(); + ruleSetsBuilder_ = null; + ruleSets_ = other.ruleSets_; + bitField0_ = (bitField0_ & ~0x00000001); + ruleSetsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getRuleSetsFieldBuilder() + : null; + } else { + ruleSetsBuilder_.addAllMessages(other.ruleSets_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.contentwarehouse.v1.RuleSet m = + input.readMessage( + com.google.cloud.contentwarehouse.v1.RuleSet.parser(), extensionRegistry); + if (ruleSetsBuilder_ == null) { + ensureRuleSetsIsMutable(); + ruleSets_.add(m); + } else { + ruleSetsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List ruleSets_ = + java.util.Collections.emptyList(); + + private void ensureRuleSetsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + ruleSets_ = + new java.util.ArrayList(ruleSets_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.RuleSet, + com.google.cloud.contentwarehouse.v1.RuleSet.Builder, + com.google.cloud.contentwarehouse.v1.RuleSetOrBuilder> + ruleSetsBuilder_; + + /** + * + * + *
+     * The rule sets from the specified parent.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.RuleSet rule_sets = 1; + */ + public java.util.List getRuleSetsList() { + if (ruleSetsBuilder_ == null) { + return java.util.Collections.unmodifiableList(ruleSets_); + } else { + return ruleSetsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The rule sets from the specified parent.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.RuleSet rule_sets = 1; + */ + public int getRuleSetsCount() { + if (ruleSetsBuilder_ == null) { + return ruleSets_.size(); + } else { + return ruleSetsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The rule sets from the specified parent.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.RuleSet rule_sets = 1; + */ + public com.google.cloud.contentwarehouse.v1.RuleSet getRuleSets(int index) { + if (ruleSetsBuilder_ == null) { + return ruleSets_.get(index); + } else { + return ruleSetsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The rule sets from the specified parent.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.RuleSet rule_sets = 1; + */ + public Builder setRuleSets(int index, com.google.cloud.contentwarehouse.v1.RuleSet value) { + if (ruleSetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRuleSetsIsMutable(); + ruleSets_.set(index, value); + onChanged(); + } else { + ruleSetsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The rule sets from the specified parent.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.RuleSet rule_sets = 1; + */ + public Builder setRuleSets( + int index, com.google.cloud.contentwarehouse.v1.RuleSet.Builder builderForValue) { + if (ruleSetsBuilder_ == null) { + ensureRuleSetsIsMutable(); + ruleSets_.set(index, builderForValue.build()); + onChanged(); + } else { + ruleSetsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The rule sets from the specified parent.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.RuleSet rule_sets = 1; + */ + public Builder addRuleSets(com.google.cloud.contentwarehouse.v1.RuleSet value) { + if (ruleSetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRuleSetsIsMutable(); + ruleSets_.add(value); + onChanged(); + } else { + ruleSetsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The rule sets from the specified parent.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.RuleSet rule_sets = 1; + */ + public Builder addRuleSets(int index, com.google.cloud.contentwarehouse.v1.RuleSet value) { + if (ruleSetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRuleSetsIsMutable(); + ruleSets_.add(index, value); + onChanged(); + } else { + ruleSetsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The rule sets from the specified parent.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.RuleSet rule_sets = 1; + */ + public Builder addRuleSets( + com.google.cloud.contentwarehouse.v1.RuleSet.Builder builderForValue) { + if (ruleSetsBuilder_ == null) { + ensureRuleSetsIsMutable(); + ruleSets_.add(builderForValue.build()); + onChanged(); + } else { + ruleSetsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The rule sets from the specified parent.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.RuleSet rule_sets = 1; + */ + public Builder addRuleSets( + int index, com.google.cloud.contentwarehouse.v1.RuleSet.Builder builderForValue) { + if (ruleSetsBuilder_ == null) { + ensureRuleSetsIsMutable(); + ruleSets_.add(index, builderForValue.build()); + onChanged(); + } else { + ruleSetsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The rule sets from the specified parent.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.RuleSet rule_sets = 1; + */ + public Builder addAllRuleSets( + java.lang.Iterable values) { + if (ruleSetsBuilder_ == null) { + ensureRuleSetsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, ruleSets_); + onChanged(); + } else { + ruleSetsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The rule sets from the specified parent.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.RuleSet rule_sets = 1; + */ + public Builder clearRuleSets() { + if (ruleSetsBuilder_ == null) { + ruleSets_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + ruleSetsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The rule sets from the specified parent.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.RuleSet rule_sets = 1; + */ + public Builder removeRuleSets(int index) { + if (ruleSetsBuilder_ == null) { + ensureRuleSetsIsMutable(); + ruleSets_.remove(index); + onChanged(); + } else { + ruleSetsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The rule sets from the specified parent.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.RuleSet rule_sets = 1; + */ + public com.google.cloud.contentwarehouse.v1.RuleSet.Builder getRuleSetsBuilder(int index) { + return getRuleSetsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The rule sets from the specified parent.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.RuleSet rule_sets = 1; + */ + public com.google.cloud.contentwarehouse.v1.RuleSetOrBuilder getRuleSetsOrBuilder(int index) { + if (ruleSetsBuilder_ == null) { + return ruleSets_.get(index); + } else { + return ruleSetsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The rule sets from the specified parent.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.RuleSet rule_sets = 1; + */ + public java.util.List + getRuleSetsOrBuilderList() { + if (ruleSetsBuilder_ != null) { + return ruleSetsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(ruleSets_); + } + } + /** + * + * + *
+     * The rule sets from the specified parent.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.RuleSet rule_sets = 1; + */ + public com.google.cloud.contentwarehouse.v1.RuleSet.Builder addRuleSetsBuilder() { + return getRuleSetsFieldBuilder() + .addBuilder(com.google.cloud.contentwarehouse.v1.RuleSet.getDefaultInstance()); + } + /** + * + * + *
+     * The rule sets from the specified parent.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.RuleSet rule_sets = 1; + */ + public com.google.cloud.contentwarehouse.v1.RuleSet.Builder addRuleSetsBuilder(int index) { + return getRuleSetsFieldBuilder() + .addBuilder(index, com.google.cloud.contentwarehouse.v1.RuleSet.getDefaultInstance()); + } + /** + * + * + *
+     * The rule sets from the specified parent.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.RuleSet rule_sets = 1; + */ + public java.util.List + getRuleSetsBuilderList() { + return getRuleSetsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.RuleSet, + com.google.cloud.contentwarehouse.v1.RuleSet.Builder, + com.google.cloud.contentwarehouse.v1.RuleSetOrBuilder> + getRuleSetsFieldBuilder() { + if (ruleSetsBuilder_ == null) { + ruleSetsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.RuleSet, + com.google.cloud.contentwarehouse.v1.RuleSet.Builder, + com.google.cloud.contentwarehouse.v1.RuleSetOrBuilder>( + ruleSets_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + ruleSets_ = null; + } + return ruleSetsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.ListRuleSetsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.ListRuleSetsResponse) + private static final com.google.cloud.contentwarehouse.v1.ListRuleSetsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.ListRuleSetsResponse(); + } + + public static com.google.cloud.contentwarehouse.v1.ListRuleSetsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListRuleSetsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ListRuleSetsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListRuleSetsResponseOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListRuleSetsResponseOrBuilder.java new file mode 100644 index 000000000000..6e9638bd4fc6 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListRuleSetsResponseOrBuilder.java @@ -0,0 +1,104 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/ruleset_service_request.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface ListRuleSetsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.ListRuleSetsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The rule sets from the specified parent.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.RuleSet rule_sets = 1; + */ + java.util.List getRuleSetsList(); + /** + * + * + *
+   * The rule sets from the specified parent.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.RuleSet rule_sets = 1; + */ + com.google.cloud.contentwarehouse.v1.RuleSet getRuleSets(int index); + /** + * + * + *
+   * The rule sets from the specified parent.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.RuleSet rule_sets = 1; + */ + int getRuleSetsCount(); + /** + * + * + *
+   * The rule sets from the specified parent.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.RuleSet rule_sets = 1; + */ + java.util.List + getRuleSetsOrBuilderList(); + /** + * + * + *
+   * The rule sets from the specified parent.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.RuleSet rule_sets = 1; + */ + com.google.cloud.contentwarehouse.v1.RuleSetOrBuilder getRuleSetsOrBuilder(int index); + + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListSynonymSetsRequest.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListSynonymSetsRequest.java new file mode 100644 index 000000000000..7d17e5632f56 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListSynonymSetsRequest.java @@ -0,0 +1,941 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/synonymset_service_request.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Request message for SynonymSetService.ListSynonymSets.
+ * Will return all synonymSets belonging to the customer project.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.ListSynonymSetsRequest} + */ +public final class ListSynonymSetsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.ListSynonymSetsRequest) + ListSynonymSetsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListSynonymSetsRequest.newBuilder() to construct. + private ListSynonymSetsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListSynonymSetsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListSynonymSetsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.SynonymSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_ListSynonymSetsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.SynonymSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_ListSynonymSetsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest.class, + com.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent name.
+   * Format: projects/{project_number}/locations/{location}.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent name.
+   * Format: projects/{project_number}/locations/{location}.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * + * + *
+   * The maximum number of synonymSets to return. The service may return
+   * fewer than this value.
+   * If unspecified, at most 50 rule sets will be returned.
+   * The maximum value is 1000; values above 1000 will be coerced to 1000.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * A page token, received from a previous `ListSynonymSets` call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to `ListSynonymSets`
+   * must match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A page token, received from a previous `ListSynonymSets` call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to `ListSynonymSets`
+   * must match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest other = + (com.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for SynonymSetService.ListSynonymSets.
+   * Will return all synonymSets belonging to the customer project.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.ListSynonymSetsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.ListSynonymSetsRequest) + com.google.cloud.contentwarehouse.v1.ListSynonymSetsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.SynonymSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_ListSynonymSetsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.SynonymSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_ListSynonymSetsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest.class, + com.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.SynonymSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_ListSynonymSetsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest build() { + com.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest buildPartial() { + com.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest result = + new com.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest other) { + if (other == com.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent name.
+     * Format: projects/{project_number}/locations/{location}.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent name.
+     * Format: projects/{project_number}/locations/{location}.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent name.
+     * Format: projects/{project_number}/locations/{location}.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent name.
+     * Format: projects/{project_number}/locations/{location}.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent name.
+     * Format: projects/{project_number}/locations/{location}.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * The maximum number of synonymSets to return. The service may return
+     * fewer than this value.
+     * If unspecified, at most 50 rule sets will be returned.
+     * The maximum value is 1000; values above 1000 will be coerced to 1000.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of synonymSets to return. The service may return
+     * fewer than this value.
+     * If unspecified, at most 50 rule sets will be returned.
+     * The maximum value is 1000; values above 1000 will be coerced to 1000.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of synonymSets to return. The service may return
+     * fewer than this value.
+     * If unspecified, at most 50 rule sets will be returned.
+     * The maximum value is 1000; values above 1000 will be coerced to 1000.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A page token, received from a previous `ListSynonymSets` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListSynonymSets`
+     * must match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A page token, received from a previous `ListSynonymSets` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListSynonymSets`
+     * must match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A page token, received from a previous `ListSynonymSets` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListSynonymSets`
+     * must match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A page token, received from a previous `ListSynonymSets` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListSynonymSets`
+     * must match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A page token, received from a previous `ListSynonymSets` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListSynonymSets`
+     * must match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.ListSynonymSetsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.ListSynonymSetsRequest) + private static final com.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest(); + } + + public static com.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListSynonymSetsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListSynonymSetsRequestOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListSynonymSetsRequestOrBuilder.java new file mode 100644 index 000000000000..3e1248b98eb6 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListSynonymSetsRequestOrBuilder.java @@ -0,0 +1,103 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/synonymset_service_request.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface ListSynonymSetsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.ListSynonymSetsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent name.
+   * Format: projects/{project_number}/locations/{location}.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent name.
+   * Format: projects/{project_number}/locations/{location}.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The maximum number of synonymSets to return. The service may return
+   * fewer than this value.
+   * If unspecified, at most 50 rule sets will be returned.
+   * The maximum value is 1000; values above 1000 will be coerced to 1000.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * A page token, received from a previous `ListSynonymSets` call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to `ListSynonymSets`
+   * must match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A page token, received from a previous `ListSynonymSets` call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to `ListSynonymSets`
+   * must match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListSynonymSetsResponse.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListSynonymSetsResponse.java new file mode 100644 index 000000000000..1384409e9ab5 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListSynonymSetsResponse.java @@ -0,0 +1,1124 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/synonymset_service_request.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Response message for SynonymSetService.ListSynonymSets.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.ListSynonymSetsResponse} + */ +public final class ListSynonymSetsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.ListSynonymSetsResponse) + ListSynonymSetsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListSynonymSetsResponse.newBuilder() to construct. + private ListSynonymSetsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListSynonymSetsResponse() { + synonymSets_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListSynonymSetsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.SynonymSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_ListSynonymSetsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.SynonymSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_ListSynonymSetsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.ListSynonymSetsResponse.class, + com.google.cloud.contentwarehouse.v1.ListSynonymSetsResponse.Builder.class); + } + + public static final int SYNONYM_SETS_FIELD_NUMBER = 1; + private java.util.List synonymSets_; + /** + * + * + *
+   * The synonymSets from the specified parent.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.SynonymSet synonym_sets = 1; + */ + @java.lang.Override + public java.util.List getSynonymSetsList() { + return synonymSets_; + } + /** + * + * + *
+   * The synonymSets from the specified parent.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.SynonymSet synonym_sets = 1; + */ + @java.lang.Override + public java.util.List + getSynonymSetsOrBuilderList() { + return synonymSets_; + } + /** + * + * + *
+   * The synonymSets from the specified parent.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.SynonymSet synonym_sets = 1; + */ + @java.lang.Override + public int getSynonymSetsCount() { + return synonymSets_.size(); + } + /** + * + * + *
+   * The synonymSets from the specified parent.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.SynonymSet synonym_sets = 1; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.SynonymSet getSynonymSets(int index) { + return synonymSets_.get(index); + } + /** + * + * + *
+   * The synonymSets from the specified parent.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.SynonymSet synonym_sets = 1; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.SynonymSetOrBuilder getSynonymSetsOrBuilder( + int index) { + return synonymSets_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * A page token, received from a previous `ListSynonymSets` call.
+   * Provide this to retrieve the subsequent page.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A page token, received from a previous `ListSynonymSets` call.
+   * Provide this to retrieve the subsequent page.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < synonymSets_.size(); i++) { + output.writeMessage(1, synonymSets_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < synonymSets_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, synonymSets_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.ListSynonymSetsResponse)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.ListSynonymSetsResponse other = + (com.google.cloud.contentwarehouse.v1.ListSynonymSetsResponse) obj; + + if (!getSynonymSetsList().equals(other.getSynonymSetsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getSynonymSetsCount() > 0) { + hash = (37 * hash) + SYNONYM_SETS_FIELD_NUMBER; + hash = (53 * hash) + getSynonymSetsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.ListSynonymSetsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.ListSynonymSetsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ListSynonymSetsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.ListSynonymSetsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ListSynonymSetsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.ListSynonymSetsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ListSynonymSetsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.ListSynonymSetsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ListSynonymSetsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.ListSynonymSetsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ListSynonymSetsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.ListSynonymSetsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.ListSynonymSetsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for SynonymSetService.ListSynonymSets.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.ListSynonymSetsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.ListSynonymSetsResponse) + com.google.cloud.contentwarehouse.v1.ListSynonymSetsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.SynonymSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_ListSynonymSetsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.SynonymSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_ListSynonymSetsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.ListSynonymSetsResponse.class, + com.google.cloud.contentwarehouse.v1.ListSynonymSetsResponse.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.ListSynonymSetsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (synonymSetsBuilder_ == null) { + synonymSets_ = java.util.Collections.emptyList(); + } else { + synonymSets_ = null; + synonymSetsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.SynonymSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_ListSynonymSetsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ListSynonymSetsResponse + getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.ListSynonymSetsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ListSynonymSetsResponse build() { + com.google.cloud.contentwarehouse.v1.ListSynonymSetsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ListSynonymSetsResponse buildPartial() { + com.google.cloud.contentwarehouse.v1.ListSynonymSetsResponse result = + new com.google.cloud.contentwarehouse.v1.ListSynonymSetsResponse(this); + int from_bitField0_ = bitField0_; + if (synonymSetsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + synonymSets_ = java.util.Collections.unmodifiableList(synonymSets_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.synonymSets_ = synonymSets_; + } else { + result.synonymSets_ = synonymSetsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.ListSynonymSetsResponse) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.ListSynonymSetsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.ListSynonymSetsResponse other) { + if (other + == com.google.cloud.contentwarehouse.v1.ListSynonymSetsResponse.getDefaultInstance()) + return this; + if (synonymSetsBuilder_ == null) { + if (!other.synonymSets_.isEmpty()) { + if (synonymSets_.isEmpty()) { + synonymSets_ = other.synonymSets_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSynonymSetsIsMutable(); + synonymSets_.addAll(other.synonymSets_); + } + onChanged(); + } + } else { + if (!other.synonymSets_.isEmpty()) { + if (synonymSetsBuilder_.isEmpty()) { + synonymSetsBuilder_.dispose(); + synonymSetsBuilder_ = null; + synonymSets_ = other.synonymSets_; + bitField0_ = (bitField0_ & ~0x00000001); + synonymSetsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getSynonymSetsFieldBuilder() + : null; + } else { + synonymSetsBuilder_.addAllMessages(other.synonymSets_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.contentwarehouse.v1.SynonymSet m = + input.readMessage( + com.google.cloud.contentwarehouse.v1.SynonymSet.parser(), + extensionRegistry); + if (synonymSetsBuilder_ == null) { + ensureSynonymSetsIsMutable(); + synonymSets_.add(m); + } else { + synonymSetsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List synonymSets_ = + java.util.Collections.emptyList(); + + private void ensureSynonymSetsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + synonymSets_ = + new java.util.ArrayList(synonymSets_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.SynonymSet, + com.google.cloud.contentwarehouse.v1.SynonymSet.Builder, + com.google.cloud.contentwarehouse.v1.SynonymSetOrBuilder> + synonymSetsBuilder_; + + /** + * + * + *
+     * The synonymSets from the specified parent.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.SynonymSet synonym_sets = 1; + */ + public java.util.List getSynonymSetsList() { + if (synonymSetsBuilder_ == null) { + return java.util.Collections.unmodifiableList(synonymSets_); + } else { + return synonymSetsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The synonymSets from the specified parent.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.SynonymSet synonym_sets = 1; + */ + public int getSynonymSetsCount() { + if (synonymSetsBuilder_ == null) { + return synonymSets_.size(); + } else { + return synonymSetsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The synonymSets from the specified parent.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.SynonymSet synonym_sets = 1; + */ + public com.google.cloud.contentwarehouse.v1.SynonymSet getSynonymSets(int index) { + if (synonymSetsBuilder_ == null) { + return synonymSets_.get(index); + } else { + return synonymSetsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The synonymSets from the specified parent.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.SynonymSet synonym_sets = 1; + */ + public Builder setSynonymSets( + int index, com.google.cloud.contentwarehouse.v1.SynonymSet value) { + if (synonymSetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSynonymSetsIsMutable(); + synonymSets_.set(index, value); + onChanged(); + } else { + synonymSetsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The synonymSets from the specified parent.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.SynonymSet synonym_sets = 1; + */ + public Builder setSynonymSets( + int index, com.google.cloud.contentwarehouse.v1.SynonymSet.Builder builderForValue) { + if (synonymSetsBuilder_ == null) { + ensureSynonymSetsIsMutable(); + synonymSets_.set(index, builderForValue.build()); + onChanged(); + } else { + synonymSetsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The synonymSets from the specified parent.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.SynonymSet synonym_sets = 1; + */ + public Builder addSynonymSets(com.google.cloud.contentwarehouse.v1.SynonymSet value) { + if (synonymSetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSynonymSetsIsMutable(); + synonymSets_.add(value); + onChanged(); + } else { + synonymSetsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The synonymSets from the specified parent.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.SynonymSet synonym_sets = 1; + */ + public Builder addSynonymSets( + int index, com.google.cloud.contentwarehouse.v1.SynonymSet value) { + if (synonymSetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSynonymSetsIsMutable(); + synonymSets_.add(index, value); + onChanged(); + } else { + synonymSetsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The synonymSets from the specified parent.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.SynonymSet synonym_sets = 1; + */ + public Builder addSynonymSets( + com.google.cloud.contentwarehouse.v1.SynonymSet.Builder builderForValue) { + if (synonymSetsBuilder_ == null) { + ensureSynonymSetsIsMutable(); + synonymSets_.add(builderForValue.build()); + onChanged(); + } else { + synonymSetsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The synonymSets from the specified parent.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.SynonymSet synonym_sets = 1; + */ + public Builder addSynonymSets( + int index, com.google.cloud.contentwarehouse.v1.SynonymSet.Builder builderForValue) { + if (synonymSetsBuilder_ == null) { + ensureSynonymSetsIsMutable(); + synonymSets_.add(index, builderForValue.build()); + onChanged(); + } else { + synonymSetsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The synonymSets from the specified parent.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.SynonymSet synonym_sets = 1; + */ + public Builder addAllSynonymSets( + java.lang.Iterable values) { + if (synonymSetsBuilder_ == null) { + ensureSynonymSetsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, synonymSets_); + onChanged(); + } else { + synonymSetsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The synonymSets from the specified parent.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.SynonymSet synonym_sets = 1; + */ + public Builder clearSynonymSets() { + if (synonymSetsBuilder_ == null) { + synonymSets_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + synonymSetsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The synonymSets from the specified parent.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.SynonymSet synonym_sets = 1; + */ + public Builder removeSynonymSets(int index) { + if (synonymSetsBuilder_ == null) { + ensureSynonymSetsIsMutable(); + synonymSets_.remove(index); + onChanged(); + } else { + synonymSetsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The synonymSets from the specified parent.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.SynonymSet synonym_sets = 1; + */ + public com.google.cloud.contentwarehouse.v1.SynonymSet.Builder getSynonymSetsBuilder( + int index) { + return getSynonymSetsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The synonymSets from the specified parent.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.SynonymSet synonym_sets = 1; + */ + public com.google.cloud.contentwarehouse.v1.SynonymSetOrBuilder getSynonymSetsOrBuilder( + int index) { + if (synonymSetsBuilder_ == null) { + return synonymSets_.get(index); + } else { + return synonymSetsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The synonymSets from the specified parent.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.SynonymSet synonym_sets = 1; + */ + public java.util.List + getSynonymSetsOrBuilderList() { + if (synonymSetsBuilder_ != null) { + return synonymSetsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(synonymSets_); + } + } + /** + * + * + *
+     * The synonymSets from the specified parent.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.SynonymSet synonym_sets = 1; + */ + public com.google.cloud.contentwarehouse.v1.SynonymSet.Builder addSynonymSetsBuilder() { + return getSynonymSetsFieldBuilder() + .addBuilder(com.google.cloud.contentwarehouse.v1.SynonymSet.getDefaultInstance()); + } + /** + * + * + *
+     * The synonymSets from the specified parent.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.SynonymSet synonym_sets = 1; + */ + public com.google.cloud.contentwarehouse.v1.SynonymSet.Builder addSynonymSetsBuilder( + int index) { + return getSynonymSetsFieldBuilder() + .addBuilder(index, com.google.cloud.contentwarehouse.v1.SynonymSet.getDefaultInstance()); + } + /** + * + * + *
+     * The synonymSets from the specified parent.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.SynonymSet synonym_sets = 1; + */ + public java.util.List + getSynonymSetsBuilderList() { + return getSynonymSetsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.SynonymSet, + com.google.cloud.contentwarehouse.v1.SynonymSet.Builder, + com.google.cloud.contentwarehouse.v1.SynonymSetOrBuilder> + getSynonymSetsFieldBuilder() { + if (synonymSetsBuilder_ == null) { + synonymSetsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.SynonymSet, + com.google.cloud.contentwarehouse.v1.SynonymSet.Builder, + com.google.cloud.contentwarehouse.v1.SynonymSetOrBuilder>( + synonymSets_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + synonymSets_ = null; + } + return synonymSetsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A page token, received from a previous `ListSynonymSets` call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A page token, received from a previous `ListSynonymSets` call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A page token, received from a previous `ListSynonymSets` call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A page token, received from a previous `ListSynonymSets` call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A page token, received from a previous `ListSynonymSets` call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.ListSynonymSetsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.ListSynonymSetsResponse) + private static final com.google.cloud.contentwarehouse.v1.ListSynonymSetsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.ListSynonymSetsResponse(); + } + + public static com.google.cloud.contentwarehouse.v1.ListSynonymSetsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListSynonymSetsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ListSynonymSetsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListSynonymSetsResponseOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListSynonymSetsResponseOrBuilder.java new file mode 100644 index 000000000000..e370c9a5d995 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ListSynonymSetsResponseOrBuilder.java @@ -0,0 +1,104 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/synonymset_service_request.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface ListSynonymSetsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.ListSynonymSetsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The synonymSets from the specified parent.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.SynonymSet synonym_sets = 1; + */ + java.util.List getSynonymSetsList(); + /** + * + * + *
+   * The synonymSets from the specified parent.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.SynonymSet synonym_sets = 1; + */ + com.google.cloud.contentwarehouse.v1.SynonymSet getSynonymSets(int index); + /** + * + * + *
+   * The synonymSets from the specified parent.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.SynonymSet synonym_sets = 1; + */ + int getSynonymSetsCount(); + /** + * + * + *
+   * The synonymSets from the specified parent.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.SynonymSet synonym_sets = 1; + */ + java.util.List + getSynonymSetsOrBuilderList(); + /** + * + * + *
+   * The synonymSets from the specified parent.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.SynonymSet synonym_sets = 1; + */ + com.google.cloud.contentwarehouse.v1.SynonymSetOrBuilder getSynonymSetsOrBuilder(int index); + + /** + * + * + *
+   * A page token, received from a previous `ListSynonymSets` call.
+   * Provide this to retrieve the subsequent page.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A page token, received from a previous `ListSynonymSets` call.
+   * Provide this to retrieve the subsequent page.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/LocationName.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/LocationName.java new file mode 100644 index 000000000000..c4a7687650be --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/LocationName.java @@ -0,0 +1,192 @@ +/* + * 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; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class LocationName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + + @Deprecated + protected LocationName() { + project = null; + location = null; + } + + private LocationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static LocationName of(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build(); + } + + public static String format(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build().toString(); + } + + public static LocationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION.validatedMatch( + formattedString, "LocationName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (LocationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION.instantiate("project", project, "location", location); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + LocationName that = ((LocationName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + return h; + } + + /** Builder for projects/{project}/locations/{location}. */ + public static class Builder { + private String project; + private String location; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + private Builder(LocationName locationName) { + this.project = locationName.project; + this.location = locationName.location; + } + + public LocationName build() { + return new LocationName(this); + } + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/MapProperty.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/MapProperty.java new file mode 100644 index 000000000000..4304c4e125be --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/MapProperty.java @@ -0,0 +1,785 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Map property value.
+ * Represents a structured entries of key value pairs, consisting of field names
+ * which map to dynamically typed values.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.MapProperty} + */ +public final class MapProperty extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.MapProperty) + MapPropertyOrBuilder { + private static final long serialVersionUID = 0L; + // Use MapProperty.newBuilder() to construct. + private MapProperty(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private MapProperty() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new MapProperty(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_MapProperty_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 1: + return internalGetFields(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_MapProperty_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.MapProperty.class, + com.google.cloud.contentwarehouse.v1.MapProperty.Builder.class); + } + + public static final int FIELDS_FIELD_NUMBER = 1; + + private static final class FieldsDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.contentwarehouse.v1.Value> + defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_MapProperty_FieldsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.cloud.contentwarehouse.v1.Value.getDefaultInstance()); + } + + private com.google.protobuf.MapField + fields_; + + private com.google.protobuf.MapField + internalGetFields() { + if (fields_ == null) { + return com.google.protobuf.MapField.emptyMapField(FieldsDefaultEntryHolder.defaultEntry); + } + return fields_; + } + + public int getFieldsCount() { + return internalGetFields().getMap().size(); + } + /** + * + * + *
+   * Unordered map of dynamically typed values.
+   * 
+ * + * map<string, .google.cloud.contentwarehouse.v1.Value> fields = 1; + */ + @java.lang.Override + public boolean containsFields(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetFields().getMap().containsKey(key); + } + /** Use {@link #getFieldsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getFields() { + return getFieldsMap(); + } + /** + * + * + *
+   * Unordered map of dynamically typed values.
+   * 
+ * + * map<string, .google.cloud.contentwarehouse.v1.Value> fields = 1; + */ + @java.lang.Override + public java.util.Map + getFieldsMap() { + return internalGetFields().getMap(); + } + /** + * + * + *
+   * Unordered map of dynamically typed values.
+   * 
+ * + * map<string, .google.cloud.contentwarehouse.v1.Value> fields = 1; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.Value getFieldsOrDefault( + java.lang.String key, com.google.cloud.contentwarehouse.v1.Value defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetFields().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Unordered map of dynamically typed values.
+   * 
+ * + * map<string, .google.cloud.contentwarehouse.v1.Value> fields = 1; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.Value getFieldsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetFields().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetFields(), FieldsDefaultEntryHolder.defaultEntry, 1); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry entry : + internalGetFields().getMap().entrySet()) { + com.google.protobuf.MapEntry + fields__ = + FieldsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, fields__); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.MapProperty)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.MapProperty other = + (com.google.cloud.contentwarehouse.v1.MapProperty) obj; + + if (!internalGetFields().equals(other.internalGetFields())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetFields().getMap().isEmpty()) { + hash = (37 * hash) + FIELDS_FIELD_NUMBER; + hash = (53 * hash) + internalGetFields().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.MapProperty parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.MapProperty parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.MapProperty parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.MapProperty parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.MapProperty parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.MapProperty parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.MapProperty parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.MapProperty parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.MapProperty parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.MapProperty parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.MapProperty parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.MapProperty parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.contentwarehouse.v1.MapProperty prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Map property value.
+   * Represents a structured entries of key value pairs, consisting of field names
+   * which map to dynamically typed values.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.MapProperty} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.MapProperty) + com.google.cloud.contentwarehouse.v1.MapPropertyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_MapProperty_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 1: + return internalGetFields(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 1: + return internalGetMutableFields(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_MapProperty_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.MapProperty.class, + com.google.cloud.contentwarehouse.v1.MapProperty.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.MapProperty.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + internalGetMutableFields().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_MapProperty_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.MapProperty getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.MapProperty.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.MapProperty build() { + com.google.cloud.contentwarehouse.v1.MapProperty result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.MapProperty buildPartial() { + com.google.cloud.contentwarehouse.v1.MapProperty result = + new com.google.cloud.contentwarehouse.v1.MapProperty(this); + int from_bitField0_ = bitField0_; + result.fields_ = internalGetFields(); + result.fields_.makeImmutable(); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.MapProperty) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.MapProperty) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.MapProperty other) { + if (other == com.google.cloud.contentwarehouse.v1.MapProperty.getDefaultInstance()) + return this; + internalGetMutableFields().mergeFrom(other.internalGetFields()); + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.contentwarehouse.v1.Value> + fields__ = + input.readMessage( + FieldsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableFields() + .getMutableMap() + .put(fields__.getKey(), fields__.getValue()); + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.contentwarehouse.v1.Value> + fields_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.contentwarehouse.v1.Value> + internalGetFields() { + if (fields_ == null) { + return com.google.protobuf.MapField.emptyMapField(FieldsDefaultEntryHolder.defaultEntry); + } + return fields_; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.contentwarehouse.v1.Value> + internalGetMutableFields() { + onChanged(); + ; + if (fields_ == null) { + fields_ = com.google.protobuf.MapField.newMapField(FieldsDefaultEntryHolder.defaultEntry); + } + if (!fields_.isMutable()) { + fields_ = fields_.copy(); + } + return fields_; + } + + public int getFieldsCount() { + return internalGetFields().getMap().size(); + } + /** + * + * + *
+     * Unordered map of dynamically typed values.
+     * 
+ * + * map<string, .google.cloud.contentwarehouse.v1.Value> fields = 1; + */ + @java.lang.Override + public boolean containsFields(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetFields().getMap().containsKey(key); + } + /** Use {@link #getFieldsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getFields() { + return getFieldsMap(); + } + /** + * + * + *
+     * Unordered map of dynamically typed values.
+     * 
+ * + * map<string, .google.cloud.contentwarehouse.v1.Value> fields = 1; + */ + @java.lang.Override + public java.util.Map + getFieldsMap() { + return internalGetFields().getMap(); + } + /** + * + * + *
+     * Unordered map of dynamically typed values.
+     * 
+ * + * map<string, .google.cloud.contentwarehouse.v1.Value> fields = 1; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.Value getFieldsOrDefault( + java.lang.String key, com.google.cloud.contentwarehouse.v1.Value defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetFields().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Unordered map of dynamically typed values.
+     * 
+ * + * map<string, .google.cloud.contentwarehouse.v1.Value> fields = 1; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.Value getFieldsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetFields().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearFields() { + internalGetMutableFields().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Unordered map of dynamically typed values.
+     * 
+ * + * map<string, .google.cloud.contentwarehouse.v1.Value> fields = 1; + */ + public Builder removeFields(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableFields().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableFields() { + return internalGetMutableFields().getMutableMap(); + } + /** + * + * + *
+     * Unordered map of dynamically typed values.
+     * 
+ * + * map<string, .google.cloud.contentwarehouse.v1.Value> fields = 1; + */ + public Builder putFields( + java.lang.String key, com.google.cloud.contentwarehouse.v1.Value value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + + internalGetMutableFields().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Unordered map of dynamically typed values.
+     * 
+ * + * map<string, .google.cloud.contentwarehouse.v1.Value> fields = 1; + */ + public Builder putAllFields( + java.util.Map values) { + internalGetMutableFields().getMutableMap().putAll(values); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.MapProperty) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.MapProperty) + private static final com.google.cloud.contentwarehouse.v1.MapProperty DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.MapProperty(); + } + + public static com.google.cloud.contentwarehouse.v1.MapProperty getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MapProperty parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.MapProperty getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/MapPropertyOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/MapPropertyOrBuilder.java new file mode 100644 index 000000000000..7a4e1e413687 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/MapPropertyOrBuilder.java @@ -0,0 +1,84 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface MapPropertyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.MapProperty) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Unordered map of dynamically typed values.
+   * 
+ * + * map<string, .google.cloud.contentwarehouse.v1.Value> fields = 1; + */ + int getFieldsCount(); + /** + * + * + *
+   * Unordered map of dynamically typed values.
+   * 
+ * + * map<string, .google.cloud.contentwarehouse.v1.Value> fields = 1; + */ + boolean containsFields(java.lang.String key); + /** Use {@link #getFieldsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getFields(); + /** + * + * + *
+   * Unordered map of dynamically typed values.
+   * 
+ * + * map<string, .google.cloud.contentwarehouse.v1.Value> fields = 1; + */ + java.util.Map getFieldsMap(); + /** + * + * + *
+   * Unordered map of dynamically typed values.
+   * 
+ * + * map<string, .google.cloud.contentwarehouse.v1.Value> fields = 1; + */ + + /* nullable */ + com.google.cloud.contentwarehouse.v1.Value getFieldsOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.contentwarehouse.v1.Value defaultValue); + /** + * + * + *
+   * Unordered map of dynamically typed values.
+   * 
+ * + * map<string, .google.cloud.contentwarehouse.v1.Value> fields = 1; + */ + com.google.cloud.contentwarehouse.v1.Value getFieldsOrThrow(java.lang.String key); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/MapTypeOptions.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/MapTypeOptions.java new file mode 100644 index 000000000000..b6da875998c1 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/MapTypeOptions.java @@ -0,0 +1,436 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_schema.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Configurations for a Map property.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.MapTypeOptions} + */ +public final class MapTypeOptions extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.MapTypeOptions) + MapTypeOptionsOrBuilder { + private static final long serialVersionUID = 0L; + // Use MapTypeOptions.newBuilder() to construct. + private MapTypeOptions(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private MapTypeOptions() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new MapTypeOptions(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaProto + .internal_static_google_cloud_contentwarehouse_v1_MapTypeOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaProto + .internal_static_google_cloud_contentwarehouse_v1_MapTypeOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.MapTypeOptions.class, + com.google.cloud.contentwarehouse.v1.MapTypeOptions.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.MapTypeOptions)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.MapTypeOptions other = + (com.google.cloud.contentwarehouse.v1.MapTypeOptions) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.MapTypeOptions parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.MapTypeOptions parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.MapTypeOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.MapTypeOptions parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.MapTypeOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.MapTypeOptions parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.MapTypeOptions parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.MapTypeOptions parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.MapTypeOptions parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.MapTypeOptions parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.MapTypeOptions parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.MapTypeOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.contentwarehouse.v1.MapTypeOptions prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Configurations for a Map property.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.MapTypeOptions} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.MapTypeOptions) + com.google.cloud.contentwarehouse.v1.MapTypeOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaProto + .internal_static_google_cloud_contentwarehouse_v1_MapTypeOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaProto + .internal_static_google_cloud_contentwarehouse_v1_MapTypeOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.MapTypeOptions.class, + com.google.cloud.contentwarehouse.v1.MapTypeOptions.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.MapTypeOptions.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaProto + .internal_static_google_cloud_contentwarehouse_v1_MapTypeOptions_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.MapTypeOptions getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.MapTypeOptions.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.MapTypeOptions build() { + com.google.cloud.contentwarehouse.v1.MapTypeOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.MapTypeOptions buildPartial() { + com.google.cloud.contentwarehouse.v1.MapTypeOptions result = + new com.google.cloud.contentwarehouse.v1.MapTypeOptions(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.MapTypeOptions) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.MapTypeOptions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.MapTypeOptions other) { + if (other == com.google.cloud.contentwarehouse.v1.MapTypeOptions.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.MapTypeOptions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.MapTypeOptions) + private static final com.google.cloud.contentwarehouse.v1.MapTypeOptions DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.MapTypeOptions(); + } + + public static com.google.cloud.contentwarehouse.v1.MapTypeOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MapTypeOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.MapTypeOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/MapTypeOptionsOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/MapTypeOptionsOrBuilder.java new file mode 100644 index 000000000000..71c51a35976d --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/MapTypeOptionsOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_schema.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface MapTypeOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.MapTypeOptions) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/MergeFieldsOptions.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/MergeFieldsOptions.java new file mode 100644 index 000000000000..d96e1fb43db7 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/MergeFieldsOptions.java @@ -0,0 +1,773 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/common.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Options for merging updated fields.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.MergeFieldsOptions} + */ +public final class MergeFieldsOptions extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.MergeFieldsOptions) + MergeFieldsOptionsOrBuilder { + private static final long serialVersionUID = 0L; + // Use MergeFieldsOptions.newBuilder() to construct. + private MergeFieldsOptions(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private MergeFieldsOptions() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new MergeFieldsOptions(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.CommonProto + .internal_static_google_cloud_contentwarehouse_v1_MergeFieldsOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.CommonProto + .internal_static_google_cloud_contentwarehouse_v1_MergeFieldsOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.MergeFieldsOptions.class, + com.google.cloud.contentwarehouse.v1.MergeFieldsOptions.Builder.class); + } + + private int bitField0_; + public static final int REPLACE_MESSAGE_FIELDS_FIELD_NUMBER = 1; + private boolean replaceMessageFields_; + /** + * + * + *
+   * When merging message fields, the default behavior is to merge
+   * the content of two message fields together. If you instead want to use
+   * the field from the source message to replace the corresponding field in
+   * the destination message, set this flag to true. When this flag is set,
+   * specified submessage fields that are missing in source will be cleared in
+   * destination.
+   * 
+ * + * optional bool replace_message_fields = 1; + * + * @return Whether the replaceMessageFields field is set. + */ + @java.lang.Override + public boolean hasReplaceMessageFields() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * When merging message fields, the default behavior is to merge
+   * the content of two message fields together. If you instead want to use
+   * the field from the source message to replace the corresponding field in
+   * the destination message, set this flag to true. When this flag is set,
+   * specified submessage fields that are missing in source will be cleared in
+   * destination.
+   * 
+ * + * optional bool replace_message_fields = 1; + * + * @return The replaceMessageFields. + */ + @java.lang.Override + public boolean getReplaceMessageFields() { + return replaceMessageFields_; + } + + public static final int REPLACE_REPEATED_FIELDS_FIELD_NUMBER = 2; + private boolean replaceRepeatedFields_; + /** + * + * + *
+   * When merging repeated fields, the default behavior is to append
+   * entries from the source repeated field to the destination repeated field.
+   * If you instead want to keep only the entries from the source repeated
+   * field, set this flag to true.
+   * If you want to replace a repeated field within a message field on the
+   * destination message, you must set both replace_repeated_fields and
+   * replace_message_fields to true, otherwise the repeated fields will be
+   * appended.
+   * 
+ * + * optional bool replace_repeated_fields = 2; + * + * @return Whether the replaceRepeatedFields field is set. + */ + @java.lang.Override + public boolean hasReplaceRepeatedFields() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * When merging repeated fields, the default behavior is to append
+   * entries from the source repeated field to the destination repeated field.
+   * If you instead want to keep only the entries from the source repeated
+   * field, set this flag to true.
+   * If you want to replace a repeated field within a message field on the
+   * destination message, you must set both replace_repeated_fields and
+   * replace_message_fields to true, otherwise the repeated fields will be
+   * appended.
+   * 
+ * + * optional bool replace_repeated_fields = 2; + * + * @return The replaceRepeatedFields. + */ + @java.lang.Override + public boolean getReplaceRepeatedFields() { + return replaceRepeatedFields_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeBool(1, replaceMessageFields_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeBool(2, replaceRepeatedFields_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, replaceMessageFields_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, replaceRepeatedFields_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.MergeFieldsOptions)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.MergeFieldsOptions other = + (com.google.cloud.contentwarehouse.v1.MergeFieldsOptions) obj; + + if (hasReplaceMessageFields() != other.hasReplaceMessageFields()) return false; + if (hasReplaceMessageFields()) { + if (getReplaceMessageFields() != other.getReplaceMessageFields()) return false; + } + if (hasReplaceRepeatedFields() != other.hasReplaceRepeatedFields()) return false; + if (hasReplaceRepeatedFields()) { + if (getReplaceRepeatedFields() != other.getReplaceRepeatedFields()) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasReplaceMessageFields()) { + hash = (37 * hash) + REPLACE_MESSAGE_FIELDS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getReplaceMessageFields()); + } + if (hasReplaceRepeatedFields()) { + hash = (37 * hash) + REPLACE_REPEATED_FIELDS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getReplaceRepeatedFields()); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.MergeFieldsOptions parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.MergeFieldsOptions parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.MergeFieldsOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.MergeFieldsOptions parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.MergeFieldsOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.MergeFieldsOptions parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.MergeFieldsOptions parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.MergeFieldsOptions parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.MergeFieldsOptions parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.MergeFieldsOptions parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.MergeFieldsOptions parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.MergeFieldsOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.MergeFieldsOptions prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Options for merging updated fields.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.MergeFieldsOptions} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.MergeFieldsOptions) + com.google.cloud.contentwarehouse.v1.MergeFieldsOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.CommonProto + .internal_static_google_cloud_contentwarehouse_v1_MergeFieldsOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.CommonProto + .internal_static_google_cloud_contentwarehouse_v1_MergeFieldsOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.MergeFieldsOptions.class, + com.google.cloud.contentwarehouse.v1.MergeFieldsOptions.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.MergeFieldsOptions.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + replaceMessageFields_ = false; + bitField0_ = (bitField0_ & ~0x00000001); + replaceRepeatedFields_ = false; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.CommonProto + .internal_static_google_cloud_contentwarehouse_v1_MergeFieldsOptions_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.MergeFieldsOptions getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.MergeFieldsOptions.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.MergeFieldsOptions build() { + com.google.cloud.contentwarehouse.v1.MergeFieldsOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.MergeFieldsOptions buildPartial() { + com.google.cloud.contentwarehouse.v1.MergeFieldsOptions result = + new com.google.cloud.contentwarehouse.v1.MergeFieldsOptions(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.replaceMessageFields_ = replaceMessageFields_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.replaceRepeatedFields_ = replaceRepeatedFields_; + to_bitField0_ |= 0x00000002; + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.MergeFieldsOptions) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.MergeFieldsOptions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.MergeFieldsOptions other) { + if (other == com.google.cloud.contentwarehouse.v1.MergeFieldsOptions.getDefaultInstance()) + return this; + if (other.hasReplaceMessageFields()) { + setReplaceMessageFields(other.getReplaceMessageFields()); + } + if (other.hasReplaceRepeatedFields()) { + setReplaceRepeatedFields(other.getReplaceRepeatedFields()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + replaceMessageFields_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + replaceRepeatedFields_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private boolean replaceMessageFields_; + /** + * + * + *
+     * When merging message fields, the default behavior is to merge
+     * the content of two message fields together. If you instead want to use
+     * the field from the source message to replace the corresponding field in
+     * the destination message, set this flag to true. When this flag is set,
+     * specified submessage fields that are missing in source will be cleared in
+     * destination.
+     * 
+ * + * optional bool replace_message_fields = 1; + * + * @return Whether the replaceMessageFields field is set. + */ + @java.lang.Override + public boolean hasReplaceMessageFields() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * When merging message fields, the default behavior is to merge
+     * the content of two message fields together. If you instead want to use
+     * the field from the source message to replace the corresponding field in
+     * the destination message, set this flag to true. When this flag is set,
+     * specified submessage fields that are missing in source will be cleared in
+     * destination.
+     * 
+ * + * optional bool replace_message_fields = 1; + * + * @return The replaceMessageFields. + */ + @java.lang.Override + public boolean getReplaceMessageFields() { + return replaceMessageFields_; + } + /** + * + * + *
+     * When merging message fields, the default behavior is to merge
+     * the content of two message fields together. If you instead want to use
+     * the field from the source message to replace the corresponding field in
+     * the destination message, set this flag to true. When this flag is set,
+     * specified submessage fields that are missing in source will be cleared in
+     * destination.
+     * 
+ * + * optional bool replace_message_fields = 1; + * + * @param value The replaceMessageFields to set. + * @return This builder for chaining. + */ + public Builder setReplaceMessageFields(boolean value) { + bitField0_ |= 0x00000001; + replaceMessageFields_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * When merging message fields, the default behavior is to merge
+     * the content of two message fields together. If you instead want to use
+     * the field from the source message to replace the corresponding field in
+     * the destination message, set this flag to true. When this flag is set,
+     * specified submessage fields that are missing in source will be cleared in
+     * destination.
+     * 
+ * + * optional bool replace_message_fields = 1; + * + * @return This builder for chaining. + */ + public Builder clearReplaceMessageFields() { + bitField0_ = (bitField0_ & ~0x00000001); + replaceMessageFields_ = false; + onChanged(); + return this; + } + + private boolean replaceRepeatedFields_; + /** + * + * + *
+     * When merging repeated fields, the default behavior is to append
+     * entries from the source repeated field to the destination repeated field.
+     * If you instead want to keep only the entries from the source repeated
+     * field, set this flag to true.
+     * If you want to replace a repeated field within a message field on the
+     * destination message, you must set both replace_repeated_fields and
+     * replace_message_fields to true, otherwise the repeated fields will be
+     * appended.
+     * 
+ * + * optional bool replace_repeated_fields = 2; + * + * @return Whether the replaceRepeatedFields field is set. + */ + @java.lang.Override + public boolean hasReplaceRepeatedFields() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * When merging repeated fields, the default behavior is to append
+     * entries from the source repeated field to the destination repeated field.
+     * If you instead want to keep only the entries from the source repeated
+     * field, set this flag to true.
+     * If you want to replace a repeated field within a message field on the
+     * destination message, you must set both replace_repeated_fields and
+     * replace_message_fields to true, otherwise the repeated fields will be
+     * appended.
+     * 
+ * + * optional bool replace_repeated_fields = 2; + * + * @return The replaceRepeatedFields. + */ + @java.lang.Override + public boolean getReplaceRepeatedFields() { + return replaceRepeatedFields_; + } + /** + * + * + *
+     * When merging repeated fields, the default behavior is to append
+     * entries from the source repeated field to the destination repeated field.
+     * If you instead want to keep only the entries from the source repeated
+     * field, set this flag to true.
+     * If you want to replace a repeated field within a message field on the
+     * destination message, you must set both replace_repeated_fields and
+     * replace_message_fields to true, otherwise the repeated fields will be
+     * appended.
+     * 
+ * + * optional bool replace_repeated_fields = 2; + * + * @param value The replaceRepeatedFields to set. + * @return This builder for chaining. + */ + public Builder setReplaceRepeatedFields(boolean value) { + bitField0_ |= 0x00000002; + replaceRepeatedFields_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * When merging repeated fields, the default behavior is to append
+     * entries from the source repeated field to the destination repeated field.
+     * If you instead want to keep only the entries from the source repeated
+     * field, set this flag to true.
+     * If you want to replace a repeated field within a message field on the
+     * destination message, you must set both replace_repeated_fields and
+     * replace_message_fields to true, otherwise the repeated fields will be
+     * appended.
+     * 
+ * + * optional bool replace_repeated_fields = 2; + * + * @return This builder for chaining. + */ + public Builder clearReplaceRepeatedFields() { + bitField0_ = (bitField0_ & ~0x00000002); + replaceRepeatedFields_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.MergeFieldsOptions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.MergeFieldsOptions) + private static final com.google.cloud.contentwarehouse.v1.MergeFieldsOptions DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.MergeFieldsOptions(); + } + + public static com.google.cloud.contentwarehouse.v1.MergeFieldsOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MergeFieldsOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.MergeFieldsOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/MergeFieldsOptionsOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/MergeFieldsOptionsOrBuilder.java new file mode 100644 index 000000000000..c59088ca5192 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/MergeFieldsOptionsOrBuilder.java @@ -0,0 +1,99 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/common.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface MergeFieldsOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.MergeFieldsOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * When merging message fields, the default behavior is to merge
+   * the content of two message fields together. If you instead want to use
+   * the field from the source message to replace the corresponding field in
+   * the destination message, set this flag to true. When this flag is set,
+   * specified submessage fields that are missing in source will be cleared in
+   * destination.
+   * 
+ * + * optional bool replace_message_fields = 1; + * + * @return Whether the replaceMessageFields field is set. + */ + boolean hasReplaceMessageFields(); + /** + * + * + *
+   * When merging message fields, the default behavior is to merge
+   * the content of two message fields together. If you instead want to use
+   * the field from the source message to replace the corresponding field in
+   * the destination message, set this flag to true. When this flag is set,
+   * specified submessage fields that are missing in source will be cleared in
+   * destination.
+   * 
+ * + * optional bool replace_message_fields = 1; + * + * @return The replaceMessageFields. + */ + boolean getReplaceMessageFields(); + + /** + * + * + *
+   * When merging repeated fields, the default behavior is to append
+   * entries from the source repeated field to the destination repeated field.
+   * If you instead want to keep only the entries from the source repeated
+   * field, set this flag to true.
+   * If you want to replace a repeated field within a message field on the
+   * destination message, you must set both replace_repeated_fields and
+   * replace_message_fields to true, otherwise the repeated fields will be
+   * appended.
+   * 
+ * + * optional bool replace_repeated_fields = 2; + * + * @return Whether the replaceRepeatedFields field is set. + */ + boolean hasReplaceRepeatedFields(); + /** + * + * + *
+   * When merging repeated fields, the default behavior is to append
+   * entries from the source repeated field to the destination repeated field.
+   * If you instead want to keep only the entries from the source repeated
+   * field, set this flag to true.
+   * If you want to replace a repeated field within a message field on the
+   * destination message, you must set both replace_repeated_fields and
+   * replace_message_fields to true, otherwise the repeated fields will be
+   * appended.
+   * 
+ * + * optional bool replace_repeated_fields = 2; + * + * @return The replaceRepeatedFields. + */ + boolean getReplaceRepeatedFields(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/Property.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/Property.java new file mode 100644 index 000000000000..872e08770564 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/Property.java @@ -0,0 +1,3116 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Property of a document.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.Property} + */ +public final class Property extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.Property) + PropertyOrBuilder { + private static final long serialVersionUID = 0L; + // Use Property.newBuilder() to construct. + private Property(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Property() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Property(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_Property_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_Property_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.Property.class, + com.google.cloud.contentwarehouse.v1.Property.Builder.class); + } + + private int valuesCase_ = 0; + private java.lang.Object values_; + + public enum ValuesCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + INTEGER_VALUES(2), + FLOAT_VALUES(3), + TEXT_VALUES(4), + ENUM_VALUES(5), + PROPERTY_VALUES(6), + DATE_TIME_VALUES(7), + MAP_PROPERTY(8), + TIMESTAMP_VALUES(9), + VALUES_NOT_SET(0); + private final int value; + + private ValuesCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ValuesCase valueOf(int value) { + return forNumber(value); + } + + public static ValuesCase forNumber(int value) { + switch (value) { + case 2: + return INTEGER_VALUES; + case 3: + return FLOAT_VALUES; + case 4: + return TEXT_VALUES; + case 5: + return ENUM_VALUES; + case 6: + return PROPERTY_VALUES; + case 7: + return DATE_TIME_VALUES; + case 8: + return MAP_PROPERTY; + case 9: + return TIMESTAMP_VALUES; + case 0: + return VALUES_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ValuesCase getValuesCase() { + return ValuesCase.forNumber(valuesCase_); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Must match the name of a PropertyDefinition in the DocumentSchema.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Must match the name of a PropertyDefinition in the DocumentSchema.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INTEGER_VALUES_FIELD_NUMBER = 2; + /** + * + * + *
+   * Integer property values.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.IntegerArray integer_values = 2; + * + * @return Whether the integerValues field is set. + */ + @java.lang.Override + public boolean hasIntegerValues() { + return valuesCase_ == 2; + } + /** + * + * + *
+   * Integer property values.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.IntegerArray integer_values = 2; + * + * @return The integerValues. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.IntegerArray getIntegerValues() { + if (valuesCase_ == 2) { + return (com.google.cloud.contentwarehouse.v1.IntegerArray) values_; + } + return com.google.cloud.contentwarehouse.v1.IntegerArray.getDefaultInstance(); + } + /** + * + * + *
+   * Integer property values.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.IntegerArray integer_values = 2; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.IntegerArrayOrBuilder getIntegerValuesOrBuilder() { + if (valuesCase_ == 2) { + return (com.google.cloud.contentwarehouse.v1.IntegerArray) values_; + } + return com.google.cloud.contentwarehouse.v1.IntegerArray.getDefaultInstance(); + } + + public static final int FLOAT_VALUES_FIELD_NUMBER = 3; + /** + * + * + *
+   * Float property values.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.FloatArray float_values = 3; + * + * @return Whether the floatValues field is set. + */ + @java.lang.Override + public boolean hasFloatValues() { + return valuesCase_ == 3; + } + /** + * + * + *
+   * Float property values.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.FloatArray float_values = 3; + * + * @return The floatValues. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.FloatArray getFloatValues() { + if (valuesCase_ == 3) { + return (com.google.cloud.contentwarehouse.v1.FloatArray) values_; + } + return com.google.cloud.contentwarehouse.v1.FloatArray.getDefaultInstance(); + } + /** + * + * + *
+   * Float property values.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.FloatArray float_values = 3; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.FloatArrayOrBuilder getFloatValuesOrBuilder() { + if (valuesCase_ == 3) { + return (com.google.cloud.contentwarehouse.v1.FloatArray) values_; + } + return com.google.cloud.contentwarehouse.v1.FloatArray.getDefaultInstance(); + } + + public static final int TEXT_VALUES_FIELD_NUMBER = 4; + /** + * + * + *
+   * String/text property values.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.TextArray text_values = 4; + * + * @return Whether the textValues field is set. + */ + @java.lang.Override + public boolean hasTextValues() { + return valuesCase_ == 4; + } + /** + * + * + *
+   * String/text property values.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.TextArray text_values = 4; + * + * @return The textValues. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.TextArray getTextValues() { + if (valuesCase_ == 4) { + return (com.google.cloud.contentwarehouse.v1.TextArray) values_; + } + return com.google.cloud.contentwarehouse.v1.TextArray.getDefaultInstance(); + } + /** + * + * + *
+   * String/text property values.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.TextArray text_values = 4; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.TextArrayOrBuilder getTextValuesOrBuilder() { + if (valuesCase_ == 4) { + return (com.google.cloud.contentwarehouse.v1.TextArray) values_; + } + return com.google.cloud.contentwarehouse.v1.TextArray.getDefaultInstance(); + } + + public static final int ENUM_VALUES_FIELD_NUMBER = 5; + /** + * + * + *
+   * Enum property values.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.EnumArray enum_values = 5; + * + * @return Whether the enumValues field is set. + */ + @java.lang.Override + public boolean hasEnumValues() { + return valuesCase_ == 5; + } + /** + * + * + *
+   * Enum property values.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.EnumArray enum_values = 5; + * + * @return The enumValues. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.EnumArray getEnumValues() { + if (valuesCase_ == 5) { + return (com.google.cloud.contentwarehouse.v1.EnumArray) values_; + } + return com.google.cloud.contentwarehouse.v1.EnumArray.getDefaultInstance(); + } + /** + * + * + *
+   * Enum property values.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.EnumArray enum_values = 5; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.EnumArrayOrBuilder getEnumValuesOrBuilder() { + if (valuesCase_ == 5) { + return (com.google.cloud.contentwarehouse.v1.EnumArray) values_; + } + return com.google.cloud.contentwarehouse.v1.EnumArray.getDefaultInstance(); + } + + public static final int PROPERTY_VALUES_FIELD_NUMBER = 6; + /** + * + * + *
+   * Nested structured data property values.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.PropertyArray property_values = 6; + * + * @return Whether the propertyValues field is set. + */ + @java.lang.Override + public boolean hasPropertyValues() { + return valuesCase_ == 6; + } + /** + * + * + *
+   * Nested structured data property values.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.PropertyArray property_values = 6; + * + * @return The propertyValues. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.PropertyArray getPropertyValues() { + if (valuesCase_ == 6) { + return (com.google.cloud.contentwarehouse.v1.PropertyArray) values_; + } + return com.google.cloud.contentwarehouse.v1.PropertyArray.getDefaultInstance(); + } + /** + * + * + *
+   * Nested structured data property values.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.PropertyArray property_values = 6; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.PropertyArrayOrBuilder getPropertyValuesOrBuilder() { + if (valuesCase_ == 6) { + return (com.google.cloud.contentwarehouse.v1.PropertyArray) values_; + } + return com.google.cloud.contentwarehouse.v1.PropertyArray.getDefaultInstance(); + } + + public static final int DATE_TIME_VALUES_FIELD_NUMBER = 7; + /** + * + * + *
+   * Date time property values.
+   * It is not supported by CMEK compliant deployment.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.DateTimeArray date_time_values = 7; + * + * @return Whether the dateTimeValues field is set. + */ + @java.lang.Override + public boolean hasDateTimeValues() { + return valuesCase_ == 7; + } + /** + * + * + *
+   * Date time property values.
+   * It is not supported by CMEK compliant deployment.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.DateTimeArray date_time_values = 7; + * + * @return The dateTimeValues. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DateTimeArray getDateTimeValues() { + if (valuesCase_ == 7) { + return (com.google.cloud.contentwarehouse.v1.DateTimeArray) values_; + } + return com.google.cloud.contentwarehouse.v1.DateTimeArray.getDefaultInstance(); + } + /** + * + * + *
+   * Date time property values.
+   * It is not supported by CMEK compliant deployment.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.DateTimeArray date_time_values = 7; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DateTimeArrayOrBuilder getDateTimeValuesOrBuilder() { + if (valuesCase_ == 7) { + return (com.google.cloud.contentwarehouse.v1.DateTimeArray) values_; + } + return com.google.cloud.contentwarehouse.v1.DateTimeArray.getDefaultInstance(); + } + + public static final int MAP_PROPERTY_FIELD_NUMBER = 8; + /** + * + * + *
+   * Map property values.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.MapProperty map_property = 8; + * + * @return Whether the mapProperty field is set. + */ + @java.lang.Override + public boolean hasMapProperty() { + return valuesCase_ == 8; + } + /** + * + * + *
+   * Map property values.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.MapProperty map_property = 8; + * + * @return The mapProperty. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.MapProperty getMapProperty() { + if (valuesCase_ == 8) { + return (com.google.cloud.contentwarehouse.v1.MapProperty) values_; + } + return com.google.cloud.contentwarehouse.v1.MapProperty.getDefaultInstance(); + } + /** + * + * + *
+   * Map property values.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.MapProperty map_property = 8; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.MapPropertyOrBuilder getMapPropertyOrBuilder() { + if (valuesCase_ == 8) { + return (com.google.cloud.contentwarehouse.v1.MapProperty) values_; + } + return com.google.cloud.contentwarehouse.v1.MapProperty.getDefaultInstance(); + } + + public static final int TIMESTAMP_VALUES_FIELD_NUMBER = 9; + /** + * + * + *
+   * Timestamp property values.
+   * It is not supported by CMEK compliant deployment.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.TimestampArray timestamp_values = 9; + * + * @return Whether the timestampValues field is set. + */ + @java.lang.Override + public boolean hasTimestampValues() { + return valuesCase_ == 9; + } + /** + * + * + *
+   * Timestamp property values.
+   * It is not supported by CMEK compliant deployment.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.TimestampArray timestamp_values = 9; + * + * @return The timestampValues. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.TimestampArray getTimestampValues() { + if (valuesCase_ == 9) { + return (com.google.cloud.contentwarehouse.v1.TimestampArray) values_; + } + return com.google.cloud.contentwarehouse.v1.TimestampArray.getDefaultInstance(); + } + /** + * + * + *
+   * Timestamp property values.
+   * It is not supported by CMEK compliant deployment.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.TimestampArray timestamp_values = 9; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.TimestampArrayOrBuilder + getTimestampValuesOrBuilder() { + if (valuesCase_ == 9) { + return (com.google.cloud.contentwarehouse.v1.TimestampArray) values_; + } + return com.google.cloud.contentwarehouse.v1.TimestampArray.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (valuesCase_ == 2) { + output.writeMessage(2, (com.google.cloud.contentwarehouse.v1.IntegerArray) values_); + } + if (valuesCase_ == 3) { + output.writeMessage(3, (com.google.cloud.contentwarehouse.v1.FloatArray) values_); + } + if (valuesCase_ == 4) { + output.writeMessage(4, (com.google.cloud.contentwarehouse.v1.TextArray) values_); + } + if (valuesCase_ == 5) { + output.writeMessage(5, (com.google.cloud.contentwarehouse.v1.EnumArray) values_); + } + if (valuesCase_ == 6) { + output.writeMessage(6, (com.google.cloud.contentwarehouse.v1.PropertyArray) values_); + } + if (valuesCase_ == 7) { + output.writeMessage(7, (com.google.cloud.contentwarehouse.v1.DateTimeArray) values_); + } + if (valuesCase_ == 8) { + output.writeMessage(8, (com.google.cloud.contentwarehouse.v1.MapProperty) values_); + } + if (valuesCase_ == 9) { + output.writeMessage(9, (com.google.cloud.contentwarehouse.v1.TimestampArray) values_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (valuesCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.cloud.contentwarehouse.v1.IntegerArray) values_); + } + if (valuesCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.cloud.contentwarehouse.v1.FloatArray) values_); + } + if (valuesCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.cloud.contentwarehouse.v1.TextArray) values_); + } + if (valuesCase_ == 5) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, (com.google.cloud.contentwarehouse.v1.EnumArray) values_); + } + if (valuesCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, (com.google.cloud.contentwarehouse.v1.PropertyArray) values_); + } + if (valuesCase_ == 7) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 7, (com.google.cloud.contentwarehouse.v1.DateTimeArray) values_); + } + if (valuesCase_ == 8) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 8, (com.google.cloud.contentwarehouse.v1.MapProperty) values_); + } + if (valuesCase_ == 9) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 9, (com.google.cloud.contentwarehouse.v1.TimestampArray) values_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.Property)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.Property other = + (com.google.cloud.contentwarehouse.v1.Property) obj; + + if (!getName().equals(other.getName())) return false; + if (!getValuesCase().equals(other.getValuesCase())) return false; + switch (valuesCase_) { + case 2: + if (!getIntegerValues().equals(other.getIntegerValues())) return false; + break; + case 3: + if (!getFloatValues().equals(other.getFloatValues())) return false; + break; + case 4: + if (!getTextValues().equals(other.getTextValues())) return false; + break; + case 5: + if (!getEnumValues().equals(other.getEnumValues())) return false; + break; + case 6: + if (!getPropertyValues().equals(other.getPropertyValues())) return false; + break; + case 7: + if (!getDateTimeValues().equals(other.getDateTimeValues())) return false; + break; + case 8: + if (!getMapProperty().equals(other.getMapProperty())) return false; + break; + case 9: + if (!getTimestampValues().equals(other.getTimestampValues())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + switch (valuesCase_) { + case 2: + hash = (37 * hash) + INTEGER_VALUES_FIELD_NUMBER; + hash = (53 * hash) + getIntegerValues().hashCode(); + break; + case 3: + hash = (37 * hash) + FLOAT_VALUES_FIELD_NUMBER; + hash = (53 * hash) + getFloatValues().hashCode(); + break; + case 4: + hash = (37 * hash) + TEXT_VALUES_FIELD_NUMBER; + hash = (53 * hash) + getTextValues().hashCode(); + break; + case 5: + hash = (37 * hash) + ENUM_VALUES_FIELD_NUMBER; + hash = (53 * hash) + getEnumValues().hashCode(); + break; + case 6: + hash = (37 * hash) + PROPERTY_VALUES_FIELD_NUMBER; + hash = (53 * hash) + getPropertyValues().hashCode(); + break; + case 7: + hash = (37 * hash) + DATE_TIME_VALUES_FIELD_NUMBER; + hash = (53 * hash) + getDateTimeValues().hashCode(); + break; + case 8: + hash = (37 * hash) + MAP_PROPERTY_FIELD_NUMBER; + hash = (53 * hash) + getMapProperty().hashCode(); + break; + case 9: + hash = (37 * hash) + TIMESTAMP_VALUES_FIELD_NUMBER; + hash = (53 * hash) + getTimestampValues().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.Property parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.Property parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.Property parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.Property parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.Property parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.Property parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.Property parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.Property parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.Property parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.Property parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.Property parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.Property parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.contentwarehouse.v1.Property prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Property of a document.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.Property} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.Property) + com.google.cloud.contentwarehouse.v1.PropertyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_Property_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_Property_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.Property.class, + com.google.cloud.contentwarehouse.v1.Property.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.Property.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (integerValuesBuilder_ != null) { + integerValuesBuilder_.clear(); + } + if (floatValuesBuilder_ != null) { + floatValuesBuilder_.clear(); + } + if (textValuesBuilder_ != null) { + textValuesBuilder_.clear(); + } + if (enumValuesBuilder_ != null) { + enumValuesBuilder_.clear(); + } + if (propertyValuesBuilder_ != null) { + propertyValuesBuilder_.clear(); + } + if (dateTimeValuesBuilder_ != null) { + dateTimeValuesBuilder_.clear(); + } + if (mapPropertyBuilder_ != null) { + mapPropertyBuilder_.clear(); + } + if (timestampValuesBuilder_ != null) { + timestampValuesBuilder_.clear(); + } + valuesCase_ = 0; + values_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_Property_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.Property getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.Property.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.Property build() { + com.google.cloud.contentwarehouse.v1.Property result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.Property buildPartial() { + com.google.cloud.contentwarehouse.v1.Property result = + new com.google.cloud.contentwarehouse.v1.Property(this); + result.name_ = name_; + if (valuesCase_ == 2) { + if (integerValuesBuilder_ == null) { + result.values_ = values_; + } else { + result.values_ = integerValuesBuilder_.build(); + } + } + if (valuesCase_ == 3) { + if (floatValuesBuilder_ == null) { + result.values_ = values_; + } else { + result.values_ = floatValuesBuilder_.build(); + } + } + if (valuesCase_ == 4) { + if (textValuesBuilder_ == null) { + result.values_ = values_; + } else { + result.values_ = textValuesBuilder_.build(); + } + } + if (valuesCase_ == 5) { + if (enumValuesBuilder_ == null) { + result.values_ = values_; + } else { + result.values_ = enumValuesBuilder_.build(); + } + } + if (valuesCase_ == 6) { + if (propertyValuesBuilder_ == null) { + result.values_ = values_; + } else { + result.values_ = propertyValuesBuilder_.build(); + } + } + if (valuesCase_ == 7) { + if (dateTimeValuesBuilder_ == null) { + result.values_ = values_; + } else { + result.values_ = dateTimeValuesBuilder_.build(); + } + } + if (valuesCase_ == 8) { + if (mapPropertyBuilder_ == null) { + result.values_ = values_; + } else { + result.values_ = mapPropertyBuilder_.build(); + } + } + if (valuesCase_ == 9) { + if (timestampValuesBuilder_ == null) { + result.values_ = values_; + } else { + result.values_ = timestampValuesBuilder_.build(); + } + } + result.valuesCase_ = valuesCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.Property) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.Property) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.Property other) { + if (other == com.google.cloud.contentwarehouse.v1.Property.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + switch (other.getValuesCase()) { + case INTEGER_VALUES: + { + mergeIntegerValues(other.getIntegerValues()); + break; + } + case FLOAT_VALUES: + { + mergeFloatValues(other.getFloatValues()); + break; + } + case TEXT_VALUES: + { + mergeTextValues(other.getTextValues()); + break; + } + case ENUM_VALUES: + { + mergeEnumValues(other.getEnumValues()); + break; + } + case PROPERTY_VALUES: + { + mergePropertyValues(other.getPropertyValues()); + break; + } + case DATE_TIME_VALUES: + { + mergeDateTimeValues(other.getDateTimeValues()); + break; + } + case MAP_PROPERTY: + { + mergeMapProperty(other.getMapProperty()); + break; + } + case TIMESTAMP_VALUES: + { + mergeTimestampValues(other.getTimestampValues()); + break; + } + case VALUES_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + input.readMessage(getIntegerValuesFieldBuilder().getBuilder(), extensionRegistry); + valuesCase_ = 2; + break; + } // case 18 + case 26: + { + input.readMessage(getFloatValuesFieldBuilder().getBuilder(), extensionRegistry); + valuesCase_ = 3; + break; + } // case 26 + case 34: + { + input.readMessage(getTextValuesFieldBuilder().getBuilder(), extensionRegistry); + valuesCase_ = 4; + break; + } // case 34 + case 42: + { + input.readMessage(getEnumValuesFieldBuilder().getBuilder(), extensionRegistry); + valuesCase_ = 5; + break; + } // case 42 + case 50: + { + input.readMessage(getPropertyValuesFieldBuilder().getBuilder(), extensionRegistry); + valuesCase_ = 6; + break; + } // case 50 + case 58: + { + input.readMessage(getDateTimeValuesFieldBuilder().getBuilder(), extensionRegistry); + valuesCase_ = 7; + break; + } // case 58 + case 66: + { + input.readMessage(getMapPropertyFieldBuilder().getBuilder(), extensionRegistry); + valuesCase_ = 8; + break; + } // case 66 + case 74: + { + input.readMessage(getTimestampValuesFieldBuilder().getBuilder(), extensionRegistry); + valuesCase_ = 9; + break; + } // case 74 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int valuesCase_ = 0; + private java.lang.Object values_; + + public ValuesCase getValuesCase() { + return ValuesCase.forNumber(valuesCase_); + } + + public Builder clearValues() { + valuesCase_ = 0; + values_ = null; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Must match the name of a PropertyDefinition in the DocumentSchema.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Must match the name of a PropertyDefinition in the DocumentSchema.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Must match the name of a PropertyDefinition in the DocumentSchema.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Must match the name of a PropertyDefinition in the DocumentSchema.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Must match the name of a PropertyDefinition in the DocumentSchema.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.IntegerArray, + com.google.cloud.contentwarehouse.v1.IntegerArray.Builder, + com.google.cloud.contentwarehouse.v1.IntegerArrayOrBuilder> + integerValuesBuilder_; + /** + * + * + *
+     * Integer property values.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.IntegerArray integer_values = 2; + * + * @return Whether the integerValues field is set. + */ + @java.lang.Override + public boolean hasIntegerValues() { + return valuesCase_ == 2; + } + /** + * + * + *
+     * Integer property values.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.IntegerArray integer_values = 2; + * + * @return The integerValues. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.IntegerArray getIntegerValues() { + if (integerValuesBuilder_ == null) { + if (valuesCase_ == 2) { + return (com.google.cloud.contentwarehouse.v1.IntegerArray) values_; + } + return com.google.cloud.contentwarehouse.v1.IntegerArray.getDefaultInstance(); + } else { + if (valuesCase_ == 2) { + return integerValuesBuilder_.getMessage(); + } + return com.google.cloud.contentwarehouse.v1.IntegerArray.getDefaultInstance(); + } + } + /** + * + * + *
+     * Integer property values.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.IntegerArray integer_values = 2; + */ + public Builder setIntegerValues(com.google.cloud.contentwarehouse.v1.IntegerArray value) { + if (integerValuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + values_ = value; + onChanged(); + } else { + integerValuesBuilder_.setMessage(value); + } + valuesCase_ = 2; + return this; + } + /** + * + * + *
+     * Integer property values.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.IntegerArray integer_values = 2; + */ + public Builder setIntegerValues( + com.google.cloud.contentwarehouse.v1.IntegerArray.Builder builderForValue) { + if (integerValuesBuilder_ == null) { + values_ = builderForValue.build(); + onChanged(); + } else { + integerValuesBuilder_.setMessage(builderForValue.build()); + } + valuesCase_ = 2; + return this; + } + /** + * + * + *
+     * Integer property values.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.IntegerArray integer_values = 2; + */ + public Builder mergeIntegerValues(com.google.cloud.contentwarehouse.v1.IntegerArray value) { + if (integerValuesBuilder_ == null) { + if (valuesCase_ == 2 + && values_ != com.google.cloud.contentwarehouse.v1.IntegerArray.getDefaultInstance()) { + values_ = + com.google.cloud.contentwarehouse.v1.IntegerArray.newBuilder( + (com.google.cloud.contentwarehouse.v1.IntegerArray) values_) + .mergeFrom(value) + .buildPartial(); + } else { + values_ = value; + } + onChanged(); + } else { + if (valuesCase_ == 2) { + integerValuesBuilder_.mergeFrom(value); + } else { + integerValuesBuilder_.setMessage(value); + } + } + valuesCase_ = 2; + return this; + } + /** + * + * + *
+     * Integer property values.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.IntegerArray integer_values = 2; + */ + public Builder clearIntegerValues() { + if (integerValuesBuilder_ == null) { + if (valuesCase_ == 2) { + valuesCase_ = 0; + values_ = null; + onChanged(); + } + } else { + if (valuesCase_ == 2) { + valuesCase_ = 0; + values_ = null; + } + integerValuesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Integer property values.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.IntegerArray integer_values = 2; + */ + public com.google.cloud.contentwarehouse.v1.IntegerArray.Builder getIntegerValuesBuilder() { + return getIntegerValuesFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Integer property values.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.IntegerArray integer_values = 2; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.IntegerArrayOrBuilder getIntegerValuesOrBuilder() { + if ((valuesCase_ == 2) && (integerValuesBuilder_ != null)) { + return integerValuesBuilder_.getMessageOrBuilder(); + } else { + if (valuesCase_ == 2) { + return (com.google.cloud.contentwarehouse.v1.IntegerArray) values_; + } + return com.google.cloud.contentwarehouse.v1.IntegerArray.getDefaultInstance(); + } + } + /** + * + * + *
+     * Integer property values.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.IntegerArray integer_values = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.IntegerArray, + com.google.cloud.contentwarehouse.v1.IntegerArray.Builder, + com.google.cloud.contentwarehouse.v1.IntegerArrayOrBuilder> + getIntegerValuesFieldBuilder() { + if (integerValuesBuilder_ == null) { + if (!(valuesCase_ == 2)) { + values_ = com.google.cloud.contentwarehouse.v1.IntegerArray.getDefaultInstance(); + } + integerValuesBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.IntegerArray, + com.google.cloud.contentwarehouse.v1.IntegerArray.Builder, + com.google.cloud.contentwarehouse.v1.IntegerArrayOrBuilder>( + (com.google.cloud.contentwarehouse.v1.IntegerArray) values_, + getParentForChildren(), + isClean()); + values_ = null; + } + valuesCase_ = 2; + onChanged(); + ; + return integerValuesBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.FloatArray, + com.google.cloud.contentwarehouse.v1.FloatArray.Builder, + com.google.cloud.contentwarehouse.v1.FloatArrayOrBuilder> + floatValuesBuilder_; + /** + * + * + *
+     * Float property values.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.FloatArray float_values = 3; + * + * @return Whether the floatValues field is set. + */ + @java.lang.Override + public boolean hasFloatValues() { + return valuesCase_ == 3; + } + /** + * + * + *
+     * Float property values.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.FloatArray float_values = 3; + * + * @return The floatValues. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.FloatArray getFloatValues() { + if (floatValuesBuilder_ == null) { + if (valuesCase_ == 3) { + return (com.google.cloud.contentwarehouse.v1.FloatArray) values_; + } + return com.google.cloud.contentwarehouse.v1.FloatArray.getDefaultInstance(); + } else { + if (valuesCase_ == 3) { + return floatValuesBuilder_.getMessage(); + } + return com.google.cloud.contentwarehouse.v1.FloatArray.getDefaultInstance(); + } + } + /** + * + * + *
+     * Float property values.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.FloatArray float_values = 3; + */ + public Builder setFloatValues(com.google.cloud.contentwarehouse.v1.FloatArray value) { + if (floatValuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + values_ = value; + onChanged(); + } else { + floatValuesBuilder_.setMessage(value); + } + valuesCase_ = 3; + return this; + } + /** + * + * + *
+     * Float property values.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.FloatArray float_values = 3; + */ + public Builder setFloatValues( + com.google.cloud.contentwarehouse.v1.FloatArray.Builder builderForValue) { + if (floatValuesBuilder_ == null) { + values_ = builderForValue.build(); + onChanged(); + } else { + floatValuesBuilder_.setMessage(builderForValue.build()); + } + valuesCase_ = 3; + return this; + } + /** + * + * + *
+     * Float property values.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.FloatArray float_values = 3; + */ + public Builder mergeFloatValues(com.google.cloud.contentwarehouse.v1.FloatArray value) { + if (floatValuesBuilder_ == null) { + if (valuesCase_ == 3 + && values_ != com.google.cloud.contentwarehouse.v1.FloatArray.getDefaultInstance()) { + values_ = + com.google.cloud.contentwarehouse.v1.FloatArray.newBuilder( + (com.google.cloud.contentwarehouse.v1.FloatArray) values_) + .mergeFrom(value) + .buildPartial(); + } else { + values_ = value; + } + onChanged(); + } else { + if (valuesCase_ == 3) { + floatValuesBuilder_.mergeFrom(value); + } else { + floatValuesBuilder_.setMessage(value); + } + } + valuesCase_ = 3; + return this; + } + /** + * + * + *
+     * Float property values.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.FloatArray float_values = 3; + */ + public Builder clearFloatValues() { + if (floatValuesBuilder_ == null) { + if (valuesCase_ == 3) { + valuesCase_ = 0; + values_ = null; + onChanged(); + } + } else { + if (valuesCase_ == 3) { + valuesCase_ = 0; + values_ = null; + } + floatValuesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Float property values.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.FloatArray float_values = 3; + */ + public com.google.cloud.contentwarehouse.v1.FloatArray.Builder getFloatValuesBuilder() { + return getFloatValuesFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Float property values.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.FloatArray float_values = 3; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.FloatArrayOrBuilder getFloatValuesOrBuilder() { + if ((valuesCase_ == 3) && (floatValuesBuilder_ != null)) { + return floatValuesBuilder_.getMessageOrBuilder(); + } else { + if (valuesCase_ == 3) { + return (com.google.cloud.contentwarehouse.v1.FloatArray) values_; + } + return com.google.cloud.contentwarehouse.v1.FloatArray.getDefaultInstance(); + } + } + /** + * + * + *
+     * Float property values.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.FloatArray float_values = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.FloatArray, + com.google.cloud.contentwarehouse.v1.FloatArray.Builder, + com.google.cloud.contentwarehouse.v1.FloatArrayOrBuilder> + getFloatValuesFieldBuilder() { + if (floatValuesBuilder_ == null) { + if (!(valuesCase_ == 3)) { + values_ = com.google.cloud.contentwarehouse.v1.FloatArray.getDefaultInstance(); + } + floatValuesBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.FloatArray, + com.google.cloud.contentwarehouse.v1.FloatArray.Builder, + com.google.cloud.contentwarehouse.v1.FloatArrayOrBuilder>( + (com.google.cloud.contentwarehouse.v1.FloatArray) values_, + getParentForChildren(), + isClean()); + values_ = null; + } + valuesCase_ = 3; + onChanged(); + ; + return floatValuesBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.TextArray, + com.google.cloud.contentwarehouse.v1.TextArray.Builder, + com.google.cloud.contentwarehouse.v1.TextArrayOrBuilder> + textValuesBuilder_; + /** + * + * + *
+     * String/text property values.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.TextArray text_values = 4; + * + * @return Whether the textValues field is set. + */ + @java.lang.Override + public boolean hasTextValues() { + return valuesCase_ == 4; + } + /** + * + * + *
+     * String/text property values.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.TextArray text_values = 4; + * + * @return The textValues. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.TextArray getTextValues() { + if (textValuesBuilder_ == null) { + if (valuesCase_ == 4) { + return (com.google.cloud.contentwarehouse.v1.TextArray) values_; + } + return com.google.cloud.contentwarehouse.v1.TextArray.getDefaultInstance(); + } else { + if (valuesCase_ == 4) { + return textValuesBuilder_.getMessage(); + } + return com.google.cloud.contentwarehouse.v1.TextArray.getDefaultInstance(); + } + } + /** + * + * + *
+     * String/text property values.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.TextArray text_values = 4; + */ + public Builder setTextValues(com.google.cloud.contentwarehouse.v1.TextArray value) { + if (textValuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + values_ = value; + onChanged(); + } else { + textValuesBuilder_.setMessage(value); + } + valuesCase_ = 4; + return this; + } + /** + * + * + *
+     * String/text property values.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.TextArray text_values = 4; + */ + public Builder setTextValues( + com.google.cloud.contentwarehouse.v1.TextArray.Builder builderForValue) { + if (textValuesBuilder_ == null) { + values_ = builderForValue.build(); + onChanged(); + } else { + textValuesBuilder_.setMessage(builderForValue.build()); + } + valuesCase_ = 4; + return this; + } + /** + * + * + *
+     * String/text property values.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.TextArray text_values = 4; + */ + public Builder mergeTextValues(com.google.cloud.contentwarehouse.v1.TextArray value) { + if (textValuesBuilder_ == null) { + if (valuesCase_ == 4 + && values_ != com.google.cloud.contentwarehouse.v1.TextArray.getDefaultInstance()) { + values_ = + com.google.cloud.contentwarehouse.v1.TextArray.newBuilder( + (com.google.cloud.contentwarehouse.v1.TextArray) values_) + .mergeFrom(value) + .buildPartial(); + } else { + values_ = value; + } + onChanged(); + } else { + if (valuesCase_ == 4) { + textValuesBuilder_.mergeFrom(value); + } else { + textValuesBuilder_.setMessage(value); + } + } + valuesCase_ = 4; + return this; + } + /** + * + * + *
+     * String/text property values.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.TextArray text_values = 4; + */ + public Builder clearTextValues() { + if (textValuesBuilder_ == null) { + if (valuesCase_ == 4) { + valuesCase_ = 0; + values_ = null; + onChanged(); + } + } else { + if (valuesCase_ == 4) { + valuesCase_ = 0; + values_ = null; + } + textValuesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * String/text property values.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.TextArray text_values = 4; + */ + public com.google.cloud.contentwarehouse.v1.TextArray.Builder getTextValuesBuilder() { + return getTextValuesFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * String/text property values.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.TextArray text_values = 4; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.TextArrayOrBuilder getTextValuesOrBuilder() { + if ((valuesCase_ == 4) && (textValuesBuilder_ != null)) { + return textValuesBuilder_.getMessageOrBuilder(); + } else { + if (valuesCase_ == 4) { + return (com.google.cloud.contentwarehouse.v1.TextArray) values_; + } + return com.google.cloud.contentwarehouse.v1.TextArray.getDefaultInstance(); + } + } + /** + * + * + *
+     * String/text property values.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.TextArray text_values = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.TextArray, + com.google.cloud.contentwarehouse.v1.TextArray.Builder, + com.google.cloud.contentwarehouse.v1.TextArrayOrBuilder> + getTextValuesFieldBuilder() { + if (textValuesBuilder_ == null) { + if (!(valuesCase_ == 4)) { + values_ = com.google.cloud.contentwarehouse.v1.TextArray.getDefaultInstance(); + } + textValuesBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.TextArray, + com.google.cloud.contentwarehouse.v1.TextArray.Builder, + com.google.cloud.contentwarehouse.v1.TextArrayOrBuilder>( + (com.google.cloud.contentwarehouse.v1.TextArray) values_, + getParentForChildren(), + isClean()); + values_ = null; + } + valuesCase_ = 4; + onChanged(); + ; + return textValuesBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.EnumArray, + com.google.cloud.contentwarehouse.v1.EnumArray.Builder, + com.google.cloud.contentwarehouse.v1.EnumArrayOrBuilder> + enumValuesBuilder_; + /** + * + * + *
+     * Enum property values.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.EnumArray enum_values = 5; + * + * @return Whether the enumValues field is set. + */ + @java.lang.Override + public boolean hasEnumValues() { + return valuesCase_ == 5; + } + /** + * + * + *
+     * Enum property values.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.EnumArray enum_values = 5; + * + * @return The enumValues. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.EnumArray getEnumValues() { + if (enumValuesBuilder_ == null) { + if (valuesCase_ == 5) { + return (com.google.cloud.contentwarehouse.v1.EnumArray) values_; + } + return com.google.cloud.contentwarehouse.v1.EnumArray.getDefaultInstance(); + } else { + if (valuesCase_ == 5) { + return enumValuesBuilder_.getMessage(); + } + return com.google.cloud.contentwarehouse.v1.EnumArray.getDefaultInstance(); + } + } + /** + * + * + *
+     * Enum property values.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.EnumArray enum_values = 5; + */ + public Builder setEnumValues(com.google.cloud.contentwarehouse.v1.EnumArray value) { + if (enumValuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + values_ = value; + onChanged(); + } else { + enumValuesBuilder_.setMessage(value); + } + valuesCase_ = 5; + return this; + } + /** + * + * + *
+     * Enum property values.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.EnumArray enum_values = 5; + */ + public Builder setEnumValues( + com.google.cloud.contentwarehouse.v1.EnumArray.Builder builderForValue) { + if (enumValuesBuilder_ == null) { + values_ = builderForValue.build(); + onChanged(); + } else { + enumValuesBuilder_.setMessage(builderForValue.build()); + } + valuesCase_ = 5; + return this; + } + /** + * + * + *
+     * Enum property values.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.EnumArray enum_values = 5; + */ + public Builder mergeEnumValues(com.google.cloud.contentwarehouse.v1.EnumArray value) { + if (enumValuesBuilder_ == null) { + if (valuesCase_ == 5 + && values_ != com.google.cloud.contentwarehouse.v1.EnumArray.getDefaultInstance()) { + values_ = + com.google.cloud.contentwarehouse.v1.EnumArray.newBuilder( + (com.google.cloud.contentwarehouse.v1.EnumArray) values_) + .mergeFrom(value) + .buildPartial(); + } else { + values_ = value; + } + onChanged(); + } else { + if (valuesCase_ == 5) { + enumValuesBuilder_.mergeFrom(value); + } else { + enumValuesBuilder_.setMessage(value); + } + } + valuesCase_ = 5; + return this; + } + /** + * + * + *
+     * Enum property values.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.EnumArray enum_values = 5; + */ + public Builder clearEnumValues() { + if (enumValuesBuilder_ == null) { + if (valuesCase_ == 5) { + valuesCase_ = 0; + values_ = null; + onChanged(); + } + } else { + if (valuesCase_ == 5) { + valuesCase_ = 0; + values_ = null; + } + enumValuesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Enum property values.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.EnumArray enum_values = 5; + */ + public com.google.cloud.contentwarehouse.v1.EnumArray.Builder getEnumValuesBuilder() { + return getEnumValuesFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Enum property values.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.EnumArray enum_values = 5; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.EnumArrayOrBuilder getEnumValuesOrBuilder() { + if ((valuesCase_ == 5) && (enumValuesBuilder_ != null)) { + return enumValuesBuilder_.getMessageOrBuilder(); + } else { + if (valuesCase_ == 5) { + return (com.google.cloud.contentwarehouse.v1.EnumArray) values_; + } + return com.google.cloud.contentwarehouse.v1.EnumArray.getDefaultInstance(); + } + } + /** + * + * + *
+     * Enum property values.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.EnumArray enum_values = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.EnumArray, + com.google.cloud.contentwarehouse.v1.EnumArray.Builder, + com.google.cloud.contentwarehouse.v1.EnumArrayOrBuilder> + getEnumValuesFieldBuilder() { + if (enumValuesBuilder_ == null) { + if (!(valuesCase_ == 5)) { + values_ = com.google.cloud.contentwarehouse.v1.EnumArray.getDefaultInstance(); + } + enumValuesBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.EnumArray, + com.google.cloud.contentwarehouse.v1.EnumArray.Builder, + com.google.cloud.contentwarehouse.v1.EnumArrayOrBuilder>( + (com.google.cloud.contentwarehouse.v1.EnumArray) values_, + getParentForChildren(), + isClean()); + values_ = null; + } + valuesCase_ = 5; + onChanged(); + ; + return enumValuesBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.PropertyArray, + com.google.cloud.contentwarehouse.v1.PropertyArray.Builder, + com.google.cloud.contentwarehouse.v1.PropertyArrayOrBuilder> + propertyValuesBuilder_; + /** + * + * + *
+     * Nested structured data property values.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.PropertyArray property_values = 6; + * + * @return Whether the propertyValues field is set. + */ + @java.lang.Override + public boolean hasPropertyValues() { + return valuesCase_ == 6; + } + /** + * + * + *
+     * Nested structured data property values.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.PropertyArray property_values = 6; + * + * @return The propertyValues. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.PropertyArray getPropertyValues() { + if (propertyValuesBuilder_ == null) { + if (valuesCase_ == 6) { + return (com.google.cloud.contentwarehouse.v1.PropertyArray) values_; + } + return com.google.cloud.contentwarehouse.v1.PropertyArray.getDefaultInstance(); + } else { + if (valuesCase_ == 6) { + return propertyValuesBuilder_.getMessage(); + } + return com.google.cloud.contentwarehouse.v1.PropertyArray.getDefaultInstance(); + } + } + /** + * + * + *
+     * Nested structured data property values.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.PropertyArray property_values = 6; + */ + public Builder setPropertyValues(com.google.cloud.contentwarehouse.v1.PropertyArray value) { + if (propertyValuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + values_ = value; + onChanged(); + } else { + propertyValuesBuilder_.setMessage(value); + } + valuesCase_ = 6; + return this; + } + /** + * + * + *
+     * Nested structured data property values.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.PropertyArray property_values = 6; + */ + public Builder setPropertyValues( + com.google.cloud.contentwarehouse.v1.PropertyArray.Builder builderForValue) { + if (propertyValuesBuilder_ == null) { + values_ = builderForValue.build(); + onChanged(); + } else { + propertyValuesBuilder_.setMessage(builderForValue.build()); + } + valuesCase_ = 6; + return this; + } + /** + * + * + *
+     * Nested structured data property values.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.PropertyArray property_values = 6; + */ + public Builder mergePropertyValues(com.google.cloud.contentwarehouse.v1.PropertyArray value) { + if (propertyValuesBuilder_ == null) { + if (valuesCase_ == 6 + && values_ != com.google.cloud.contentwarehouse.v1.PropertyArray.getDefaultInstance()) { + values_ = + com.google.cloud.contentwarehouse.v1.PropertyArray.newBuilder( + (com.google.cloud.contentwarehouse.v1.PropertyArray) values_) + .mergeFrom(value) + .buildPartial(); + } else { + values_ = value; + } + onChanged(); + } else { + if (valuesCase_ == 6) { + propertyValuesBuilder_.mergeFrom(value); + } else { + propertyValuesBuilder_.setMessage(value); + } + } + valuesCase_ = 6; + return this; + } + /** + * + * + *
+     * Nested structured data property values.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.PropertyArray property_values = 6; + */ + public Builder clearPropertyValues() { + if (propertyValuesBuilder_ == null) { + if (valuesCase_ == 6) { + valuesCase_ = 0; + values_ = null; + onChanged(); + } + } else { + if (valuesCase_ == 6) { + valuesCase_ = 0; + values_ = null; + } + propertyValuesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Nested structured data property values.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.PropertyArray property_values = 6; + */ + public com.google.cloud.contentwarehouse.v1.PropertyArray.Builder getPropertyValuesBuilder() { + return getPropertyValuesFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Nested structured data property values.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.PropertyArray property_values = 6; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.PropertyArrayOrBuilder + getPropertyValuesOrBuilder() { + if ((valuesCase_ == 6) && (propertyValuesBuilder_ != null)) { + return propertyValuesBuilder_.getMessageOrBuilder(); + } else { + if (valuesCase_ == 6) { + return (com.google.cloud.contentwarehouse.v1.PropertyArray) values_; + } + return com.google.cloud.contentwarehouse.v1.PropertyArray.getDefaultInstance(); + } + } + /** + * + * + *
+     * Nested structured data property values.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.PropertyArray property_values = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.PropertyArray, + com.google.cloud.contentwarehouse.v1.PropertyArray.Builder, + com.google.cloud.contentwarehouse.v1.PropertyArrayOrBuilder> + getPropertyValuesFieldBuilder() { + if (propertyValuesBuilder_ == null) { + if (!(valuesCase_ == 6)) { + values_ = com.google.cloud.contentwarehouse.v1.PropertyArray.getDefaultInstance(); + } + propertyValuesBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.PropertyArray, + com.google.cloud.contentwarehouse.v1.PropertyArray.Builder, + com.google.cloud.contentwarehouse.v1.PropertyArrayOrBuilder>( + (com.google.cloud.contentwarehouse.v1.PropertyArray) values_, + getParentForChildren(), + isClean()); + values_ = null; + } + valuesCase_ = 6; + onChanged(); + ; + return propertyValuesBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.DateTimeArray, + com.google.cloud.contentwarehouse.v1.DateTimeArray.Builder, + com.google.cloud.contentwarehouse.v1.DateTimeArrayOrBuilder> + dateTimeValuesBuilder_; + /** + * + * + *
+     * Date time property values.
+     * It is not supported by CMEK compliant deployment.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DateTimeArray date_time_values = 7; + * + * @return Whether the dateTimeValues field is set. + */ + @java.lang.Override + public boolean hasDateTimeValues() { + return valuesCase_ == 7; + } + /** + * + * + *
+     * Date time property values.
+     * It is not supported by CMEK compliant deployment.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DateTimeArray date_time_values = 7; + * + * @return The dateTimeValues. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DateTimeArray getDateTimeValues() { + if (dateTimeValuesBuilder_ == null) { + if (valuesCase_ == 7) { + return (com.google.cloud.contentwarehouse.v1.DateTimeArray) values_; + } + return com.google.cloud.contentwarehouse.v1.DateTimeArray.getDefaultInstance(); + } else { + if (valuesCase_ == 7) { + return dateTimeValuesBuilder_.getMessage(); + } + return com.google.cloud.contentwarehouse.v1.DateTimeArray.getDefaultInstance(); + } + } + /** + * + * + *
+     * Date time property values.
+     * It is not supported by CMEK compliant deployment.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DateTimeArray date_time_values = 7; + */ + public Builder setDateTimeValues(com.google.cloud.contentwarehouse.v1.DateTimeArray value) { + if (dateTimeValuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + values_ = value; + onChanged(); + } else { + dateTimeValuesBuilder_.setMessage(value); + } + valuesCase_ = 7; + return this; + } + /** + * + * + *
+     * Date time property values.
+     * It is not supported by CMEK compliant deployment.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DateTimeArray date_time_values = 7; + */ + public Builder setDateTimeValues( + com.google.cloud.contentwarehouse.v1.DateTimeArray.Builder builderForValue) { + if (dateTimeValuesBuilder_ == null) { + values_ = builderForValue.build(); + onChanged(); + } else { + dateTimeValuesBuilder_.setMessage(builderForValue.build()); + } + valuesCase_ = 7; + return this; + } + /** + * + * + *
+     * Date time property values.
+     * It is not supported by CMEK compliant deployment.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DateTimeArray date_time_values = 7; + */ + public Builder mergeDateTimeValues(com.google.cloud.contentwarehouse.v1.DateTimeArray value) { + if (dateTimeValuesBuilder_ == null) { + if (valuesCase_ == 7 + && values_ != com.google.cloud.contentwarehouse.v1.DateTimeArray.getDefaultInstance()) { + values_ = + com.google.cloud.contentwarehouse.v1.DateTimeArray.newBuilder( + (com.google.cloud.contentwarehouse.v1.DateTimeArray) values_) + .mergeFrom(value) + .buildPartial(); + } else { + values_ = value; + } + onChanged(); + } else { + if (valuesCase_ == 7) { + dateTimeValuesBuilder_.mergeFrom(value); + } else { + dateTimeValuesBuilder_.setMessage(value); + } + } + valuesCase_ = 7; + return this; + } + /** + * + * + *
+     * Date time property values.
+     * It is not supported by CMEK compliant deployment.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DateTimeArray date_time_values = 7; + */ + public Builder clearDateTimeValues() { + if (dateTimeValuesBuilder_ == null) { + if (valuesCase_ == 7) { + valuesCase_ = 0; + values_ = null; + onChanged(); + } + } else { + if (valuesCase_ == 7) { + valuesCase_ = 0; + values_ = null; + } + dateTimeValuesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Date time property values.
+     * It is not supported by CMEK compliant deployment.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DateTimeArray date_time_values = 7; + */ + public com.google.cloud.contentwarehouse.v1.DateTimeArray.Builder getDateTimeValuesBuilder() { + return getDateTimeValuesFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Date time property values.
+     * It is not supported by CMEK compliant deployment.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DateTimeArray date_time_values = 7; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DateTimeArrayOrBuilder + getDateTimeValuesOrBuilder() { + if ((valuesCase_ == 7) && (dateTimeValuesBuilder_ != null)) { + return dateTimeValuesBuilder_.getMessageOrBuilder(); + } else { + if (valuesCase_ == 7) { + return (com.google.cloud.contentwarehouse.v1.DateTimeArray) values_; + } + return com.google.cloud.contentwarehouse.v1.DateTimeArray.getDefaultInstance(); + } + } + /** + * + * + *
+     * Date time property values.
+     * It is not supported by CMEK compliant deployment.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DateTimeArray date_time_values = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.DateTimeArray, + com.google.cloud.contentwarehouse.v1.DateTimeArray.Builder, + com.google.cloud.contentwarehouse.v1.DateTimeArrayOrBuilder> + getDateTimeValuesFieldBuilder() { + if (dateTimeValuesBuilder_ == null) { + if (!(valuesCase_ == 7)) { + values_ = com.google.cloud.contentwarehouse.v1.DateTimeArray.getDefaultInstance(); + } + dateTimeValuesBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.DateTimeArray, + com.google.cloud.contentwarehouse.v1.DateTimeArray.Builder, + com.google.cloud.contentwarehouse.v1.DateTimeArrayOrBuilder>( + (com.google.cloud.contentwarehouse.v1.DateTimeArray) values_, + getParentForChildren(), + isClean()); + values_ = null; + } + valuesCase_ = 7; + onChanged(); + ; + return dateTimeValuesBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.MapProperty, + com.google.cloud.contentwarehouse.v1.MapProperty.Builder, + com.google.cloud.contentwarehouse.v1.MapPropertyOrBuilder> + mapPropertyBuilder_; + /** + * + * + *
+     * Map property values.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.MapProperty map_property = 8; + * + * @return Whether the mapProperty field is set. + */ + @java.lang.Override + public boolean hasMapProperty() { + return valuesCase_ == 8; + } + /** + * + * + *
+     * Map property values.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.MapProperty map_property = 8; + * + * @return The mapProperty. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.MapProperty getMapProperty() { + if (mapPropertyBuilder_ == null) { + if (valuesCase_ == 8) { + return (com.google.cloud.contentwarehouse.v1.MapProperty) values_; + } + return com.google.cloud.contentwarehouse.v1.MapProperty.getDefaultInstance(); + } else { + if (valuesCase_ == 8) { + return mapPropertyBuilder_.getMessage(); + } + return com.google.cloud.contentwarehouse.v1.MapProperty.getDefaultInstance(); + } + } + /** + * + * + *
+     * Map property values.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.MapProperty map_property = 8; + */ + public Builder setMapProperty(com.google.cloud.contentwarehouse.v1.MapProperty value) { + if (mapPropertyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + values_ = value; + onChanged(); + } else { + mapPropertyBuilder_.setMessage(value); + } + valuesCase_ = 8; + return this; + } + /** + * + * + *
+     * Map property values.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.MapProperty map_property = 8; + */ + public Builder setMapProperty( + com.google.cloud.contentwarehouse.v1.MapProperty.Builder builderForValue) { + if (mapPropertyBuilder_ == null) { + values_ = builderForValue.build(); + onChanged(); + } else { + mapPropertyBuilder_.setMessage(builderForValue.build()); + } + valuesCase_ = 8; + return this; + } + /** + * + * + *
+     * Map property values.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.MapProperty map_property = 8; + */ + public Builder mergeMapProperty(com.google.cloud.contentwarehouse.v1.MapProperty value) { + if (mapPropertyBuilder_ == null) { + if (valuesCase_ == 8 + && values_ != com.google.cloud.contentwarehouse.v1.MapProperty.getDefaultInstance()) { + values_ = + com.google.cloud.contentwarehouse.v1.MapProperty.newBuilder( + (com.google.cloud.contentwarehouse.v1.MapProperty) values_) + .mergeFrom(value) + .buildPartial(); + } else { + values_ = value; + } + onChanged(); + } else { + if (valuesCase_ == 8) { + mapPropertyBuilder_.mergeFrom(value); + } else { + mapPropertyBuilder_.setMessage(value); + } + } + valuesCase_ = 8; + return this; + } + /** + * + * + *
+     * Map property values.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.MapProperty map_property = 8; + */ + public Builder clearMapProperty() { + if (mapPropertyBuilder_ == null) { + if (valuesCase_ == 8) { + valuesCase_ = 0; + values_ = null; + onChanged(); + } + } else { + if (valuesCase_ == 8) { + valuesCase_ = 0; + values_ = null; + } + mapPropertyBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Map property values.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.MapProperty map_property = 8; + */ + public com.google.cloud.contentwarehouse.v1.MapProperty.Builder getMapPropertyBuilder() { + return getMapPropertyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Map property values.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.MapProperty map_property = 8; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.MapPropertyOrBuilder getMapPropertyOrBuilder() { + if ((valuesCase_ == 8) && (mapPropertyBuilder_ != null)) { + return mapPropertyBuilder_.getMessageOrBuilder(); + } else { + if (valuesCase_ == 8) { + return (com.google.cloud.contentwarehouse.v1.MapProperty) values_; + } + return com.google.cloud.contentwarehouse.v1.MapProperty.getDefaultInstance(); + } + } + /** + * + * + *
+     * Map property values.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.MapProperty map_property = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.MapProperty, + com.google.cloud.contentwarehouse.v1.MapProperty.Builder, + com.google.cloud.contentwarehouse.v1.MapPropertyOrBuilder> + getMapPropertyFieldBuilder() { + if (mapPropertyBuilder_ == null) { + if (!(valuesCase_ == 8)) { + values_ = com.google.cloud.contentwarehouse.v1.MapProperty.getDefaultInstance(); + } + mapPropertyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.MapProperty, + com.google.cloud.contentwarehouse.v1.MapProperty.Builder, + com.google.cloud.contentwarehouse.v1.MapPropertyOrBuilder>( + (com.google.cloud.contentwarehouse.v1.MapProperty) values_, + getParentForChildren(), + isClean()); + values_ = null; + } + valuesCase_ = 8; + onChanged(); + ; + return mapPropertyBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.TimestampArray, + com.google.cloud.contentwarehouse.v1.TimestampArray.Builder, + com.google.cloud.contentwarehouse.v1.TimestampArrayOrBuilder> + timestampValuesBuilder_; + /** + * + * + *
+     * Timestamp property values.
+     * It is not supported by CMEK compliant deployment.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.TimestampArray timestamp_values = 9; + * + * @return Whether the timestampValues field is set. + */ + @java.lang.Override + public boolean hasTimestampValues() { + return valuesCase_ == 9; + } + /** + * + * + *
+     * Timestamp property values.
+     * It is not supported by CMEK compliant deployment.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.TimestampArray timestamp_values = 9; + * + * @return The timestampValues. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.TimestampArray getTimestampValues() { + if (timestampValuesBuilder_ == null) { + if (valuesCase_ == 9) { + return (com.google.cloud.contentwarehouse.v1.TimestampArray) values_; + } + return com.google.cloud.contentwarehouse.v1.TimestampArray.getDefaultInstance(); + } else { + if (valuesCase_ == 9) { + return timestampValuesBuilder_.getMessage(); + } + return com.google.cloud.contentwarehouse.v1.TimestampArray.getDefaultInstance(); + } + } + /** + * + * + *
+     * Timestamp property values.
+     * It is not supported by CMEK compliant deployment.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.TimestampArray timestamp_values = 9; + */ + public Builder setTimestampValues(com.google.cloud.contentwarehouse.v1.TimestampArray value) { + if (timestampValuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + values_ = value; + onChanged(); + } else { + timestampValuesBuilder_.setMessage(value); + } + valuesCase_ = 9; + return this; + } + /** + * + * + *
+     * Timestamp property values.
+     * It is not supported by CMEK compliant deployment.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.TimestampArray timestamp_values = 9; + */ + public Builder setTimestampValues( + com.google.cloud.contentwarehouse.v1.TimestampArray.Builder builderForValue) { + if (timestampValuesBuilder_ == null) { + values_ = builderForValue.build(); + onChanged(); + } else { + timestampValuesBuilder_.setMessage(builderForValue.build()); + } + valuesCase_ = 9; + return this; + } + /** + * + * + *
+     * Timestamp property values.
+     * It is not supported by CMEK compliant deployment.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.TimestampArray timestamp_values = 9; + */ + public Builder mergeTimestampValues(com.google.cloud.contentwarehouse.v1.TimestampArray value) { + if (timestampValuesBuilder_ == null) { + if (valuesCase_ == 9 + && values_ + != com.google.cloud.contentwarehouse.v1.TimestampArray.getDefaultInstance()) { + values_ = + com.google.cloud.contentwarehouse.v1.TimestampArray.newBuilder( + (com.google.cloud.contentwarehouse.v1.TimestampArray) values_) + .mergeFrom(value) + .buildPartial(); + } else { + values_ = value; + } + onChanged(); + } else { + if (valuesCase_ == 9) { + timestampValuesBuilder_.mergeFrom(value); + } else { + timestampValuesBuilder_.setMessage(value); + } + } + valuesCase_ = 9; + return this; + } + /** + * + * + *
+     * Timestamp property values.
+     * It is not supported by CMEK compliant deployment.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.TimestampArray timestamp_values = 9; + */ + public Builder clearTimestampValues() { + if (timestampValuesBuilder_ == null) { + if (valuesCase_ == 9) { + valuesCase_ = 0; + values_ = null; + onChanged(); + } + } else { + if (valuesCase_ == 9) { + valuesCase_ = 0; + values_ = null; + } + timestampValuesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Timestamp property values.
+     * It is not supported by CMEK compliant deployment.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.TimestampArray timestamp_values = 9; + */ + public com.google.cloud.contentwarehouse.v1.TimestampArray.Builder getTimestampValuesBuilder() { + return getTimestampValuesFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Timestamp property values.
+     * It is not supported by CMEK compliant deployment.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.TimestampArray timestamp_values = 9; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.TimestampArrayOrBuilder + getTimestampValuesOrBuilder() { + if ((valuesCase_ == 9) && (timestampValuesBuilder_ != null)) { + return timestampValuesBuilder_.getMessageOrBuilder(); + } else { + if (valuesCase_ == 9) { + return (com.google.cloud.contentwarehouse.v1.TimestampArray) values_; + } + return com.google.cloud.contentwarehouse.v1.TimestampArray.getDefaultInstance(); + } + } + /** + * + * + *
+     * Timestamp property values.
+     * It is not supported by CMEK compliant deployment.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.TimestampArray timestamp_values = 9; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.TimestampArray, + com.google.cloud.contentwarehouse.v1.TimestampArray.Builder, + com.google.cloud.contentwarehouse.v1.TimestampArrayOrBuilder> + getTimestampValuesFieldBuilder() { + if (timestampValuesBuilder_ == null) { + if (!(valuesCase_ == 9)) { + values_ = com.google.cloud.contentwarehouse.v1.TimestampArray.getDefaultInstance(); + } + timestampValuesBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.TimestampArray, + com.google.cloud.contentwarehouse.v1.TimestampArray.Builder, + com.google.cloud.contentwarehouse.v1.TimestampArrayOrBuilder>( + (com.google.cloud.contentwarehouse.v1.TimestampArray) values_, + getParentForChildren(), + isClean()); + values_ = null; + } + valuesCase_ = 9; + onChanged(); + ; + return timestampValuesBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.Property) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.Property) + private static final com.google.cloud.contentwarehouse.v1.Property DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.Property(); + } + + public static com.google.cloud.contentwarehouse.v1.Property getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Property parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.Property getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/PropertyArray.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/PropertyArray.java new file mode 100644 index 000000000000..2d3c68cde132 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/PropertyArray.java @@ -0,0 +1,929 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Property values.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.PropertyArray} + */ +public final class PropertyArray extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.PropertyArray) + PropertyArrayOrBuilder { + private static final long serialVersionUID = 0L; + // Use PropertyArray.newBuilder() to construct. + private PropertyArray(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PropertyArray() { + properties_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PropertyArray(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_PropertyArray_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_PropertyArray_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.PropertyArray.class, + com.google.cloud.contentwarehouse.v1.PropertyArray.Builder.class); + } + + public static final int PROPERTIES_FIELD_NUMBER = 1; + private java.util.List properties_; + /** + * + * + *
+   * List of property values.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Property properties = 1; + */ + @java.lang.Override + public java.util.List getPropertiesList() { + return properties_; + } + /** + * + * + *
+   * List of property values.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Property properties = 1; + */ + @java.lang.Override + public java.util.List + getPropertiesOrBuilderList() { + return properties_; + } + /** + * + * + *
+   * List of property values.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Property properties = 1; + */ + @java.lang.Override + public int getPropertiesCount() { + return properties_.size(); + } + /** + * + * + *
+   * List of property values.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Property properties = 1; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.Property getProperties(int index) { + return properties_.get(index); + } + /** + * + * + *
+   * List of property values.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Property properties = 1; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.PropertyOrBuilder getPropertiesOrBuilder(int index) { + return properties_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < properties_.size(); i++) { + output.writeMessage(1, properties_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < properties_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, properties_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.PropertyArray)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.PropertyArray other = + (com.google.cloud.contentwarehouse.v1.PropertyArray) obj; + + if (!getPropertiesList().equals(other.getPropertiesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getPropertiesCount() > 0) { + hash = (37 * hash) + PROPERTIES_FIELD_NUMBER; + hash = (53 * hash) + getPropertiesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.PropertyArray parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.PropertyArray parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.PropertyArray parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.PropertyArray parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.PropertyArray parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.PropertyArray parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.PropertyArray parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.PropertyArray parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.PropertyArray parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.PropertyArray parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.PropertyArray parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.PropertyArray parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.contentwarehouse.v1.PropertyArray prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Property values.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.PropertyArray} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.PropertyArray) + com.google.cloud.contentwarehouse.v1.PropertyArrayOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_PropertyArray_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_PropertyArray_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.PropertyArray.class, + com.google.cloud.contentwarehouse.v1.PropertyArray.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.PropertyArray.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (propertiesBuilder_ == null) { + properties_ = java.util.Collections.emptyList(); + } else { + properties_ = null; + propertiesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_PropertyArray_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.PropertyArray getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.PropertyArray.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.PropertyArray build() { + com.google.cloud.contentwarehouse.v1.PropertyArray result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.PropertyArray buildPartial() { + com.google.cloud.contentwarehouse.v1.PropertyArray result = + new com.google.cloud.contentwarehouse.v1.PropertyArray(this); + int from_bitField0_ = bitField0_; + if (propertiesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + properties_ = java.util.Collections.unmodifiableList(properties_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.properties_ = properties_; + } else { + result.properties_ = propertiesBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.PropertyArray) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.PropertyArray) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.PropertyArray other) { + if (other == com.google.cloud.contentwarehouse.v1.PropertyArray.getDefaultInstance()) + return this; + if (propertiesBuilder_ == null) { + if (!other.properties_.isEmpty()) { + if (properties_.isEmpty()) { + properties_ = other.properties_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePropertiesIsMutable(); + properties_.addAll(other.properties_); + } + onChanged(); + } + } else { + if (!other.properties_.isEmpty()) { + if (propertiesBuilder_.isEmpty()) { + propertiesBuilder_.dispose(); + propertiesBuilder_ = null; + properties_ = other.properties_; + bitField0_ = (bitField0_ & ~0x00000001); + propertiesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getPropertiesFieldBuilder() + : null; + } else { + propertiesBuilder_.addAllMessages(other.properties_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.contentwarehouse.v1.Property m = + input.readMessage( + com.google.cloud.contentwarehouse.v1.Property.parser(), extensionRegistry); + if (propertiesBuilder_ == null) { + ensurePropertiesIsMutable(); + properties_.add(m); + } else { + propertiesBuilder_.addMessage(m); + } + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List properties_ = + java.util.Collections.emptyList(); + + private void ensurePropertiesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + properties_ = + new java.util.ArrayList(properties_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.Property, + com.google.cloud.contentwarehouse.v1.Property.Builder, + com.google.cloud.contentwarehouse.v1.PropertyOrBuilder> + propertiesBuilder_; + + /** + * + * + *
+     * List of property values.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Property properties = 1; + */ + public java.util.List getPropertiesList() { + if (propertiesBuilder_ == null) { + return java.util.Collections.unmodifiableList(properties_); + } else { + return propertiesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * List of property values.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Property properties = 1; + */ + public int getPropertiesCount() { + if (propertiesBuilder_ == null) { + return properties_.size(); + } else { + return propertiesBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of property values.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Property properties = 1; + */ + public com.google.cloud.contentwarehouse.v1.Property getProperties(int index) { + if (propertiesBuilder_ == null) { + return properties_.get(index); + } else { + return propertiesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of property values.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Property properties = 1; + */ + public Builder setProperties(int index, com.google.cloud.contentwarehouse.v1.Property value) { + if (propertiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePropertiesIsMutable(); + properties_.set(index, value); + onChanged(); + } else { + propertiesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of property values.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Property properties = 1; + */ + public Builder setProperties( + int index, com.google.cloud.contentwarehouse.v1.Property.Builder builderForValue) { + if (propertiesBuilder_ == null) { + ensurePropertiesIsMutable(); + properties_.set(index, builderForValue.build()); + onChanged(); + } else { + propertiesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of property values.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Property properties = 1; + */ + public Builder addProperties(com.google.cloud.contentwarehouse.v1.Property value) { + if (propertiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePropertiesIsMutable(); + properties_.add(value); + onChanged(); + } else { + propertiesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * List of property values.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Property properties = 1; + */ + public Builder addProperties(int index, com.google.cloud.contentwarehouse.v1.Property value) { + if (propertiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePropertiesIsMutable(); + properties_.add(index, value); + onChanged(); + } else { + propertiesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of property values.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Property properties = 1; + */ + public Builder addProperties( + com.google.cloud.contentwarehouse.v1.Property.Builder builderForValue) { + if (propertiesBuilder_ == null) { + ensurePropertiesIsMutable(); + properties_.add(builderForValue.build()); + onChanged(); + } else { + propertiesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of property values.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Property properties = 1; + */ + public Builder addProperties( + int index, com.google.cloud.contentwarehouse.v1.Property.Builder builderForValue) { + if (propertiesBuilder_ == null) { + ensurePropertiesIsMutable(); + properties_.add(index, builderForValue.build()); + onChanged(); + } else { + propertiesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of property values.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Property properties = 1; + */ + public Builder addAllProperties( + java.lang.Iterable values) { + if (propertiesBuilder_ == null) { + ensurePropertiesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, properties_); + onChanged(); + } else { + propertiesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * List of property values.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Property properties = 1; + */ + public Builder clearProperties() { + if (propertiesBuilder_ == null) { + properties_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + propertiesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of property values.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Property properties = 1; + */ + public Builder removeProperties(int index) { + if (propertiesBuilder_ == null) { + ensurePropertiesIsMutable(); + properties_.remove(index); + onChanged(); + } else { + propertiesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * List of property values.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Property properties = 1; + */ + public com.google.cloud.contentwarehouse.v1.Property.Builder getPropertiesBuilder(int index) { + return getPropertiesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of property values.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Property properties = 1; + */ + public com.google.cloud.contentwarehouse.v1.PropertyOrBuilder getPropertiesOrBuilder( + int index) { + if (propertiesBuilder_ == null) { + return properties_.get(index); + } else { + return propertiesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of property values.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Property properties = 1; + */ + public java.util.List + getPropertiesOrBuilderList() { + if (propertiesBuilder_ != null) { + return propertiesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(properties_); + } + } + /** + * + * + *
+     * List of property values.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Property properties = 1; + */ + public com.google.cloud.contentwarehouse.v1.Property.Builder addPropertiesBuilder() { + return getPropertiesFieldBuilder() + .addBuilder(com.google.cloud.contentwarehouse.v1.Property.getDefaultInstance()); + } + /** + * + * + *
+     * List of property values.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Property properties = 1; + */ + public com.google.cloud.contentwarehouse.v1.Property.Builder addPropertiesBuilder(int index) { + return getPropertiesFieldBuilder() + .addBuilder(index, com.google.cloud.contentwarehouse.v1.Property.getDefaultInstance()); + } + /** + * + * + *
+     * List of property values.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Property properties = 1; + */ + public java.util.List + getPropertiesBuilderList() { + return getPropertiesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.Property, + com.google.cloud.contentwarehouse.v1.Property.Builder, + com.google.cloud.contentwarehouse.v1.PropertyOrBuilder> + getPropertiesFieldBuilder() { + if (propertiesBuilder_ == null) { + propertiesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.Property, + com.google.cloud.contentwarehouse.v1.Property.Builder, + com.google.cloud.contentwarehouse.v1.PropertyOrBuilder>( + properties_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + properties_ = null; + } + return propertiesBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.PropertyArray) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.PropertyArray) + private static final com.google.cloud.contentwarehouse.v1.PropertyArray DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.PropertyArray(); + } + + public static com.google.cloud.contentwarehouse.v1.PropertyArray getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PropertyArray parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.PropertyArray getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/PropertyArrayOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/PropertyArrayOrBuilder.java new file mode 100644 index 000000000000..98c183b26ab3 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/PropertyArrayOrBuilder.java @@ -0,0 +1,77 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface PropertyArrayOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.PropertyArray) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of property values.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Property properties = 1; + */ + java.util.List getPropertiesList(); + /** + * + * + *
+   * List of property values.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Property properties = 1; + */ + com.google.cloud.contentwarehouse.v1.Property getProperties(int index); + /** + * + * + *
+   * List of property values.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Property properties = 1; + */ + int getPropertiesCount(); + /** + * + * + *
+   * List of property values.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Property properties = 1; + */ + java.util.List + getPropertiesOrBuilderList(); + /** + * + * + *
+   * List of property values.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Property properties = 1; + */ + com.google.cloud.contentwarehouse.v1.PropertyOrBuilder getPropertiesOrBuilder(int index); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/PropertyDefinition.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/PropertyDefinition.java new file mode 100644 index 000000000000..9ec683665c87 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/PropertyDefinition.java @@ -0,0 +1,3872 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_schema.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Defines the metadata for a schema property.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.PropertyDefinition} + */ +public final class PropertyDefinition extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.PropertyDefinition) + PropertyDefinitionOrBuilder { + private static final long serialVersionUID = 0L; + // Use PropertyDefinition.newBuilder() to construct. + private PropertyDefinition(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PropertyDefinition() { + name_ = ""; + displayName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PropertyDefinition(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaProto + .internal_static_google_cloud_contentwarehouse_v1_PropertyDefinition_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaProto + .internal_static_google_cloud_contentwarehouse_v1_PropertyDefinition_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.PropertyDefinition.class, + com.google.cloud.contentwarehouse.v1.PropertyDefinition.Builder.class); + } + + private int valueTypeOptionsCase_ = 0; + private java.lang.Object valueTypeOptions_; + + public enum ValueTypeOptionsCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + INTEGER_TYPE_OPTIONS(7), + FLOAT_TYPE_OPTIONS(8), + TEXT_TYPE_OPTIONS(9), + PROPERTY_TYPE_OPTIONS(10), + ENUM_TYPE_OPTIONS(11), + DATE_TIME_TYPE_OPTIONS(13), + MAP_TYPE_OPTIONS(15), + TIMESTAMP_TYPE_OPTIONS(16), + VALUETYPEOPTIONS_NOT_SET(0); + private final int value; + + private ValueTypeOptionsCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ValueTypeOptionsCase valueOf(int value) { + return forNumber(value); + } + + public static ValueTypeOptionsCase forNumber(int value) { + switch (value) { + case 7: + return INTEGER_TYPE_OPTIONS; + case 8: + return FLOAT_TYPE_OPTIONS; + case 9: + return TEXT_TYPE_OPTIONS; + case 10: + return PROPERTY_TYPE_OPTIONS; + case 11: + return ENUM_TYPE_OPTIONS; + case 13: + return DATE_TIME_TYPE_OPTIONS; + case 15: + return MAP_TYPE_OPTIONS; + case 16: + return TIMESTAMP_TYPE_OPTIONS; + case 0: + return VALUETYPEOPTIONS_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ValueTypeOptionsCase getValueTypeOptionsCase() { + return ValueTypeOptionsCase.forNumber(valueTypeOptionsCase_); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the metadata property.
+   * Must be unique within a document schema and is case insensitive.
+   * Names must be non-blank, start with a letter, and can contain alphanumeric
+   * characters and: /, :, -, _, and .
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the metadata property.
+   * Must be unique within a document schema and is case insensitive.
+   * Names must be non-blank, start with a letter, and can contain alphanumeric
+   * characters and: /, :, -, _, and .
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 12; + private volatile java.lang.Object displayName_; + /** + * + * + *
+   * The display-name for the property, used for front-end.
+   * 
+ * + * string display_name = 12; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * The display-name for the property, used for front-end.
+   * 
+ * + * string display_name = 12; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IS_REPEATABLE_FIELD_NUMBER = 2; + private boolean isRepeatable_; + /** + * + * + *
+   * Whether the property can have multiple values.
+   * 
+ * + * bool is_repeatable = 2; + * + * @return The isRepeatable. + */ + @java.lang.Override + public boolean getIsRepeatable() { + return isRepeatable_; + } + + public static final int IS_FILTERABLE_FIELD_NUMBER = 3; + private boolean isFilterable_; + /** + * + * + *
+   * Whether the property can be filtered. If this is a sub-property, all the
+   * parent properties must be marked filterable.
+   * 
+ * + * bool is_filterable = 3; + * + * @return The isFilterable. + */ + @java.lang.Override + public boolean getIsFilterable() { + return isFilterable_; + } + + public static final int IS_SEARCHABLE_FIELD_NUMBER = 4; + private boolean isSearchable_; + /** + * + * + *
+   * Indicates that the property should be included in a global search.
+   * 
+ * + * bool is_searchable = 4; + * + * @return The isSearchable. + */ + @java.lang.Override + public boolean getIsSearchable() { + return isSearchable_; + } + + public static final int IS_METADATA_FIELD_NUMBER = 5; + private boolean isMetadata_; + /** + * + * + *
+   * Whether the property is user supplied metadata.
+   * 
+ * + * bool is_metadata = 5; + * + * @return The isMetadata. + */ + @java.lang.Override + public boolean getIsMetadata() { + return isMetadata_; + } + + public static final int IS_REQUIRED_FIELD_NUMBER = 14; + private boolean isRequired_; + /** + * + * + *
+   * Whether the property is mandatory.
+   * Default is 'false', i.e. populating property value can be skipped.
+   * If 'true' then user must populate the value for this property.
+   * 
+ * + * bool is_required = 14; + * + * @return The isRequired. + */ + @java.lang.Override + public boolean getIsRequired() { + return isRequired_; + } + + public static final int INTEGER_TYPE_OPTIONS_FIELD_NUMBER = 7; + /** + * + * + *
+   * Integer property.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.IntegerTypeOptions integer_type_options = 7; + * + * @return Whether the integerTypeOptions field is set. + */ + @java.lang.Override + public boolean hasIntegerTypeOptions() { + return valueTypeOptionsCase_ == 7; + } + /** + * + * + *
+   * Integer property.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.IntegerTypeOptions integer_type_options = 7; + * + * @return The integerTypeOptions. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.IntegerTypeOptions getIntegerTypeOptions() { + if (valueTypeOptionsCase_ == 7) { + return (com.google.cloud.contentwarehouse.v1.IntegerTypeOptions) valueTypeOptions_; + } + return com.google.cloud.contentwarehouse.v1.IntegerTypeOptions.getDefaultInstance(); + } + /** + * + * + *
+   * Integer property.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.IntegerTypeOptions integer_type_options = 7; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.IntegerTypeOptionsOrBuilder + getIntegerTypeOptionsOrBuilder() { + if (valueTypeOptionsCase_ == 7) { + return (com.google.cloud.contentwarehouse.v1.IntegerTypeOptions) valueTypeOptions_; + } + return com.google.cloud.contentwarehouse.v1.IntegerTypeOptions.getDefaultInstance(); + } + + public static final int FLOAT_TYPE_OPTIONS_FIELD_NUMBER = 8; + /** + * + * + *
+   * Float property.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.FloatTypeOptions float_type_options = 8; + * + * @return Whether the floatTypeOptions field is set. + */ + @java.lang.Override + public boolean hasFloatTypeOptions() { + return valueTypeOptionsCase_ == 8; + } + /** + * + * + *
+   * Float property.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.FloatTypeOptions float_type_options = 8; + * + * @return The floatTypeOptions. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.FloatTypeOptions getFloatTypeOptions() { + if (valueTypeOptionsCase_ == 8) { + return (com.google.cloud.contentwarehouse.v1.FloatTypeOptions) valueTypeOptions_; + } + return com.google.cloud.contentwarehouse.v1.FloatTypeOptions.getDefaultInstance(); + } + /** + * + * + *
+   * Float property.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.FloatTypeOptions float_type_options = 8; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.FloatTypeOptionsOrBuilder + getFloatTypeOptionsOrBuilder() { + if (valueTypeOptionsCase_ == 8) { + return (com.google.cloud.contentwarehouse.v1.FloatTypeOptions) valueTypeOptions_; + } + return com.google.cloud.contentwarehouse.v1.FloatTypeOptions.getDefaultInstance(); + } + + public static final int TEXT_TYPE_OPTIONS_FIELD_NUMBER = 9; + /** + * + * + *
+   * Text/string property.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.TextTypeOptions text_type_options = 9; + * + * @return Whether the textTypeOptions field is set. + */ + @java.lang.Override + public boolean hasTextTypeOptions() { + return valueTypeOptionsCase_ == 9; + } + /** + * + * + *
+   * Text/string property.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.TextTypeOptions text_type_options = 9; + * + * @return The textTypeOptions. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.TextTypeOptions getTextTypeOptions() { + if (valueTypeOptionsCase_ == 9) { + return (com.google.cloud.contentwarehouse.v1.TextTypeOptions) valueTypeOptions_; + } + return com.google.cloud.contentwarehouse.v1.TextTypeOptions.getDefaultInstance(); + } + /** + * + * + *
+   * Text/string property.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.TextTypeOptions text_type_options = 9; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.TextTypeOptionsOrBuilder + getTextTypeOptionsOrBuilder() { + if (valueTypeOptionsCase_ == 9) { + return (com.google.cloud.contentwarehouse.v1.TextTypeOptions) valueTypeOptions_; + } + return com.google.cloud.contentwarehouse.v1.TextTypeOptions.getDefaultInstance(); + } + + public static final int PROPERTY_TYPE_OPTIONS_FIELD_NUMBER = 10; + /** + * + * + *
+   * Nested structured data property.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.PropertyTypeOptions property_type_options = 10; + * + * @return Whether the propertyTypeOptions field is set. + */ + @java.lang.Override + public boolean hasPropertyTypeOptions() { + return valueTypeOptionsCase_ == 10; + } + /** + * + * + *
+   * Nested structured data property.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.PropertyTypeOptions property_type_options = 10; + * + * @return The propertyTypeOptions. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.PropertyTypeOptions getPropertyTypeOptions() { + if (valueTypeOptionsCase_ == 10) { + return (com.google.cloud.contentwarehouse.v1.PropertyTypeOptions) valueTypeOptions_; + } + return com.google.cloud.contentwarehouse.v1.PropertyTypeOptions.getDefaultInstance(); + } + /** + * + * + *
+   * Nested structured data property.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.PropertyTypeOptions property_type_options = 10; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.PropertyTypeOptionsOrBuilder + getPropertyTypeOptionsOrBuilder() { + if (valueTypeOptionsCase_ == 10) { + return (com.google.cloud.contentwarehouse.v1.PropertyTypeOptions) valueTypeOptions_; + } + return com.google.cloud.contentwarehouse.v1.PropertyTypeOptions.getDefaultInstance(); + } + + public static final int ENUM_TYPE_OPTIONS_FIELD_NUMBER = 11; + /** + * + * + *
+   * Enum/categorical property.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.EnumTypeOptions enum_type_options = 11; + * + * @return Whether the enumTypeOptions field is set. + */ + @java.lang.Override + public boolean hasEnumTypeOptions() { + return valueTypeOptionsCase_ == 11; + } + /** + * + * + *
+   * Enum/categorical property.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.EnumTypeOptions enum_type_options = 11; + * + * @return The enumTypeOptions. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.EnumTypeOptions getEnumTypeOptions() { + if (valueTypeOptionsCase_ == 11) { + return (com.google.cloud.contentwarehouse.v1.EnumTypeOptions) valueTypeOptions_; + } + return com.google.cloud.contentwarehouse.v1.EnumTypeOptions.getDefaultInstance(); + } + /** + * + * + *
+   * Enum/categorical property.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.EnumTypeOptions enum_type_options = 11; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.EnumTypeOptionsOrBuilder + getEnumTypeOptionsOrBuilder() { + if (valueTypeOptionsCase_ == 11) { + return (com.google.cloud.contentwarehouse.v1.EnumTypeOptions) valueTypeOptions_; + } + return com.google.cloud.contentwarehouse.v1.EnumTypeOptions.getDefaultInstance(); + } + + public static final int DATE_TIME_TYPE_OPTIONS_FIELD_NUMBER = 13; + /** + * + * + *
+   * Date time property.
+   * It is not supported by CMEK compliant deployment.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.DateTimeTypeOptions date_time_type_options = 13; + * + * @return Whether the dateTimeTypeOptions field is set. + */ + @java.lang.Override + public boolean hasDateTimeTypeOptions() { + return valueTypeOptionsCase_ == 13; + } + /** + * + * + *
+   * Date time property.
+   * It is not supported by CMEK compliant deployment.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.DateTimeTypeOptions date_time_type_options = 13; + * + * @return The dateTimeTypeOptions. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions getDateTimeTypeOptions() { + if (valueTypeOptionsCase_ == 13) { + return (com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions) valueTypeOptions_; + } + return com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions.getDefaultInstance(); + } + /** + * + * + *
+   * Date time property.
+   * It is not supported by CMEK compliant deployment.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.DateTimeTypeOptions date_time_type_options = 13; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DateTimeTypeOptionsOrBuilder + getDateTimeTypeOptionsOrBuilder() { + if (valueTypeOptionsCase_ == 13) { + return (com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions) valueTypeOptions_; + } + return com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions.getDefaultInstance(); + } + + public static final int MAP_TYPE_OPTIONS_FIELD_NUMBER = 15; + /** + * + * + *
+   * Map property.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.MapTypeOptions map_type_options = 15; + * + * @return Whether the mapTypeOptions field is set. + */ + @java.lang.Override + public boolean hasMapTypeOptions() { + return valueTypeOptionsCase_ == 15; + } + /** + * + * + *
+   * Map property.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.MapTypeOptions map_type_options = 15; + * + * @return The mapTypeOptions. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.MapTypeOptions getMapTypeOptions() { + if (valueTypeOptionsCase_ == 15) { + return (com.google.cloud.contentwarehouse.v1.MapTypeOptions) valueTypeOptions_; + } + return com.google.cloud.contentwarehouse.v1.MapTypeOptions.getDefaultInstance(); + } + /** + * + * + *
+   * Map property.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.MapTypeOptions map_type_options = 15; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.MapTypeOptionsOrBuilder getMapTypeOptionsOrBuilder() { + if (valueTypeOptionsCase_ == 15) { + return (com.google.cloud.contentwarehouse.v1.MapTypeOptions) valueTypeOptions_; + } + return com.google.cloud.contentwarehouse.v1.MapTypeOptions.getDefaultInstance(); + } + + public static final int TIMESTAMP_TYPE_OPTIONS_FIELD_NUMBER = 16; + /** + * + * + *
+   * Timestamp property.
+   * It is not supported by CMEK compliant deployment.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.TimestampTypeOptions timestamp_type_options = 16; + * + * + * @return Whether the timestampTypeOptions field is set. + */ + @java.lang.Override + public boolean hasTimestampTypeOptions() { + return valueTypeOptionsCase_ == 16; + } + /** + * + * + *
+   * Timestamp property.
+   * It is not supported by CMEK compliant deployment.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.TimestampTypeOptions timestamp_type_options = 16; + * + * + * @return The timestampTypeOptions. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.TimestampTypeOptions getTimestampTypeOptions() { + if (valueTypeOptionsCase_ == 16) { + return (com.google.cloud.contentwarehouse.v1.TimestampTypeOptions) valueTypeOptions_; + } + return com.google.cloud.contentwarehouse.v1.TimestampTypeOptions.getDefaultInstance(); + } + /** + * + * + *
+   * Timestamp property.
+   * It is not supported by CMEK compliant deployment.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.TimestampTypeOptions timestamp_type_options = 16; + * + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.TimestampTypeOptionsOrBuilder + getTimestampTypeOptionsOrBuilder() { + if (valueTypeOptionsCase_ == 16) { + return (com.google.cloud.contentwarehouse.v1.TimestampTypeOptions) valueTypeOptions_; + } + return com.google.cloud.contentwarehouse.v1.TimestampTypeOptions.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (isRepeatable_ != false) { + output.writeBool(2, isRepeatable_); + } + if (isFilterable_ != false) { + output.writeBool(3, isFilterable_); + } + if (isSearchable_ != false) { + output.writeBool(4, isSearchable_); + } + if (isMetadata_ != false) { + output.writeBool(5, isMetadata_); + } + if (valueTypeOptionsCase_ == 7) { + output.writeMessage( + 7, (com.google.cloud.contentwarehouse.v1.IntegerTypeOptions) valueTypeOptions_); + } + if (valueTypeOptionsCase_ == 8) { + output.writeMessage( + 8, (com.google.cloud.contentwarehouse.v1.FloatTypeOptions) valueTypeOptions_); + } + if (valueTypeOptionsCase_ == 9) { + output.writeMessage( + 9, (com.google.cloud.contentwarehouse.v1.TextTypeOptions) valueTypeOptions_); + } + if (valueTypeOptionsCase_ == 10) { + output.writeMessage( + 10, (com.google.cloud.contentwarehouse.v1.PropertyTypeOptions) valueTypeOptions_); + } + if (valueTypeOptionsCase_ == 11) { + output.writeMessage( + 11, (com.google.cloud.contentwarehouse.v1.EnumTypeOptions) valueTypeOptions_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 12, displayName_); + } + if (valueTypeOptionsCase_ == 13) { + output.writeMessage( + 13, (com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions) valueTypeOptions_); + } + if (isRequired_ != false) { + output.writeBool(14, isRequired_); + } + if (valueTypeOptionsCase_ == 15) { + output.writeMessage( + 15, (com.google.cloud.contentwarehouse.v1.MapTypeOptions) valueTypeOptions_); + } + if (valueTypeOptionsCase_ == 16) { + output.writeMessage( + 16, (com.google.cloud.contentwarehouse.v1.TimestampTypeOptions) valueTypeOptions_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (isRepeatable_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, isRepeatable_); + } + if (isFilterable_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, isFilterable_); + } + if (isSearchable_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, isSearchable_); + } + if (isMetadata_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, isMetadata_); + } + if (valueTypeOptionsCase_ == 7) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 7, (com.google.cloud.contentwarehouse.v1.IntegerTypeOptions) valueTypeOptions_); + } + if (valueTypeOptionsCase_ == 8) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 8, (com.google.cloud.contentwarehouse.v1.FloatTypeOptions) valueTypeOptions_); + } + if (valueTypeOptionsCase_ == 9) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 9, (com.google.cloud.contentwarehouse.v1.TextTypeOptions) valueTypeOptions_); + } + if (valueTypeOptionsCase_ == 10) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 10, (com.google.cloud.contentwarehouse.v1.PropertyTypeOptions) valueTypeOptions_); + } + if (valueTypeOptionsCase_ == 11) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 11, (com.google.cloud.contentwarehouse.v1.EnumTypeOptions) valueTypeOptions_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, displayName_); + } + if (valueTypeOptionsCase_ == 13) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 13, (com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions) valueTypeOptions_); + } + if (isRequired_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(14, isRequired_); + } + if (valueTypeOptionsCase_ == 15) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 15, (com.google.cloud.contentwarehouse.v1.MapTypeOptions) valueTypeOptions_); + } + if (valueTypeOptionsCase_ == 16) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 16, (com.google.cloud.contentwarehouse.v1.TimestampTypeOptions) valueTypeOptions_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.PropertyDefinition)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.PropertyDefinition other = + (com.google.cloud.contentwarehouse.v1.PropertyDefinition) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (getIsRepeatable() != other.getIsRepeatable()) return false; + if (getIsFilterable() != other.getIsFilterable()) return false; + if (getIsSearchable() != other.getIsSearchable()) return false; + if (getIsMetadata() != other.getIsMetadata()) return false; + if (getIsRequired() != other.getIsRequired()) return false; + if (!getValueTypeOptionsCase().equals(other.getValueTypeOptionsCase())) return false; + switch (valueTypeOptionsCase_) { + case 7: + if (!getIntegerTypeOptions().equals(other.getIntegerTypeOptions())) return false; + break; + case 8: + if (!getFloatTypeOptions().equals(other.getFloatTypeOptions())) return false; + break; + case 9: + if (!getTextTypeOptions().equals(other.getTextTypeOptions())) return false; + break; + case 10: + if (!getPropertyTypeOptions().equals(other.getPropertyTypeOptions())) return false; + break; + case 11: + if (!getEnumTypeOptions().equals(other.getEnumTypeOptions())) return false; + break; + case 13: + if (!getDateTimeTypeOptions().equals(other.getDateTimeTypeOptions())) return false; + break; + case 15: + if (!getMapTypeOptions().equals(other.getMapTypeOptions())) return false; + break; + case 16: + if (!getTimestampTypeOptions().equals(other.getTimestampTypeOptions())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + IS_REPEATABLE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIsRepeatable()); + hash = (37 * hash) + IS_FILTERABLE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIsFilterable()); + hash = (37 * hash) + IS_SEARCHABLE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIsSearchable()); + hash = (37 * hash) + IS_METADATA_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIsMetadata()); + hash = (37 * hash) + IS_REQUIRED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIsRequired()); + switch (valueTypeOptionsCase_) { + case 7: + hash = (37 * hash) + INTEGER_TYPE_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getIntegerTypeOptions().hashCode(); + break; + case 8: + hash = (37 * hash) + FLOAT_TYPE_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getFloatTypeOptions().hashCode(); + break; + case 9: + hash = (37 * hash) + TEXT_TYPE_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getTextTypeOptions().hashCode(); + break; + case 10: + hash = (37 * hash) + PROPERTY_TYPE_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getPropertyTypeOptions().hashCode(); + break; + case 11: + hash = (37 * hash) + ENUM_TYPE_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getEnumTypeOptions().hashCode(); + break; + case 13: + hash = (37 * hash) + DATE_TIME_TYPE_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getDateTimeTypeOptions().hashCode(); + break; + case 15: + hash = (37 * hash) + MAP_TYPE_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getMapTypeOptions().hashCode(); + break; + case 16: + hash = (37 * hash) + TIMESTAMP_TYPE_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getTimestampTypeOptions().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.PropertyDefinition parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.PropertyDefinition parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.PropertyDefinition parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.PropertyDefinition parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.PropertyDefinition parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.PropertyDefinition parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.PropertyDefinition parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.PropertyDefinition parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.PropertyDefinition parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.PropertyDefinition parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.PropertyDefinition parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.PropertyDefinition parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.PropertyDefinition prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Defines the metadata for a schema property.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.PropertyDefinition} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.PropertyDefinition) + com.google.cloud.contentwarehouse.v1.PropertyDefinitionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaProto + .internal_static_google_cloud_contentwarehouse_v1_PropertyDefinition_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaProto + .internal_static_google_cloud_contentwarehouse_v1_PropertyDefinition_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.PropertyDefinition.class, + com.google.cloud.contentwarehouse.v1.PropertyDefinition.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.PropertyDefinition.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + displayName_ = ""; + + isRepeatable_ = false; + + isFilterable_ = false; + + isSearchable_ = false; + + isMetadata_ = false; + + isRequired_ = false; + + if (integerTypeOptionsBuilder_ != null) { + integerTypeOptionsBuilder_.clear(); + } + if (floatTypeOptionsBuilder_ != null) { + floatTypeOptionsBuilder_.clear(); + } + if (textTypeOptionsBuilder_ != null) { + textTypeOptionsBuilder_.clear(); + } + if (propertyTypeOptionsBuilder_ != null) { + propertyTypeOptionsBuilder_.clear(); + } + if (enumTypeOptionsBuilder_ != null) { + enumTypeOptionsBuilder_.clear(); + } + if (dateTimeTypeOptionsBuilder_ != null) { + dateTimeTypeOptionsBuilder_.clear(); + } + if (mapTypeOptionsBuilder_ != null) { + mapTypeOptionsBuilder_.clear(); + } + if (timestampTypeOptionsBuilder_ != null) { + timestampTypeOptionsBuilder_.clear(); + } + valueTypeOptionsCase_ = 0; + valueTypeOptions_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaProto + .internal_static_google_cloud_contentwarehouse_v1_PropertyDefinition_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.PropertyDefinition getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.PropertyDefinition.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.PropertyDefinition build() { + com.google.cloud.contentwarehouse.v1.PropertyDefinition result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.PropertyDefinition buildPartial() { + com.google.cloud.contentwarehouse.v1.PropertyDefinition result = + new com.google.cloud.contentwarehouse.v1.PropertyDefinition(this); + result.name_ = name_; + result.displayName_ = displayName_; + result.isRepeatable_ = isRepeatable_; + result.isFilterable_ = isFilterable_; + result.isSearchable_ = isSearchable_; + result.isMetadata_ = isMetadata_; + result.isRequired_ = isRequired_; + if (valueTypeOptionsCase_ == 7) { + if (integerTypeOptionsBuilder_ == null) { + result.valueTypeOptions_ = valueTypeOptions_; + } else { + result.valueTypeOptions_ = integerTypeOptionsBuilder_.build(); + } + } + if (valueTypeOptionsCase_ == 8) { + if (floatTypeOptionsBuilder_ == null) { + result.valueTypeOptions_ = valueTypeOptions_; + } else { + result.valueTypeOptions_ = floatTypeOptionsBuilder_.build(); + } + } + if (valueTypeOptionsCase_ == 9) { + if (textTypeOptionsBuilder_ == null) { + result.valueTypeOptions_ = valueTypeOptions_; + } else { + result.valueTypeOptions_ = textTypeOptionsBuilder_.build(); + } + } + if (valueTypeOptionsCase_ == 10) { + if (propertyTypeOptionsBuilder_ == null) { + result.valueTypeOptions_ = valueTypeOptions_; + } else { + result.valueTypeOptions_ = propertyTypeOptionsBuilder_.build(); + } + } + if (valueTypeOptionsCase_ == 11) { + if (enumTypeOptionsBuilder_ == null) { + result.valueTypeOptions_ = valueTypeOptions_; + } else { + result.valueTypeOptions_ = enumTypeOptionsBuilder_.build(); + } + } + if (valueTypeOptionsCase_ == 13) { + if (dateTimeTypeOptionsBuilder_ == null) { + result.valueTypeOptions_ = valueTypeOptions_; + } else { + result.valueTypeOptions_ = dateTimeTypeOptionsBuilder_.build(); + } + } + if (valueTypeOptionsCase_ == 15) { + if (mapTypeOptionsBuilder_ == null) { + result.valueTypeOptions_ = valueTypeOptions_; + } else { + result.valueTypeOptions_ = mapTypeOptionsBuilder_.build(); + } + } + if (valueTypeOptionsCase_ == 16) { + if (timestampTypeOptionsBuilder_ == null) { + result.valueTypeOptions_ = valueTypeOptions_; + } else { + result.valueTypeOptions_ = timestampTypeOptionsBuilder_.build(); + } + } + result.valueTypeOptionsCase_ = valueTypeOptionsCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.PropertyDefinition) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.PropertyDefinition) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.PropertyDefinition other) { + if (other == com.google.cloud.contentwarehouse.v1.PropertyDefinition.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (other.getIsRepeatable() != false) { + setIsRepeatable(other.getIsRepeatable()); + } + if (other.getIsFilterable() != false) { + setIsFilterable(other.getIsFilterable()); + } + if (other.getIsSearchable() != false) { + setIsSearchable(other.getIsSearchable()); + } + if (other.getIsMetadata() != false) { + setIsMetadata(other.getIsMetadata()); + } + if (other.getIsRequired() != false) { + setIsRequired(other.getIsRequired()); + } + switch (other.getValueTypeOptionsCase()) { + case INTEGER_TYPE_OPTIONS: + { + mergeIntegerTypeOptions(other.getIntegerTypeOptions()); + break; + } + case FLOAT_TYPE_OPTIONS: + { + mergeFloatTypeOptions(other.getFloatTypeOptions()); + break; + } + case TEXT_TYPE_OPTIONS: + { + mergeTextTypeOptions(other.getTextTypeOptions()); + break; + } + case PROPERTY_TYPE_OPTIONS: + { + mergePropertyTypeOptions(other.getPropertyTypeOptions()); + break; + } + case ENUM_TYPE_OPTIONS: + { + mergeEnumTypeOptions(other.getEnumTypeOptions()); + break; + } + case DATE_TIME_TYPE_OPTIONS: + { + mergeDateTimeTypeOptions(other.getDateTimeTypeOptions()); + break; + } + case MAP_TYPE_OPTIONS: + { + mergeMapTypeOptions(other.getMapTypeOptions()); + break; + } + case TIMESTAMP_TYPE_OPTIONS: + { + mergeTimestampTypeOptions(other.getTimestampTypeOptions()); + break; + } + case VALUETYPEOPTIONS_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 16: + { + isRepeatable_ = input.readBool(); + + break; + } // case 16 + case 24: + { + isFilterable_ = input.readBool(); + + break; + } // case 24 + case 32: + { + isSearchable_ = input.readBool(); + + break; + } // case 32 + case 40: + { + isMetadata_ = input.readBool(); + + break; + } // case 40 + case 58: + { + input.readMessage( + getIntegerTypeOptionsFieldBuilder().getBuilder(), extensionRegistry); + valueTypeOptionsCase_ = 7; + break; + } // case 58 + case 66: + { + input.readMessage( + getFloatTypeOptionsFieldBuilder().getBuilder(), extensionRegistry); + valueTypeOptionsCase_ = 8; + break; + } // case 66 + case 74: + { + input.readMessage(getTextTypeOptionsFieldBuilder().getBuilder(), extensionRegistry); + valueTypeOptionsCase_ = 9; + break; + } // case 74 + case 82: + { + input.readMessage( + getPropertyTypeOptionsFieldBuilder().getBuilder(), extensionRegistry); + valueTypeOptionsCase_ = 10; + break; + } // case 82 + case 90: + { + input.readMessage(getEnumTypeOptionsFieldBuilder().getBuilder(), extensionRegistry); + valueTypeOptionsCase_ = 11; + break; + } // case 90 + case 98: + { + displayName_ = input.readStringRequireUtf8(); + + break; + } // case 98 + case 106: + { + input.readMessage( + getDateTimeTypeOptionsFieldBuilder().getBuilder(), extensionRegistry); + valueTypeOptionsCase_ = 13; + break; + } // case 106 + case 112: + { + isRequired_ = input.readBool(); + + break; + } // case 112 + case 122: + { + input.readMessage(getMapTypeOptionsFieldBuilder().getBuilder(), extensionRegistry); + valueTypeOptionsCase_ = 15; + break; + } // case 122 + case 130: + { + input.readMessage( + getTimestampTypeOptionsFieldBuilder().getBuilder(), extensionRegistry); + valueTypeOptionsCase_ = 16; + break; + } // case 130 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int valueTypeOptionsCase_ = 0; + private java.lang.Object valueTypeOptions_; + + public ValueTypeOptionsCase getValueTypeOptionsCase() { + return ValueTypeOptionsCase.forNumber(valueTypeOptionsCase_); + } + + public Builder clearValueTypeOptions() { + valueTypeOptionsCase_ = 0; + valueTypeOptions_ = null; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the metadata property.
+     * Must be unique within a document schema and is case insensitive.
+     * Names must be non-blank, start with a letter, and can contain alphanumeric
+     * characters and: /, :, -, _, and .
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the metadata property.
+     * Must be unique within a document schema and is case insensitive.
+     * Names must be non-blank, start with a letter, and can contain alphanumeric
+     * characters and: /, :, -, _, and .
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the metadata property.
+     * Must be unique within a document schema and is case insensitive.
+     * Names must be non-blank, start with a letter, and can contain alphanumeric
+     * characters and: /, :, -, _, and .
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the metadata property.
+     * Must be unique within a document schema and is case insensitive.
+     * Names must be non-blank, start with a letter, and can contain alphanumeric
+     * characters and: /, :, -, _, and .
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the metadata property.
+     * Must be unique within a document schema and is case insensitive.
+     * Names must be non-blank, start with a letter, and can contain alphanumeric
+     * characters and: /, :, -, _, and .
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * The display-name for the property, used for front-end.
+     * 
+ * + * string display_name = 12; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The display-name for the property, used for front-end.
+     * 
+ * + * string display_name = 12; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The display-name for the property, used for front-end.
+     * 
+ * + * string display_name = 12; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The display-name for the property, used for front-end.
+     * 
+ * + * string display_name = 12; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The display-name for the property, used for front-end.
+     * 
+ * + * string display_name = 12; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayName_ = value; + onChanged(); + return this; + } + + private boolean isRepeatable_; + /** + * + * + *
+     * Whether the property can have multiple values.
+     * 
+ * + * bool is_repeatable = 2; + * + * @return The isRepeatable. + */ + @java.lang.Override + public boolean getIsRepeatable() { + return isRepeatable_; + } + /** + * + * + *
+     * Whether the property can have multiple values.
+     * 
+ * + * bool is_repeatable = 2; + * + * @param value The isRepeatable to set. + * @return This builder for chaining. + */ + public Builder setIsRepeatable(boolean value) { + + isRepeatable_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether the property can have multiple values.
+     * 
+ * + * bool is_repeatable = 2; + * + * @return This builder for chaining. + */ + public Builder clearIsRepeatable() { + + isRepeatable_ = false; + onChanged(); + return this; + } + + private boolean isFilterable_; + /** + * + * + *
+     * Whether the property can be filtered. If this is a sub-property, all the
+     * parent properties must be marked filterable.
+     * 
+ * + * bool is_filterable = 3; + * + * @return The isFilterable. + */ + @java.lang.Override + public boolean getIsFilterable() { + return isFilterable_; + } + /** + * + * + *
+     * Whether the property can be filtered. If this is a sub-property, all the
+     * parent properties must be marked filterable.
+     * 
+ * + * bool is_filterable = 3; + * + * @param value The isFilterable to set. + * @return This builder for chaining. + */ + public Builder setIsFilterable(boolean value) { + + isFilterable_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether the property can be filtered. If this is a sub-property, all the
+     * parent properties must be marked filterable.
+     * 
+ * + * bool is_filterable = 3; + * + * @return This builder for chaining. + */ + public Builder clearIsFilterable() { + + isFilterable_ = false; + onChanged(); + return this; + } + + private boolean isSearchable_; + /** + * + * + *
+     * Indicates that the property should be included in a global search.
+     * 
+ * + * bool is_searchable = 4; + * + * @return The isSearchable. + */ + @java.lang.Override + public boolean getIsSearchable() { + return isSearchable_; + } + /** + * + * + *
+     * Indicates that the property should be included in a global search.
+     * 
+ * + * bool is_searchable = 4; + * + * @param value The isSearchable to set. + * @return This builder for chaining. + */ + public Builder setIsSearchable(boolean value) { + + isSearchable_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Indicates that the property should be included in a global search.
+     * 
+ * + * bool is_searchable = 4; + * + * @return This builder for chaining. + */ + public Builder clearIsSearchable() { + + isSearchable_ = false; + onChanged(); + return this; + } + + private boolean isMetadata_; + /** + * + * + *
+     * Whether the property is user supplied metadata.
+     * 
+ * + * bool is_metadata = 5; + * + * @return The isMetadata. + */ + @java.lang.Override + public boolean getIsMetadata() { + return isMetadata_; + } + /** + * + * + *
+     * Whether the property is user supplied metadata.
+     * 
+ * + * bool is_metadata = 5; + * + * @param value The isMetadata to set. + * @return This builder for chaining. + */ + public Builder setIsMetadata(boolean value) { + + isMetadata_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether the property is user supplied metadata.
+     * 
+ * + * bool is_metadata = 5; + * + * @return This builder for chaining. + */ + public Builder clearIsMetadata() { + + isMetadata_ = false; + onChanged(); + return this; + } + + private boolean isRequired_; + /** + * + * + *
+     * Whether the property is mandatory.
+     * Default is 'false', i.e. populating property value can be skipped.
+     * If 'true' then user must populate the value for this property.
+     * 
+ * + * bool is_required = 14; + * + * @return The isRequired. + */ + @java.lang.Override + public boolean getIsRequired() { + return isRequired_; + } + /** + * + * + *
+     * Whether the property is mandatory.
+     * Default is 'false', i.e. populating property value can be skipped.
+     * If 'true' then user must populate the value for this property.
+     * 
+ * + * bool is_required = 14; + * + * @param value The isRequired to set. + * @return This builder for chaining. + */ + public Builder setIsRequired(boolean value) { + + isRequired_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether the property is mandatory.
+     * Default is 'false', i.e. populating property value can be skipped.
+     * If 'true' then user must populate the value for this property.
+     * 
+ * + * bool is_required = 14; + * + * @return This builder for chaining. + */ + public Builder clearIsRequired() { + + isRequired_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.IntegerTypeOptions, + com.google.cloud.contentwarehouse.v1.IntegerTypeOptions.Builder, + com.google.cloud.contentwarehouse.v1.IntegerTypeOptionsOrBuilder> + integerTypeOptionsBuilder_; + /** + * + * + *
+     * Integer property.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.IntegerTypeOptions integer_type_options = 7; + * + * @return Whether the integerTypeOptions field is set. + */ + @java.lang.Override + public boolean hasIntegerTypeOptions() { + return valueTypeOptionsCase_ == 7; + } + /** + * + * + *
+     * Integer property.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.IntegerTypeOptions integer_type_options = 7; + * + * @return The integerTypeOptions. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.IntegerTypeOptions getIntegerTypeOptions() { + if (integerTypeOptionsBuilder_ == null) { + if (valueTypeOptionsCase_ == 7) { + return (com.google.cloud.contentwarehouse.v1.IntegerTypeOptions) valueTypeOptions_; + } + return com.google.cloud.contentwarehouse.v1.IntegerTypeOptions.getDefaultInstance(); + } else { + if (valueTypeOptionsCase_ == 7) { + return integerTypeOptionsBuilder_.getMessage(); + } + return com.google.cloud.contentwarehouse.v1.IntegerTypeOptions.getDefaultInstance(); + } + } + /** + * + * + *
+     * Integer property.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.IntegerTypeOptions integer_type_options = 7; + */ + public Builder setIntegerTypeOptions( + com.google.cloud.contentwarehouse.v1.IntegerTypeOptions value) { + if (integerTypeOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + valueTypeOptions_ = value; + onChanged(); + } else { + integerTypeOptionsBuilder_.setMessage(value); + } + valueTypeOptionsCase_ = 7; + return this; + } + /** + * + * + *
+     * Integer property.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.IntegerTypeOptions integer_type_options = 7; + */ + public Builder setIntegerTypeOptions( + com.google.cloud.contentwarehouse.v1.IntegerTypeOptions.Builder builderForValue) { + if (integerTypeOptionsBuilder_ == null) { + valueTypeOptions_ = builderForValue.build(); + onChanged(); + } else { + integerTypeOptionsBuilder_.setMessage(builderForValue.build()); + } + valueTypeOptionsCase_ = 7; + return this; + } + /** + * + * + *
+     * Integer property.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.IntegerTypeOptions integer_type_options = 7; + */ + public Builder mergeIntegerTypeOptions( + com.google.cloud.contentwarehouse.v1.IntegerTypeOptions value) { + if (integerTypeOptionsBuilder_ == null) { + if (valueTypeOptionsCase_ == 7 + && valueTypeOptions_ + != com.google.cloud.contentwarehouse.v1.IntegerTypeOptions.getDefaultInstance()) { + valueTypeOptions_ = + com.google.cloud.contentwarehouse.v1.IntegerTypeOptions.newBuilder( + (com.google.cloud.contentwarehouse.v1.IntegerTypeOptions) valueTypeOptions_) + .mergeFrom(value) + .buildPartial(); + } else { + valueTypeOptions_ = value; + } + onChanged(); + } else { + if (valueTypeOptionsCase_ == 7) { + integerTypeOptionsBuilder_.mergeFrom(value); + } else { + integerTypeOptionsBuilder_.setMessage(value); + } + } + valueTypeOptionsCase_ = 7; + return this; + } + /** + * + * + *
+     * Integer property.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.IntegerTypeOptions integer_type_options = 7; + */ + public Builder clearIntegerTypeOptions() { + if (integerTypeOptionsBuilder_ == null) { + if (valueTypeOptionsCase_ == 7) { + valueTypeOptionsCase_ = 0; + valueTypeOptions_ = null; + onChanged(); + } + } else { + if (valueTypeOptionsCase_ == 7) { + valueTypeOptionsCase_ = 0; + valueTypeOptions_ = null; + } + integerTypeOptionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Integer property.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.IntegerTypeOptions integer_type_options = 7; + */ + public com.google.cloud.contentwarehouse.v1.IntegerTypeOptions.Builder + getIntegerTypeOptionsBuilder() { + return getIntegerTypeOptionsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Integer property.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.IntegerTypeOptions integer_type_options = 7; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.IntegerTypeOptionsOrBuilder + getIntegerTypeOptionsOrBuilder() { + if ((valueTypeOptionsCase_ == 7) && (integerTypeOptionsBuilder_ != null)) { + return integerTypeOptionsBuilder_.getMessageOrBuilder(); + } else { + if (valueTypeOptionsCase_ == 7) { + return (com.google.cloud.contentwarehouse.v1.IntegerTypeOptions) valueTypeOptions_; + } + return com.google.cloud.contentwarehouse.v1.IntegerTypeOptions.getDefaultInstance(); + } + } + /** + * + * + *
+     * Integer property.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.IntegerTypeOptions integer_type_options = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.IntegerTypeOptions, + com.google.cloud.contentwarehouse.v1.IntegerTypeOptions.Builder, + com.google.cloud.contentwarehouse.v1.IntegerTypeOptionsOrBuilder> + getIntegerTypeOptionsFieldBuilder() { + if (integerTypeOptionsBuilder_ == null) { + if (!(valueTypeOptionsCase_ == 7)) { + valueTypeOptions_ = + com.google.cloud.contentwarehouse.v1.IntegerTypeOptions.getDefaultInstance(); + } + integerTypeOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.IntegerTypeOptions, + com.google.cloud.contentwarehouse.v1.IntegerTypeOptions.Builder, + com.google.cloud.contentwarehouse.v1.IntegerTypeOptionsOrBuilder>( + (com.google.cloud.contentwarehouse.v1.IntegerTypeOptions) valueTypeOptions_, + getParentForChildren(), + isClean()); + valueTypeOptions_ = null; + } + valueTypeOptionsCase_ = 7; + onChanged(); + ; + return integerTypeOptionsBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.FloatTypeOptions, + com.google.cloud.contentwarehouse.v1.FloatTypeOptions.Builder, + com.google.cloud.contentwarehouse.v1.FloatTypeOptionsOrBuilder> + floatTypeOptionsBuilder_; + /** + * + * + *
+     * Float property.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.FloatTypeOptions float_type_options = 8; + * + * @return Whether the floatTypeOptions field is set. + */ + @java.lang.Override + public boolean hasFloatTypeOptions() { + return valueTypeOptionsCase_ == 8; + } + /** + * + * + *
+     * Float property.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.FloatTypeOptions float_type_options = 8; + * + * @return The floatTypeOptions. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.FloatTypeOptions getFloatTypeOptions() { + if (floatTypeOptionsBuilder_ == null) { + if (valueTypeOptionsCase_ == 8) { + return (com.google.cloud.contentwarehouse.v1.FloatTypeOptions) valueTypeOptions_; + } + return com.google.cloud.contentwarehouse.v1.FloatTypeOptions.getDefaultInstance(); + } else { + if (valueTypeOptionsCase_ == 8) { + return floatTypeOptionsBuilder_.getMessage(); + } + return com.google.cloud.contentwarehouse.v1.FloatTypeOptions.getDefaultInstance(); + } + } + /** + * + * + *
+     * Float property.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.FloatTypeOptions float_type_options = 8; + */ + public Builder setFloatTypeOptions( + com.google.cloud.contentwarehouse.v1.FloatTypeOptions value) { + if (floatTypeOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + valueTypeOptions_ = value; + onChanged(); + } else { + floatTypeOptionsBuilder_.setMessage(value); + } + valueTypeOptionsCase_ = 8; + return this; + } + /** + * + * + *
+     * Float property.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.FloatTypeOptions float_type_options = 8; + */ + public Builder setFloatTypeOptions( + com.google.cloud.contentwarehouse.v1.FloatTypeOptions.Builder builderForValue) { + if (floatTypeOptionsBuilder_ == null) { + valueTypeOptions_ = builderForValue.build(); + onChanged(); + } else { + floatTypeOptionsBuilder_.setMessage(builderForValue.build()); + } + valueTypeOptionsCase_ = 8; + return this; + } + /** + * + * + *
+     * Float property.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.FloatTypeOptions float_type_options = 8; + */ + public Builder mergeFloatTypeOptions( + com.google.cloud.contentwarehouse.v1.FloatTypeOptions value) { + if (floatTypeOptionsBuilder_ == null) { + if (valueTypeOptionsCase_ == 8 + && valueTypeOptions_ + != com.google.cloud.contentwarehouse.v1.FloatTypeOptions.getDefaultInstance()) { + valueTypeOptions_ = + com.google.cloud.contentwarehouse.v1.FloatTypeOptions.newBuilder( + (com.google.cloud.contentwarehouse.v1.FloatTypeOptions) valueTypeOptions_) + .mergeFrom(value) + .buildPartial(); + } else { + valueTypeOptions_ = value; + } + onChanged(); + } else { + if (valueTypeOptionsCase_ == 8) { + floatTypeOptionsBuilder_.mergeFrom(value); + } else { + floatTypeOptionsBuilder_.setMessage(value); + } + } + valueTypeOptionsCase_ = 8; + return this; + } + /** + * + * + *
+     * Float property.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.FloatTypeOptions float_type_options = 8; + */ + public Builder clearFloatTypeOptions() { + if (floatTypeOptionsBuilder_ == null) { + if (valueTypeOptionsCase_ == 8) { + valueTypeOptionsCase_ = 0; + valueTypeOptions_ = null; + onChanged(); + } + } else { + if (valueTypeOptionsCase_ == 8) { + valueTypeOptionsCase_ = 0; + valueTypeOptions_ = null; + } + floatTypeOptionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Float property.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.FloatTypeOptions float_type_options = 8; + */ + public com.google.cloud.contentwarehouse.v1.FloatTypeOptions.Builder + getFloatTypeOptionsBuilder() { + return getFloatTypeOptionsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Float property.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.FloatTypeOptions float_type_options = 8; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.FloatTypeOptionsOrBuilder + getFloatTypeOptionsOrBuilder() { + if ((valueTypeOptionsCase_ == 8) && (floatTypeOptionsBuilder_ != null)) { + return floatTypeOptionsBuilder_.getMessageOrBuilder(); + } else { + if (valueTypeOptionsCase_ == 8) { + return (com.google.cloud.contentwarehouse.v1.FloatTypeOptions) valueTypeOptions_; + } + return com.google.cloud.contentwarehouse.v1.FloatTypeOptions.getDefaultInstance(); + } + } + /** + * + * + *
+     * Float property.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.FloatTypeOptions float_type_options = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.FloatTypeOptions, + com.google.cloud.contentwarehouse.v1.FloatTypeOptions.Builder, + com.google.cloud.contentwarehouse.v1.FloatTypeOptionsOrBuilder> + getFloatTypeOptionsFieldBuilder() { + if (floatTypeOptionsBuilder_ == null) { + if (!(valueTypeOptionsCase_ == 8)) { + valueTypeOptions_ = + com.google.cloud.contentwarehouse.v1.FloatTypeOptions.getDefaultInstance(); + } + floatTypeOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.FloatTypeOptions, + com.google.cloud.contentwarehouse.v1.FloatTypeOptions.Builder, + com.google.cloud.contentwarehouse.v1.FloatTypeOptionsOrBuilder>( + (com.google.cloud.contentwarehouse.v1.FloatTypeOptions) valueTypeOptions_, + getParentForChildren(), + isClean()); + valueTypeOptions_ = null; + } + valueTypeOptionsCase_ = 8; + onChanged(); + ; + return floatTypeOptionsBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.TextTypeOptions, + com.google.cloud.contentwarehouse.v1.TextTypeOptions.Builder, + com.google.cloud.contentwarehouse.v1.TextTypeOptionsOrBuilder> + textTypeOptionsBuilder_; + /** + * + * + *
+     * Text/string property.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.TextTypeOptions text_type_options = 9; + * + * @return Whether the textTypeOptions field is set. + */ + @java.lang.Override + public boolean hasTextTypeOptions() { + return valueTypeOptionsCase_ == 9; + } + /** + * + * + *
+     * Text/string property.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.TextTypeOptions text_type_options = 9; + * + * @return The textTypeOptions. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.TextTypeOptions getTextTypeOptions() { + if (textTypeOptionsBuilder_ == null) { + if (valueTypeOptionsCase_ == 9) { + return (com.google.cloud.contentwarehouse.v1.TextTypeOptions) valueTypeOptions_; + } + return com.google.cloud.contentwarehouse.v1.TextTypeOptions.getDefaultInstance(); + } else { + if (valueTypeOptionsCase_ == 9) { + return textTypeOptionsBuilder_.getMessage(); + } + return com.google.cloud.contentwarehouse.v1.TextTypeOptions.getDefaultInstance(); + } + } + /** + * + * + *
+     * Text/string property.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.TextTypeOptions text_type_options = 9; + */ + public Builder setTextTypeOptions(com.google.cloud.contentwarehouse.v1.TextTypeOptions value) { + if (textTypeOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + valueTypeOptions_ = value; + onChanged(); + } else { + textTypeOptionsBuilder_.setMessage(value); + } + valueTypeOptionsCase_ = 9; + return this; + } + /** + * + * + *
+     * Text/string property.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.TextTypeOptions text_type_options = 9; + */ + public Builder setTextTypeOptions( + com.google.cloud.contentwarehouse.v1.TextTypeOptions.Builder builderForValue) { + if (textTypeOptionsBuilder_ == null) { + valueTypeOptions_ = builderForValue.build(); + onChanged(); + } else { + textTypeOptionsBuilder_.setMessage(builderForValue.build()); + } + valueTypeOptionsCase_ = 9; + return this; + } + /** + * + * + *
+     * Text/string property.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.TextTypeOptions text_type_options = 9; + */ + public Builder mergeTextTypeOptions( + com.google.cloud.contentwarehouse.v1.TextTypeOptions value) { + if (textTypeOptionsBuilder_ == null) { + if (valueTypeOptionsCase_ == 9 + && valueTypeOptions_ + != com.google.cloud.contentwarehouse.v1.TextTypeOptions.getDefaultInstance()) { + valueTypeOptions_ = + com.google.cloud.contentwarehouse.v1.TextTypeOptions.newBuilder( + (com.google.cloud.contentwarehouse.v1.TextTypeOptions) valueTypeOptions_) + .mergeFrom(value) + .buildPartial(); + } else { + valueTypeOptions_ = value; + } + onChanged(); + } else { + if (valueTypeOptionsCase_ == 9) { + textTypeOptionsBuilder_.mergeFrom(value); + } else { + textTypeOptionsBuilder_.setMessage(value); + } + } + valueTypeOptionsCase_ = 9; + return this; + } + /** + * + * + *
+     * Text/string property.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.TextTypeOptions text_type_options = 9; + */ + public Builder clearTextTypeOptions() { + if (textTypeOptionsBuilder_ == null) { + if (valueTypeOptionsCase_ == 9) { + valueTypeOptionsCase_ = 0; + valueTypeOptions_ = null; + onChanged(); + } + } else { + if (valueTypeOptionsCase_ == 9) { + valueTypeOptionsCase_ = 0; + valueTypeOptions_ = null; + } + textTypeOptionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Text/string property.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.TextTypeOptions text_type_options = 9; + */ + public com.google.cloud.contentwarehouse.v1.TextTypeOptions.Builder + getTextTypeOptionsBuilder() { + return getTextTypeOptionsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Text/string property.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.TextTypeOptions text_type_options = 9; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.TextTypeOptionsOrBuilder + getTextTypeOptionsOrBuilder() { + if ((valueTypeOptionsCase_ == 9) && (textTypeOptionsBuilder_ != null)) { + return textTypeOptionsBuilder_.getMessageOrBuilder(); + } else { + if (valueTypeOptionsCase_ == 9) { + return (com.google.cloud.contentwarehouse.v1.TextTypeOptions) valueTypeOptions_; + } + return com.google.cloud.contentwarehouse.v1.TextTypeOptions.getDefaultInstance(); + } + } + /** + * + * + *
+     * Text/string property.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.TextTypeOptions text_type_options = 9; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.TextTypeOptions, + com.google.cloud.contentwarehouse.v1.TextTypeOptions.Builder, + com.google.cloud.contentwarehouse.v1.TextTypeOptionsOrBuilder> + getTextTypeOptionsFieldBuilder() { + if (textTypeOptionsBuilder_ == null) { + if (!(valueTypeOptionsCase_ == 9)) { + valueTypeOptions_ = + com.google.cloud.contentwarehouse.v1.TextTypeOptions.getDefaultInstance(); + } + textTypeOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.TextTypeOptions, + com.google.cloud.contentwarehouse.v1.TextTypeOptions.Builder, + com.google.cloud.contentwarehouse.v1.TextTypeOptionsOrBuilder>( + (com.google.cloud.contentwarehouse.v1.TextTypeOptions) valueTypeOptions_, + getParentForChildren(), + isClean()); + valueTypeOptions_ = null; + } + valueTypeOptionsCase_ = 9; + onChanged(); + ; + return textTypeOptionsBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.PropertyTypeOptions, + com.google.cloud.contentwarehouse.v1.PropertyTypeOptions.Builder, + com.google.cloud.contentwarehouse.v1.PropertyTypeOptionsOrBuilder> + propertyTypeOptionsBuilder_; + /** + * + * + *
+     * Nested structured data property.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.PropertyTypeOptions property_type_options = 10; + * + * + * @return Whether the propertyTypeOptions field is set. + */ + @java.lang.Override + public boolean hasPropertyTypeOptions() { + return valueTypeOptionsCase_ == 10; + } + /** + * + * + *
+     * Nested structured data property.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.PropertyTypeOptions property_type_options = 10; + * + * + * @return The propertyTypeOptions. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.PropertyTypeOptions getPropertyTypeOptions() { + if (propertyTypeOptionsBuilder_ == null) { + if (valueTypeOptionsCase_ == 10) { + return (com.google.cloud.contentwarehouse.v1.PropertyTypeOptions) valueTypeOptions_; + } + return com.google.cloud.contentwarehouse.v1.PropertyTypeOptions.getDefaultInstance(); + } else { + if (valueTypeOptionsCase_ == 10) { + return propertyTypeOptionsBuilder_.getMessage(); + } + return com.google.cloud.contentwarehouse.v1.PropertyTypeOptions.getDefaultInstance(); + } + } + /** + * + * + *
+     * Nested structured data property.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.PropertyTypeOptions property_type_options = 10; + * + */ + public Builder setPropertyTypeOptions( + com.google.cloud.contentwarehouse.v1.PropertyTypeOptions value) { + if (propertyTypeOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + valueTypeOptions_ = value; + onChanged(); + } else { + propertyTypeOptionsBuilder_.setMessage(value); + } + valueTypeOptionsCase_ = 10; + return this; + } + /** + * + * + *
+     * Nested structured data property.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.PropertyTypeOptions property_type_options = 10; + * + */ + public Builder setPropertyTypeOptions( + com.google.cloud.contentwarehouse.v1.PropertyTypeOptions.Builder builderForValue) { + if (propertyTypeOptionsBuilder_ == null) { + valueTypeOptions_ = builderForValue.build(); + onChanged(); + } else { + propertyTypeOptionsBuilder_.setMessage(builderForValue.build()); + } + valueTypeOptionsCase_ = 10; + return this; + } + /** + * + * + *
+     * Nested structured data property.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.PropertyTypeOptions property_type_options = 10; + * + */ + public Builder mergePropertyTypeOptions( + com.google.cloud.contentwarehouse.v1.PropertyTypeOptions value) { + if (propertyTypeOptionsBuilder_ == null) { + if (valueTypeOptionsCase_ == 10 + && valueTypeOptions_ + != com.google.cloud.contentwarehouse.v1.PropertyTypeOptions.getDefaultInstance()) { + valueTypeOptions_ = + com.google.cloud.contentwarehouse.v1.PropertyTypeOptions.newBuilder( + (com.google.cloud.contentwarehouse.v1.PropertyTypeOptions) valueTypeOptions_) + .mergeFrom(value) + .buildPartial(); + } else { + valueTypeOptions_ = value; + } + onChanged(); + } else { + if (valueTypeOptionsCase_ == 10) { + propertyTypeOptionsBuilder_.mergeFrom(value); + } else { + propertyTypeOptionsBuilder_.setMessage(value); + } + } + valueTypeOptionsCase_ = 10; + return this; + } + /** + * + * + *
+     * Nested structured data property.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.PropertyTypeOptions property_type_options = 10; + * + */ + public Builder clearPropertyTypeOptions() { + if (propertyTypeOptionsBuilder_ == null) { + if (valueTypeOptionsCase_ == 10) { + valueTypeOptionsCase_ = 0; + valueTypeOptions_ = null; + onChanged(); + } + } else { + if (valueTypeOptionsCase_ == 10) { + valueTypeOptionsCase_ = 0; + valueTypeOptions_ = null; + } + propertyTypeOptionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Nested structured data property.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.PropertyTypeOptions property_type_options = 10; + * + */ + public com.google.cloud.contentwarehouse.v1.PropertyTypeOptions.Builder + getPropertyTypeOptionsBuilder() { + return getPropertyTypeOptionsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Nested structured data property.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.PropertyTypeOptions property_type_options = 10; + * + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.PropertyTypeOptionsOrBuilder + getPropertyTypeOptionsOrBuilder() { + if ((valueTypeOptionsCase_ == 10) && (propertyTypeOptionsBuilder_ != null)) { + return propertyTypeOptionsBuilder_.getMessageOrBuilder(); + } else { + if (valueTypeOptionsCase_ == 10) { + return (com.google.cloud.contentwarehouse.v1.PropertyTypeOptions) valueTypeOptions_; + } + return com.google.cloud.contentwarehouse.v1.PropertyTypeOptions.getDefaultInstance(); + } + } + /** + * + * + *
+     * Nested structured data property.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.PropertyTypeOptions property_type_options = 10; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.PropertyTypeOptions, + com.google.cloud.contentwarehouse.v1.PropertyTypeOptions.Builder, + com.google.cloud.contentwarehouse.v1.PropertyTypeOptionsOrBuilder> + getPropertyTypeOptionsFieldBuilder() { + if (propertyTypeOptionsBuilder_ == null) { + if (!(valueTypeOptionsCase_ == 10)) { + valueTypeOptions_ = + com.google.cloud.contentwarehouse.v1.PropertyTypeOptions.getDefaultInstance(); + } + propertyTypeOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.PropertyTypeOptions, + com.google.cloud.contentwarehouse.v1.PropertyTypeOptions.Builder, + com.google.cloud.contentwarehouse.v1.PropertyTypeOptionsOrBuilder>( + (com.google.cloud.contentwarehouse.v1.PropertyTypeOptions) valueTypeOptions_, + getParentForChildren(), + isClean()); + valueTypeOptions_ = null; + } + valueTypeOptionsCase_ = 10; + onChanged(); + ; + return propertyTypeOptionsBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.EnumTypeOptions, + com.google.cloud.contentwarehouse.v1.EnumTypeOptions.Builder, + com.google.cloud.contentwarehouse.v1.EnumTypeOptionsOrBuilder> + enumTypeOptionsBuilder_; + /** + * + * + *
+     * Enum/categorical property.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.EnumTypeOptions enum_type_options = 11; + * + * @return Whether the enumTypeOptions field is set. + */ + @java.lang.Override + public boolean hasEnumTypeOptions() { + return valueTypeOptionsCase_ == 11; + } + /** + * + * + *
+     * Enum/categorical property.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.EnumTypeOptions enum_type_options = 11; + * + * @return The enumTypeOptions. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.EnumTypeOptions getEnumTypeOptions() { + if (enumTypeOptionsBuilder_ == null) { + if (valueTypeOptionsCase_ == 11) { + return (com.google.cloud.contentwarehouse.v1.EnumTypeOptions) valueTypeOptions_; + } + return com.google.cloud.contentwarehouse.v1.EnumTypeOptions.getDefaultInstance(); + } else { + if (valueTypeOptionsCase_ == 11) { + return enumTypeOptionsBuilder_.getMessage(); + } + return com.google.cloud.contentwarehouse.v1.EnumTypeOptions.getDefaultInstance(); + } + } + /** + * + * + *
+     * Enum/categorical property.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.EnumTypeOptions enum_type_options = 11; + */ + public Builder setEnumTypeOptions(com.google.cloud.contentwarehouse.v1.EnumTypeOptions value) { + if (enumTypeOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + valueTypeOptions_ = value; + onChanged(); + } else { + enumTypeOptionsBuilder_.setMessage(value); + } + valueTypeOptionsCase_ = 11; + return this; + } + /** + * + * + *
+     * Enum/categorical property.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.EnumTypeOptions enum_type_options = 11; + */ + public Builder setEnumTypeOptions( + com.google.cloud.contentwarehouse.v1.EnumTypeOptions.Builder builderForValue) { + if (enumTypeOptionsBuilder_ == null) { + valueTypeOptions_ = builderForValue.build(); + onChanged(); + } else { + enumTypeOptionsBuilder_.setMessage(builderForValue.build()); + } + valueTypeOptionsCase_ = 11; + return this; + } + /** + * + * + *
+     * Enum/categorical property.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.EnumTypeOptions enum_type_options = 11; + */ + public Builder mergeEnumTypeOptions( + com.google.cloud.contentwarehouse.v1.EnumTypeOptions value) { + if (enumTypeOptionsBuilder_ == null) { + if (valueTypeOptionsCase_ == 11 + && valueTypeOptions_ + != com.google.cloud.contentwarehouse.v1.EnumTypeOptions.getDefaultInstance()) { + valueTypeOptions_ = + com.google.cloud.contentwarehouse.v1.EnumTypeOptions.newBuilder( + (com.google.cloud.contentwarehouse.v1.EnumTypeOptions) valueTypeOptions_) + .mergeFrom(value) + .buildPartial(); + } else { + valueTypeOptions_ = value; + } + onChanged(); + } else { + if (valueTypeOptionsCase_ == 11) { + enumTypeOptionsBuilder_.mergeFrom(value); + } else { + enumTypeOptionsBuilder_.setMessage(value); + } + } + valueTypeOptionsCase_ = 11; + return this; + } + /** + * + * + *
+     * Enum/categorical property.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.EnumTypeOptions enum_type_options = 11; + */ + public Builder clearEnumTypeOptions() { + if (enumTypeOptionsBuilder_ == null) { + if (valueTypeOptionsCase_ == 11) { + valueTypeOptionsCase_ = 0; + valueTypeOptions_ = null; + onChanged(); + } + } else { + if (valueTypeOptionsCase_ == 11) { + valueTypeOptionsCase_ = 0; + valueTypeOptions_ = null; + } + enumTypeOptionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Enum/categorical property.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.EnumTypeOptions enum_type_options = 11; + */ + public com.google.cloud.contentwarehouse.v1.EnumTypeOptions.Builder + getEnumTypeOptionsBuilder() { + return getEnumTypeOptionsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Enum/categorical property.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.EnumTypeOptions enum_type_options = 11; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.EnumTypeOptionsOrBuilder + getEnumTypeOptionsOrBuilder() { + if ((valueTypeOptionsCase_ == 11) && (enumTypeOptionsBuilder_ != null)) { + return enumTypeOptionsBuilder_.getMessageOrBuilder(); + } else { + if (valueTypeOptionsCase_ == 11) { + return (com.google.cloud.contentwarehouse.v1.EnumTypeOptions) valueTypeOptions_; + } + return com.google.cloud.contentwarehouse.v1.EnumTypeOptions.getDefaultInstance(); + } + } + /** + * + * + *
+     * Enum/categorical property.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.EnumTypeOptions enum_type_options = 11; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.EnumTypeOptions, + com.google.cloud.contentwarehouse.v1.EnumTypeOptions.Builder, + com.google.cloud.contentwarehouse.v1.EnumTypeOptionsOrBuilder> + getEnumTypeOptionsFieldBuilder() { + if (enumTypeOptionsBuilder_ == null) { + if (!(valueTypeOptionsCase_ == 11)) { + valueTypeOptions_ = + com.google.cloud.contentwarehouse.v1.EnumTypeOptions.getDefaultInstance(); + } + enumTypeOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.EnumTypeOptions, + com.google.cloud.contentwarehouse.v1.EnumTypeOptions.Builder, + com.google.cloud.contentwarehouse.v1.EnumTypeOptionsOrBuilder>( + (com.google.cloud.contentwarehouse.v1.EnumTypeOptions) valueTypeOptions_, + getParentForChildren(), + isClean()); + valueTypeOptions_ = null; + } + valueTypeOptionsCase_ = 11; + onChanged(); + ; + return enumTypeOptionsBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions, + com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions.Builder, + com.google.cloud.contentwarehouse.v1.DateTimeTypeOptionsOrBuilder> + dateTimeTypeOptionsBuilder_; + /** + * + * + *
+     * Date time property.
+     * It is not supported by CMEK compliant deployment.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DateTimeTypeOptions date_time_type_options = 13; + * + * + * @return Whether the dateTimeTypeOptions field is set. + */ + @java.lang.Override + public boolean hasDateTimeTypeOptions() { + return valueTypeOptionsCase_ == 13; + } + /** + * + * + *
+     * Date time property.
+     * It is not supported by CMEK compliant deployment.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DateTimeTypeOptions date_time_type_options = 13; + * + * + * @return The dateTimeTypeOptions. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions getDateTimeTypeOptions() { + if (dateTimeTypeOptionsBuilder_ == null) { + if (valueTypeOptionsCase_ == 13) { + return (com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions) valueTypeOptions_; + } + return com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions.getDefaultInstance(); + } else { + if (valueTypeOptionsCase_ == 13) { + return dateTimeTypeOptionsBuilder_.getMessage(); + } + return com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions.getDefaultInstance(); + } + } + /** + * + * + *
+     * Date time property.
+     * It is not supported by CMEK compliant deployment.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DateTimeTypeOptions date_time_type_options = 13; + * + */ + public Builder setDateTimeTypeOptions( + com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions value) { + if (dateTimeTypeOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + valueTypeOptions_ = value; + onChanged(); + } else { + dateTimeTypeOptionsBuilder_.setMessage(value); + } + valueTypeOptionsCase_ = 13; + return this; + } + /** + * + * + *
+     * Date time property.
+     * It is not supported by CMEK compliant deployment.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DateTimeTypeOptions date_time_type_options = 13; + * + */ + public Builder setDateTimeTypeOptions( + com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions.Builder builderForValue) { + if (dateTimeTypeOptionsBuilder_ == null) { + valueTypeOptions_ = builderForValue.build(); + onChanged(); + } else { + dateTimeTypeOptionsBuilder_.setMessage(builderForValue.build()); + } + valueTypeOptionsCase_ = 13; + return this; + } + /** + * + * + *
+     * Date time property.
+     * It is not supported by CMEK compliant deployment.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DateTimeTypeOptions date_time_type_options = 13; + * + */ + public Builder mergeDateTimeTypeOptions( + com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions value) { + if (dateTimeTypeOptionsBuilder_ == null) { + if (valueTypeOptionsCase_ == 13 + && valueTypeOptions_ + != com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions.getDefaultInstance()) { + valueTypeOptions_ = + com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions.newBuilder( + (com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions) valueTypeOptions_) + .mergeFrom(value) + .buildPartial(); + } else { + valueTypeOptions_ = value; + } + onChanged(); + } else { + if (valueTypeOptionsCase_ == 13) { + dateTimeTypeOptionsBuilder_.mergeFrom(value); + } else { + dateTimeTypeOptionsBuilder_.setMessage(value); + } + } + valueTypeOptionsCase_ = 13; + return this; + } + /** + * + * + *
+     * Date time property.
+     * It is not supported by CMEK compliant deployment.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DateTimeTypeOptions date_time_type_options = 13; + * + */ + public Builder clearDateTimeTypeOptions() { + if (dateTimeTypeOptionsBuilder_ == null) { + if (valueTypeOptionsCase_ == 13) { + valueTypeOptionsCase_ = 0; + valueTypeOptions_ = null; + onChanged(); + } + } else { + if (valueTypeOptionsCase_ == 13) { + valueTypeOptionsCase_ = 0; + valueTypeOptions_ = null; + } + dateTimeTypeOptionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Date time property.
+     * It is not supported by CMEK compliant deployment.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DateTimeTypeOptions date_time_type_options = 13; + * + */ + public com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions.Builder + getDateTimeTypeOptionsBuilder() { + return getDateTimeTypeOptionsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Date time property.
+     * It is not supported by CMEK compliant deployment.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DateTimeTypeOptions date_time_type_options = 13; + * + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DateTimeTypeOptionsOrBuilder + getDateTimeTypeOptionsOrBuilder() { + if ((valueTypeOptionsCase_ == 13) && (dateTimeTypeOptionsBuilder_ != null)) { + return dateTimeTypeOptionsBuilder_.getMessageOrBuilder(); + } else { + if (valueTypeOptionsCase_ == 13) { + return (com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions) valueTypeOptions_; + } + return com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions.getDefaultInstance(); + } + } + /** + * + * + *
+     * Date time property.
+     * It is not supported by CMEK compliant deployment.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DateTimeTypeOptions date_time_type_options = 13; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions, + com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions.Builder, + com.google.cloud.contentwarehouse.v1.DateTimeTypeOptionsOrBuilder> + getDateTimeTypeOptionsFieldBuilder() { + if (dateTimeTypeOptionsBuilder_ == null) { + if (!(valueTypeOptionsCase_ == 13)) { + valueTypeOptions_ = + com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions.getDefaultInstance(); + } + dateTimeTypeOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions, + com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions.Builder, + com.google.cloud.contentwarehouse.v1.DateTimeTypeOptionsOrBuilder>( + (com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions) valueTypeOptions_, + getParentForChildren(), + isClean()); + valueTypeOptions_ = null; + } + valueTypeOptionsCase_ = 13; + onChanged(); + ; + return dateTimeTypeOptionsBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.MapTypeOptions, + com.google.cloud.contentwarehouse.v1.MapTypeOptions.Builder, + com.google.cloud.contentwarehouse.v1.MapTypeOptionsOrBuilder> + mapTypeOptionsBuilder_; + /** + * + * + *
+     * Map property.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.MapTypeOptions map_type_options = 15; + * + * @return Whether the mapTypeOptions field is set. + */ + @java.lang.Override + public boolean hasMapTypeOptions() { + return valueTypeOptionsCase_ == 15; + } + /** + * + * + *
+     * Map property.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.MapTypeOptions map_type_options = 15; + * + * @return The mapTypeOptions. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.MapTypeOptions getMapTypeOptions() { + if (mapTypeOptionsBuilder_ == null) { + if (valueTypeOptionsCase_ == 15) { + return (com.google.cloud.contentwarehouse.v1.MapTypeOptions) valueTypeOptions_; + } + return com.google.cloud.contentwarehouse.v1.MapTypeOptions.getDefaultInstance(); + } else { + if (valueTypeOptionsCase_ == 15) { + return mapTypeOptionsBuilder_.getMessage(); + } + return com.google.cloud.contentwarehouse.v1.MapTypeOptions.getDefaultInstance(); + } + } + /** + * + * + *
+     * Map property.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.MapTypeOptions map_type_options = 15; + */ + public Builder setMapTypeOptions(com.google.cloud.contentwarehouse.v1.MapTypeOptions value) { + if (mapTypeOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + valueTypeOptions_ = value; + onChanged(); + } else { + mapTypeOptionsBuilder_.setMessage(value); + } + valueTypeOptionsCase_ = 15; + return this; + } + /** + * + * + *
+     * Map property.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.MapTypeOptions map_type_options = 15; + */ + public Builder setMapTypeOptions( + com.google.cloud.contentwarehouse.v1.MapTypeOptions.Builder builderForValue) { + if (mapTypeOptionsBuilder_ == null) { + valueTypeOptions_ = builderForValue.build(); + onChanged(); + } else { + mapTypeOptionsBuilder_.setMessage(builderForValue.build()); + } + valueTypeOptionsCase_ = 15; + return this; + } + /** + * + * + *
+     * Map property.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.MapTypeOptions map_type_options = 15; + */ + public Builder mergeMapTypeOptions(com.google.cloud.contentwarehouse.v1.MapTypeOptions value) { + if (mapTypeOptionsBuilder_ == null) { + if (valueTypeOptionsCase_ == 15 + && valueTypeOptions_ + != com.google.cloud.contentwarehouse.v1.MapTypeOptions.getDefaultInstance()) { + valueTypeOptions_ = + com.google.cloud.contentwarehouse.v1.MapTypeOptions.newBuilder( + (com.google.cloud.contentwarehouse.v1.MapTypeOptions) valueTypeOptions_) + .mergeFrom(value) + .buildPartial(); + } else { + valueTypeOptions_ = value; + } + onChanged(); + } else { + if (valueTypeOptionsCase_ == 15) { + mapTypeOptionsBuilder_.mergeFrom(value); + } else { + mapTypeOptionsBuilder_.setMessage(value); + } + } + valueTypeOptionsCase_ = 15; + return this; + } + /** + * + * + *
+     * Map property.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.MapTypeOptions map_type_options = 15; + */ + public Builder clearMapTypeOptions() { + if (mapTypeOptionsBuilder_ == null) { + if (valueTypeOptionsCase_ == 15) { + valueTypeOptionsCase_ = 0; + valueTypeOptions_ = null; + onChanged(); + } + } else { + if (valueTypeOptionsCase_ == 15) { + valueTypeOptionsCase_ = 0; + valueTypeOptions_ = null; + } + mapTypeOptionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Map property.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.MapTypeOptions map_type_options = 15; + */ + public com.google.cloud.contentwarehouse.v1.MapTypeOptions.Builder getMapTypeOptionsBuilder() { + return getMapTypeOptionsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Map property.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.MapTypeOptions map_type_options = 15; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.MapTypeOptionsOrBuilder + getMapTypeOptionsOrBuilder() { + if ((valueTypeOptionsCase_ == 15) && (mapTypeOptionsBuilder_ != null)) { + return mapTypeOptionsBuilder_.getMessageOrBuilder(); + } else { + if (valueTypeOptionsCase_ == 15) { + return (com.google.cloud.contentwarehouse.v1.MapTypeOptions) valueTypeOptions_; + } + return com.google.cloud.contentwarehouse.v1.MapTypeOptions.getDefaultInstance(); + } + } + /** + * + * + *
+     * Map property.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.MapTypeOptions map_type_options = 15; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.MapTypeOptions, + com.google.cloud.contentwarehouse.v1.MapTypeOptions.Builder, + com.google.cloud.contentwarehouse.v1.MapTypeOptionsOrBuilder> + getMapTypeOptionsFieldBuilder() { + if (mapTypeOptionsBuilder_ == null) { + if (!(valueTypeOptionsCase_ == 15)) { + valueTypeOptions_ = + com.google.cloud.contentwarehouse.v1.MapTypeOptions.getDefaultInstance(); + } + mapTypeOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.MapTypeOptions, + com.google.cloud.contentwarehouse.v1.MapTypeOptions.Builder, + com.google.cloud.contentwarehouse.v1.MapTypeOptionsOrBuilder>( + (com.google.cloud.contentwarehouse.v1.MapTypeOptions) valueTypeOptions_, + getParentForChildren(), + isClean()); + valueTypeOptions_ = null; + } + valueTypeOptionsCase_ = 15; + onChanged(); + ; + return mapTypeOptionsBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.TimestampTypeOptions, + com.google.cloud.contentwarehouse.v1.TimestampTypeOptions.Builder, + com.google.cloud.contentwarehouse.v1.TimestampTypeOptionsOrBuilder> + timestampTypeOptionsBuilder_; + /** + * + * + *
+     * Timestamp property.
+     * It is not supported by CMEK compliant deployment.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.TimestampTypeOptions timestamp_type_options = 16; + * + * + * @return Whether the timestampTypeOptions field is set. + */ + @java.lang.Override + public boolean hasTimestampTypeOptions() { + return valueTypeOptionsCase_ == 16; + } + /** + * + * + *
+     * Timestamp property.
+     * It is not supported by CMEK compliant deployment.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.TimestampTypeOptions timestamp_type_options = 16; + * + * + * @return The timestampTypeOptions. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.TimestampTypeOptions getTimestampTypeOptions() { + if (timestampTypeOptionsBuilder_ == null) { + if (valueTypeOptionsCase_ == 16) { + return (com.google.cloud.contentwarehouse.v1.TimestampTypeOptions) valueTypeOptions_; + } + return com.google.cloud.contentwarehouse.v1.TimestampTypeOptions.getDefaultInstance(); + } else { + if (valueTypeOptionsCase_ == 16) { + return timestampTypeOptionsBuilder_.getMessage(); + } + return com.google.cloud.contentwarehouse.v1.TimestampTypeOptions.getDefaultInstance(); + } + } + /** + * + * + *
+     * Timestamp property.
+     * It is not supported by CMEK compliant deployment.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.TimestampTypeOptions timestamp_type_options = 16; + * + */ + public Builder setTimestampTypeOptions( + com.google.cloud.contentwarehouse.v1.TimestampTypeOptions value) { + if (timestampTypeOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + valueTypeOptions_ = value; + onChanged(); + } else { + timestampTypeOptionsBuilder_.setMessage(value); + } + valueTypeOptionsCase_ = 16; + return this; + } + /** + * + * + *
+     * Timestamp property.
+     * It is not supported by CMEK compliant deployment.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.TimestampTypeOptions timestamp_type_options = 16; + * + */ + public Builder setTimestampTypeOptions( + com.google.cloud.contentwarehouse.v1.TimestampTypeOptions.Builder builderForValue) { + if (timestampTypeOptionsBuilder_ == null) { + valueTypeOptions_ = builderForValue.build(); + onChanged(); + } else { + timestampTypeOptionsBuilder_.setMessage(builderForValue.build()); + } + valueTypeOptionsCase_ = 16; + return this; + } + /** + * + * + *
+     * Timestamp property.
+     * It is not supported by CMEK compliant deployment.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.TimestampTypeOptions timestamp_type_options = 16; + * + */ + public Builder mergeTimestampTypeOptions( + com.google.cloud.contentwarehouse.v1.TimestampTypeOptions value) { + if (timestampTypeOptionsBuilder_ == null) { + if (valueTypeOptionsCase_ == 16 + && valueTypeOptions_ + != com.google.cloud.contentwarehouse.v1.TimestampTypeOptions.getDefaultInstance()) { + valueTypeOptions_ = + com.google.cloud.contentwarehouse.v1.TimestampTypeOptions.newBuilder( + (com.google.cloud.contentwarehouse.v1.TimestampTypeOptions) valueTypeOptions_) + .mergeFrom(value) + .buildPartial(); + } else { + valueTypeOptions_ = value; + } + onChanged(); + } else { + if (valueTypeOptionsCase_ == 16) { + timestampTypeOptionsBuilder_.mergeFrom(value); + } else { + timestampTypeOptionsBuilder_.setMessage(value); + } + } + valueTypeOptionsCase_ = 16; + return this; + } + /** + * + * + *
+     * Timestamp property.
+     * It is not supported by CMEK compliant deployment.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.TimestampTypeOptions timestamp_type_options = 16; + * + */ + public Builder clearTimestampTypeOptions() { + if (timestampTypeOptionsBuilder_ == null) { + if (valueTypeOptionsCase_ == 16) { + valueTypeOptionsCase_ = 0; + valueTypeOptions_ = null; + onChanged(); + } + } else { + if (valueTypeOptionsCase_ == 16) { + valueTypeOptionsCase_ = 0; + valueTypeOptions_ = null; + } + timestampTypeOptionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Timestamp property.
+     * It is not supported by CMEK compliant deployment.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.TimestampTypeOptions timestamp_type_options = 16; + * + */ + public com.google.cloud.contentwarehouse.v1.TimestampTypeOptions.Builder + getTimestampTypeOptionsBuilder() { + return getTimestampTypeOptionsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Timestamp property.
+     * It is not supported by CMEK compliant deployment.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.TimestampTypeOptions timestamp_type_options = 16; + * + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.TimestampTypeOptionsOrBuilder + getTimestampTypeOptionsOrBuilder() { + if ((valueTypeOptionsCase_ == 16) && (timestampTypeOptionsBuilder_ != null)) { + return timestampTypeOptionsBuilder_.getMessageOrBuilder(); + } else { + if (valueTypeOptionsCase_ == 16) { + return (com.google.cloud.contentwarehouse.v1.TimestampTypeOptions) valueTypeOptions_; + } + return com.google.cloud.contentwarehouse.v1.TimestampTypeOptions.getDefaultInstance(); + } + } + /** + * + * + *
+     * Timestamp property.
+     * It is not supported by CMEK compliant deployment.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.TimestampTypeOptions timestamp_type_options = 16; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.TimestampTypeOptions, + com.google.cloud.contentwarehouse.v1.TimestampTypeOptions.Builder, + com.google.cloud.contentwarehouse.v1.TimestampTypeOptionsOrBuilder> + getTimestampTypeOptionsFieldBuilder() { + if (timestampTypeOptionsBuilder_ == null) { + if (!(valueTypeOptionsCase_ == 16)) { + valueTypeOptions_ = + com.google.cloud.contentwarehouse.v1.TimestampTypeOptions.getDefaultInstance(); + } + timestampTypeOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.TimestampTypeOptions, + com.google.cloud.contentwarehouse.v1.TimestampTypeOptions.Builder, + com.google.cloud.contentwarehouse.v1.TimestampTypeOptionsOrBuilder>( + (com.google.cloud.contentwarehouse.v1.TimestampTypeOptions) valueTypeOptions_, + getParentForChildren(), + isClean()); + valueTypeOptions_ = null; + } + valueTypeOptionsCase_ = 16; + onChanged(); + ; + return timestampTypeOptionsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.PropertyDefinition) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.PropertyDefinition) + private static final com.google.cloud.contentwarehouse.v1.PropertyDefinition DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.PropertyDefinition(); + } + + public static com.google.cloud.contentwarehouse.v1.PropertyDefinition getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PropertyDefinition parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.PropertyDefinition getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/PropertyDefinitionOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/PropertyDefinitionOrBuilder.java new file mode 100644 index 000000000000..aab61c8d9d88 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/PropertyDefinitionOrBuilder.java @@ -0,0 +1,444 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_schema.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface PropertyDefinitionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.PropertyDefinition) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the metadata property.
+   * Must be unique within a document schema and is case insensitive.
+   * Names must be non-blank, start with a letter, and can contain alphanumeric
+   * characters and: /, :, -, _, and .
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the metadata property.
+   * Must be unique within a document schema and is case insensitive.
+   * Names must be non-blank, start with a letter, and can contain alphanumeric
+   * characters and: /, :, -, _, and .
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The display-name for the property, used for front-end.
+   * 
+ * + * string display_name = 12; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * The display-name for the property, used for front-end.
+   * 
+ * + * string display_name = 12; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Whether the property can have multiple values.
+   * 
+ * + * bool is_repeatable = 2; + * + * @return The isRepeatable. + */ + boolean getIsRepeatable(); + + /** + * + * + *
+   * Whether the property can be filtered. If this is a sub-property, all the
+   * parent properties must be marked filterable.
+   * 
+ * + * bool is_filterable = 3; + * + * @return The isFilterable. + */ + boolean getIsFilterable(); + + /** + * + * + *
+   * Indicates that the property should be included in a global search.
+   * 
+ * + * bool is_searchable = 4; + * + * @return The isSearchable. + */ + boolean getIsSearchable(); + + /** + * + * + *
+   * Whether the property is user supplied metadata.
+   * 
+ * + * bool is_metadata = 5; + * + * @return The isMetadata. + */ + boolean getIsMetadata(); + + /** + * + * + *
+   * Whether the property is mandatory.
+   * Default is 'false', i.e. populating property value can be skipped.
+   * If 'true' then user must populate the value for this property.
+   * 
+ * + * bool is_required = 14; + * + * @return The isRequired. + */ + boolean getIsRequired(); + + /** + * + * + *
+   * Integer property.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.IntegerTypeOptions integer_type_options = 7; + * + * @return Whether the integerTypeOptions field is set. + */ + boolean hasIntegerTypeOptions(); + /** + * + * + *
+   * Integer property.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.IntegerTypeOptions integer_type_options = 7; + * + * @return The integerTypeOptions. + */ + com.google.cloud.contentwarehouse.v1.IntegerTypeOptions getIntegerTypeOptions(); + /** + * + * + *
+   * Integer property.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.IntegerTypeOptions integer_type_options = 7; + */ + com.google.cloud.contentwarehouse.v1.IntegerTypeOptionsOrBuilder getIntegerTypeOptionsOrBuilder(); + + /** + * + * + *
+   * Float property.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.FloatTypeOptions float_type_options = 8; + * + * @return Whether the floatTypeOptions field is set. + */ + boolean hasFloatTypeOptions(); + /** + * + * + *
+   * Float property.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.FloatTypeOptions float_type_options = 8; + * + * @return The floatTypeOptions. + */ + com.google.cloud.contentwarehouse.v1.FloatTypeOptions getFloatTypeOptions(); + /** + * + * + *
+   * Float property.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.FloatTypeOptions float_type_options = 8; + */ + com.google.cloud.contentwarehouse.v1.FloatTypeOptionsOrBuilder getFloatTypeOptionsOrBuilder(); + + /** + * + * + *
+   * Text/string property.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.TextTypeOptions text_type_options = 9; + * + * @return Whether the textTypeOptions field is set. + */ + boolean hasTextTypeOptions(); + /** + * + * + *
+   * Text/string property.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.TextTypeOptions text_type_options = 9; + * + * @return The textTypeOptions. + */ + com.google.cloud.contentwarehouse.v1.TextTypeOptions getTextTypeOptions(); + /** + * + * + *
+   * Text/string property.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.TextTypeOptions text_type_options = 9; + */ + com.google.cloud.contentwarehouse.v1.TextTypeOptionsOrBuilder getTextTypeOptionsOrBuilder(); + + /** + * + * + *
+   * Nested structured data property.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.PropertyTypeOptions property_type_options = 10; + * + * @return Whether the propertyTypeOptions field is set. + */ + boolean hasPropertyTypeOptions(); + /** + * + * + *
+   * Nested structured data property.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.PropertyTypeOptions property_type_options = 10; + * + * @return The propertyTypeOptions. + */ + com.google.cloud.contentwarehouse.v1.PropertyTypeOptions getPropertyTypeOptions(); + /** + * + * + *
+   * Nested structured data property.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.PropertyTypeOptions property_type_options = 10; + */ + com.google.cloud.contentwarehouse.v1.PropertyTypeOptionsOrBuilder + getPropertyTypeOptionsOrBuilder(); + + /** + * + * + *
+   * Enum/categorical property.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.EnumTypeOptions enum_type_options = 11; + * + * @return Whether the enumTypeOptions field is set. + */ + boolean hasEnumTypeOptions(); + /** + * + * + *
+   * Enum/categorical property.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.EnumTypeOptions enum_type_options = 11; + * + * @return The enumTypeOptions. + */ + com.google.cloud.contentwarehouse.v1.EnumTypeOptions getEnumTypeOptions(); + /** + * + * + *
+   * Enum/categorical property.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.EnumTypeOptions enum_type_options = 11; + */ + com.google.cloud.contentwarehouse.v1.EnumTypeOptionsOrBuilder getEnumTypeOptionsOrBuilder(); + + /** + * + * + *
+   * Date time property.
+   * It is not supported by CMEK compliant deployment.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.DateTimeTypeOptions date_time_type_options = 13; + * + * @return Whether the dateTimeTypeOptions field is set. + */ + boolean hasDateTimeTypeOptions(); + /** + * + * + *
+   * Date time property.
+   * It is not supported by CMEK compliant deployment.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.DateTimeTypeOptions date_time_type_options = 13; + * + * @return The dateTimeTypeOptions. + */ + com.google.cloud.contentwarehouse.v1.DateTimeTypeOptions getDateTimeTypeOptions(); + /** + * + * + *
+   * Date time property.
+   * It is not supported by CMEK compliant deployment.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.DateTimeTypeOptions date_time_type_options = 13; + */ + com.google.cloud.contentwarehouse.v1.DateTimeTypeOptionsOrBuilder + getDateTimeTypeOptionsOrBuilder(); + + /** + * + * + *
+   * Map property.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.MapTypeOptions map_type_options = 15; + * + * @return Whether the mapTypeOptions field is set. + */ + boolean hasMapTypeOptions(); + /** + * + * + *
+   * Map property.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.MapTypeOptions map_type_options = 15; + * + * @return The mapTypeOptions. + */ + com.google.cloud.contentwarehouse.v1.MapTypeOptions getMapTypeOptions(); + /** + * + * + *
+   * Map property.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.MapTypeOptions map_type_options = 15; + */ + com.google.cloud.contentwarehouse.v1.MapTypeOptionsOrBuilder getMapTypeOptionsOrBuilder(); + + /** + * + * + *
+   * Timestamp property.
+   * It is not supported by CMEK compliant deployment.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.TimestampTypeOptions timestamp_type_options = 16; + * + * + * @return Whether the timestampTypeOptions field is set. + */ + boolean hasTimestampTypeOptions(); + /** + * + * + *
+   * Timestamp property.
+   * It is not supported by CMEK compliant deployment.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.TimestampTypeOptions timestamp_type_options = 16; + * + * + * @return The timestampTypeOptions. + */ + com.google.cloud.contentwarehouse.v1.TimestampTypeOptions getTimestampTypeOptions(); + /** + * + * + *
+   * Timestamp property.
+   * It is not supported by CMEK compliant deployment.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.TimestampTypeOptions timestamp_type_options = 16; + * + */ + com.google.cloud.contentwarehouse.v1.TimestampTypeOptionsOrBuilder + getTimestampTypeOptionsOrBuilder(); + + public com.google.cloud.contentwarehouse.v1.PropertyDefinition.ValueTypeOptionsCase + getValueTypeOptionsCase(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/PropertyFilter.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/PropertyFilter.java new file mode 100644 index 000000000000..1097ed6351ce --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/PropertyFilter.java @@ -0,0 +1,1008 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/filters.proto + +package com.google.cloud.contentwarehouse.v1; + +/** Protobuf type {@code google.cloud.contentwarehouse.v1.PropertyFilter} */ +public final class PropertyFilter extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.PropertyFilter) + PropertyFilterOrBuilder { + private static final long serialVersionUID = 0L; + // Use PropertyFilter.newBuilder() to construct. + private PropertyFilter(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PropertyFilter() { + documentSchemaName_ = ""; + condition_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PropertyFilter(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.FiltersProto + .internal_static_google_cloud_contentwarehouse_v1_PropertyFilter_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.FiltersProto + .internal_static_google_cloud_contentwarehouse_v1_PropertyFilter_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.PropertyFilter.class, + com.google.cloud.contentwarehouse.v1.PropertyFilter.Builder.class); + } + + public static final int DOCUMENT_SCHEMA_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object documentSchemaName_; + /** + * + * + *
+   * The Document schema name [Document.document_schema_name][google.cloud.contentwarehouse.v1.Document.document_schema_name].
+   * Format:
+   * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
+   * 
+ * + * string document_schema_name = 1 [(.google.api.resource_reference) = { ... } + * + * @return The documentSchemaName. + */ + @java.lang.Override + public java.lang.String getDocumentSchemaName() { + java.lang.Object ref = documentSchemaName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + documentSchemaName_ = s; + return s; + } + } + /** + * + * + *
+   * The Document schema name [Document.document_schema_name][google.cloud.contentwarehouse.v1.Document.document_schema_name].
+   * Format:
+   * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
+   * 
+ * + * string document_schema_name = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for documentSchemaName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDocumentSchemaNameBytes() { + java.lang.Object ref = documentSchemaName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + documentSchemaName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONDITION_FIELD_NUMBER = 2; + private volatile java.lang.Object condition_; + /** + * + * + *
+   * The filter condition.
+   * The syntax for this expression is a subset of SQL syntax.
+   * Supported operators are: `=`, `!=`, `<`, `<=`, `>`, `>=`, and `~~` where
+   * the left of the operator is a property name and the right of the operator
+   * is a number or a quoted string. You must escape backslash (\\) and quote
+   * (\") characters.
+   * `~~` is the LIKE operator. The right of the operator must be a string. The
+   * only supported property data type for LIKE is text_values. It provides
+   * semantic search functionality by parsing, stemming and doing synonyms
+   * expansion against the input query. It matches if the property contains
+   * semantic similar content to the query. It is not regex matching or wildcard
+   * matching. For example, "property.company ~~ \"google\"" will match records
+   * whose property `property.compnay` have values like "Google Inc.", "Google
+   * LLC" or "Google Company".
+   * Supported functions are `LOWER([property_name])` to perform a
+   * case insensitive match and `EMPTY([property_name])` to filter on the
+   * existence of a key.
+   * Boolean expressions (AND/OR/NOT) are supported up to 3 levels of nesting
+   * (for example, "((A AND B AND C) OR NOT D) AND E"), a maximum of 100
+   * comparisons or functions are allowed in the expression. The expression must
+   * be < 6000 bytes in length.
+   * Only properties that are marked filterable are allowed
+   * ([PropertyDefinition.is_filterable][google.cloud.contentwarehouse.v1.PropertyDefinition.is_filterable]). Property names do not need to be
+   * prefixed by the document schema id (as is the case with histograms),
+   * however property names will need to be prefixed by its parent hierarchy, if
+   * any.  For example: top_property_name.sub_property_name.
+   * Sample Query:
+   * `(LOWER(driving_license)="class \"a\"" OR EMPTY(driving_license)) AND
+   * driving_years > 10`
+   * CMEK compliant deployment only supports:
+   * * Operators: `=`, `<`, `<=`, `>`, and `>=`.
+   * * Boolean expressions: AND and OR.
+   * 
+ * + * string condition = 2; + * + * @return The condition. + */ + @java.lang.Override + public java.lang.String getCondition() { + java.lang.Object ref = condition_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + condition_ = s; + return s; + } + } + /** + * + * + *
+   * The filter condition.
+   * The syntax for this expression is a subset of SQL syntax.
+   * Supported operators are: `=`, `!=`, `<`, `<=`, `>`, `>=`, and `~~` where
+   * the left of the operator is a property name and the right of the operator
+   * is a number or a quoted string. You must escape backslash (\\) and quote
+   * (\") characters.
+   * `~~` is the LIKE operator. The right of the operator must be a string. The
+   * only supported property data type for LIKE is text_values. It provides
+   * semantic search functionality by parsing, stemming and doing synonyms
+   * expansion against the input query. It matches if the property contains
+   * semantic similar content to the query. It is not regex matching or wildcard
+   * matching. For example, "property.company ~~ \"google\"" will match records
+   * whose property `property.compnay` have values like "Google Inc.", "Google
+   * LLC" or "Google Company".
+   * Supported functions are `LOWER([property_name])` to perform a
+   * case insensitive match and `EMPTY([property_name])` to filter on the
+   * existence of a key.
+   * Boolean expressions (AND/OR/NOT) are supported up to 3 levels of nesting
+   * (for example, "((A AND B AND C) OR NOT D) AND E"), a maximum of 100
+   * comparisons or functions are allowed in the expression. The expression must
+   * be < 6000 bytes in length.
+   * Only properties that are marked filterable are allowed
+   * ([PropertyDefinition.is_filterable][google.cloud.contentwarehouse.v1.PropertyDefinition.is_filterable]). Property names do not need to be
+   * prefixed by the document schema id (as is the case with histograms),
+   * however property names will need to be prefixed by its parent hierarchy, if
+   * any.  For example: top_property_name.sub_property_name.
+   * Sample Query:
+   * `(LOWER(driving_license)="class \"a\"" OR EMPTY(driving_license)) AND
+   * driving_years > 10`
+   * CMEK compliant deployment only supports:
+   * * Operators: `=`, `<`, `<=`, `>`, and `>=`.
+   * * Boolean expressions: AND and OR.
+   * 
+ * + * string condition = 2; + * + * @return The bytes for condition. + */ + @java.lang.Override + public com.google.protobuf.ByteString getConditionBytes() { + java.lang.Object ref = condition_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + condition_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(documentSchemaName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, documentSchemaName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(condition_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, condition_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(documentSchemaName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, documentSchemaName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(condition_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, condition_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.PropertyFilter)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.PropertyFilter other = + (com.google.cloud.contentwarehouse.v1.PropertyFilter) obj; + + if (!getDocumentSchemaName().equals(other.getDocumentSchemaName())) return false; + if (!getCondition().equals(other.getCondition())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + DOCUMENT_SCHEMA_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDocumentSchemaName().hashCode(); + hash = (37 * hash) + CONDITION_FIELD_NUMBER; + hash = (53 * hash) + getCondition().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.PropertyFilter parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.PropertyFilter parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.PropertyFilter parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.PropertyFilter parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.PropertyFilter parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.PropertyFilter parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.PropertyFilter parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.PropertyFilter parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.PropertyFilter parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.PropertyFilter parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.PropertyFilter parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.PropertyFilter parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.contentwarehouse.v1.PropertyFilter prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** Protobuf type {@code google.cloud.contentwarehouse.v1.PropertyFilter} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.PropertyFilter) + com.google.cloud.contentwarehouse.v1.PropertyFilterOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.FiltersProto + .internal_static_google_cloud_contentwarehouse_v1_PropertyFilter_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.FiltersProto + .internal_static_google_cloud_contentwarehouse_v1_PropertyFilter_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.PropertyFilter.class, + com.google.cloud.contentwarehouse.v1.PropertyFilter.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.PropertyFilter.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + documentSchemaName_ = ""; + + condition_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.FiltersProto + .internal_static_google_cloud_contentwarehouse_v1_PropertyFilter_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.PropertyFilter getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.PropertyFilter.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.PropertyFilter build() { + com.google.cloud.contentwarehouse.v1.PropertyFilter result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.PropertyFilter buildPartial() { + com.google.cloud.contentwarehouse.v1.PropertyFilter result = + new com.google.cloud.contentwarehouse.v1.PropertyFilter(this); + result.documentSchemaName_ = documentSchemaName_; + result.condition_ = condition_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.PropertyFilter) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.PropertyFilter) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.PropertyFilter other) { + if (other == com.google.cloud.contentwarehouse.v1.PropertyFilter.getDefaultInstance()) + return this; + if (!other.getDocumentSchemaName().isEmpty()) { + documentSchemaName_ = other.documentSchemaName_; + onChanged(); + } + if (!other.getCondition().isEmpty()) { + condition_ = other.condition_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + documentSchemaName_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + condition_ = input.readStringRequireUtf8(); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object documentSchemaName_ = ""; + /** + * + * + *
+     * The Document schema name [Document.document_schema_name][google.cloud.contentwarehouse.v1.Document.document_schema_name].
+     * Format:
+     * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
+     * 
+ * + * string document_schema_name = 1 [(.google.api.resource_reference) = { ... } + * + * @return The documentSchemaName. + */ + public java.lang.String getDocumentSchemaName() { + java.lang.Object ref = documentSchemaName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + documentSchemaName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The Document schema name [Document.document_schema_name][google.cloud.contentwarehouse.v1.Document.document_schema_name].
+     * Format:
+     * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
+     * 
+ * + * string document_schema_name = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for documentSchemaName. + */ + public com.google.protobuf.ByteString getDocumentSchemaNameBytes() { + java.lang.Object ref = documentSchemaName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + documentSchemaName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The Document schema name [Document.document_schema_name][google.cloud.contentwarehouse.v1.Document.document_schema_name].
+     * Format:
+     * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
+     * 
+ * + * string document_schema_name = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The documentSchemaName to set. + * @return This builder for chaining. + */ + public Builder setDocumentSchemaName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + documentSchemaName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The Document schema name [Document.document_schema_name][google.cloud.contentwarehouse.v1.Document.document_schema_name].
+     * Format:
+     * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
+     * 
+ * + * string document_schema_name = 1 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearDocumentSchemaName() { + + documentSchemaName_ = getDefaultInstance().getDocumentSchemaName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The Document schema name [Document.document_schema_name][google.cloud.contentwarehouse.v1.Document.document_schema_name].
+     * Format:
+     * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
+     * 
+ * + * string document_schema_name = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for documentSchemaName to set. + * @return This builder for chaining. + */ + public Builder setDocumentSchemaNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + documentSchemaName_ = value; + onChanged(); + return this; + } + + private java.lang.Object condition_ = ""; + /** + * + * + *
+     * The filter condition.
+     * The syntax for this expression is a subset of SQL syntax.
+     * Supported operators are: `=`, `!=`, `<`, `<=`, `>`, `>=`, and `~~` where
+     * the left of the operator is a property name and the right of the operator
+     * is a number or a quoted string. You must escape backslash (\\) and quote
+     * (\") characters.
+     * `~~` is the LIKE operator. The right of the operator must be a string. The
+     * only supported property data type for LIKE is text_values. It provides
+     * semantic search functionality by parsing, stemming and doing synonyms
+     * expansion against the input query. It matches if the property contains
+     * semantic similar content to the query. It is not regex matching or wildcard
+     * matching. For example, "property.company ~~ \"google\"" will match records
+     * whose property `property.compnay` have values like "Google Inc.", "Google
+     * LLC" or "Google Company".
+     * Supported functions are `LOWER([property_name])` to perform a
+     * case insensitive match and `EMPTY([property_name])` to filter on the
+     * existence of a key.
+     * Boolean expressions (AND/OR/NOT) are supported up to 3 levels of nesting
+     * (for example, "((A AND B AND C) OR NOT D) AND E"), a maximum of 100
+     * comparisons or functions are allowed in the expression. The expression must
+     * be < 6000 bytes in length.
+     * Only properties that are marked filterable are allowed
+     * ([PropertyDefinition.is_filterable][google.cloud.contentwarehouse.v1.PropertyDefinition.is_filterable]). Property names do not need to be
+     * prefixed by the document schema id (as is the case with histograms),
+     * however property names will need to be prefixed by its parent hierarchy, if
+     * any.  For example: top_property_name.sub_property_name.
+     * Sample Query:
+     * `(LOWER(driving_license)="class \"a\"" OR EMPTY(driving_license)) AND
+     * driving_years > 10`
+     * CMEK compliant deployment only supports:
+     * * Operators: `=`, `<`, `<=`, `>`, and `>=`.
+     * * Boolean expressions: AND and OR.
+     * 
+ * + * string condition = 2; + * + * @return The condition. + */ + public java.lang.String getCondition() { + java.lang.Object ref = condition_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + condition_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The filter condition.
+     * The syntax for this expression is a subset of SQL syntax.
+     * Supported operators are: `=`, `!=`, `<`, `<=`, `>`, `>=`, and `~~` where
+     * the left of the operator is a property name and the right of the operator
+     * is a number or a quoted string. You must escape backslash (\\) and quote
+     * (\") characters.
+     * `~~` is the LIKE operator. The right of the operator must be a string. The
+     * only supported property data type for LIKE is text_values. It provides
+     * semantic search functionality by parsing, stemming and doing synonyms
+     * expansion against the input query. It matches if the property contains
+     * semantic similar content to the query. It is not regex matching or wildcard
+     * matching. For example, "property.company ~~ \"google\"" will match records
+     * whose property `property.compnay` have values like "Google Inc.", "Google
+     * LLC" or "Google Company".
+     * Supported functions are `LOWER([property_name])` to perform a
+     * case insensitive match and `EMPTY([property_name])` to filter on the
+     * existence of a key.
+     * Boolean expressions (AND/OR/NOT) are supported up to 3 levels of nesting
+     * (for example, "((A AND B AND C) OR NOT D) AND E"), a maximum of 100
+     * comparisons or functions are allowed in the expression. The expression must
+     * be < 6000 bytes in length.
+     * Only properties that are marked filterable are allowed
+     * ([PropertyDefinition.is_filterable][google.cloud.contentwarehouse.v1.PropertyDefinition.is_filterable]). Property names do not need to be
+     * prefixed by the document schema id (as is the case with histograms),
+     * however property names will need to be prefixed by its parent hierarchy, if
+     * any.  For example: top_property_name.sub_property_name.
+     * Sample Query:
+     * `(LOWER(driving_license)="class \"a\"" OR EMPTY(driving_license)) AND
+     * driving_years > 10`
+     * CMEK compliant deployment only supports:
+     * * Operators: `=`, `<`, `<=`, `>`, and `>=`.
+     * * Boolean expressions: AND and OR.
+     * 
+ * + * string condition = 2; + * + * @return The bytes for condition. + */ + public com.google.protobuf.ByteString getConditionBytes() { + java.lang.Object ref = condition_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + condition_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The filter condition.
+     * The syntax for this expression is a subset of SQL syntax.
+     * Supported operators are: `=`, `!=`, `<`, `<=`, `>`, `>=`, and `~~` where
+     * the left of the operator is a property name and the right of the operator
+     * is a number or a quoted string. You must escape backslash (\\) and quote
+     * (\") characters.
+     * `~~` is the LIKE operator. The right of the operator must be a string. The
+     * only supported property data type for LIKE is text_values. It provides
+     * semantic search functionality by parsing, stemming and doing synonyms
+     * expansion against the input query. It matches if the property contains
+     * semantic similar content to the query. It is not regex matching or wildcard
+     * matching. For example, "property.company ~~ \"google\"" will match records
+     * whose property `property.compnay` have values like "Google Inc.", "Google
+     * LLC" or "Google Company".
+     * Supported functions are `LOWER([property_name])` to perform a
+     * case insensitive match and `EMPTY([property_name])` to filter on the
+     * existence of a key.
+     * Boolean expressions (AND/OR/NOT) are supported up to 3 levels of nesting
+     * (for example, "((A AND B AND C) OR NOT D) AND E"), a maximum of 100
+     * comparisons or functions are allowed in the expression. The expression must
+     * be < 6000 bytes in length.
+     * Only properties that are marked filterable are allowed
+     * ([PropertyDefinition.is_filterable][google.cloud.contentwarehouse.v1.PropertyDefinition.is_filterable]). Property names do not need to be
+     * prefixed by the document schema id (as is the case with histograms),
+     * however property names will need to be prefixed by its parent hierarchy, if
+     * any.  For example: top_property_name.sub_property_name.
+     * Sample Query:
+     * `(LOWER(driving_license)="class \"a\"" OR EMPTY(driving_license)) AND
+     * driving_years > 10`
+     * CMEK compliant deployment only supports:
+     * * Operators: `=`, `<`, `<=`, `>`, and `>=`.
+     * * Boolean expressions: AND and OR.
+     * 
+ * + * string condition = 2; + * + * @param value The condition to set. + * @return This builder for chaining. + */ + public Builder setCondition(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + condition_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The filter condition.
+     * The syntax for this expression is a subset of SQL syntax.
+     * Supported operators are: `=`, `!=`, `<`, `<=`, `>`, `>=`, and `~~` where
+     * the left of the operator is a property name and the right of the operator
+     * is a number or a quoted string. You must escape backslash (\\) and quote
+     * (\") characters.
+     * `~~` is the LIKE operator. The right of the operator must be a string. The
+     * only supported property data type for LIKE is text_values. It provides
+     * semantic search functionality by parsing, stemming and doing synonyms
+     * expansion against the input query. It matches if the property contains
+     * semantic similar content to the query. It is not regex matching or wildcard
+     * matching. For example, "property.company ~~ \"google\"" will match records
+     * whose property `property.compnay` have values like "Google Inc.", "Google
+     * LLC" or "Google Company".
+     * Supported functions are `LOWER([property_name])` to perform a
+     * case insensitive match and `EMPTY([property_name])` to filter on the
+     * existence of a key.
+     * Boolean expressions (AND/OR/NOT) are supported up to 3 levels of nesting
+     * (for example, "((A AND B AND C) OR NOT D) AND E"), a maximum of 100
+     * comparisons or functions are allowed in the expression. The expression must
+     * be < 6000 bytes in length.
+     * Only properties that are marked filterable are allowed
+     * ([PropertyDefinition.is_filterable][google.cloud.contentwarehouse.v1.PropertyDefinition.is_filterable]). Property names do not need to be
+     * prefixed by the document schema id (as is the case with histograms),
+     * however property names will need to be prefixed by its parent hierarchy, if
+     * any.  For example: top_property_name.sub_property_name.
+     * Sample Query:
+     * `(LOWER(driving_license)="class \"a\"" OR EMPTY(driving_license)) AND
+     * driving_years > 10`
+     * CMEK compliant deployment only supports:
+     * * Operators: `=`, `<`, `<=`, `>`, and `>=`.
+     * * Boolean expressions: AND and OR.
+     * 
+ * + * string condition = 2; + * + * @return This builder for chaining. + */ + public Builder clearCondition() { + + condition_ = getDefaultInstance().getCondition(); + onChanged(); + return this; + } + /** + * + * + *
+     * The filter condition.
+     * The syntax for this expression is a subset of SQL syntax.
+     * Supported operators are: `=`, `!=`, `<`, `<=`, `>`, `>=`, and `~~` where
+     * the left of the operator is a property name and the right of the operator
+     * is a number or a quoted string. You must escape backslash (\\) and quote
+     * (\") characters.
+     * `~~` is the LIKE operator. The right of the operator must be a string. The
+     * only supported property data type for LIKE is text_values. It provides
+     * semantic search functionality by parsing, stemming and doing synonyms
+     * expansion against the input query. It matches if the property contains
+     * semantic similar content to the query. It is not regex matching or wildcard
+     * matching. For example, "property.company ~~ \"google\"" will match records
+     * whose property `property.compnay` have values like "Google Inc.", "Google
+     * LLC" or "Google Company".
+     * Supported functions are `LOWER([property_name])` to perform a
+     * case insensitive match and `EMPTY([property_name])` to filter on the
+     * existence of a key.
+     * Boolean expressions (AND/OR/NOT) are supported up to 3 levels of nesting
+     * (for example, "((A AND B AND C) OR NOT D) AND E"), a maximum of 100
+     * comparisons or functions are allowed in the expression. The expression must
+     * be < 6000 bytes in length.
+     * Only properties that are marked filterable are allowed
+     * ([PropertyDefinition.is_filterable][google.cloud.contentwarehouse.v1.PropertyDefinition.is_filterable]). Property names do not need to be
+     * prefixed by the document schema id (as is the case with histograms),
+     * however property names will need to be prefixed by its parent hierarchy, if
+     * any.  For example: top_property_name.sub_property_name.
+     * Sample Query:
+     * `(LOWER(driving_license)="class \"a\"" OR EMPTY(driving_license)) AND
+     * driving_years > 10`
+     * CMEK compliant deployment only supports:
+     * * Operators: `=`, `<`, `<=`, `>`, and `>=`.
+     * * Boolean expressions: AND and OR.
+     * 
+ * + * string condition = 2; + * + * @param value The bytes for condition to set. + * @return This builder for chaining. + */ + public Builder setConditionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + condition_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.PropertyFilter) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.PropertyFilter) + private static final com.google.cloud.contentwarehouse.v1.PropertyFilter DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.PropertyFilter(); + } + + public static com.google.cloud.contentwarehouse.v1.PropertyFilter getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PropertyFilter parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.PropertyFilter getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/PropertyFilterOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/PropertyFilterOrBuilder.java new file mode 100644 index 000000000000..c3b2bcc9f4e9 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/PropertyFilterOrBuilder.java @@ -0,0 +1,141 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/filters.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface PropertyFilterOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.PropertyFilter) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The Document schema name [Document.document_schema_name][google.cloud.contentwarehouse.v1.Document.document_schema_name].
+   * Format:
+   * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
+   * 
+ * + * string document_schema_name = 1 [(.google.api.resource_reference) = { ... } + * + * @return The documentSchemaName. + */ + java.lang.String getDocumentSchemaName(); + /** + * + * + *
+   * The Document schema name [Document.document_schema_name][google.cloud.contentwarehouse.v1.Document.document_schema_name].
+   * Format:
+   * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
+   * 
+ * + * string document_schema_name = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for documentSchemaName. + */ + com.google.protobuf.ByteString getDocumentSchemaNameBytes(); + + /** + * + * + *
+   * The filter condition.
+   * The syntax for this expression is a subset of SQL syntax.
+   * Supported operators are: `=`, `!=`, `<`, `<=`, `>`, `>=`, and `~~` where
+   * the left of the operator is a property name and the right of the operator
+   * is a number or a quoted string. You must escape backslash (\\) and quote
+   * (\") characters.
+   * `~~` is the LIKE operator. The right of the operator must be a string. The
+   * only supported property data type for LIKE is text_values. It provides
+   * semantic search functionality by parsing, stemming and doing synonyms
+   * expansion against the input query. It matches if the property contains
+   * semantic similar content to the query. It is not regex matching or wildcard
+   * matching. For example, "property.company ~~ \"google\"" will match records
+   * whose property `property.compnay` have values like "Google Inc.", "Google
+   * LLC" or "Google Company".
+   * Supported functions are `LOWER([property_name])` to perform a
+   * case insensitive match and `EMPTY([property_name])` to filter on the
+   * existence of a key.
+   * Boolean expressions (AND/OR/NOT) are supported up to 3 levels of nesting
+   * (for example, "((A AND B AND C) OR NOT D) AND E"), a maximum of 100
+   * comparisons or functions are allowed in the expression. The expression must
+   * be < 6000 bytes in length.
+   * Only properties that are marked filterable are allowed
+   * ([PropertyDefinition.is_filterable][google.cloud.contentwarehouse.v1.PropertyDefinition.is_filterable]). Property names do not need to be
+   * prefixed by the document schema id (as is the case with histograms),
+   * however property names will need to be prefixed by its parent hierarchy, if
+   * any.  For example: top_property_name.sub_property_name.
+   * Sample Query:
+   * `(LOWER(driving_license)="class \"a\"" OR EMPTY(driving_license)) AND
+   * driving_years > 10`
+   * CMEK compliant deployment only supports:
+   * * Operators: `=`, `<`, `<=`, `>`, and `>=`.
+   * * Boolean expressions: AND and OR.
+   * 
+ * + * string condition = 2; + * + * @return The condition. + */ + java.lang.String getCondition(); + /** + * + * + *
+   * The filter condition.
+   * The syntax for this expression is a subset of SQL syntax.
+   * Supported operators are: `=`, `!=`, `<`, `<=`, `>`, `>=`, and `~~` where
+   * the left of the operator is a property name and the right of the operator
+   * is a number or a quoted string. You must escape backslash (\\) and quote
+   * (\") characters.
+   * `~~` is the LIKE operator. The right of the operator must be a string. The
+   * only supported property data type for LIKE is text_values. It provides
+   * semantic search functionality by parsing, stemming and doing synonyms
+   * expansion against the input query. It matches if the property contains
+   * semantic similar content to the query. It is not regex matching or wildcard
+   * matching. For example, "property.company ~~ \"google\"" will match records
+   * whose property `property.compnay` have values like "Google Inc.", "Google
+   * LLC" or "Google Company".
+   * Supported functions are `LOWER([property_name])` to perform a
+   * case insensitive match and `EMPTY([property_name])` to filter on the
+   * existence of a key.
+   * Boolean expressions (AND/OR/NOT) are supported up to 3 levels of nesting
+   * (for example, "((A AND B AND C) OR NOT D) AND E"), a maximum of 100
+   * comparisons or functions are allowed in the expression. The expression must
+   * be < 6000 bytes in length.
+   * Only properties that are marked filterable are allowed
+   * ([PropertyDefinition.is_filterable][google.cloud.contentwarehouse.v1.PropertyDefinition.is_filterable]). Property names do not need to be
+   * prefixed by the document schema id (as is the case with histograms),
+   * however property names will need to be prefixed by its parent hierarchy, if
+   * any.  For example: top_property_name.sub_property_name.
+   * Sample Query:
+   * `(LOWER(driving_license)="class \"a\"" OR EMPTY(driving_license)) AND
+   * driving_years > 10`
+   * CMEK compliant deployment only supports:
+   * * Operators: `=`, `<`, `<=`, `>`, and `>=`.
+   * * Boolean expressions: AND and OR.
+   * 
+ * + * string condition = 2; + * + * @return The bytes for condition. + */ + com.google.protobuf.ByteString getConditionBytes(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/PropertyOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/PropertyOrBuilder.java new file mode 100644 index 000000000000..dac438381319 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/PropertyOrBuilder.java @@ -0,0 +1,338 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface PropertyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.Property) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Must match the name of a PropertyDefinition in the DocumentSchema.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Must match the name of a PropertyDefinition in the DocumentSchema.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Integer property values.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.IntegerArray integer_values = 2; + * + * @return Whether the integerValues field is set. + */ + boolean hasIntegerValues(); + /** + * + * + *
+   * Integer property values.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.IntegerArray integer_values = 2; + * + * @return The integerValues. + */ + com.google.cloud.contentwarehouse.v1.IntegerArray getIntegerValues(); + /** + * + * + *
+   * Integer property values.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.IntegerArray integer_values = 2; + */ + com.google.cloud.contentwarehouse.v1.IntegerArrayOrBuilder getIntegerValuesOrBuilder(); + + /** + * + * + *
+   * Float property values.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.FloatArray float_values = 3; + * + * @return Whether the floatValues field is set. + */ + boolean hasFloatValues(); + /** + * + * + *
+   * Float property values.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.FloatArray float_values = 3; + * + * @return The floatValues. + */ + com.google.cloud.contentwarehouse.v1.FloatArray getFloatValues(); + /** + * + * + *
+   * Float property values.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.FloatArray float_values = 3; + */ + com.google.cloud.contentwarehouse.v1.FloatArrayOrBuilder getFloatValuesOrBuilder(); + + /** + * + * + *
+   * String/text property values.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.TextArray text_values = 4; + * + * @return Whether the textValues field is set. + */ + boolean hasTextValues(); + /** + * + * + *
+   * String/text property values.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.TextArray text_values = 4; + * + * @return The textValues. + */ + com.google.cloud.contentwarehouse.v1.TextArray getTextValues(); + /** + * + * + *
+   * String/text property values.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.TextArray text_values = 4; + */ + com.google.cloud.contentwarehouse.v1.TextArrayOrBuilder getTextValuesOrBuilder(); + + /** + * + * + *
+   * Enum property values.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.EnumArray enum_values = 5; + * + * @return Whether the enumValues field is set. + */ + boolean hasEnumValues(); + /** + * + * + *
+   * Enum property values.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.EnumArray enum_values = 5; + * + * @return The enumValues. + */ + com.google.cloud.contentwarehouse.v1.EnumArray getEnumValues(); + /** + * + * + *
+   * Enum property values.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.EnumArray enum_values = 5; + */ + com.google.cloud.contentwarehouse.v1.EnumArrayOrBuilder getEnumValuesOrBuilder(); + + /** + * + * + *
+   * Nested structured data property values.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.PropertyArray property_values = 6; + * + * @return Whether the propertyValues field is set. + */ + boolean hasPropertyValues(); + /** + * + * + *
+   * Nested structured data property values.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.PropertyArray property_values = 6; + * + * @return The propertyValues. + */ + com.google.cloud.contentwarehouse.v1.PropertyArray getPropertyValues(); + /** + * + * + *
+   * Nested structured data property values.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.PropertyArray property_values = 6; + */ + com.google.cloud.contentwarehouse.v1.PropertyArrayOrBuilder getPropertyValuesOrBuilder(); + + /** + * + * + *
+   * Date time property values.
+   * It is not supported by CMEK compliant deployment.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.DateTimeArray date_time_values = 7; + * + * @return Whether the dateTimeValues field is set. + */ + boolean hasDateTimeValues(); + /** + * + * + *
+   * Date time property values.
+   * It is not supported by CMEK compliant deployment.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.DateTimeArray date_time_values = 7; + * + * @return The dateTimeValues. + */ + com.google.cloud.contentwarehouse.v1.DateTimeArray getDateTimeValues(); + /** + * + * + *
+   * Date time property values.
+   * It is not supported by CMEK compliant deployment.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.DateTimeArray date_time_values = 7; + */ + com.google.cloud.contentwarehouse.v1.DateTimeArrayOrBuilder getDateTimeValuesOrBuilder(); + + /** + * + * + *
+   * Map property values.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.MapProperty map_property = 8; + * + * @return Whether the mapProperty field is set. + */ + boolean hasMapProperty(); + /** + * + * + *
+   * Map property values.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.MapProperty map_property = 8; + * + * @return The mapProperty. + */ + com.google.cloud.contentwarehouse.v1.MapProperty getMapProperty(); + /** + * + * + *
+   * Map property values.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.MapProperty map_property = 8; + */ + com.google.cloud.contentwarehouse.v1.MapPropertyOrBuilder getMapPropertyOrBuilder(); + + /** + * + * + *
+   * Timestamp property values.
+   * It is not supported by CMEK compliant deployment.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.TimestampArray timestamp_values = 9; + * + * @return Whether the timestampValues field is set. + */ + boolean hasTimestampValues(); + /** + * + * + *
+   * Timestamp property values.
+   * It is not supported by CMEK compliant deployment.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.TimestampArray timestamp_values = 9; + * + * @return The timestampValues. + */ + com.google.cloud.contentwarehouse.v1.TimestampArray getTimestampValues(); + /** + * + * + *
+   * Timestamp property values.
+   * It is not supported by CMEK compliant deployment.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.TimestampArray timestamp_values = 9; + */ + com.google.cloud.contentwarehouse.v1.TimestampArrayOrBuilder getTimestampValuesOrBuilder(); + + public com.google.cloud.contentwarehouse.v1.Property.ValuesCase getValuesCase(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/PropertyTypeOptions.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/PropertyTypeOptions.java new file mode 100644 index 000000000000..bff407ca7a3d --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/PropertyTypeOptions.java @@ -0,0 +1,998 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_schema.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Configurations for a nested structured data property.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.PropertyTypeOptions} + */ +public final class PropertyTypeOptions extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.PropertyTypeOptions) + PropertyTypeOptionsOrBuilder { + private static final long serialVersionUID = 0L; + // Use PropertyTypeOptions.newBuilder() to construct. + private PropertyTypeOptions(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PropertyTypeOptions() { + propertyDefinitions_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PropertyTypeOptions(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaProto + .internal_static_google_cloud_contentwarehouse_v1_PropertyTypeOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaProto + .internal_static_google_cloud_contentwarehouse_v1_PropertyTypeOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.PropertyTypeOptions.class, + com.google.cloud.contentwarehouse.v1.PropertyTypeOptions.Builder.class); + } + + public static final int PROPERTY_DEFINITIONS_FIELD_NUMBER = 1; + private java.util.List + propertyDefinitions_; + /** + * + * + *
+   * Required. List of property definitions.
+   * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.PropertyDefinition property_definitions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List + getPropertyDefinitionsList() { + return propertyDefinitions_; + } + /** + * + * + *
+   * Required. List of property definitions.
+   * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.PropertyDefinition property_definitions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List + getPropertyDefinitionsOrBuilderList() { + return propertyDefinitions_; + } + /** + * + * + *
+   * Required. List of property definitions.
+   * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.PropertyDefinition property_definitions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public int getPropertyDefinitionsCount() { + return propertyDefinitions_.size(); + } + /** + * + * + *
+   * Required. List of property definitions.
+   * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.PropertyDefinition property_definitions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.PropertyDefinition getPropertyDefinitions(int index) { + return propertyDefinitions_.get(index); + } + /** + * + * + *
+   * Required. List of property definitions.
+   * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.PropertyDefinition property_definitions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.PropertyDefinitionOrBuilder + getPropertyDefinitionsOrBuilder(int index) { + return propertyDefinitions_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < propertyDefinitions_.size(); i++) { + output.writeMessage(1, propertyDefinitions_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < propertyDefinitions_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(1, propertyDefinitions_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.PropertyTypeOptions)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.PropertyTypeOptions other = + (com.google.cloud.contentwarehouse.v1.PropertyTypeOptions) obj; + + if (!getPropertyDefinitionsList().equals(other.getPropertyDefinitionsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getPropertyDefinitionsCount() > 0) { + hash = (37 * hash) + PROPERTY_DEFINITIONS_FIELD_NUMBER; + hash = (53 * hash) + getPropertyDefinitionsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.PropertyTypeOptions parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.PropertyTypeOptions parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.PropertyTypeOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.PropertyTypeOptions parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.PropertyTypeOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.PropertyTypeOptions parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.PropertyTypeOptions parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.PropertyTypeOptions parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.PropertyTypeOptions parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.PropertyTypeOptions parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.PropertyTypeOptions parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.PropertyTypeOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.PropertyTypeOptions prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Configurations for a nested structured data property.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.PropertyTypeOptions} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.PropertyTypeOptions) + com.google.cloud.contentwarehouse.v1.PropertyTypeOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaProto + .internal_static_google_cloud_contentwarehouse_v1_PropertyTypeOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaProto + .internal_static_google_cloud_contentwarehouse_v1_PropertyTypeOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.PropertyTypeOptions.class, + com.google.cloud.contentwarehouse.v1.PropertyTypeOptions.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.PropertyTypeOptions.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (propertyDefinitionsBuilder_ == null) { + propertyDefinitions_ = java.util.Collections.emptyList(); + } else { + propertyDefinitions_ = null; + propertyDefinitionsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaProto + .internal_static_google_cloud_contentwarehouse_v1_PropertyTypeOptions_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.PropertyTypeOptions getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.PropertyTypeOptions.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.PropertyTypeOptions build() { + com.google.cloud.contentwarehouse.v1.PropertyTypeOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.PropertyTypeOptions buildPartial() { + com.google.cloud.contentwarehouse.v1.PropertyTypeOptions result = + new com.google.cloud.contentwarehouse.v1.PropertyTypeOptions(this); + int from_bitField0_ = bitField0_; + if (propertyDefinitionsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + propertyDefinitions_ = java.util.Collections.unmodifiableList(propertyDefinitions_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.propertyDefinitions_ = propertyDefinitions_; + } else { + result.propertyDefinitions_ = propertyDefinitionsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.PropertyTypeOptions) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.PropertyTypeOptions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.PropertyTypeOptions other) { + if (other == com.google.cloud.contentwarehouse.v1.PropertyTypeOptions.getDefaultInstance()) + return this; + if (propertyDefinitionsBuilder_ == null) { + if (!other.propertyDefinitions_.isEmpty()) { + if (propertyDefinitions_.isEmpty()) { + propertyDefinitions_ = other.propertyDefinitions_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePropertyDefinitionsIsMutable(); + propertyDefinitions_.addAll(other.propertyDefinitions_); + } + onChanged(); + } + } else { + if (!other.propertyDefinitions_.isEmpty()) { + if (propertyDefinitionsBuilder_.isEmpty()) { + propertyDefinitionsBuilder_.dispose(); + propertyDefinitionsBuilder_ = null; + propertyDefinitions_ = other.propertyDefinitions_; + bitField0_ = (bitField0_ & ~0x00000001); + propertyDefinitionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getPropertyDefinitionsFieldBuilder() + : null; + } else { + propertyDefinitionsBuilder_.addAllMessages(other.propertyDefinitions_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.contentwarehouse.v1.PropertyDefinition m = + input.readMessage( + com.google.cloud.contentwarehouse.v1.PropertyDefinition.parser(), + extensionRegistry); + if (propertyDefinitionsBuilder_ == null) { + ensurePropertyDefinitionsIsMutable(); + propertyDefinitions_.add(m); + } else { + propertyDefinitionsBuilder_.addMessage(m); + } + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List + propertyDefinitions_ = java.util.Collections.emptyList(); + + private void ensurePropertyDefinitionsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + propertyDefinitions_ = + new java.util.ArrayList( + propertyDefinitions_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.PropertyDefinition, + com.google.cloud.contentwarehouse.v1.PropertyDefinition.Builder, + com.google.cloud.contentwarehouse.v1.PropertyDefinitionOrBuilder> + propertyDefinitionsBuilder_; + + /** + * + * + *
+     * Required. List of property definitions.
+     * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.PropertyDefinition property_definitions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getPropertyDefinitionsList() { + if (propertyDefinitionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(propertyDefinitions_); + } else { + return propertyDefinitionsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Required. List of property definitions.
+     * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.PropertyDefinition property_definitions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public int getPropertyDefinitionsCount() { + if (propertyDefinitionsBuilder_ == null) { + return propertyDefinitions_.size(); + } else { + return propertyDefinitionsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Required. List of property definitions.
+     * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.PropertyDefinition property_definitions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.contentwarehouse.v1.PropertyDefinition getPropertyDefinitions( + int index) { + if (propertyDefinitionsBuilder_ == null) { + return propertyDefinitions_.get(index); + } else { + return propertyDefinitionsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Required. List of property definitions.
+     * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.PropertyDefinition property_definitions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPropertyDefinitions( + int index, com.google.cloud.contentwarehouse.v1.PropertyDefinition value) { + if (propertyDefinitionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePropertyDefinitionsIsMutable(); + propertyDefinitions_.set(index, value); + onChanged(); + } else { + propertyDefinitionsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. List of property definitions.
+     * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.PropertyDefinition property_definitions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPropertyDefinitions( + int index, + com.google.cloud.contentwarehouse.v1.PropertyDefinition.Builder builderForValue) { + if (propertyDefinitionsBuilder_ == null) { + ensurePropertyDefinitionsIsMutable(); + propertyDefinitions_.set(index, builderForValue.build()); + onChanged(); + } else { + propertyDefinitionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. List of property definitions.
+     * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.PropertyDefinition property_definitions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addPropertyDefinitions( + com.google.cloud.contentwarehouse.v1.PropertyDefinition value) { + if (propertyDefinitionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePropertyDefinitionsIsMutable(); + propertyDefinitions_.add(value); + onChanged(); + } else { + propertyDefinitionsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Required. List of property definitions.
+     * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.PropertyDefinition property_definitions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addPropertyDefinitions( + int index, com.google.cloud.contentwarehouse.v1.PropertyDefinition value) { + if (propertyDefinitionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePropertyDefinitionsIsMutable(); + propertyDefinitions_.add(index, value); + onChanged(); + } else { + propertyDefinitionsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. List of property definitions.
+     * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.PropertyDefinition property_definitions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addPropertyDefinitions( + com.google.cloud.contentwarehouse.v1.PropertyDefinition.Builder builderForValue) { + if (propertyDefinitionsBuilder_ == null) { + ensurePropertyDefinitionsIsMutable(); + propertyDefinitions_.add(builderForValue.build()); + onChanged(); + } else { + propertyDefinitionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. List of property definitions.
+     * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.PropertyDefinition property_definitions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addPropertyDefinitions( + int index, + com.google.cloud.contentwarehouse.v1.PropertyDefinition.Builder builderForValue) { + if (propertyDefinitionsBuilder_ == null) { + ensurePropertyDefinitionsIsMutable(); + propertyDefinitions_.add(index, builderForValue.build()); + onChanged(); + } else { + propertyDefinitionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. List of property definitions.
+     * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.PropertyDefinition property_definitions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addAllPropertyDefinitions( + java.lang.Iterable + values) { + if (propertyDefinitionsBuilder_ == null) { + ensurePropertyDefinitionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, propertyDefinitions_); + onChanged(); + } else { + propertyDefinitionsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Required. List of property definitions.
+     * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.PropertyDefinition property_definitions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearPropertyDefinitions() { + if (propertyDefinitionsBuilder_ == null) { + propertyDefinitions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + propertyDefinitionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Required. List of property definitions.
+     * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.PropertyDefinition property_definitions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder removePropertyDefinitions(int index) { + if (propertyDefinitionsBuilder_ == null) { + ensurePropertyDefinitionsIsMutable(); + propertyDefinitions_.remove(index); + onChanged(); + } else { + propertyDefinitionsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Required. List of property definitions.
+     * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.PropertyDefinition property_definitions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.contentwarehouse.v1.PropertyDefinition.Builder + getPropertyDefinitionsBuilder(int index) { + return getPropertyDefinitionsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Required. List of property definitions.
+     * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.PropertyDefinition property_definitions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.contentwarehouse.v1.PropertyDefinitionOrBuilder + getPropertyDefinitionsOrBuilder(int index) { + if (propertyDefinitionsBuilder_ == null) { + return propertyDefinitions_.get(index); + } else { + return propertyDefinitionsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Required. List of property definitions.
+     * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.PropertyDefinition property_definitions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List< + ? extends com.google.cloud.contentwarehouse.v1.PropertyDefinitionOrBuilder> + getPropertyDefinitionsOrBuilderList() { + if (propertyDefinitionsBuilder_ != null) { + return propertyDefinitionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(propertyDefinitions_); + } + } + /** + * + * + *
+     * Required. List of property definitions.
+     * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.PropertyDefinition property_definitions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.contentwarehouse.v1.PropertyDefinition.Builder + addPropertyDefinitionsBuilder() { + return getPropertyDefinitionsFieldBuilder() + .addBuilder(com.google.cloud.contentwarehouse.v1.PropertyDefinition.getDefaultInstance()); + } + /** + * + * + *
+     * Required. List of property definitions.
+     * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.PropertyDefinition property_definitions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.contentwarehouse.v1.PropertyDefinition.Builder + addPropertyDefinitionsBuilder(int index) { + return getPropertyDefinitionsFieldBuilder() + .addBuilder( + index, com.google.cloud.contentwarehouse.v1.PropertyDefinition.getDefaultInstance()); + } + /** + * + * + *
+     * Required. List of property definitions.
+     * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.PropertyDefinition property_definitions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getPropertyDefinitionsBuilderList() { + return getPropertyDefinitionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.PropertyDefinition, + com.google.cloud.contentwarehouse.v1.PropertyDefinition.Builder, + com.google.cloud.contentwarehouse.v1.PropertyDefinitionOrBuilder> + getPropertyDefinitionsFieldBuilder() { + if (propertyDefinitionsBuilder_ == null) { + propertyDefinitionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.PropertyDefinition, + com.google.cloud.contentwarehouse.v1.PropertyDefinition.Builder, + com.google.cloud.contentwarehouse.v1.PropertyDefinitionOrBuilder>( + propertyDefinitions_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + propertyDefinitions_ = null; + } + return propertyDefinitionsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.PropertyTypeOptions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.PropertyTypeOptions) + private static final com.google.cloud.contentwarehouse.v1.PropertyTypeOptions DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.PropertyTypeOptions(); + } + + public static com.google.cloud.contentwarehouse.v1.PropertyTypeOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PropertyTypeOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.PropertyTypeOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/PropertyTypeOptionsOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/PropertyTypeOptionsOrBuilder.java new file mode 100644 index 000000000000..8d10df64df05 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/PropertyTypeOptionsOrBuilder.java @@ -0,0 +1,89 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_schema.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface PropertyTypeOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.PropertyTypeOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. List of property definitions.
+   * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.PropertyDefinition property_definitions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List + getPropertyDefinitionsList(); + /** + * + * + *
+   * Required. List of property definitions.
+   * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.PropertyDefinition property_definitions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.contentwarehouse.v1.PropertyDefinition getPropertyDefinitions(int index); + /** + * + * + *
+   * Required. List of property definitions.
+   * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.PropertyDefinition property_definitions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + int getPropertyDefinitionsCount(); + /** + * + * + *
+   * Required. List of property definitions.
+   * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.PropertyDefinition property_definitions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List + getPropertyDefinitionsOrBuilderList(); + /** + * + * + *
+   * Required. List of property definitions.
+   * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.PropertyDefinition property_definitions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.contentwarehouse.v1.PropertyDefinitionOrBuilder getPropertyDefinitionsOrBuilder( + int index); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/PublishAction.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/PublishAction.java new file mode 100644 index 000000000000..da7cda01a694 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/PublishAction.java @@ -0,0 +1,895 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/rule_engine.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Represents the action responsible for publishing messages to a Pub/Sub topic.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.PublishAction} + */ +public final class PublishAction extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.PublishAction) + PublishActionOrBuilder { + private static final long serialVersionUID = 0L; + // Use PublishAction.newBuilder() to construct. + private PublishAction(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PublishAction() { + topicId_ = ""; + messages_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PublishAction(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_PublishAction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_PublishAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.PublishAction.class, + com.google.cloud.contentwarehouse.v1.PublishAction.Builder.class); + } + + public static final int TOPIC_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object topicId_; + /** + * + * + *
+   * The topic id in the Pub/Sub service for which messages will be published
+   * to.
+   * 
+ * + * string topic_id = 1; + * + * @return The topicId. + */ + @java.lang.Override + public java.lang.String getTopicId() { + java.lang.Object ref = topicId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + topicId_ = s; + return s; + } + } + /** + * + * + *
+   * The topic id in the Pub/Sub service for which messages will be published
+   * to.
+   * 
+ * + * string topic_id = 1; + * + * @return The bytes for topicId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTopicIdBytes() { + java.lang.Object ref = topicId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + topicId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MESSAGES_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList messages_; + /** + * + * + *
+   * Messages to be published.
+   * 
+ * + * repeated string messages = 2; + * + * @return A list containing the messages. + */ + public com.google.protobuf.ProtocolStringList getMessagesList() { + return messages_; + } + /** + * + * + *
+   * Messages to be published.
+   * 
+ * + * repeated string messages = 2; + * + * @return The count of messages. + */ + public int getMessagesCount() { + return messages_.size(); + } + /** + * + * + *
+   * Messages to be published.
+   * 
+ * + * repeated string messages = 2; + * + * @param index The index of the element to return. + * @return The messages at the given index. + */ + public java.lang.String getMessages(int index) { + return messages_.get(index); + } + /** + * + * + *
+   * Messages to be published.
+   * 
+ * + * repeated string messages = 2; + * + * @param index The index of the value to return. + * @return The bytes of the messages at the given index. + */ + public com.google.protobuf.ByteString getMessagesBytes(int index) { + return messages_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(topicId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, topicId_); + } + for (int i = 0; i < messages_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, messages_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(topicId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, topicId_); + } + { + int dataSize = 0; + for (int i = 0; i < messages_.size(); i++) { + dataSize += computeStringSizeNoTag(messages_.getRaw(i)); + } + size += dataSize; + size += 1 * getMessagesList().size(); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.PublishAction)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.PublishAction other = + (com.google.cloud.contentwarehouse.v1.PublishAction) obj; + + if (!getTopicId().equals(other.getTopicId())) return false; + if (!getMessagesList().equals(other.getMessagesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TOPIC_ID_FIELD_NUMBER; + hash = (53 * hash) + getTopicId().hashCode(); + if (getMessagesCount() > 0) { + hash = (37 * hash) + MESSAGES_FIELD_NUMBER; + hash = (53 * hash) + getMessagesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.PublishAction parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.PublishAction parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.PublishAction parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.PublishAction parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.PublishAction parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.PublishAction parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.PublishAction parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.PublishAction parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.PublishAction parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.PublishAction parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.PublishAction parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.PublishAction parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.contentwarehouse.v1.PublishAction prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Represents the action responsible for publishing messages to a Pub/Sub topic.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.PublishAction} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.PublishAction) + com.google.cloud.contentwarehouse.v1.PublishActionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_PublishAction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_PublishAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.PublishAction.class, + com.google.cloud.contentwarehouse.v1.PublishAction.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.PublishAction.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + topicId_ = ""; + + messages_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_PublishAction_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.PublishAction getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.PublishAction.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.PublishAction build() { + com.google.cloud.contentwarehouse.v1.PublishAction result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.PublishAction buildPartial() { + com.google.cloud.contentwarehouse.v1.PublishAction result = + new com.google.cloud.contentwarehouse.v1.PublishAction(this); + int from_bitField0_ = bitField0_; + result.topicId_ = topicId_; + if (((bitField0_ & 0x00000001) != 0)) { + messages_ = messages_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.messages_ = messages_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.PublishAction) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.PublishAction) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.PublishAction other) { + if (other == com.google.cloud.contentwarehouse.v1.PublishAction.getDefaultInstance()) + return this; + if (!other.getTopicId().isEmpty()) { + topicId_ = other.topicId_; + onChanged(); + } + if (!other.messages_.isEmpty()) { + if (messages_.isEmpty()) { + messages_ = other.messages_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureMessagesIsMutable(); + messages_.addAll(other.messages_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + topicId_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureMessagesIsMutable(); + messages_.add(s); + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object topicId_ = ""; + /** + * + * + *
+     * The topic id in the Pub/Sub service for which messages will be published
+     * to.
+     * 
+ * + * string topic_id = 1; + * + * @return The topicId. + */ + public java.lang.String getTopicId() { + java.lang.Object ref = topicId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + topicId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The topic id in the Pub/Sub service for which messages will be published
+     * to.
+     * 
+ * + * string topic_id = 1; + * + * @return The bytes for topicId. + */ + public com.google.protobuf.ByteString getTopicIdBytes() { + java.lang.Object ref = topicId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + topicId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The topic id in the Pub/Sub service for which messages will be published
+     * to.
+     * 
+ * + * string topic_id = 1; + * + * @param value The topicId to set. + * @return This builder for chaining. + */ + public Builder setTopicId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + topicId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The topic id in the Pub/Sub service for which messages will be published
+     * to.
+     * 
+ * + * string topic_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearTopicId() { + + topicId_ = getDefaultInstance().getTopicId(); + onChanged(); + return this; + } + /** + * + * + *
+     * The topic id in the Pub/Sub service for which messages will be published
+     * to.
+     * 
+ * + * string topic_id = 1; + * + * @param value The bytes for topicId to set. + * @return This builder for chaining. + */ + public Builder setTopicIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + topicId_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList messages_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureMessagesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + messages_ = new com.google.protobuf.LazyStringArrayList(messages_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * Messages to be published.
+     * 
+ * + * repeated string messages = 2; + * + * @return A list containing the messages. + */ + public com.google.protobuf.ProtocolStringList getMessagesList() { + return messages_.getUnmodifiableView(); + } + /** + * + * + *
+     * Messages to be published.
+     * 
+ * + * repeated string messages = 2; + * + * @return The count of messages. + */ + public int getMessagesCount() { + return messages_.size(); + } + /** + * + * + *
+     * Messages to be published.
+     * 
+ * + * repeated string messages = 2; + * + * @param index The index of the element to return. + * @return The messages at the given index. + */ + public java.lang.String getMessages(int index) { + return messages_.get(index); + } + /** + * + * + *
+     * Messages to be published.
+     * 
+ * + * repeated string messages = 2; + * + * @param index The index of the value to return. + * @return The bytes of the messages at the given index. + */ + public com.google.protobuf.ByteString getMessagesBytes(int index) { + return messages_.getByteString(index); + } + /** + * + * + *
+     * Messages to be published.
+     * 
+ * + * repeated string messages = 2; + * + * @param index The index to set the value at. + * @param value The messages to set. + * @return This builder for chaining. + */ + public Builder setMessages(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureMessagesIsMutable(); + messages_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Messages to be published.
+     * 
+ * + * repeated string messages = 2; + * + * @param value The messages to add. + * @return This builder for chaining. + */ + public Builder addMessages(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureMessagesIsMutable(); + messages_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Messages to be published.
+     * 
+ * + * repeated string messages = 2; + * + * @param values The messages to add. + * @return This builder for chaining. + */ + public Builder addAllMessages(java.lang.Iterable values) { + ensureMessagesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, messages_); + onChanged(); + return this; + } + /** + * + * + *
+     * Messages to be published.
+     * 
+ * + * repeated string messages = 2; + * + * @return This builder for chaining. + */ + public Builder clearMessages() { + messages_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Messages to be published.
+     * 
+ * + * repeated string messages = 2; + * + * @param value The bytes of the messages to add. + * @return This builder for chaining. + */ + public Builder addMessagesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureMessagesIsMutable(); + messages_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.PublishAction) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.PublishAction) + private static final com.google.cloud.contentwarehouse.v1.PublishAction DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.PublishAction(); + } + + public static com.google.cloud.contentwarehouse.v1.PublishAction getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PublishAction parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.PublishAction getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/PublishActionOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/PublishActionOrBuilder.java new file mode 100644 index 000000000000..8e06f58aa0c9 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/PublishActionOrBuilder.java @@ -0,0 +1,103 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/rule_engine.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface PublishActionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.PublishAction) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The topic id in the Pub/Sub service for which messages will be published
+   * to.
+   * 
+ * + * string topic_id = 1; + * + * @return The topicId. + */ + java.lang.String getTopicId(); + /** + * + * + *
+   * The topic id in the Pub/Sub service for which messages will be published
+   * to.
+   * 
+ * + * string topic_id = 1; + * + * @return The bytes for topicId. + */ + com.google.protobuf.ByteString getTopicIdBytes(); + + /** + * + * + *
+   * Messages to be published.
+   * 
+ * + * repeated string messages = 2; + * + * @return A list containing the messages. + */ + java.util.List getMessagesList(); + /** + * + * + *
+   * Messages to be published.
+   * 
+ * + * repeated string messages = 2; + * + * @return The count of messages. + */ + int getMessagesCount(); + /** + * + * + *
+   * Messages to be published.
+   * 
+ * + * repeated string messages = 2; + * + * @param index The index of the element to return. + * @return The messages at the given index. + */ + java.lang.String getMessages(int index); + /** + * + * + *
+   * Messages to be published.
+   * 
+ * + * repeated string messages = 2; + * + * @param index The index of the value to return. + * @return The bytes of the messages at the given index. + */ + com.google.protobuf.ByteString getMessagesBytes(int index); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/QAResult.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/QAResult.java new file mode 100644 index 000000000000..f2e841cfa172 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/QAResult.java @@ -0,0 +1,1681 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_service.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Additional result info for the question-answering feature.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.QAResult} + */ +public final class QAResult extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.QAResult) + QAResultOrBuilder { + private static final long serialVersionUID = 0L; + // Use QAResult.newBuilder() to construct. + private QAResult(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private QAResult() { + highlights_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new QAResult(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceProto + .internal_static_google_cloud_contentwarehouse_v1_QAResult_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceProto + .internal_static_google_cloud_contentwarehouse_v1_QAResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.QAResult.class, + com.google.cloud.contentwarehouse.v1.QAResult.Builder.class); + } + + public interface HighlightOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.QAResult.Highlight) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Start index of the highlight.
+     * 
+ * + * int32 start_index = 1; + * + * @return The startIndex. + */ + int getStartIndex(); + + /** + * + * + *
+     * End index of the highlight, exclusive.
+     * 
+ * + * int32 end_index = 2; + * + * @return The endIndex. + */ + int getEndIndex(); + } + /** + * + * + *
+   * A text span in the search text snippet that represents a highlighted
+   * section (answer context, highly relevant sentence, etc.).
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.QAResult.Highlight} + */ + public static final class Highlight extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.QAResult.Highlight) + HighlightOrBuilder { + private static final long serialVersionUID = 0L; + // Use Highlight.newBuilder() to construct. + private Highlight(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Highlight() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Highlight(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceProto + .internal_static_google_cloud_contentwarehouse_v1_QAResult_Highlight_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceProto + .internal_static_google_cloud_contentwarehouse_v1_QAResult_Highlight_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.QAResult.Highlight.class, + com.google.cloud.contentwarehouse.v1.QAResult.Highlight.Builder.class); + } + + public static final int START_INDEX_FIELD_NUMBER = 1; + private int startIndex_; + /** + * + * + *
+     * Start index of the highlight.
+     * 
+ * + * int32 start_index = 1; + * + * @return The startIndex. + */ + @java.lang.Override + public int getStartIndex() { + return startIndex_; + } + + public static final int END_INDEX_FIELD_NUMBER = 2; + private int endIndex_; + /** + * + * + *
+     * End index of the highlight, exclusive.
+     * 
+ * + * int32 end_index = 2; + * + * @return The endIndex. + */ + @java.lang.Override + public int getEndIndex() { + return endIndex_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (startIndex_ != 0) { + output.writeInt32(1, startIndex_); + } + if (endIndex_ != 0) { + output.writeInt32(2, endIndex_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (startIndex_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, startIndex_); + } + if (endIndex_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, endIndex_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.QAResult.Highlight)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.QAResult.Highlight other = + (com.google.cloud.contentwarehouse.v1.QAResult.Highlight) obj; + + if (getStartIndex() != other.getStartIndex()) return false; + if (getEndIndex() != other.getEndIndex()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + START_INDEX_FIELD_NUMBER; + hash = (53 * hash) + getStartIndex(); + hash = (37 * hash) + END_INDEX_FIELD_NUMBER; + hash = (53 * hash) + getEndIndex(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.QAResult.Highlight parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.QAResult.Highlight parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.QAResult.Highlight parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.QAResult.Highlight parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.QAResult.Highlight parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.QAResult.Highlight parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.QAResult.Highlight parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.QAResult.Highlight parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.QAResult.Highlight parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.QAResult.Highlight parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.QAResult.Highlight parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.QAResult.Highlight parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.QAResult.Highlight prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * A text span in the search text snippet that represents a highlighted
+     * section (answer context, highly relevant sentence, etc.).
+     * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.QAResult.Highlight} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.QAResult.Highlight) + com.google.cloud.contentwarehouse.v1.QAResult.HighlightOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceProto + .internal_static_google_cloud_contentwarehouse_v1_QAResult_Highlight_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceProto + .internal_static_google_cloud_contentwarehouse_v1_QAResult_Highlight_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.QAResult.Highlight.class, + com.google.cloud.contentwarehouse.v1.QAResult.Highlight.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.QAResult.Highlight.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + startIndex_ = 0; + + endIndex_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceProto + .internal_static_google_cloud_contentwarehouse_v1_QAResult_Highlight_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.QAResult.Highlight getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.QAResult.Highlight.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.QAResult.Highlight build() { + com.google.cloud.contentwarehouse.v1.QAResult.Highlight result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.QAResult.Highlight buildPartial() { + com.google.cloud.contentwarehouse.v1.QAResult.Highlight result = + new com.google.cloud.contentwarehouse.v1.QAResult.Highlight(this); + result.startIndex_ = startIndex_; + result.endIndex_ = endIndex_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.QAResult.Highlight) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.QAResult.Highlight) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.QAResult.Highlight other) { + if (other == com.google.cloud.contentwarehouse.v1.QAResult.Highlight.getDefaultInstance()) + return this; + if (other.getStartIndex() != 0) { + setStartIndex(other.getStartIndex()); + } + if (other.getEndIndex() != 0) { + setEndIndex(other.getEndIndex()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + startIndex_ = input.readInt32(); + + break; + } // case 8 + case 16: + { + endIndex_ = input.readInt32(); + + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int startIndex_; + /** + * + * + *
+       * Start index of the highlight.
+       * 
+ * + * int32 start_index = 1; + * + * @return The startIndex. + */ + @java.lang.Override + public int getStartIndex() { + return startIndex_; + } + /** + * + * + *
+       * Start index of the highlight.
+       * 
+ * + * int32 start_index = 1; + * + * @param value The startIndex to set. + * @return This builder for chaining. + */ + public Builder setStartIndex(int value) { + + startIndex_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Start index of the highlight.
+       * 
+ * + * int32 start_index = 1; + * + * @return This builder for chaining. + */ + public Builder clearStartIndex() { + + startIndex_ = 0; + onChanged(); + return this; + } + + private int endIndex_; + /** + * + * + *
+       * End index of the highlight, exclusive.
+       * 
+ * + * int32 end_index = 2; + * + * @return The endIndex. + */ + @java.lang.Override + public int getEndIndex() { + return endIndex_; + } + /** + * + * + *
+       * End index of the highlight, exclusive.
+       * 
+ * + * int32 end_index = 2; + * + * @param value The endIndex to set. + * @return This builder for chaining. + */ + public Builder setEndIndex(int value) { + + endIndex_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * End index of the highlight, exclusive.
+       * 
+ * + * int32 end_index = 2; + * + * @return This builder for chaining. + */ + public Builder clearEndIndex() { + + endIndex_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.QAResult.Highlight) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.QAResult.Highlight) + private static final com.google.cloud.contentwarehouse.v1.QAResult.Highlight DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.QAResult.Highlight(); + } + + public static com.google.cloud.contentwarehouse.v1.QAResult.Highlight getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Highlight parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.QAResult.Highlight getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int HIGHLIGHTS_FIELD_NUMBER = 1; + private java.util.List highlights_; + /** + * + * + *
+   * Highlighted sections in the snippet.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.QAResult.Highlight highlights = 1; + */ + @java.lang.Override + public java.util.List + getHighlightsList() { + return highlights_; + } + /** + * + * + *
+   * Highlighted sections in the snippet.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.QAResult.Highlight highlights = 1; + */ + @java.lang.Override + public java.util.List + getHighlightsOrBuilderList() { + return highlights_; + } + /** + * + * + *
+   * Highlighted sections in the snippet.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.QAResult.Highlight highlights = 1; + */ + @java.lang.Override + public int getHighlightsCount() { + return highlights_.size(); + } + /** + * + * + *
+   * Highlighted sections in the snippet.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.QAResult.Highlight highlights = 1; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.QAResult.Highlight getHighlights(int index) { + return highlights_.get(index); + } + /** + * + * + *
+   * Highlighted sections in the snippet.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.QAResult.Highlight highlights = 1; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.QAResult.HighlightOrBuilder getHighlightsOrBuilder( + int index) { + return highlights_.get(index); + } + + public static final int CONFIDENCE_SCORE_FIELD_NUMBER = 2; + private float confidenceScore_; + /** + * + * + *
+   * The calibrated confidence score for this document, in the range
+   * [0., 1.]. This represents the confidence level for whether the returned
+   * document and snippet answers the user's query.
+   * 
+ * + * float confidence_score = 2; + * + * @return The confidenceScore. + */ + @java.lang.Override + public float getConfidenceScore() { + return confidenceScore_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < highlights_.size(); i++) { + output.writeMessage(1, highlights_.get(i)); + } + if (java.lang.Float.floatToRawIntBits(confidenceScore_) != 0) { + output.writeFloat(2, confidenceScore_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < highlights_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, highlights_.get(i)); + } + if (java.lang.Float.floatToRawIntBits(confidenceScore_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, confidenceScore_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.QAResult)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.QAResult other = + (com.google.cloud.contentwarehouse.v1.QAResult) obj; + + if (!getHighlightsList().equals(other.getHighlightsList())) return false; + if (java.lang.Float.floatToIntBits(getConfidenceScore()) + != java.lang.Float.floatToIntBits(other.getConfidenceScore())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getHighlightsCount() > 0) { + hash = (37 * hash) + HIGHLIGHTS_FIELD_NUMBER; + hash = (53 * hash) + getHighlightsList().hashCode(); + } + hash = (37 * hash) + CONFIDENCE_SCORE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getConfidenceScore()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.QAResult parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.QAResult parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.QAResult parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.QAResult parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.QAResult parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.QAResult parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.QAResult parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.QAResult parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.QAResult parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.QAResult parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.QAResult parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.QAResult parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.contentwarehouse.v1.QAResult prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Additional result info for the question-answering feature.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.QAResult} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.QAResult) + com.google.cloud.contentwarehouse.v1.QAResultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceProto + .internal_static_google_cloud_contentwarehouse_v1_QAResult_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceProto + .internal_static_google_cloud_contentwarehouse_v1_QAResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.QAResult.class, + com.google.cloud.contentwarehouse.v1.QAResult.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.QAResult.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (highlightsBuilder_ == null) { + highlights_ = java.util.Collections.emptyList(); + } else { + highlights_ = null; + highlightsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + confidenceScore_ = 0F; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceProto + .internal_static_google_cloud_contentwarehouse_v1_QAResult_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.QAResult getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.QAResult.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.QAResult build() { + com.google.cloud.contentwarehouse.v1.QAResult result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.QAResult buildPartial() { + com.google.cloud.contentwarehouse.v1.QAResult result = + new com.google.cloud.contentwarehouse.v1.QAResult(this); + int from_bitField0_ = bitField0_; + if (highlightsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + highlights_ = java.util.Collections.unmodifiableList(highlights_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.highlights_ = highlights_; + } else { + result.highlights_ = highlightsBuilder_.build(); + } + result.confidenceScore_ = confidenceScore_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.QAResult) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.QAResult) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.QAResult other) { + if (other == com.google.cloud.contentwarehouse.v1.QAResult.getDefaultInstance()) return this; + if (highlightsBuilder_ == null) { + if (!other.highlights_.isEmpty()) { + if (highlights_.isEmpty()) { + highlights_ = other.highlights_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureHighlightsIsMutable(); + highlights_.addAll(other.highlights_); + } + onChanged(); + } + } else { + if (!other.highlights_.isEmpty()) { + if (highlightsBuilder_.isEmpty()) { + highlightsBuilder_.dispose(); + highlightsBuilder_ = null; + highlights_ = other.highlights_; + bitField0_ = (bitField0_ & ~0x00000001); + highlightsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getHighlightsFieldBuilder() + : null; + } else { + highlightsBuilder_.addAllMessages(other.highlights_); + } + } + } + if (other.getConfidenceScore() != 0F) { + setConfidenceScore(other.getConfidenceScore()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.contentwarehouse.v1.QAResult.Highlight m = + input.readMessage( + com.google.cloud.contentwarehouse.v1.QAResult.Highlight.parser(), + extensionRegistry); + if (highlightsBuilder_ == null) { + ensureHighlightsIsMutable(); + highlights_.add(m); + } else { + highlightsBuilder_.addMessage(m); + } + break; + } // case 10 + case 21: + { + confidenceScore_ = input.readFloat(); + + break; + } // case 21 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List highlights_ = + java.util.Collections.emptyList(); + + private void ensureHighlightsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + highlights_ = + new java.util.ArrayList( + highlights_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.QAResult.Highlight, + com.google.cloud.contentwarehouse.v1.QAResult.Highlight.Builder, + com.google.cloud.contentwarehouse.v1.QAResult.HighlightOrBuilder> + highlightsBuilder_; + + /** + * + * + *
+     * Highlighted sections in the snippet.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.QAResult.Highlight highlights = 1; + */ + public java.util.List + getHighlightsList() { + if (highlightsBuilder_ == null) { + return java.util.Collections.unmodifiableList(highlights_); + } else { + return highlightsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Highlighted sections in the snippet.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.QAResult.Highlight highlights = 1; + */ + public int getHighlightsCount() { + if (highlightsBuilder_ == null) { + return highlights_.size(); + } else { + return highlightsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Highlighted sections in the snippet.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.QAResult.Highlight highlights = 1; + */ + public com.google.cloud.contentwarehouse.v1.QAResult.Highlight getHighlights(int index) { + if (highlightsBuilder_ == null) { + return highlights_.get(index); + } else { + return highlightsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Highlighted sections in the snippet.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.QAResult.Highlight highlights = 1; + */ + public Builder setHighlights( + int index, com.google.cloud.contentwarehouse.v1.QAResult.Highlight value) { + if (highlightsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureHighlightsIsMutable(); + highlights_.set(index, value); + onChanged(); + } else { + highlightsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Highlighted sections in the snippet.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.QAResult.Highlight highlights = 1; + */ + public Builder setHighlights( + int index, + com.google.cloud.contentwarehouse.v1.QAResult.Highlight.Builder builderForValue) { + if (highlightsBuilder_ == null) { + ensureHighlightsIsMutable(); + highlights_.set(index, builderForValue.build()); + onChanged(); + } else { + highlightsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Highlighted sections in the snippet.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.QAResult.Highlight highlights = 1; + */ + public Builder addHighlights(com.google.cloud.contentwarehouse.v1.QAResult.Highlight value) { + if (highlightsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureHighlightsIsMutable(); + highlights_.add(value); + onChanged(); + } else { + highlightsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Highlighted sections in the snippet.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.QAResult.Highlight highlights = 1; + */ + public Builder addHighlights( + int index, com.google.cloud.contentwarehouse.v1.QAResult.Highlight value) { + if (highlightsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureHighlightsIsMutable(); + highlights_.add(index, value); + onChanged(); + } else { + highlightsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Highlighted sections in the snippet.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.QAResult.Highlight highlights = 1; + */ + public Builder addHighlights( + com.google.cloud.contentwarehouse.v1.QAResult.Highlight.Builder builderForValue) { + if (highlightsBuilder_ == null) { + ensureHighlightsIsMutable(); + highlights_.add(builderForValue.build()); + onChanged(); + } else { + highlightsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Highlighted sections in the snippet.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.QAResult.Highlight highlights = 1; + */ + public Builder addHighlights( + int index, + com.google.cloud.contentwarehouse.v1.QAResult.Highlight.Builder builderForValue) { + if (highlightsBuilder_ == null) { + ensureHighlightsIsMutable(); + highlights_.add(index, builderForValue.build()); + onChanged(); + } else { + highlightsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Highlighted sections in the snippet.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.QAResult.Highlight highlights = 1; + */ + public Builder addAllHighlights( + java.lang.Iterable + values) { + if (highlightsBuilder_ == null) { + ensureHighlightsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, highlights_); + onChanged(); + } else { + highlightsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Highlighted sections in the snippet.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.QAResult.Highlight highlights = 1; + */ + public Builder clearHighlights() { + if (highlightsBuilder_ == null) { + highlights_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + highlightsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Highlighted sections in the snippet.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.QAResult.Highlight highlights = 1; + */ + public Builder removeHighlights(int index) { + if (highlightsBuilder_ == null) { + ensureHighlightsIsMutable(); + highlights_.remove(index); + onChanged(); + } else { + highlightsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Highlighted sections in the snippet.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.QAResult.Highlight highlights = 1; + */ + public com.google.cloud.contentwarehouse.v1.QAResult.Highlight.Builder getHighlightsBuilder( + int index) { + return getHighlightsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Highlighted sections in the snippet.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.QAResult.Highlight highlights = 1; + */ + public com.google.cloud.contentwarehouse.v1.QAResult.HighlightOrBuilder getHighlightsOrBuilder( + int index) { + if (highlightsBuilder_ == null) { + return highlights_.get(index); + } else { + return highlightsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Highlighted sections in the snippet.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.QAResult.Highlight highlights = 1; + */ + public java.util.List< + ? extends com.google.cloud.contentwarehouse.v1.QAResult.HighlightOrBuilder> + getHighlightsOrBuilderList() { + if (highlightsBuilder_ != null) { + return highlightsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(highlights_); + } + } + /** + * + * + *
+     * Highlighted sections in the snippet.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.QAResult.Highlight highlights = 1; + */ + public com.google.cloud.contentwarehouse.v1.QAResult.Highlight.Builder addHighlightsBuilder() { + return getHighlightsFieldBuilder() + .addBuilder(com.google.cloud.contentwarehouse.v1.QAResult.Highlight.getDefaultInstance()); + } + /** + * + * + *
+     * Highlighted sections in the snippet.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.QAResult.Highlight highlights = 1; + */ + public com.google.cloud.contentwarehouse.v1.QAResult.Highlight.Builder addHighlightsBuilder( + int index) { + return getHighlightsFieldBuilder() + .addBuilder( + index, com.google.cloud.contentwarehouse.v1.QAResult.Highlight.getDefaultInstance()); + } + /** + * + * + *
+     * Highlighted sections in the snippet.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.QAResult.Highlight highlights = 1; + */ + public java.util.List + getHighlightsBuilderList() { + return getHighlightsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.QAResult.Highlight, + com.google.cloud.contentwarehouse.v1.QAResult.Highlight.Builder, + com.google.cloud.contentwarehouse.v1.QAResult.HighlightOrBuilder> + getHighlightsFieldBuilder() { + if (highlightsBuilder_ == null) { + highlightsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.QAResult.Highlight, + com.google.cloud.contentwarehouse.v1.QAResult.Highlight.Builder, + com.google.cloud.contentwarehouse.v1.QAResult.HighlightOrBuilder>( + highlights_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + highlights_ = null; + } + return highlightsBuilder_; + } + + private float confidenceScore_; + /** + * + * + *
+     * The calibrated confidence score for this document, in the range
+     * [0., 1.]. This represents the confidence level for whether the returned
+     * document and snippet answers the user's query.
+     * 
+ * + * float confidence_score = 2; + * + * @return The confidenceScore. + */ + @java.lang.Override + public float getConfidenceScore() { + return confidenceScore_; + } + /** + * + * + *
+     * The calibrated confidence score for this document, in the range
+     * [0., 1.]. This represents the confidence level for whether the returned
+     * document and snippet answers the user's query.
+     * 
+ * + * float confidence_score = 2; + * + * @param value The confidenceScore to set. + * @return This builder for chaining. + */ + public Builder setConfidenceScore(float value) { + + confidenceScore_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The calibrated confidence score for this document, in the range
+     * [0., 1.]. This represents the confidence level for whether the returned
+     * document and snippet answers the user's query.
+     * 
+ * + * float confidence_score = 2; + * + * @return This builder for chaining. + */ + public Builder clearConfidenceScore() { + + confidenceScore_ = 0F; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.QAResult) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.QAResult) + private static final com.google.cloud.contentwarehouse.v1.QAResult DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.QAResult(); + } + + public static com.google.cloud.contentwarehouse.v1.QAResult getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public QAResult parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.QAResult getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/QAResultOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/QAResultOrBuilder.java new file mode 100644 index 000000000000..5b2190629d79 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/QAResultOrBuilder.java @@ -0,0 +1,93 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_service.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface QAResultOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.QAResult) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Highlighted sections in the snippet.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.QAResult.Highlight highlights = 1; + */ + java.util.List getHighlightsList(); + /** + * + * + *
+   * Highlighted sections in the snippet.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.QAResult.Highlight highlights = 1; + */ + com.google.cloud.contentwarehouse.v1.QAResult.Highlight getHighlights(int index); + /** + * + * + *
+   * Highlighted sections in the snippet.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.QAResult.Highlight highlights = 1; + */ + int getHighlightsCount(); + /** + * + * + *
+   * Highlighted sections in the snippet.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.QAResult.Highlight highlights = 1; + */ + java.util.List + getHighlightsOrBuilderList(); + /** + * + * + *
+   * Highlighted sections in the snippet.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.QAResult.Highlight highlights = 1; + */ + com.google.cloud.contentwarehouse.v1.QAResult.HighlightOrBuilder getHighlightsOrBuilder( + int index); + + /** + * + * + *
+   * The calibrated confidence score for this document, in the range
+   * [0., 1.]. This represents the confidence level for whether the returned
+   * document and snippet answers the user's query.
+   * 
+ * + * float confidence_score = 2; + * + * @return The confidenceScore. + */ + float getConfidenceScore(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/RawDocumentFileType.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/RawDocumentFileType.java new file mode 100644 index 000000000000..023e6b26258b --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/RawDocumentFileType.java @@ -0,0 +1,245 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * When a raw document is supplied, this indicates the file format
+ * 
+ * + * Protobuf enum {@code google.cloud.contentwarehouse.v1.RawDocumentFileType} + */ +public enum RawDocumentFileType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * No raw document specified or it is non-parsable
+   * 
+ * + * RAW_DOCUMENT_FILE_TYPE_UNSPECIFIED = 0; + */ + RAW_DOCUMENT_FILE_TYPE_UNSPECIFIED(0), + /** + * + * + *
+   * Adobe PDF format
+   * 
+ * + * RAW_DOCUMENT_FILE_TYPE_PDF = 1; + */ + RAW_DOCUMENT_FILE_TYPE_PDF(1), + /** + * + * + *
+   * Microsoft Word format
+   * 
+ * + * RAW_DOCUMENT_FILE_TYPE_DOCX = 2; + */ + RAW_DOCUMENT_FILE_TYPE_DOCX(2), + /** + * + * + *
+   * Microsoft Excel format
+   * 
+ * + * RAW_DOCUMENT_FILE_TYPE_XLSX = 3; + */ + RAW_DOCUMENT_FILE_TYPE_XLSX(3), + /** + * + * + *
+   * Microsoft Powerpoint format
+   * 
+ * + * RAW_DOCUMENT_FILE_TYPE_PPTX = 4; + */ + RAW_DOCUMENT_FILE_TYPE_PPTX(4), + /** + * + * + *
+   * UTF-8 encoded text format
+   * 
+ * + * RAW_DOCUMENT_FILE_TYPE_TEXT = 5; + */ + RAW_DOCUMENT_FILE_TYPE_TEXT(5), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * No raw document specified or it is non-parsable
+   * 
+ * + * RAW_DOCUMENT_FILE_TYPE_UNSPECIFIED = 0; + */ + public static final int RAW_DOCUMENT_FILE_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * Adobe PDF format
+   * 
+ * + * RAW_DOCUMENT_FILE_TYPE_PDF = 1; + */ + public static final int RAW_DOCUMENT_FILE_TYPE_PDF_VALUE = 1; + /** + * + * + *
+   * Microsoft Word format
+   * 
+ * + * RAW_DOCUMENT_FILE_TYPE_DOCX = 2; + */ + public static final int RAW_DOCUMENT_FILE_TYPE_DOCX_VALUE = 2; + /** + * + * + *
+   * Microsoft Excel format
+   * 
+ * + * RAW_DOCUMENT_FILE_TYPE_XLSX = 3; + */ + public static final int RAW_DOCUMENT_FILE_TYPE_XLSX_VALUE = 3; + /** + * + * + *
+   * Microsoft Powerpoint format
+   * 
+ * + * RAW_DOCUMENT_FILE_TYPE_PPTX = 4; + */ + public static final int RAW_DOCUMENT_FILE_TYPE_PPTX_VALUE = 4; + /** + * + * + *
+   * UTF-8 encoded text format
+   * 
+ * + * RAW_DOCUMENT_FILE_TYPE_TEXT = 5; + */ + public static final int RAW_DOCUMENT_FILE_TYPE_TEXT_VALUE = 5; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static RawDocumentFileType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static RawDocumentFileType forNumber(int value) { + switch (value) { + case 0: + return RAW_DOCUMENT_FILE_TYPE_UNSPECIFIED; + case 1: + return RAW_DOCUMENT_FILE_TYPE_PDF; + case 2: + return RAW_DOCUMENT_FILE_TYPE_DOCX; + case 3: + return RAW_DOCUMENT_FILE_TYPE_XLSX; + case 4: + return RAW_DOCUMENT_FILE_TYPE_PPTX; + case 5: + return RAW_DOCUMENT_FILE_TYPE_TEXT; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public RawDocumentFileType findValueByNumber(int number) { + return RawDocumentFileType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentProto.getDescriptor().getEnumTypes().get(0); + } + + private static final RawDocumentFileType[] VALUES = values(); + + public static RawDocumentFileType valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private RawDocumentFileType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.contentwarehouse.v1.RawDocumentFileType) +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/RemoveFromFolderAction.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/RemoveFromFolderAction.java new file mode 100644 index 000000000000..ab3547962883 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/RemoveFromFolderAction.java @@ -0,0 +1,810 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/rule_engine.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Represents the action responsible for remove a document from a specific
+ * folder.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.RemoveFromFolderAction} + */ +public final class RemoveFromFolderAction extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.RemoveFromFolderAction) + RemoveFromFolderActionOrBuilder { + private static final long serialVersionUID = 0L; + // Use RemoveFromFolderAction.newBuilder() to construct. + private RemoveFromFolderAction(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RemoveFromFolderAction() { + condition_ = ""; + folder_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RemoveFromFolderAction(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_RemoveFromFolderAction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_RemoveFromFolderAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction.class, + com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction.Builder.class); + } + + public static final int CONDITION_FIELD_NUMBER = 1; + private volatile java.lang.Object condition_; + /** + * + * + *
+   * Condition of the action to be executed.
+   * 
+ * + * string condition = 1; + * + * @return The condition. + */ + @java.lang.Override + public java.lang.String getCondition() { + java.lang.Object ref = condition_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + condition_ = s; + return s; + } + } + /** + * + * + *
+   * Condition of the action to be executed.
+   * 
+ * + * string condition = 1; + * + * @return The bytes for condition. + */ + @java.lang.Override + public com.google.protobuf.ByteString getConditionBytes() { + java.lang.Object ref = condition_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + condition_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FOLDER_FIELD_NUMBER = 2; + private volatile java.lang.Object folder_; + /** + * + * + *
+   * Name of the folder under which new document is to be added.
+   * Format:
+   * projects/{project_number}/locations/{location}/documents/{document_id}.
+   * 
+ * + * string folder = 2 [(.google.api.resource_reference) = { ... } + * + * @return The folder. + */ + @java.lang.Override + public java.lang.String getFolder() { + java.lang.Object ref = folder_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + folder_ = s; + return s; + } + } + /** + * + * + *
+   * Name of the folder under which new document is to be added.
+   * Format:
+   * projects/{project_number}/locations/{location}/documents/{document_id}.
+   * 
+ * + * string folder = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for folder. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFolderBytes() { + java.lang.Object ref = folder_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + folder_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(condition_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, condition_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(folder_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, folder_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(condition_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, condition_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(folder_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, folder_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction other = + (com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction) obj; + + if (!getCondition().equals(other.getCondition())) return false; + if (!getFolder().equals(other.getFolder())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CONDITION_FIELD_NUMBER; + hash = (53 * hash) + getCondition().hashCode(); + hash = (37 * hash) + FOLDER_FIELD_NUMBER; + hash = (53 * hash) + getFolder().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Represents the action responsible for remove a document from a specific
+   * folder.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.RemoveFromFolderAction} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.RemoveFromFolderAction) + com.google.cloud.contentwarehouse.v1.RemoveFromFolderActionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_RemoveFromFolderAction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_RemoveFromFolderAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction.class, + com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + condition_ = ""; + + folder_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_RemoveFromFolderAction_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction build() { + com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction buildPartial() { + com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction result = + new com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction(this); + result.condition_ = condition_; + result.folder_ = folder_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction other) { + if (other == com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction.getDefaultInstance()) + return this; + if (!other.getCondition().isEmpty()) { + condition_ = other.condition_; + onChanged(); + } + if (!other.getFolder().isEmpty()) { + folder_ = other.folder_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + condition_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + folder_ = input.readStringRequireUtf8(); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object condition_ = ""; + /** + * + * + *
+     * Condition of the action to be executed.
+     * 
+ * + * string condition = 1; + * + * @return The condition. + */ + public java.lang.String getCondition() { + java.lang.Object ref = condition_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + condition_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Condition of the action to be executed.
+     * 
+ * + * string condition = 1; + * + * @return The bytes for condition. + */ + public com.google.protobuf.ByteString getConditionBytes() { + java.lang.Object ref = condition_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + condition_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Condition of the action to be executed.
+     * 
+ * + * string condition = 1; + * + * @param value The condition to set. + * @return This builder for chaining. + */ + public Builder setCondition(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + condition_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Condition of the action to be executed.
+     * 
+ * + * string condition = 1; + * + * @return This builder for chaining. + */ + public Builder clearCondition() { + + condition_ = getDefaultInstance().getCondition(); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition of the action to be executed.
+     * 
+ * + * string condition = 1; + * + * @param value The bytes for condition to set. + * @return This builder for chaining. + */ + public Builder setConditionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + condition_ = value; + onChanged(); + return this; + } + + private java.lang.Object folder_ = ""; + /** + * + * + *
+     * Name of the folder under which new document is to be added.
+     * Format:
+     * projects/{project_number}/locations/{location}/documents/{document_id}.
+     * 
+ * + * string folder = 2 [(.google.api.resource_reference) = { ... } + * + * @return The folder. + */ + public java.lang.String getFolder() { + java.lang.Object ref = folder_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + folder_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Name of the folder under which new document is to be added.
+     * Format:
+     * projects/{project_number}/locations/{location}/documents/{document_id}.
+     * 
+ * + * string folder = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for folder. + */ + public com.google.protobuf.ByteString getFolderBytes() { + java.lang.Object ref = folder_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + folder_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Name of the folder under which new document is to be added.
+     * Format:
+     * projects/{project_number}/locations/{location}/documents/{document_id}.
+     * 
+ * + * string folder = 2 [(.google.api.resource_reference) = { ... } + * + * @param value The folder to set. + * @return This builder for chaining. + */ + public Builder setFolder(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + folder_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the folder under which new document is to be added.
+     * Format:
+     * projects/{project_number}/locations/{location}/documents/{document_id}.
+     * 
+ * + * string folder = 2 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearFolder() { + + folder_ = getDefaultInstance().getFolder(); + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the folder under which new document is to be added.
+     * Format:
+     * projects/{project_number}/locations/{location}/documents/{document_id}.
+     * 
+ * + * string folder = 2 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for folder to set. + * @return This builder for chaining. + */ + public Builder setFolderBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + folder_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.RemoveFromFolderAction) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.RemoveFromFolderAction) + private static final com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction(); + } + + public static com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RemoveFromFolderAction parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RemoveFromFolderAction getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/RemoveFromFolderActionOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/RemoveFromFolderActionOrBuilder.java new file mode 100644 index 000000000000..8a88cebb116f --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/RemoveFromFolderActionOrBuilder.java @@ -0,0 +1,79 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/rule_engine.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface RemoveFromFolderActionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.RemoveFromFolderAction) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Condition of the action to be executed.
+   * 
+ * + * string condition = 1; + * + * @return The condition. + */ + java.lang.String getCondition(); + /** + * + * + *
+   * Condition of the action to be executed.
+   * 
+ * + * string condition = 1; + * + * @return The bytes for condition. + */ + com.google.protobuf.ByteString getConditionBytes(); + + /** + * + * + *
+   * Name of the folder under which new document is to be added.
+   * Format:
+   * projects/{project_number}/locations/{location}/documents/{document_id}.
+   * 
+ * + * string folder = 2 [(.google.api.resource_reference) = { ... } + * + * @return The folder. + */ + java.lang.String getFolder(); + /** + * + * + *
+   * Name of the folder under which new document is to be added.
+   * Format:
+   * projects/{project_number}/locations/{location}/documents/{document_id}.
+   * 
+ * + * string folder = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for folder. + */ + com.google.protobuf.ByteString getFolderBytes(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/RequestMetadata.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/RequestMetadata.java new file mode 100644 index 000000000000..a94aed7b8760 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/RequestMetadata.java @@ -0,0 +1,704 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/common.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Meta information is used to improve the performance of the service.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.RequestMetadata} + */ +public final class RequestMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.RequestMetadata) + RequestMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use RequestMetadata.newBuilder() to construct. + private RequestMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RequestMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RequestMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.CommonProto + .internal_static_google_cloud_contentwarehouse_v1_RequestMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.CommonProto + .internal_static_google_cloud_contentwarehouse_v1_RequestMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.RequestMetadata.class, + com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder.class); + } + + public static final int USER_INFO_FIELD_NUMBER = 1; + private com.google.cloud.contentwarehouse.v1.UserInfo userInfo_; + /** + * + * + *
+   * Provides user unique identification and groups information.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.UserInfo user_info = 1; + * + * @return Whether the userInfo field is set. + */ + @java.lang.Override + public boolean hasUserInfo() { + return userInfo_ != null; + } + /** + * + * + *
+   * Provides user unique identification and groups information.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.UserInfo user_info = 1; + * + * @return The userInfo. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.UserInfo getUserInfo() { + return userInfo_ == null + ? com.google.cloud.contentwarehouse.v1.UserInfo.getDefaultInstance() + : userInfo_; + } + /** + * + * + *
+   * Provides user unique identification and groups information.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.UserInfo user_info = 1; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.UserInfoOrBuilder getUserInfoOrBuilder() { + return getUserInfo(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (userInfo_ != null) { + output.writeMessage(1, getUserInfo()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (userInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getUserInfo()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.RequestMetadata)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.RequestMetadata other = + (com.google.cloud.contentwarehouse.v1.RequestMetadata) obj; + + if (hasUserInfo() != other.hasUserInfo()) return false; + if (hasUserInfo()) { + if (!getUserInfo().equals(other.getUserInfo())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasUserInfo()) { + hash = (37 * hash) + USER_INFO_FIELD_NUMBER; + hash = (53 * hash) + getUserInfo().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.RequestMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.RequestMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.RequestMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.RequestMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.RequestMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.RequestMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.RequestMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.RequestMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.RequestMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.RequestMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.RequestMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.RequestMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.contentwarehouse.v1.RequestMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Meta information is used to improve the performance of the service.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.RequestMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.RequestMetadata) + com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.CommonProto + .internal_static_google_cloud_contentwarehouse_v1_RequestMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.CommonProto + .internal_static_google_cloud_contentwarehouse_v1_RequestMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.RequestMetadata.class, + com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.RequestMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (userInfoBuilder_ == null) { + userInfo_ = null; + } else { + userInfo_ = null; + userInfoBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.CommonProto + .internal_static_google_cloud_contentwarehouse_v1_RequestMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RequestMetadata getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.RequestMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RequestMetadata build() { + com.google.cloud.contentwarehouse.v1.RequestMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RequestMetadata buildPartial() { + com.google.cloud.contentwarehouse.v1.RequestMetadata result = + new com.google.cloud.contentwarehouse.v1.RequestMetadata(this); + if (userInfoBuilder_ == null) { + result.userInfo_ = userInfo_; + } else { + result.userInfo_ = userInfoBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.RequestMetadata) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.RequestMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.RequestMetadata other) { + if (other == com.google.cloud.contentwarehouse.v1.RequestMetadata.getDefaultInstance()) + return this; + if (other.hasUserInfo()) { + mergeUserInfo(other.getUserInfo()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getUserInfoFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private com.google.cloud.contentwarehouse.v1.UserInfo userInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.UserInfo, + com.google.cloud.contentwarehouse.v1.UserInfo.Builder, + com.google.cloud.contentwarehouse.v1.UserInfoOrBuilder> + userInfoBuilder_; + /** + * + * + *
+     * Provides user unique identification and groups information.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.UserInfo user_info = 1; + * + * @return Whether the userInfo field is set. + */ + public boolean hasUserInfo() { + return userInfoBuilder_ != null || userInfo_ != null; + } + /** + * + * + *
+     * Provides user unique identification and groups information.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.UserInfo user_info = 1; + * + * @return The userInfo. + */ + public com.google.cloud.contentwarehouse.v1.UserInfo getUserInfo() { + if (userInfoBuilder_ == null) { + return userInfo_ == null + ? com.google.cloud.contentwarehouse.v1.UserInfo.getDefaultInstance() + : userInfo_; + } else { + return userInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Provides user unique identification and groups information.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.UserInfo user_info = 1; + */ + public Builder setUserInfo(com.google.cloud.contentwarehouse.v1.UserInfo value) { + if (userInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + userInfo_ = value; + onChanged(); + } else { + userInfoBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Provides user unique identification and groups information.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.UserInfo user_info = 1; + */ + public Builder setUserInfo( + com.google.cloud.contentwarehouse.v1.UserInfo.Builder builderForValue) { + if (userInfoBuilder_ == null) { + userInfo_ = builderForValue.build(); + onChanged(); + } else { + userInfoBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Provides user unique identification and groups information.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.UserInfo user_info = 1; + */ + public Builder mergeUserInfo(com.google.cloud.contentwarehouse.v1.UserInfo value) { + if (userInfoBuilder_ == null) { + if (userInfo_ != null) { + userInfo_ = + com.google.cloud.contentwarehouse.v1.UserInfo.newBuilder(userInfo_) + .mergeFrom(value) + .buildPartial(); + } else { + userInfo_ = value; + } + onChanged(); + } else { + userInfoBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Provides user unique identification and groups information.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.UserInfo user_info = 1; + */ + public Builder clearUserInfo() { + if (userInfoBuilder_ == null) { + userInfo_ = null; + onChanged(); + } else { + userInfo_ = null; + userInfoBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Provides user unique identification and groups information.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.UserInfo user_info = 1; + */ + public com.google.cloud.contentwarehouse.v1.UserInfo.Builder getUserInfoBuilder() { + + onChanged(); + return getUserInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Provides user unique identification and groups information.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.UserInfo user_info = 1; + */ + public com.google.cloud.contentwarehouse.v1.UserInfoOrBuilder getUserInfoOrBuilder() { + if (userInfoBuilder_ != null) { + return userInfoBuilder_.getMessageOrBuilder(); + } else { + return userInfo_ == null + ? com.google.cloud.contentwarehouse.v1.UserInfo.getDefaultInstance() + : userInfo_; + } + } + /** + * + * + *
+     * Provides user unique identification and groups information.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.UserInfo user_info = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.UserInfo, + com.google.cloud.contentwarehouse.v1.UserInfo.Builder, + com.google.cloud.contentwarehouse.v1.UserInfoOrBuilder> + getUserInfoFieldBuilder() { + if (userInfoBuilder_ == null) { + userInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.UserInfo, + com.google.cloud.contentwarehouse.v1.UserInfo.Builder, + com.google.cloud.contentwarehouse.v1.UserInfoOrBuilder>( + getUserInfo(), getParentForChildren(), isClean()); + userInfo_ = null; + } + return userInfoBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.RequestMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.RequestMetadata) + private static final com.google.cloud.contentwarehouse.v1.RequestMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.RequestMetadata(); + } + + public static com.google.cloud.contentwarehouse.v1.RequestMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RequestMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RequestMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/RequestMetadataOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/RequestMetadataOrBuilder.java new file mode 100644 index 000000000000..aae0d947d4eb --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/RequestMetadataOrBuilder.java @@ -0,0 +1,60 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/common.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface RequestMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.RequestMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Provides user unique identification and groups information.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.UserInfo user_info = 1; + * + * @return Whether the userInfo field is set. + */ + boolean hasUserInfo(); + /** + * + * + *
+   * Provides user unique identification and groups information.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.UserInfo user_info = 1; + * + * @return The userInfo. + */ + com.google.cloud.contentwarehouse.v1.UserInfo getUserInfo(); + /** + * + * + *
+   * Provides user unique identification and groups information.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.UserInfo user_info = 1; + */ + com.google.cloud.contentwarehouse.v1.UserInfoOrBuilder getUserInfoOrBuilder(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ResponseMetadata.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ResponseMetadata.java new file mode 100644 index 000000000000..3ce5b1560a84 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ResponseMetadata.java @@ -0,0 +1,623 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/common.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Additional information returned to client, such as debugging information.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.ResponseMetadata} + */ +public final class ResponseMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.ResponseMetadata) + ResponseMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use ResponseMetadata.newBuilder() to construct. + private ResponseMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ResponseMetadata() { + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ResponseMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.CommonProto + .internal_static_google_cloud_contentwarehouse_v1_ResponseMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.CommonProto + .internal_static_google_cloud_contentwarehouse_v1_ResponseMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.ResponseMetadata.class, + com.google.cloud.contentwarehouse.v1.ResponseMetadata.Builder.class); + } + + public static final int REQUEST_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object requestId_; + /** + * + * + *
+   * A unique id associated with this call. This id is logged for tracking
+   * purpose.
+   * 
+ * + * string request_id = 1; + * + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } + } + /** + * + * + *
+   * A unique id associated with this call. This id is logged for tracking
+   * purpose.
+   * 
+ * + * string request_id = 1; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, requestId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, requestId_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.ResponseMetadata)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.ResponseMetadata other = + (com.google.cloud.contentwarehouse.v1.ResponseMetadata) obj; + + if (!getRequestId().equals(other.getRequestId())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.ResponseMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.ResponseMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ResponseMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.ResponseMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ResponseMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.ResponseMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ResponseMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.ResponseMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ResponseMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.ResponseMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.ResponseMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.ResponseMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.ResponseMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Additional information returned to client, such as debugging information.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.ResponseMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.ResponseMetadata) + com.google.cloud.contentwarehouse.v1.ResponseMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.CommonProto + .internal_static_google_cloud_contentwarehouse_v1_ResponseMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.CommonProto + .internal_static_google_cloud_contentwarehouse_v1_ResponseMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.ResponseMetadata.class, + com.google.cloud.contentwarehouse.v1.ResponseMetadata.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.ResponseMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + requestId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.CommonProto + .internal_static_google_cloud_contentwarehouse_v1_ResponseMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ResponseMetadata getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.ResponseMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ResponseMetadata build() { + com.google.cloud.contentwarehouse.v1.ResponseMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ResponseMetadata buildPartial() { + com.google.cloud.contentwarehouse.v1.ResponseMetadata result = + new com.google.cloud.contentwarehouse.v1.ResponseMetadata(this); + result.requestId_ = requestId_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.ResponseMetadata) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.ResponseMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.ResponseMetadata other) { + if (other == com.google.cloud.contentwarehouse.v1.ResponseMetadata.getDefaultInstance()) + return this; + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + requestId_ = input.readStringRequireUtf8(); + + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * A unique id associated with this call. This id is logged for tracking
+     * purpose.
+     * 
+ * + * string request_id = 1; + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A unique id associated with this call. This id is logged for tracking
+     * purpose.
+     * 
+ * + * string request_id = 1; + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A unique id associated with this call. This id is logged for tracking
+     * purpose.
+     * 
+ * + * string request_id = 1; + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + requestId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A unique id associated with this call. This id is logged for tracking
+     * purpose.
+     * 
+ * + * string request_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + + requestId_ = getDefaultInstance().getRequestId(); + onChanged(); + return this; + } + /** + * + * + *
+     * A unique id associated with this call. This id is logged for tracking
+     * purpose.
+     * 
+ * + * string request_id = 1; + * + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + requestId_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.ResponseMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.ResponseMetadata) + private static final com.google.cloud.contentwarehouse.v1.ResponseMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.ResponseMetadata(); + } + + public static com.google.cloud.contentwarehouse.v1.ResponseMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ResponseMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ResponseMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ResponseMetadataOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ResponseMetadataOrBuilder.java new file mode 100644 index 000000000000..24c948ae956f --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ResponseMetadataOrBuilder.java @@ -0,0 +1,52 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/common.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface ResponseMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.ResponseMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A unique id associated with this call. This id is logged for tracking
+   * purpose.
+   * 
+ * + * string request_id = 1; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * A unique id associated with this call. This id is logged for tracking
+   * purpose.
+   * 
+ * + * string request_id = 1; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/Rule.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/Rule.java new file mode 100644 index 000000000000..480aa5104f61 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/Rule.java @@ -0,0 +1,1773 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/rule_engine.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Represents the rule for a content warehouse trigger.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.Rule} + */ +public final class Rule extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.Rule) + RuleOrBuilder { + private static final long serialVersionUID = 0L; + // Use Rule.newBuilder() to construct. + private Rule(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Rule() { + description_ = ""; + ruleId_ = ""; + triggerType_ = 0; + condition_ = ""; + actions_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Rule(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_Rule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_Rule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.Rule.class, + com.google.cloud.contentwarehouse.v1.Rule.Builder.class); + } + + /** Protobuf enum {@code google.cloud.contentwarehouse.v1.Rule.TriggerType} */ + public enum TriggerType implements com.google.protobuf.ProtocolMessageEnum { + /** UNKNOWN = 0; */ + UNKNOWN(0), + /** + * + * + *
+     * Trigger for create document action.
+     * 
+ * + * ON_CREATE = 1; + */ + ON_CREATE(1), + /** + * + * + *
+     * Trigger for update document action.
+     * 
+ * + * ON_UPDATE = 4; + */ + ON_UPDATE(4), + UNRECOGNIZED(-1), + ; + + /** UNKNOWN = 0; */ + public static final int UNKNOWN_VALUE = 0; + /** + * + * + *
+     * Trigger for create document action.
+     * 
+ * + * ON_CREATE = 1; + */ + public static final int ON_CREATE_VALUE = 1; + /** + * + * + *
+     * Trigger for update document action.
+     * 
+ * + * ON_UPDATE = 4; + */ + public static final int ON_UPDATE_VALUE = 4; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static TriggerType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static TriggerType forNumber(int value) { + switch (value) { + case 0: + return UNKNOWN; + case 1: + return ON_CREATE; + case 4: + return ON_UPDATE; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public TriggerType findValueByNumber(int number) { + return TriggerType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.Rule.getDescriptor().getEnumTypes().get(0); + } + + private static final TriggerType[] VALUES = values(); + + public static TriggerType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private TriggerType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.contentwarehouse.v1.Rule.TriggerType) + } + + public static final int DESCRIPTION_FIELD_NUMBER = 1; + private volatile java.lang.Object description_; + /** + * + * + *
+   * Short description of the rule and its context.
+   * 
+ * + * string description = 1; + * + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + /** + * + * + *
+   * Short description of the rule and its context.
+   * 
+ * + * string description = 1; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RULE_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object ruleId_; + /** + * + * + *
+   * ID of the rule. It has to be unique across all the examples.
+   * This is managed internally.
+   * 
+ * + * string rule_id = 2; + * + * @return The ruleId. + */ + @java.lang.Override + public java.lang.String getRuleId() { + java.lang.Object ref = ruleId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ruleId_ = s; + return s; + } + } + /** + * + * + *
+   * ID of the rule. It has to be unique across all the examples.
+   * This is managed internally.
+   * 
+ * + * string rule_id = 2; + * + * @return The bytes for ruleId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRuleIdBytes() { + java.lang.Object ref = ruleId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ruleId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TRIGGER_TYPE_FIELD_NUMBER = 3; + private int triggerType_; + /** + * + * + *
+   * Identifies the trigger type for running the policy.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.Rule.TriggerType trigger_type = 3; + * + * @return The enum numeric value on the wire for triggerType. + */ + @java.lang.Override + public int getTriggerTypeValue() { + return triggerType_; + } + /** + * + * + *
+   * Identifies the trigger type for running the policy.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.Rule.TriggerType trigger_type = 3; + * + * @return The triggerType. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.Rule.TriggerType getTriggerType() { + @SuppressWarnings("deprecation") + com.google.cloud.contentwarehouse.v1.Rule.TriggerType result = + com.google.cloud.contentwarehouse.v1.Rule.TriggerType.valueOf(triggerType_); + return result == null + ? com.google.cloud.contentwarehouse.v1.Rule.TriggerType.UNRECOGNIZED + : result; + } + + public static final int CONDITION_FIELD_NUMBER = 4; + private volatile java.lang.Object condition_; + /** + * + * + *
+   * Represents the conditional expression to be evaluated.
+   * Expression should evaluate to a boolean result.
+   * When the condition is true actions are executed.
+   * Example: user_role = "hsbc_role_1" AND doc.salary > 20000
+   * 
+ * + * string condition = 4; + * + * @return The condition. + */ + @java.lang.Override + public java.lang.String getCondition() { + java.lang.Object ref = condition_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + condition_ = s; + return s; + } + } + /** + * + * + *
+   * Represents the conditional expression to be evaluated.
+   * Expression should evaluate to a boolean result.
+   * When the condition is true actions are executed.
+   * Example: user_role = "hsbc_role_1" AND doc.salary > 20000
+   * 
+ * + * string condition = 4; + * + * @return The bytes for condition. + */ + @java.lang.Override + public com.google.protobuf.ByteString getConditionBytes() { + java.lang.Object ref = condition_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + condition_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ACTIONS_FIELD_NUMBER = 5; + private java.util.List actions_; + /** + * + * + *
+   * List of actions that are executed when the rule is satisfied.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Action actions = 5; + */ + @java.lang.Override + public java.util.List getActionsList() { + return actions_; + } + /** + * + * + *
+   * List of actions that are executed when the rule is satisfied.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Action actions = 5; + */ + @java.lang.Override + public java.util.List + getActionsOrBuilderList() { + return actions_; + } + /** + * + * + *
+   * List of actions that are executed when the rule is satisfied.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Action actions = 5; + */ + @java.lang.Override + public int getActionsCount() { + return actions_.size(); + } + /** + * + * + *
+   * List of actions that are executed when the rule is satisfied.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Action actions = 5; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.Action getActions(int index) { + return actions_.get(index); + } + /** + * + * + *
+   * List of actions that are executed when the rule is satisfied.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Action actions = 5; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ActionOrBuilder getActionsOrBuilder(int index) { + return actions_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, description_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(ruleId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, ruleId_); + } + if (triggerType_ != com.google.cloud.contentwarehouse.v1.Rule.TriggerType.UNKNOWN.getNumber()) { + output.writeEnum(3, triggerType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(condition_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, condition_); + } + for (int i = 0; i < actions_.size(); i++) { + output.writeMessage(5, actions_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, description_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(ruleId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, ruleId_); + } + if (triggerType_ != com.google.cloud.contentwarehouse.v1.Rule.TriggerType.UNKNOWN.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, triggerType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(condition_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, condition_); + } + for (int i = 0; i < actions_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, actions_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.Rule)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.Rule other = + (com.google.cloud.contentwarehouse.v1.Rule) obj; + + if (!getDescription().equals(other.getDescription())) return false; + if (!getRuleId().equals(other.getRuleId())) return false; + if (triggerType_ != other.triggerType_) return false; + if (!getCondition().equals(other.getCondition())) return false; + if (!getActionsList().equals(other.getActionsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + RULE_ID_FIELD_NUMBER; + hash = (53 * hash) + getRuleId().hashCode(); + hash = (37 * hash) + TRIGGER_TYPE_FIELD_NUMBER; + hash = (53 * hash) + triggerType_; + hash = (37 * hash) + CONDITION_FIELD_NUMBER; + hash = (53 * hash) + getCondition().hashCode(); + if (getActionsCount() > 0) { + hash = (37 * hash) + ACTIONS_FIELD_NUMBER; + hash = (53 * hash) + getActionsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.Rule parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.Rule parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.Rule parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.Rule parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.Rule parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.Rule parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.Rule parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.Rule parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.Rule parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.Rule parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.Rule parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.Rule parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.contentwarehouse.v1.Rule prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Represents the rule for a content warehouse trigger.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.Rule} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.Rule) + com.google.cloud.contentwarehouse.v1.RuleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_Rule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_Rule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.Rule.class, + com.google.cloud.contentwarehouse.v1.Rule.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.Rule.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + description_ = ""; + + ruleId_ = ""; + + triggerType_ = 0; + + condition_ = ""; + + if (actionsBuilder_ == null) { + actions_ = java.util.Collections.emptyList(); + } else { + actions_ = null; + actionsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_Rule_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.Rule getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.Rule.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.Rule build() { + com.google.cloud.contentwarehouse.v1.Rule result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.Rule buildPartial() { + com.google.cloud.contentwarehouse.v1.Rule result = + new com.google.cloud.contentwarehouse.v1.Rule(this); + int from_bitField0_ = bitField0_; + result.description_ = description_; + result.ruleId_ = ruleId_; + result.triggerType_ = triggerType_; + result.condition_ = condition_; + if (actionsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + actions_ = java.util.Collections.unmodifiableList(actions_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.actions_ = actions_; + } else { + result.actions_ = actionsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.Rule) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.Rule) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.Rule other) { + if (other == com.google.cloud.contentwarehouse.v1.Rule.getDefaultInstance()) return this; + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (!other.getRuleId().isEmpty()) { + ruleId_ = other.ruleId_; + onChanged(); + } + if (other.triggerType_ != 0) { + setTriggerTypeValue(other.getTriggerTypeValue()); + } + if (!other.getCondition().isEmpty()) { + condition_ = other.condition_; + onChanged(); + } + if (actionsBuilder_ == null) { + if (!other.actions_.isEmpty()) { + if (actions_.isEmpty()) { + actions_ = other.actions_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureActionsIsMutable(); + actions_.addAll(other.actions_); + } + onChanged(); + } + } else { + if (!other.actions_.isEmpty()) { + if (actionsBuilder_.isEmpty()) { + actionsBuilder_.dispose(); + actionsBuilder_ = null; + actions_ = other.actions_; + bitField0_ = (bitField0_ & ~0x00000001); + actionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getActionsFieldBuilder() + : null; + } else { + actionsBuilder_.addAllMessages(other.actions_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + description_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + ruleId_ = input.readStringRequireUtf8(); + + break; + } // case 18 + case 24: + { + triggerType_ = input.readEnum(); + + break; + } // case 24 + case 34: + { + condition_ = input.readStringRequireUtf8(); + + break; + } // case 34 + case 42: + { + com.google.cloud.contentwarehouse.v1.Action m = + input.readMessage( + com.google.cloud.contentwarehouse.v1.Action.parser(), extensionRegistry); + if (actionsBuilder_ == null) { + ensureActionsIsMutable(); + actions_.add(m); + } else { + actionsBuilder_.addMessage(m); + } + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * Short description of the rule and its context.
+     * 
+ * + * string description = 1; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Short description of the rule and its context.
+     * 
+ * + * string description = 1; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Short description of the rule and its context.
+     * 
+ * + * string description = 1; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Short description of the rule and its context.
+     * 
+ * + * string description = 1; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+     * Short description of the rule and its context.
+     * 
+ * + * string description = 1; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + private java.lang.Object ruleId_ = ""; + /** + * + * + *
+     * ID of the rule. It has to be unique across all the examples.
+     * This is managed internally.
+     * 
+ * + * string rule_id = 2; + * + * @return The ruleId. + */ + public java.lang.String getRuleId() { + java.lang.Object ref = ruleId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ruleId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * ID of the rule. It has to be unique across all the examples.
+     * This is managed internally.
+     * 
+ * + * string rule_id = 2; + * + * @return The bytes for ruleId. + */ + public com.google.protobuf.ByteString getRuleIdBytes() { + java.lang.Object ref = ruleId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ruleId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * ID of the rule. It has to be unique across all the examples.
+     * This is managed internally.
+     * 
+ * + * string rule_id = 2; + * + * @param value The ruleId to set. + * @return This builder for chaining. + */ + public Builder setRuleId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + ruleId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * ID of the rule. It has to be unique across all the examples.
+     * This is managed internally.
+     * 
+ * + * string rule_id = 2; + * + * @return This builder for chaining. + */ + public Builder clearRuleId() { + + ruleId_ = getDefaultInstance().getRuleId(); + onChanged(); + return this; + } + /** + * + * + *
+     * ID of the rule. It has to be unique across all the examples.
+     * This is managed internally.
+     * 
+ * + * string rule_id = 2; + * + * @param value The bytes for ruleId to set. + * @return This builder for chaining. + */ + public Builder setRuleIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + ruleId_ = value; + onChanged(); + return this; + } + + private int triggerType_ = 0; + /** + * + * + *
+     * Identifies the trigger type for running the policy.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.Rule.TriggerType trigger_type = 3; + * + * @return The enum numeric value on the wire for triggerType. + */ + @java.lang.Override + public int getTriggerTypeValue() { + return triggerType_; + } + /** + * + * + *
+     * Identifies the trigger type for running the policy.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.Rule.TriggerType trigger_type = 3; + * + * @param value The enum numeric value on the wire for triggerType to set. + * @return This builder for chaining. + */ + public Builder setTriggerTypeValue(int value) { + + triggerType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Identifies the trigger type for running the policy.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.Rule.TriggerType trigger_type = 3; + * + * @return The triggerType. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.Rule.TriggerType getTriggerType() { + @SuppressWarnings("deprecation") + com.google.cloud.contentwarehouse.v1.Rule.TriggerType result = + com.google.cloud.contentwarehouse.v1.Rule.TriggerType.valueOf(triggerType_); + return result == null + ? com.google.cloud.contentwarehouse.v1.Rule.TriggerType.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Identifies the trigger type for running the policy.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.Rule.TriggerType trigger_type = 3; + * + * @param value The triggerType to set. + * @return This builder for chaining. + */ + public Builder setTriggerType(com.google.cloud.contentwarehouse.v1.Rule.TriggerType value) { + if (value == null) { + throw new NullPointerException(); + } + + triggerType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Identifies the trigger type for running the policy.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.Rule.TriggerType trigger_type = 3; + * + * @return This builder for chaining. + */ + public Builder clearTriggerType() { + + triggerType_ = 0; + onChanged(); + return this; + } + + private java.lang.Object condition_ = ""; + /** + * + * + *
+     * Represents the conditional expression to be evaluated.
+     * Expression should evaluate to a boolean result.
+     * When the condition is true actions are executed.
+     * Example: user_role = "hsbc_role_1" AND doc.salary > 20000
+     * 
+ * + * string condition = 4; + * + * @return The condition. + */ + public java.lang.String getCondition() { + java.lang.Object ref = condition_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + condition_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Represents the conditional expression to be evaluated.
+     * Expression should evaluate to a boolean result.
+     * When the condition is true actions are executed.
+     * Example: user_role = "hsbc_role_1" AND doc.salary > 20000
+     * 
+ * + * string condition = 4; + * + * @return The bytes for condition. + */ + public com.google.protobuf.ByteString getConditionBytes() { + java.lang.Object ref = condition_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + condition_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Represents the conditional expression to be evaluated.
+     * Expression should evaluate to a boolean result.
+     * When the condition is true actions are executed.
+     * Example: user_role = "hsbc_role_1" AND doc.salary > 20000
+     * 
+ * + * string condition = 4; + * + * @param value The condition to set. + * @return This builder for chaining. + */ + public Builder setCondition(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + condition_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Represents the conditional expression to be evaluated.
+     * Expression should evaluate to a boolean result.
+     * When the condition is true actions are executed.
+     * Example: user_role = "hsbc_role_1" AND doc.salary > 20000
+     * 
+ * + * string condition = 4; + * + * @return This builder for chaining. + */ + public Builder clearCondition() { + + condition_ = getDefaultInstance().getCondition(); + onChanged(); + return this; + } + /** + * + * + *
+     * Represents the conditional expression to be evaluated.
+     * Expression should evaluate to a boolean result.
+     * When the condition is true actions are executed.
+     * Example: user_role = "hsbc_role_1" AND doc.salary > 20000
+     * 
+ * + * string condition = 4; + * + * @param value The bytes for condition to set. + * @return This builder for chaining. + */ + public Builder setConditionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + condition_ = value; + onChanged(); + return this; + } + + private java.util.List actions_ = + java.util.Collections.emptyList(); + + private void ensureActionsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + actions_ = new java.util.ArrayList(actions_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.Action, + com.google.cloud.contentwarehouse.v1.Action.Builder, + com.google.cloud.contentwarehouse.v1.ActionOrBuilder> + actionsBuilder_; + + /** + * + * + *
+     * List of actions that are executed when the rule is satisfied.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Action actions = 5; + */ + public java.util.List getActionsList() { + if (actionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(actions_); + } else { + return actionsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * List of actions that are executed when the rule is satisfied.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Action actions = 5; + */ + public int getActionsCount() { + if (actionsBuilder_ == null) { + return actions_.size(); + } else { + return actionsBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of actions that are executed when the rule is satisfied.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Action actions = 5; + */ + public com.google.cloud.contentwarehouse.v1.Action getActions(int index) { + if (actionsBuilder_ == null) { + return actions_.get(index); + } else { + return actionsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of actions that are executed when the rule is satisfied.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Action actions = 5; + */ + public Builder setActions(int index, com.google.cloud.contentwarehouse.v1.Action value) { + if (actionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureActionsIsMutable(); + actions_.set(index, value); + onChanged(); + } else { + actionsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of actions that are executed when the rule is satisfied.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Action actions = 5; + */ + public Builder setActions( + int index, com.google.cloud.contentwarehouse.v1.Action.Builder builderForValue) { + if (actionsBuilder_ == null) { + ensureActionsIsMutable(); + actions_.set(index, builderForValue.build()); + onChanged(); + } else { + actionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of actions that are executed when the rule is satisfied.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Action actions = 5; + */ + public Builder addActions(com.google.cloud.contentwarehouse.v1.Action value) { + if (actionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureActionsIsMutable(); + actions_.add(value); + onChanged(); + } else { + actionsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * List of actions that are executed when the rule is satisfied.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Action actions = 5; + */ + public Builder addActions(int index, com.google.cloud.contentwarehouse.v1.Action value) { + if (actionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureActionsIsMutable(); + actions_.add(index, value); + onChanged(); + } else { + actionsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of actions that are executed when the rule is satisfied.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Action actions = 5; + */ + public Builder addActions(com.google.cloud.contentwarehouse.v1.Action.Builder builderForValue) { + if (actionsBuilder_ == null) { + ensureActionsIsMutable(); + actions_.add(builderForValue.build()); + onChanged(); + } else { + actionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of actions that are executed when the rule is satisfied.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Action actions = 5; + */ + public Builder addActions( + int index, com.google.cloud.contentwarehouse.v1.Action.Builder builderForValue) { + if (actionsBuilder_ == null) { + ensureActionsIsMutable(); + actions_.add(index, builderForValue.build()); + onChanged(); + } else { + actionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of actions that are executed when the rule is satisfied.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Action actions = 5; + */ + public Builder addAllActions( + java.lang.Iterable values) { + if (actionsBuilder_ == null) { + ensureActionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, actions_); + onChanged(); + } else { + actionsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * List of actions that are executed when the rule is satisfied.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Action actions = 5; + */ + public Builder clearActions() { + if (actionsBuilder_ == null) { + actions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + actionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of actions that are executed when the rule is satisfied.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Action actions = 5; + */ + public Builder removeActions(int index) { + if (actionsBuilder_ == null) { + ensureActionsIsMutable(); + actions_.remove(index); + onChanged(); + } else { + actionsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * List of actions that are executed when the rule is satisfied.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Action actions = 5; + */ + public com.google.cloud.contentwarehouse.v1.Action.Builder getActionsBuilder(int index) { + return getActionsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of actions that are executed when the rule is satisfied.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Action actions = 5; + */ + public com.google.cloud.contentwarehouse.v1.ActionOrBuilder getActionsOrBuilder(int index) { + if (actionsBuilder_ == null) { + return actions_.get(index); + } else { + return actionsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of actions that are executed when the rule is satisfied.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Action actions = 5; + */ + public java.util.List + getActionsOrBuilderList() { + if (actionsBuilder_ != null) { + return actionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(actions_); + } + } + /** + * + * + *
+     * List of actions that are executed when the rule is satisfied.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Action actions = 5; + */ + public com.google.cloud.contentwarehouse.v1.Action.Builder addActionsBuilder() { + return getActionsFieldBuilder() + .addBuilder(com.google.cloud.contentwarehouse.v1.Action.getDefaultInstance()); + } + /** + * + * + *
+     * List of actions that are executed when the rule is satisfied.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Action actions = 5; + */ + public com.google.cloud.contentwarehouse.v1.Action.Builder addActionsBuilder(int index) { + return getActionsFieldBuilder() + .addBuilder(index, com.google.cloud.contentwarehouse.v1.Action.getDefaultInstance()); + } + /** + * + * + *
+     * List of actions that are executed when the rule is satisfied.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Action actions = 5; + */ + public java.util.List + getActionsBuilderList() { + return getActionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.Action, + com.google.cloud.contentwarehouse.v1.Action.Builder, + com.google.cloud.contentwarehouse.v1.ActionOrBuilder> + getActionsFieldBuilder() { + if (actionsBuilder_ == null) { + actionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.Action, + com.google.cloud.contentwarehouse.v1.Action.Builder, + com.google.cloud.contentwarehouse.v1.ActionOrBuilder>( + actions_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + actions_ = null; + } + return actionsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.Rule) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.Rule) + private static final com.google.cloud.contentwarehouse.v1.Rule DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.Rule(); + } + + public static com.google.cloud.contentwarehouse.v1.Rule getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Rule parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.Rule getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/RuleActionsPair.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/RuleActionsPair.java new file mode 100644 index 000000000000..75bde730623c --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/RuleActionsPair.java @@ -0,0 +1,1206 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/rule_engine.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Represents a rule and outputs of associated actions.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.RuleActionsPair} + */ +public final class RuleActionsPair extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.RuleActionsPair) + RuleActionsPairOrBuilder { + private static final long serialVersionUID = 0L; + // Use RuleActionsPair.newBuilder() to construct. + private RuleActionsPair(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RuleActionsPair() { + actionOutputs_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RuleActionsPair(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_RuleActionsPair_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_RuleActionsPair_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.RuleActionsPair.class, + com.google.cloud.contentwarehouse.v1.RuleActionsPair.Builder.class); + } + + public static final int RULE_FIELD_NUMBER = 1; + private com.google.cloud.contentwarehouse.v1.Rule rule_; + /** + * + * + *
+   * Represents the rule.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.Rule rule = 1; + * + * @return Whether the rule field is set. + */ + @java.lang.Override + public boolean hasRule() { + return rule_ != null; + } + /** + * + * + *
+   * Represents the rule.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.Rule rule = 1; + * + * @return The rule. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.Rule getRule() { + return rule_ == null ? com.google.cloud.contentwarehouse.v1.Rule.getDefaultInstance() : rule_; + } + /** + * + * + *
+   * Represents the rule.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.Rule rule = 1; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RuleOrBuilder getRuleOrBuilder() { + return getRule(); + } + + public static final int ACTION_OUTPUTS_FIELD_NUMBER = 2; + private java.util.List actionOutputs_; + /** + * + * + *
+   * Outputs of executing the actions associated with the above rule.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.ActionOutput action_outputs = 2; + */ + @java.lang.Override + public java.util.List getActionOutputsList() { + return actionOutputs_; + } + /** + * + * + *
+   * Outputs of executing the actions associated with the above rule.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.ActionOutput action_outputs = 2; + */ + @java.lang.Override + public java.util.List + getActionOutputsOrBuilderList() { + return actionOutputs_; + } + /** + * + * + *
+   * Outputs of executing the actions associated with the above rule.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.ActionOutput action_outputs = 2; + */ + @java.lang.Override + public int getActionOutputsCount() { + return actionOutputs_.size(); + } + /** + * + * + *
+   * Outputs of executing the actions associated with the above rule.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.ActionOutput action_outputs = 2; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ActionOutput getActionOutputs(int index) { + return actionOutputs_.get(index); + } + /** + * + * + *
+   * Outputs of executing the actions associated with the above rule.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.ActionOutput action_outputs = 2; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ActionOutputOrBuilder getActionOutputsOrBuilder( + int index) { + return actionOutputs_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (rule_ != null) { + output.writeMessage(1, getRule()); + } + for (int i = 0; i < actionOutputs_.size(); i++) { + output.writeMessage(2, actionOutputs_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (rule_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getRule()); + } + for (int i = 0; i < actionOutputs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, actionOutputs_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.RuleActionsPair)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.RuleActionsPair other = + (com.google.cloud.contentwarehouse.v1.RuleActionsPair) obj; + + if (hasRule() != other.hasRule()) return false; + if (hasRule()) { + if (!getRule().equals(other.getRule())) return false; + } + if (!getActionOutputsList().equals(other.getActionOutputsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasRule()) { + hash = (37 * hash) + RULE_FIELD_NUMBER; + hash = (53 * hash) + getRule().hashCode(); + } + if (getActionOutputsCount() > 0) { + hash = (37 * hash) + ACTION_OUTPUTS_FIELD_NUMBER; + hash = (53 * hash) + getActionOutputsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.RuleActionsPair parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.RuleActionsPair parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.RuleActionsPair parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.RuleActionsPair parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.RuleActionsPair parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.RuleActionsPair parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.RuleActionsPair parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.RuleActionsPair parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.RuleActionsPair parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.RuleActionsPair parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.RuleActionsPair parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.RuleActionsPair parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.contentwarehouse.v1.RuleActionsPair prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Represents a rule and outputs of associated actions.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.RuleActionsPair} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.RuleActionsPair) + com.google.cloud.contentwarehouse.v1.RuleActionsPairOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_RuleActionsPair_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_RuleActionsPair_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.RuleActionsPair.class, + com.google.cloud.contentwarehouse.v1.RuleActionsPair.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.RuleActionsPair.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (ruleBuilder_ == null) { + rule_ = null; + } else { + rule_ = null; + ruleBuilder_ = null; + } + if (actionOutputsBuilder_ == null) { + actionOutputs_ = java.util.Collections.emptyList(); + } else { + actionOutputs_ = null; + actionOutputsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_RuleActionsPair_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RuleActionsPair getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.RuleActionsPair.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RuleActionsPair build() { + com.google.cloud.contentwarehouse.v1.RuleActionsPair result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RuleActionsPair buildPartial() { + com.google.cloud.contentwarehouse.v1.RuleActionsPair result = + new com.google.cloud.contentwarehouse.v1.RuleActionsPair(this); + int from_bitField0_ = bitField0_; + if (ruleBuilder_ == null) { + result.rule_ = rule_; + } else { + result.rule_ = ruleBuilder_.build(); + } + if (actionOutputsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + actionOutputs_ = java.util.Collections.unmodifiableList(actionOutputs_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.actionOutputs_ = actionOutputs_; + } else { + result.actionOutputs_ = actionOutputsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.RuleActionsPair) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.RuleActionsPair) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.RuleActionsPair other) { + if (other == com.google.cloud.contentwarehouse.v1.RuleActionsPair.getDefaultInstance()) + return this; + if (other.hasRule()) { + mergeRule(other.getRule()); + } + if (actionOutputsBuilder_ == null) { + if (!other.actionOutputs_.isEmpty()) { + if (actionOutputs_.isEmpty()) { + actionOutputs_ = other.actionOutputs_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureActionOutputsIsMutable(); + actionOutputs_.addAll(other.actionOutputs_); + } + onChanged(); + } + } else { + if (!other.actionOutputs_.isEmpty()) { + if (actionOutputsBuilder_.isEmpty()) { + actionOutputsBuilder_.dispose(); + actionOutputsBuilder_ = null; + actionOutputs_ = other.actionOutputs_; + bitField0_ = (bitField0_ & ~0x00000001); + actionOutputsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getActionOutputsFieldBuilder() + : null; + } else { + actionOutputsBuilder_.addAllMessages(other.actionOutputs_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getRuleFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 18: + { + com.google.cloud.contentwarehouse.v1.ActionOutput m = + input.readMessage( + com.google.cloud.contentwarehouse.v1.ActionOutput.parser(), + extensionRegistry); + if (actionOutputsBuilder_ == null) { + ensureActionOutputsIsMutable(); + actionOutputs_.add(m); + } else { + actionOutputsBuilder_.addMessage(m); + } + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.contentwarehouse.v1.Rule rule_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.Rule, + com.google.cloud.contentwarehouse.v1.Rule.Builder, + com.google.cloud.contentwarehouse.v1.RuleOrBuilder> + ruleBuilder_; + /** + * + * + *
+     * Represents the rule.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.Rule rule = 1; + * + * @return Whether the rule field is set. + */ + public boolean hasRule() { + return ruleBuilder_ != null || rule_ != null; + } + /** + * + * + *
+     * Represents the rule.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.Rule rule = 1; + * + * @return The rule. + */ + public com.google.cloud.contentwarehouse.v1.Rule getRule() { + if (ruleBuilder_ == null) { + return rule_ == null + ? com.google.cloud.contentwarehouse.v1.Rule.getDefaultInstance() + : rule_; + } else { + return ruleBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Represents the rule.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.Rule rule = 1; + */ + public Builder setRule(com.google.cloud.contentwarehouse.v1.Rule value) { + if (ruleBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + rule_ = value; + onChanged(); + } else { + ruleBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Represents the rule.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.Rule rule = 1; + */ + public Builder setRule(com.google.cloud.contentwarehouse.v1.Rule.Builder builderForValue) { + if (ruleBuilder_ == null) { + rule_ = builderForValue.build(); + onChanged(); + } else { + ruleBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Represents the rule.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.Rule rule = 1; + */ + public Builder mergeRule(com.google.cloud.contentwarehouse.v1.Rule value) { + if (ruleBuilder_ == null) { + if (rule_ != null) { + rule_ = + com.google.cloud.contentwarehouse.v1.Rule.newBuilder(rule_) + .mergeFrom(value) + .buildPartial(); + } else { + rule_ = value; + } + onChanged(); + } else { + ruleBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Represents the rule.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.Rule rule = 1; + */ + public Builder clearRule() { + if (ruleBuilder_ == null) { + rule_ = null; + onChanged(); + } else { + rule_ = null; + ruleBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Represents the rule.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.Rule rule = 1; + */ + public com.google.cloud.contentwarehouse.v1.Rule.Builder getRuleBuilder() { + + onChanged(); + return getRuleFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Represents the rule.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.Rule rule = 1; + */ + public com.google.cloud.contentwarehouse.v1.RuleOrBuilder getRuleOrBuilder() { + if (ruleBuilder_ != null) { + return ruleBuilder_.getMessageOrBuilder(); + } else { + return rule_ == null + ? com.google.cloud.contentwarehouse.v1.Rule.getDefaultInstance() + : rule_; + } + } + /** + * + * + *
+     * Represents the rule.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.Rule rule = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.Rule, + com.google.cloud.contentwarehouse.v1.Rule.Builder, + com.google.cloud.contentwarehouse.v1.RuleOrBuilder> + getRuleFieldBuilder() { + if (ruleBuilder_ == null) { + ruleBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.Rule, + com.google.cloud.contentwarehouse.v1.Rule.Builder, + com.google.cloud.contentwarehouse.v1.RuleOrBuilder>( + getRule(), getParentForChildren(), isClean()); + rule_ = null; + } + return ruleBuilder_; + } + + private java.util.List actionOutputs_ = + java.util.Collections.emptyList(); + + private void ensureActionOutputsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + actionOutputs_ = + new java.util.ArrayList( + actionOutputs_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.ActionOutput, + com.google.cloud.contentwarehouse.v1.ActionOutput.Builder, + com.google.cloud.contentwarehouse.v1.ActionOutputOrBuilder> + actionOutputsBuilder_; + + /** + * + * + *
+     * Outputs of executing the actions associated with the above rule.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.ActionOutput action_outputs = 2; + */ + public java.util.List + getActionOutputsList() { + if (actionOutputsBuilder_ == null) { + return java.util.Collections.unmodifiableList(actionOutputs_); + } else { + return actionOutputsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Outputs of executing the actions associated with the above rule.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.ActionOutput action_outputs = 2; + */ + public int getActionOutputsCount() { + if (actionOutputsBuilder_ == null) { + return actionOutputs_.size(); + } else { + return actionOutputsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Outputs of executing the actions associated with the above rule.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.ActionOutput action_outputs = 2; + */ + public com.google.cloud.contentwarehouse.v1.ActionOutput getActionOutputs(int index) { + if (actionOutputsBuilder_ == null) { + return actionOutputs_.get(index); + } else { + return actionOutputsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Outputs of executing the actions associated with the above rule.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.ActionOutput action_outputs = 2; + */ + public Builder setActionOutputs( + int index, com.google.cloud.contentwarehouse.v1.ActionOutput value) { + if (actionOutputsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureActionOutputsIsMutable(); + actionOutputs_.set(index, value); + onChanged(); + } else { + actionOutputsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Outputs of executing the actions associated with the above rule.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.ActionOutput action_outputs = 2; + */ + public Builder setActionOutputs( + int index, com.google.cloud.contentwarehouse.v1.ActionOutput.Builder builderForValue) { + if (actionOutputsBuilder_ == null) { + ensureActionOutputsIsMutable(); + actionOutputs_.set(index, builderForValue.build()); + onChanged(); + } else { + actionOutputsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Outputs of executing the actions associated with the above rule.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.ActionOutput action_outputs = 2; + */ + public Builder addActionOutputs(com.google.cloud.contentwarehouse.v1.ActionOutput value) { + if (actionOutputsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureActionOutputsIsMutable(); + actionOutputs_.add(value); + onChanged(); + } else { + actionOutputsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Outputs of executing the actions associated with the above rule.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.ActionOutput action_outputs = 2; + */ + public Builder addActionOutputs( + int index, com.google.cloud.contentwarehouse.v1.ActionOutput value) { + if (actionOutputsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureActionOutputsIsMutable(); + actionOutputs_.add(index, value); + onChanged(); + } else { + actionOutputsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Outputs of executing the actions associated with the above rule.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.ActionOutput action_outputs = 2; + */ + public Builder addActionOutputs( + com.google.cloud.contentwarehouse.v1.ActionOutput.Builder builderForValue) { + if (actionOutputsBuilder_ == null) { + ensureActionOutputsIsMutable(); + actionOutputs_.add(builderForValue.build()); + onChanged(); + } else { + actionOutputsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Outputs of executing the actions associated with the above rule.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.ActionOutput action_outputs = 2; + */ + public Builder addActionOutputs( + int index, com.google.cloud.contentwarehouse.v1.ActionOutput.Builder builderForValue) { + if (actionOutputsBuilder_ == null) { + ensureActionOutputsIsMutable(); + actionOutputs_.add(index, builderForValue.build()); + onChanged(); + } else { + actionOutputsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Outputs of executing the actions associated with the above rule.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.ActionOutput action_outputs = 2; + */ + public Builder addAllActionOutputs( + java.lang.Iterable values) { + if (actionOutputsBuilder_ == null) { + ensureActionOutputsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, actionOutputs_); + onChanged(); + } else { + actionOutputsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Outputs of executing the actions associated with the above rule.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.ActionOutput action_outputs = 2; + */ + public Builder clearActionOutputs() { + if (actionOutputsBuilder_ == null) { + actionOutputs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + actionOutputsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Outputs of executing the actions associated with the above rule.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.ActionOutput action_outputs = 2; + */ + public Builder removeActionOutputs(int index) { + if (actionOutputsBuilder_ == null) { + ensureActionOutputsIsMutable(); + actionOutputs_.remove(index); + onChanged(); + } else { + actionOutputsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Outputs of executing the actions associated with the above rule.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.ActionOutput action_outputs = 2; + */ + public com.google.cloud.contentwarehouse.v1.ActionOutput.Builder getActionOutputsBuilder( + int index) { + return getActionOutputsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Outputs of executing the actions associated with the above rule.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.ActionOutput action_outputs = 2; + */ + public com.google.cloud.contentwarehouse.v1.ActionOutputOrBuilder getActionOutputsOrBuilder( + int index) { + if (actionOutputsBuilder_ == null) { + return actionOutputs_.get(index); + } else { + return actionOutputsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Outputs of executing the actions associated with the above rule.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.ActionOutput action_outputs = 2; + */ + public java.util.List + getActionOutputsOrBuilderList() { + if (actionOutputsBuilder_ != null) { + return actionOutputsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(actionOutputs_); + } + } + /** + * + * + *
+     * Outputs of executing the actions associated with the above rule.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.ActionOutput action_outputs = 2; + */ + public com.google.cloud.contentwarehouse.v1.ActionOutput.Builder addActionOutputsBuilder() { + return getActionOutputsFieldBuilder() + .addBuilder(com.google.cloud.contentwarehouse.v1.ActionOutput.getDefaultInstance()); + } + /** + * + * + *
+     * Outputs of executing the actions associated with the above rule.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.ActionOutput action_outputs = 2; + */ + public com.google.cloud.contentwarehouse.v1.ActionOutput.Builder addActionOutputsBuilder( + int index) { + return getActionOutputsFieldBuilder() + .addBuilder( + index, com.google.cloud.contentwarehouse.v1.ActionOutput.getDefaultInstance()); + } + /** + * + * + *
+     * Outputs of executing the actions associated with the above rule.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.ActionOutput action_outputs = 2; + */ + public java.util.List + getActionOutputsBuilderList() { + return getActionOutputsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.ActionOutput, + com.google.cloud.contentwarehouse.v1.ActionOutput.Builder, + com.google.cloud.contentwarehouse.v1.ActionOutputOrBuilder> + getActionOutputsFieldBuilder() { + if (actionOutputsBuilder_ == null) { + actionOutputsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.ActionOutput, + com.google.cloud.contentwarehouse.v1.ActionOutput.Builder, + com.google.cloud.contentwarehouse.v1.ActionOutputOrBuilder>( + actionOutputs_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + actionOutputs_ = null; + } + return actionOutputsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.RuleActionsPair) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.RuleActionsPair) + private static final com.google.cloud.contentwarehouse.v1.RuleActionsPair DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.RuleActionsPair(); + } + + public static com.google.cloud.contentwarehouse.v1.RuleActionsPair getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RuleActionsPair parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RuleActionsPair getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/RuleActionsPairOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/RuleActionsPairOrBuilder.java new file mode 100644 index 000000000000..84d7ea007b69 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/RuleActionsPairOrBuilder.java @@ -0,0 +1,112 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/rule_engine.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface RuleActionsPairOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.RuleActionsPair) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Represents the rule.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.Rule rule = 1; + * + * @return Whether the rule field is set. + */ + boolean hasRule(); + /** + * + * + *
+   * Represents the rule.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.Rule rule = 1; + * + * @return The rule. + */ + com.google.cloud.contentwarehouse.v1.Rule getRule(); + /** + * + * + *
+   * Represents the rule.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.Rule rule = 1; + */ + com.google.cloud.contentwarehouse.v1.RuleOrBuilder getRuleOrBuilder(); + + /** + * + * + *
+   * Outputs of executing the actions associated with the above rule.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.ActionOutput action_outputs = 2; + */ + java.util.List getActionOutputsList(); + /** + * + * + *
+   * Outputs of executing the actions associated with the above rule.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.ActionOutput action_outputs = 2; + */ + com.google.cloud.contentwarehouse.v1.ActionOutput getActionOutputs(int index); + /** + * + * + *
+   * Outputs of executing the actions associated with the above rule.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.ActionOutput action_outputs = 2; + */ + int getActionOutputsCount(); + /** + * + * + *
+   * Outputs of executing the actions associated with the above rule.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.ActionOutput action_outputs = 2; + */ + java.util.List + getActionOutputsOrBuilderList(); + /** + * + * + *
+   * Outputs of executing the actions associated with the above rule.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.ActionOutput action_outputs = 2; + */ + com.google.cloud.contentwarehouse.v1.ActionOutputOrBuilder getActionOutputsOrBuilder(int index); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/RuleEngineOutput.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/RuleEngineOutput.java new file mode 100644 index 000000000000..f47f9afd7bd5 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/RuleEngineOutput.java @@ -0,0 +1,1190 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/rule_engine.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Records the output of Rule Engine including rule evaluation and actions
+ * result.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.RuleEngineOutput} + */ +public final class RuleEngineOutput extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.RuleEngineOutput) + RuleEngineOutputOrBuilder { + private static final long serialVersionUID = 0L; + // Use RuleEngineOutput.newBuilder() to construct. + private RuleEngineOutput(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RuleEngineOutput() { + documentName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RuleEngineOutput(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_RuleEngineOutput_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_RuleEngineOutput_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.RuleEngineOutput.class, + com.google.cloud.contentwarehouse.v1.RuleEngineOutput.Builder.class); + } + + public static final int DOCUMENT_NAME_FIELD_NUMBER = 3; + private volatile java.lang.Object documentName_; + /** + * + * + *
+   * Name of the document against which the rules and actions were evaluated.
+   * 
+ * + * string document_name = 3; + * + * @return The documentName. + */ + @java.lang.Override + public java.lang.String getDocumentName() { + java.lang.Object ref = documentName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + documentName_ = s; + return s; + } + } + /** + * + * + *
+   * Name of the document against which the rules and actions were evaluated.
+   * 
+ * + * string document_name = 3; + * + * @return The bytes for documentName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDocumentNameBytes() { + java.lang.Object ref = documentName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + documentName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RULE_EVALUATOR_OUTPUT_FIELD_NUMBER = 1; + private com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput ruleEvaluatorOutput_; + /** + * + * + *
+   * Output from Rule Evaluator containing matched, unmatched and invalid rules.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RuleEvaluatorOutput rule_evaluator_output = 1; + * + * @return Whether the ruleEvaluatorOutput field is set. + */ + @java.lang.Override + public boolean hasRuleEvaluatorOutput() { + return ruleEvaluatorOutput_ != null; + } + /** + * + * + *
+   * Output from Rule Evaluator containing matched, unmatched and invalid rules.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RuleEvaluatorOutput rule_evaluator_output = 1; + * + * @return The ruleEvaluatorOutput. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput getRuleEvaluatorOutput() { + return ruleEvaluatorOutput_ == null + ? com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput.getDefaultInstance() + : ruleEvaluatorOutput_; + } + /** + * + * + *
+   * Output from Rule Evaluator containing matched, unmatched and invalid rules.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RuleEvaluatorOutput rule_evaluator_output = 1; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutputOrBuilder + getRuleEvaluatorOutputOrBuilder() { + return getRuleEvaluatorOutput(); + } + + public static final int ACTION_EXECUTOR_OUTPUT_FIELD_NUMBER = 2; + private com.google.cloud.contentwarehouse.v1.ActionExecutorOutput actionExecutorOutput_; + /** + * + * + *
+   * Output from Action Executor containing rule and corresponding actions
+   * execution result.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.ActionExecutorOutput action_executor_output = 2; + * + * @return Whether the actionExecutorOutput field is set. + */ + @java.lang.Override + public boolean hasActionExecutorOutput() { + return actionExecutorOutput_ != null; + } + /** + * + * + *
+   * Output from Action Executor containing rule and corresponding actions
+   * execution result.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.ActionExecutorOutput action_executor_output = 2; + * + * @return The actionExecutorOutput. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ActionExecutorOutput getActionExecutorOutput() { + return actionExecutorOutput_ == null + ? com.google.cloud.contentwarehouse.v1.ActionExecutorOutput.getDefaultInstance() + : actionExecutorOutput_; + } + /** + * + * + *
+   * Output from Action Executor containing rule and corresponding actions
+   * execution result.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.ActionExecutorOutput action_executor_output = 2; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ActionExecutorOutputOrBuilder + getActionExecutorOutputOrBuilder() { + return getActionExecutorOutput(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (ruleEvaluatorOutput_ != null) { + output.writeMessage(1, getRuleEvaluatorOutput()); + } + if (actionExecutorOutput_ != null) { + output.writeMessage(2, getActionExecutorOutput()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(documentName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, documentName_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (ruleEvaluatorOutput_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getRuleEvaluatorOutput()); + } + if (actionExecutorOutput_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(2, getActionExecutorOutput()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(documentName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, documentName_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.RuleEngineOutput)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.RuleEngineOutput other = + (com.google.cloud.contentwarehouse.v1.RuleEngineOutput) obj; + + if (!getDocumentName().equals(other.getDocumentName())) return false; + if (hasRuleEvaluatorOutput() != other.hasRuleEvaluatorOutput()) return false; + if (hasRuleEvaluatorOutput()) { + if (!getRuleEvaluatorOutput().equals(other.getRuleEvaluatorOutput())) return false; + } + if (hasActionExecutorOutput() != other.hasActionExecutorOutput()) return false; + if (hasActionExecutorOutput()) { + if (!getActionExecutorOutput().equals(other.getActionExecutorOutput())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + DOCUMENT_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDocumentName().hashCode(); + if (hasRuleEvaluatorOutput()) { + hash = (37 * hash) + RULE_EVALUATOR_OUTPUT_FIELD_NUMBER; + hash = (53 * hash) + getRuleEvaluatorOutput().hashCode(); + } + if (hasActionExecutorOutput()) { + hash = (37 * hash) + ACTION_EXECUTOR_OUTPUT_FIELD_NUMBER; + hash = (53 * hash) + getActionExecutorOutput().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.RuleEngineOutput parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.RuleEngineOutput parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.RuleEngineOutput parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.RuleEngineOutput parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.RuleEngineOutput parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.RuleEngineOutput parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.RuleEngineOutput parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.RuleEngineOutput parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.RuleEngineOutput parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.RuleEngineOutput parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.RuleEngineOutput parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.RuleEngineOutput parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.RuleEngineOutput prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Records the output of Rule Engine including rule evaluation and actions
+   * result.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.RuleEngineOutput} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.RuleEngineOutput) + com.google.cloud.contentwarehouse.v1.RuleEngineOutputOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_RuleEngineOutput_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_RuleEngineOutput_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.RuleEngineOutput.class, + com.google.cloud.contentwarehouse.v1.RuleEngineOutput.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.RuleEngineOutput.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + documentName_ = ""; + + if (ruleEvaluatorOutputBuilder_ == null) { + ruleEvaluatorOutput_ = null; + } else { + ruleEvaluatorOutput_ = null; + ruleEvaluatorOutputBuilder_ = null; + } + if (actionExecutorOutputBuilder_ == null) { + actionExecutorOutput_ = null; + } else { + actionExecutorOutput_ = null; + actionExecutorOutputBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_RuleEngineOutput_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RuleEngineOutput getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.RuleEngineOutput.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RuleEngineOutput build() { + com.google.cloud.contentwarehouse.v1.RuleEngineOutput result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RuleEngineOutput buildPartial() { + com.google.cloud.contentwarehouse.v1.RuleEngineOutput result = + new com.google.cloud.contentwarehouse.v1.RuleEngineOutput(this); + result.documentName_ = documentName_; + if (ruleEvaluatorOutputBuilder_ == null) { + result.ruleEvaluatorOutput_ = ruleEvaluatorOutput_; + } else { + result.ruleEvaluatorOutput_ = ruleEvaluatorOutputBuilder_.build(); + } + if (actionExecutorOutputBuilder_ == null) { + result.actionExecutorOutput_ = actionExecutorOutput_; + } else { + result.actionExecutorOutput_ = actionExecutorOutputBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.RuleEngineOutput) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.RuleEngineOutput) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.RuleEngineOutput other) { + if (other == com.google.cloud.contentwarehouse.v1.RuleEngineOutput.getDefaultInstance()) + return this; + if (!other.getDocumentName().isEmpty()) { + documentName_ = other.documentName_; + onChanged(); + } + if (other.hasRuleEvaluatorOutput()) { + mergeRuleEvaluatorOutput(other.getRuleEvaluatorOutput()); + } + if (other.hasActionExecutorOutput()) { + mergeActionExecutorOutput(other.getActionExecutorOutput()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + getRuleEvaluatorOutputFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 18: + { + input.readMessage( + getActionExecutorOutputFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + case 26: + { + documentName_ = input.readStringRequireUtf8(); + + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object documentName_ = ""; + /** + * + * + *
+     * Name of the document against which the rules and actions were evaluated.
+     * 
+ * + * string document_name = 3; + * + * @return The documentName. + */ + public java.lang.String getDocumentName() { + java.lang.Object ref = documentName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + documentName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Name of the document against which the rules and actions were evaluated.
+     * 
+ * + * string document_name = 3; + * + * @return The bytes for documentName. + */ + public com.google.protobuf.ByteString getDocumentNameBytes() { + java.lang.Object ref = documentName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + documentName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Name of the document against which the rules and actions were evaluated.
+     * 
+ * + * string document_name = 3; + * + * @param value The documentName to set. + * @return This builder for chaining. + */ + public Builder setDocumentName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + documentName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the document against which the rules and actions were evaluated.
+     * 
+ * + * string document_name = 3; + * + * @return This builder for chaining. + */ + public Builder clearDocumentName() { + + documentName_ = getDefaultInstance().getDocumentName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the document against which the rules and actions were evaluated.
+     * 
+ * + * string document_name = 3; + * + * @param value The bytes for documentName to set. + * @return This builder for chaining. + */ + public Builder setDocumentNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + documentName_ = value; + onChanged(); + return this; + } + + private com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput ruleEvaluatorOutput_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput, + com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput.Builder, + com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutputOrBuilder> + ruleEvaluatorOutputBuilder_; + /** + * + * + *
+     * Output from Rule Evaluator containing matched, unmatched and invalid rules.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RuleEvaluatorOutput rule_evaluator_output = 1; + * + * @return Whether the ruleEvaluatorOutput field is set. + */ + public boolean hasRuleEvaluatorOutput() { + return ruleEvaluatorOutputBuilder_ != null || ruleEvaluatorOutput_ != null; + } + /** + * + * + *
+     * Output from Rule Evaluator containing matched, unmatched and invalid rules.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RuleEvaluatorOutput rule_evaluator_output = 1; + * + * @return The ruleEvaluatorOutput. + */ + public com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput getRuleEvaluatorOutput() { + if (ruleEvaluatorOutputBuilder_ == null) { + return ruleEvaluatorOutput_ == null + ? com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput.getDefaultInstance() + : ruleEvaluatorOutput_; + } else { + return ruleEvaluatorOutputBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output from Rule Evaluator containing matched, unmatched and invalid rules.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RuleEvaluatorOutput rule_evaluator_output = 1; + */ + public Builder setRuleEvaluatorOutput( + com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput value) { + if (ruleEvaluatorOutputBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ruleEvaluatorOutput_ = value; + onChanged(); + } else { + ruleEvaluatorOutputBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output from Rule Evaluator containing matched, unmatched and invalid rules.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RuleEvaluatorOutput rule_evaluator_output = 1; + */ + public Builder setRuleEvaluatorOutput( + com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput.Builder builderForValue) { + if (ruleEvaluatorOutputBuilder_ == null) { + ruleEvaluatorOutput_ = builderForValue.build(); + onChanged(); + } else { + ruleEvaluatorOutputBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output from Rule Evaluator containing matched, unmatched and invalid rules.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RuleEvaluatorOutput rule_evaluator_output = 1; + */ + public Builder mergeRuleEvaluatorOutput( + com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput value) { + if (ruleEvaluatorOutputBuilder_ == null) { + if (ruleEvaluatorOutput_ != null) { + ruleEvaluatorOutput_ = + com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput.newBuilder( + ruleEvaluatorOutput_) + .mergeFrom(value) + .buildPartial(); + } else { + ruleEvaluatorOutput_ = value; + } + onChanged(); + } else { + ruleEvaluatorOutputBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output from Rule Evaluator containing matched, unmatched and invalid rules.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RuleEvaluatorOutput rule_evaluator_output = 1; + */ + public Builder clearRuleEvaluatorOutput() { + if (ruleEvaluatorOutputBuilder_ == null) { + ruleEvaluatorOutput_ = null; + onChanged(); + } else { + ruleEvaluatorOutput_ = null; + ruleEvaluatorOutputBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output from Rule Evaluator containing matched, unmatched and invalid rules.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RuleEvaluatorOutput rule_evaluator_output = 1; + */ + public com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput.Builder + getRuleEvaluatorOutputBuilder() { + + onChanged(); + return getRuleEvaluatorOutputFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output from Rule Evaluator containing matched, unmatched and invalid rules.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RuleEvaluatorOutput rule_evaluator_output = 1; + */ + public com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutputOrBuilder + getRuleEvaluatorOutputOrBuilder() { + if (ruleEvaluatorOutputBuilder_ != null) { + return ruleEvaluatorOutputBuilder_.getMessageOrBuilder(); + } else { + return ruleEvaluatorOutput_ == null + ? com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput.getDefaultInstance() + : ruleEvaluatorOutput_; + } + } + /** + * + * + *
+     * Output from Rule Evaluator containing matched, unmatched and invalid rules.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RuleEvaluatorOutput rule_evaluator_output = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput, + com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput.Builder, + com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutputOrBuilder> + getRuleEvaluatorOutputFieldBuilder() { + if (ruleEvaluatorOutputBuilder_ == null) { + ruleEvaluatorOutputBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput, + com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput.Builder, + com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutputOrBuilder>( + getRuleEvaluatorOutput(), getParentForChildren(), isClean()); + ruleEvaluatorOutput_ = null; + } + return ruleEvaluatorOutputBuilder_; + } + + private com.google.cloud.contentwarehouse.v1.ActionExecutorOutput actionExecutorOutput_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.ActionExecutorOutput, + com.google.cloud.contentwarehouse.v1.ActionExecutorOutput.Builder, + com.google.cloud.contentwarehouse.v1.ActionExecutorOutputOrBuilder> + actionExecutorOutputBuilder_; + /** + * + * + *
+     * Output from Action Executor containing rule and corresponding actions
+     * execution result.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ActionExecutorOutput action_executor_output = 2; + * + * + * @return Whether the actionExecutorOutput field is set. + */ + public boolean hasActionExecutorOutput() { + return actionExecutorOutputBuilder_ != null || actionExecutorOutput_ != null; + } + /** + * + * + *
+     * Output from Action Executor containing rule and corresponding actions
+     * execution result.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ActionExecutorOutput action_executor_output = 2; + * + * + * @return The actionExecutorOutput. + */ + public com.google.cloud.contentwarehouse.v1.ActionExecutorOutput getActionExecutorOutput() { + if (actionExecutorOutputBuilder_ == null) { + return actionExecutorOutput_ == null + ? com.google.cloud.contentwarehouse.v1.ActionExecutorOutput.getDefaultInstance() + : actionExecutorOutput_; + } else { + return actionExecutorOutputBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output from Action Executor containing rule and corresponding actions
+     * execution result.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ActionExecutorOutput action_executor_output = 2; + * + */ + public Builder setActionExecutorOutput( + com.google.cloud.contentwarehouse.v1.ActionExecutorOutput value) { + if (actionExecutorOutputBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + actionExecutorOutput_ = value; + onChanged(); + } else { + actionExecutorOutputBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output from Action Executor containing rule and corresponding actions
+     * execution result.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ActionExecutorOutput action_executor_output = 2; + * + */ + public Builder setActionExecutorOutput( + com.google.cloud.contentwarehouse.v1.ActionExecutorOutput.Builder builderForValue) { + if (actionExecutorOutputBuilder_ == null) { + actionExecutorOutput_ = builderForValue.build(); + onChanged(); + } else { + actionExecutorOutputBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output from Action Executor containing rule and corresponding actions
+     * execution result.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ActionExecutorOutput action_executor_output = 2; + * + */ + public Builder mergeActionExecutorOutput( + com.google.cloud.contentwarehouse.v1.ActionExecutorOutput value) { + if (actionExecutorOutputBuilder_ == null) { + if (actionExecutorOutput_ != null) { + actionExecutorOutput_ = + com.google.cloud.contentwarehouse.v1.ActionExecutorOutput.newBuilder( + actionExecutorOutput_) + .mergeFrom(value) + .buildPartial(); + } else { + actionExecutorOutput_ = value; + } + onChanged(); + } else { + actionExecutorOutputBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output from Action Executor containing rule and corresponding actions
+     * execution result.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ActionExecutorOutput action_executor_output = 2; + * + */ + public Builder clearActionExecutorOutput() { + if (actionExecutorOutputBuilder_ == null) { + actionExecutorOutput_ = null; + onChanged(); + } else { + actionExecutorOutput_ = null; + actionExecutorOutputBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output from Action Executor containing rule and corresponding actions
+     * execution result.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ActionExecutorOutput action_executor_output = 2; + * + */ + public com.google.cloud.contentwarehouse.v1.ActionExecutorOutput.Builder + getActionExecutorOutputBuilder() { + + onChanged(); + return getActionExecutorOutputFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output from Action Executor containing rule and corresponding actions
+     * execution result.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ActionExecutorOutput action_executor_output = 2; + * + */ + public com.google.cloud.contentwarehouse.v1.ActionExecutorOutputOrBuilder + getActionExecutorOutputOrBuilder() { + if (actionExecutorOutputBuilder_ != null) { + return actionExecutorOutputBuilder_.getMessageOrBuilder(); + } else { + return actionExecutorOutput_ == null + ? com.google.cloud.contentwarehouse.v1.ActionExecutorOutput.getDefaultInstance() + : actionExecutorOutput_; + } + } + /** + * + * + *
+     * Output from Action Executor containing rule and corresponding actions
+     * execution result.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ActionExecutorOutput action_executor_output = 2; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.ActionExecutorOutput, + com.google.cloud.contentwarehouse.v1.ActionExecutorOutput.Builder, + com.google.cloud.contentwarehouse.v1.ActionExecutorOutputOrBuilder> + getActionExecutorOutputFieldBuilder() { + if (actionExecutorOutputBuilder_ == null) { + actionExecutorOutputBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.ActionExecutorOutput, + com.google.cloud.contentwarehouse.v1.ActionExecutorOutput.Builder, + com.google.cloud.contentwarehouse.v1.ActionExecutorOutputOrBuilder>( + getActionExecutorOutput(), getParentForChildren(), isClean()); + actionExecutorOutput_ = null; + } + return actionExecutorOutputBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.RuleEngineOutput) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.RuleEngineOutput) + private static final com.google.cloud.contentwarehouse.v1.RuleEngineOutput DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.RuleEngineOutput(); + } + + public static com.google.cloud.contentwarehouse.v1.RuleEngineOutput getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RuleEngineOutput parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RuleEngineOutput getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/RuleEngineOutputOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/RuleEngineOutputOrBuilder.java new file mode 100644 index 000000000000..78d0addde472 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/RuleEngineOutputOrBuilder.java @@ -0,0 +1,125 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/rule_engine.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface RuleEngineOutputOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.RuleEngineOutput) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Name of the document against which the rules and actions were evaluated.
+   * 
+ * + * string document_name = 3; + * + * @return The documentName. + */ + java.lang.String getDocumentName(); + /** + * + * + *
+   * Name of the document against which the rules and actions were evaluated.
+   * 
+ * + * string document_name = 3; + * + * @return The bytes for documentName. + */ + com.google.protobuf.ByteString getDocumentNameBytes(); + + /** + * + * + *
+   * Output from Rule Evaluator containing matched, unmatched and invalid rules.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RuleEvaluatorOutput rule_evaluator_output = 1; + * + * @return Whether the ruleEvaluatorOutput field is set. + */ + boolean hasRuleEvaluatorOutput(); + /** + * + * + *
+   * Output from Rule Evaluator containing matched, unmatched and invalid rules.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RuleEvaluatorOutput rule_evaluator_output = 1; + * + * @return The ruleEvaluatorOutput. + */ + com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput getRuleEvaluatorOutput(); + /** + * + * + *
+   * Output from Rule Evaluator containing matched, unmatched and invalid rules.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RuleEvaluatorOutput rule_evaluator_output = 1; + */ + com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutputOrBuilder + getRuleEvaluatorOutputOrBuilder(); + + /** + * + * + *
+   * Output from Action Executor containing rule and corresponding actions
+   * execution result.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.ActionExecutorOutput action_executor_output = 2; + * + * @return Whether the actionExecutorOutput field is set. + */ + boolean hasActionExecutorOutput(); + /** + * + * + *
+   * Output from Action Executor containing rule and corresponding actions
+   * execution result.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.ActionExecutorOutput action_executor_output = 2; + * + * @return The actionExecutorOutput. + */ + com.google.cloud.contentwarehouse.v1.ActionExecutorOutput getActionExecutorOutput(); + /** + * + * + *
+   * Output from Action Executor containing rule and corresponding actions
+   * execution result.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.ActionExecutorOutput action_executor_output = 2; + */ + com.google.cloud.contentwarehouse.v1.ActionExecutorOutputOrBuilder + getActionExecutorOutputOrBuilder(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/RuleEngineProto.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/RuleEngineProto.java new file mode 100644 index 000000000000..ce3cb14bb1f8 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/RuleEngineProto.java @@ -0,0 +1,372 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/rule_engine.proto + +package com.google.cloud.contentwarehouse.v1; + +public final class RuleEngineProto { + private RuleEngineProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_RuleSet_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_RuleSet_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_Rule_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_Rule_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_Action_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_Action_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_AccessControlAction_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_AccessControlAction_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_DataValidationAction_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_DataValidationAction_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_DataValidationAction_ConditionsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_DataValidationAction_ConditionsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_DataUpdateAction_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_DataUpdateAction_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_DataUpdateAction_EntriesEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_DataUpdateAction_EntriesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_AddToFolderAction_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_AddToFolderAction_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_RemoveFromFolderAction_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_RemoveFromFolderAction_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_PublishAction_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_PublishAction_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_DeleteDocumentAction_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_DeleteDocumentAction_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_RuleEngineOutput_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_RuleEngineOutput_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_RuleEvaluatorOutput_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_RuleEvaluatorOutput_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_InvalidRule_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_InvalidRule_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_ActionExecutorOutput_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_ActionExecutorOutput_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_RuleActionsPair_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_RuleActionsPair_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_ActionOutput_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_ActionOutput_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n2google/cloud/contentwarehouse/v1/rule_" + + "engine.proto\022 google.cloud.contentwareho" + + "use.v1\032\037google/api/field_behavior.proto\032" + + "\031google/api/resource.proto\032\032google/iam/v" + + "1/policy.proto\"\336\001\n\007RuleSet\022\014\n\004name\030\006 \001(\t" + + "\022\023\n\013description\030\001 \001(\t\022\016\n\006source\030\002 \001(\t\0225\n" + + "\005rules\030\003 \003(\0132&.google.cloud.contentwareh" + + "ouse.v1.Rule:i\352Af\n\'contentwarehouse.goog" + + "leapis.com/RuleSet\022;projects/{project}/l" + + "ocations/{location}/ruleSets/{rule_set}\"" + + "\376\001\n\004Rule\022\023\n\013description\030\001 \001(\t\022\017\n\007rule_id" + + "\030\002 \001(\t\022H\n\014trigger_type\030\003 \001(\01622.google.cl" + + "oud.contentwarehouse.v1.Rule.TriggerType" + + "\022\021\n\tcondition\030\004 \001(\t\0229\n\007actions\030\005 \003(\0132(.g" + + "oogle.cloud.contentwarehouse.v1.Action\"8" + + "\n\013TriggerType\022\013\n\007UNKNOWN\020\000\022\r\n\tON_CREATE\020" + + "\001\022\r\n\tON_UPDATE\020\004\"\352\004\n\006Action\022\021\n\taction_id" + + "\030\001 \001(\t\022O\n\016access_control\030\002 \001(\01325.google." + + "cloud.contentwarehouse.v1.AccessControlA" + + "ctionH\000\022Q\n\017data_validation\030\003 \001(\01326.googl" + + "e.cloud.contentwarehouse.v1.DataValidati" + + "onActionH\000\022I\n\013data_update\030\004 \001(\01322.google" + + ".cloud.contentwarehouse.v1.DataUpdateAct" + + "ionH\000\022L\n\radd_to_folder\030\005 \001(\01323.google.cl" + + "oud.contentwarehouse.v1.AddToFolderActio" + + "nH\000\022M\n\022publish_to_pub_sub\030\006 \001(\0132/.google" + + ".cloud.contentwarehouse.v1.PublishAction" + + "H\000\022]\n\031remove_from_folder_action\030\t \001(\01328." + + "google.cloud.contentwarehouse.v1.RemoveF" + + "romFolderActionH\000\022X\n\026delete_document_act" + + "ion\030\n \001(\01326.google.cloud.contentwarehous" + + "e.v1.DeleteDocumentActionH\000B\010\n\006action\"\206\002" + + "\n\023AccessControlAction\022[\n\016operation_type\030" + + "\001 \001(\0162C.google.cloud.contentwarehouse.v1" + + ".AccessControlAction.OperationType\022%\n\006po" + + "licy\030\002 \001(\0132\025.google.iam.v1.Policy\"k\n\rOpe" + + "rationType\022\013\n\007UNKNOWN\020\000\022\026\n\022ADD_POLICY_BI" + + "NDING\020\001\022\031\n\025REMOVE_POLICY_BINDING\020\002\022\032\n\026RE" + + "PLACE_POLICY_BINDING\020\003\"\245\001\n\024DataValidatio" + + "nAction\022Z\n\nconditions\030\001 \003(\0132F.google.clo" + + "ud.contentwarehouse.v1.DataValidationAct" + + "ion.ConditionsEntry\0321\n\017ConditionsEntry\022\013" + + "\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\224\001\n\020DataU" + + "pdateAction\022P\n\007entries\030\001 \003(\0132?.google.cl" + + "oud.contentwarehouse.v1.DataUpdateAction" + + ".EntriesEntry\032.\n\014EntriesEntry\022\013\n\003key\030\001 \001" + + "(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"S\n\021AddToFolderActi" + + "on\022>\n\007folders\030\001 \003(\tB-\372A*\n(contentwarehou" + + "se.googleapis.com/Document\"j\n\026RemoveFrom" + + "FolderAction\022\021\n\tcondition\030\001 \001(\t\022=\n\006folde" + + "r\030\002 \001(\tB-\372A*\n(contentwarehouse.googleapi" + + "s.com/Document\"3\n\rPublishAction\022\020\n\010topic" + + "_id\030\001 \001(\t\022\020\n\010messages\030\002 \003(\t\"2\n\024DeleteDoc" + + "umentAction\022\032\n\022enable_hard_delete\030\001 \001(\010\"" + + "\327\001\n\020RuleEngineOutput\022\025\n\rdocument_name\030\003 " + + "\001(\t\022T\n\025rule_evaluator_output\030\001 \001(\01325.goo" + + "gle.cloud.contentwarehouse.v1.RuleEvalua" + + "torOutput\022V\n\026action_executor_output\030\002 \001(" + + "\01326.google.cloud.contentwarehouse.v1.Act" + + "ionExecutorOutput\"\333\001\n\023RuleEvaluatorOutpu" + + "t\022?\n\017triggered_rules\030\001 \003(\0132&.google.clou" + + "d.contentwarehouse.v1.Rule\022=\n\rmatched_ru" + + "les\030\002 \003(\0132&.google.cloud.contentwarehous" + + "e.v1.Rule\022D\n\rinvalid_rules\030\003 \003(\0132-.googl" + + "e.cloud.contentwarehouse.v1.InvalidRule\"" + + "R\n\013InvalidRule\0224\n\004rule\030\001 \001(\0132&.google.cl" + + "oud.contentwarehouse.v1.Rule\022\r\n\005error\030\002 " + + "\001(\t\"e\n\024ActionExecutorOutput\022M\n\022rule_acti" + + "ons_pairs\030\001 \003(\01321.google.cloud.contentwa" + + "rehouse.v1.RuleActionsPair\"\217\001\n\017RuleActio" + + "nsPair\0224\n\004rule\030\001 \001(\0132&.google.cloud.cont" + + "entwarehouse.v1.Rule\022F\n\016action_outputs\030\002" + + " \003(\0132..google.cloud.contentwarehouse.v1." + + "ActionOutput\"\356\001\n\014ActionOutput\022\021\n\taction_" + + "id\030\001 \001(\t\022J\n\014action_state\030\002 \001(\01624.google." + + "cloud.contentwarehouse.v1.ActionOutput.S" + + "tate\022\026\n\016output_message\030\003 \001(\t\"g\n\005State\022\013\n" + + "\007UNKNOWN\020\000\022\024\n\020ACTION_SUCCEEDED\020\001\022\021\n\rACTI" + + "ON_FAILED\020\002\022\024\n\020ACTION_TIMED_OUT\020\003\022\022\n\016ACT" + + "ION_PENDING\020\004B\213\001\n$com.google.cloud.conte" + + "ntwarehouse.v1B\017RuleEngineProtoP\001ZPgoogl" + + "e.golang.org/genproto/googleapis/cloud/c" + + "ontentwarehouse/v1;contentwarehouseb\006pro" + + "to3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.iam.v1.PolicyProto.getDescriptor(), + }); + internal_static_google_cloud_contentwarehouse_v1_RuleSet_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_contentwarehouse_v1_RuleSet_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_RuleSet_descriptor, + new java.lang.String[] { + "Name", "Description", "Source", "Rules", + }); + internal_static_google_cloud_contentwarehouse_v1_Rule_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_contentwarehouse_v1_Rule_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_Rule_descriptor, + new java.lang.String[] { + "Description", "RuleId", "TriggerType", "Condition", "Actions", + }); + internal_static_google_cloud_contentwarehouse_v1_Action_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_contentwarehouse_v1_Action_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_Action_descriptor, + new java.lang.String[] { + "ActionId", + "AccessControl", + "DataValidation", + "DataUpdate", + "AddToFolder", + "PublishToPubSub", + "RemoveFromFolderAction", + "DeleteDocumentAction", + "Action", + }); + internal_static_google_cloud_contentwarehouse_v1_AccessControlAction_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_contentwarehouse_v1_AccessControlAction_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_AccessControlAction_descriptor, + new java.lang.String[] { + "OperationType", "Policy", + }); + internal_static_google_cloud_contentwarehouse_v1_DataValidationAction_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_contentwarehouse_v1_DataValidationAction_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_DataValidationAction_descriptor, + new java.lang.String[] { + "Conditions", + }); + internal_static_google_cloud_contentwarehouse_v1_DataValidationAction_ConditionsEntry_descriptor = + internal_static_google_cloud_contentwarehouse_v1_DataValidationAction_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_contentwarehouse_v1_DataValidationAction_ConditionsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_DataValidationAction_ConditionsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_contentwarehouse_v1_DataUpdateAction_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_contentwarehouse_v1_DataUpdateAction_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_DataUpdateAction_descriptor, + new java.lang.String[] { + "Entries", + }); + internal_static_google_cloud_contentwarehouse_v1_DataUpdateAction_EntriesEntry_descriptor = + internal_static_google_cloud_contentwarehouse_v1_DataUpdateAction_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_contentwarehouse_v1_DataUpdateAction_EntriesEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_DataUpdateAction_EntriesEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_contentwarehouse_v1_AddToFolderAction_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_contentwarehouse_v1_AddToFolderAction_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_AddToFolderAction_descriptor, + new java.lang.String[] { + "Folders", + }); + internal_static_google_cloud_contentwarehouse_v1_RemoveFromFolderAction_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_contentwarehouse_v1_RemoveFromFolderAction_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_RemoveFromFolderAction_descriptor, + new java.lang.String[] { + "Condition", "Folder", + }); + internal_static_google_cloud_contentwarehouse_v1_PublishAction_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_contentwarehouse_v1_PublishAction_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_PublishAction_descriptor, + new java.lang.String[] { + "TopicId", "Messages", + }); + internal_static_google_cloud_contentwarehouse_v1_DeleteDocumentAction_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_contentwarehouse_v1_DeleteDocumentAction_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_DeleteDocumentAction_descriptor, + new java.lang.String[] { + "EnableHardDelete", + }); + internal_static_google_cloud_contentwarehouse_v1_RuleEngineOutput_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_contentwarehouse_v1_RuleEngineOutput_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_RuleEngineOutput_descriptor, + new java.lang.String[] { + "DocumentName", "RuleEvaluatorOutput", "ActionExecutorOutput", + }); + internal_static_google_cloud_contentwarehouse_v1_RuleEvaluatorOutput_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_contentwarehouse_v1_RuleEvaluatorOutput_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_RuleEvaluatorOutput_descriptor, + new java.lang.String[] { + "TriggeredRules", "MatchedRules", "InvalidRules", + }); + internal_static_google_cloud_contentwarehouse_v1_InvalidRule_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_contentwarehouse_v1_InvalidRule_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_InvalidRule_descriptor, + new java.lang.String[] { + "Rule", "Error", + }); + internal_static_google_cloud_contentwarehouse_v1_ActionExecutorOutput_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_cloud_contentwarehouse_v1_ActionExecutorOutput_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_ActionExecutorOutput_descriptor, + new java.lang.String[] { + "RuleActionsPairs", + }); + internal_static_google_cloud_contentwarehouse_v1_RuleActionsPair_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_cloud_contentwarehouse_v1_RuleActionsPair_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_RuleActionsPair_descriptor, + new java.lang.String[] { + "Rule", "ActionOutputs", + }); + internal_static_google_cloud_contentwarehouse_v1_ActionOutput_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_cloud_contentwarehouse_v1_ActionOutput_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_ActionOutput_descriptor, + new java.lang.String[] { + "ActionId", "ActionState", "OutputMessage", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.iam.v1.PolicyProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/RuleEvaluatorOutput.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/RuleEvaluatorOutput.java new file mode 100644 index 000000000000..673f884a18f3 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/RuleEvaluatorOutput.java @@ -0,0 +1,1940 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/rule_engine.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Represents the output of the Rule Evaluator.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.RuleEvaluatorOutput} + */ +public final class RuleEvaluatorOutput extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.RuleEvaluatorOutput) + RuleEvaluatorOutputOrBuilder { + private static final long serialVersionUID = 0L; + // Use RuleEvaluatorOutput.newBuilder() to construct. + private RuleEvaluatorOutput(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RuleEvaluatorOutput() { + triggeredRules_ = java.util.Collections.emptyList(); + matchedRules_ = java.util.Collections.emptyList(); + invalidRules_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RuleEvaluatorOutput(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_RuleEvaluatorOutput_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_RuleEvaluatorOutput_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput.class, + com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput.Builder.class); + } + + public static final int TRIGGERED_RULES_FIELD_NUMBER = 1; + private java.util.List triggeredRules_; + /** + * + * + *
+   * List of rules fetched from database for the given request trigger type.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule triggered_rules = 1; + */ + @java.lang.Override + public java.util.List getTriggeredRulesList() { + return triggeredRules_; + } + /** + * + * + *
+   * List of rules fetched from database for the given request trigger type.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule triggered_rules = 1; + */ + @java.lang.Override + public java.util.List + getTriggeredRulesOrBuilderList() { + return triggeredRules_; + } + /** + * + * + *
+   * List of rules fetched from database for the given request trigger type.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule triggered_rules = 1; + */ + @java.lang.Override + public int getTriggeredRulesCount() { + return triggeredRules_.size(); + } + /** + * + * + *
+   * List of rules fetched from database for the given request trigger type.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule triggered_rules = 1; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.Rule getTriggeredRules(int index) { + return triggeredRules_.get(index); + } + /** + * + * + *
+   * List of rules fetched from database for the given request trigger type.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule triggered_rules = 1; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RuleOrBuilder getTriggeredRulesOrBuilder(int index) { + return triggeredRules_.get(index); + } + + public static final int MATCHED_RULES_FIELD_NUMBER = 2; + private java.util.List matchedRules_; + /** + * + * + *
+   * A subset of triggered rules that are evaluated true for a given request.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule matched_rules = 2; + */ + @java.lang.Override + public java.util.List getMatchedRulesList() { + return matchedRules_; + } + /** + * + * + *
+   * A subset of triggered rules that are evaluated true for a given request.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule matched_rules = 2; + */ + @java.lang.Override + public java.util.List + getMatchedRulesOrBuilderList() { + return matchedRules_; + } + /** + * + * + *
+   * A subset of triggered rules that are evaluated true for a given request.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule matched_rules = 2; + */ + @java.lang.Override + public int getMatchedRulesCount() { + return matchedRules_.size(); + } + /** + * + * + *
+   * A subset of triggered rules that are evaluated true for a given request.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule matched_rules = 2; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.Rule getMatchedRules(int index) { + return matchedRules_.get(index); + } + /** + * + * + *
+   * A subset of triggered rules that are evaluated true for a given request.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule matched_rules = 2; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RuleOrBuilder getMatchedRulesOrBuilder(int index) { + return matchedRules_.get(index); + } + + public static final int INVALID_RULES_FIELD_NUMBER = 3; + private java.util.List invalidRules_; + /** + * + * + *
+   * A subset of triggered rules that failed the validation check(s) after
+   * parsing.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.InvalidRule invalid_rules = 3; + */ + @java.lang.Override + public java.util.List getInvalidRulesList() { + return invalidRules_; + } + /** + * + * + *
+   * A subset of triggered rules that failed the validation check(s) after
+   * parsing.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.InvalidRule invalid_rules = 3; + */ + @java.lang.Override + public java.util.List + getInvalidRulesOrBuilderList() { + return invalidRules_; + } + /** + * + * + *
+   * A subset of triggered rules that failed the validation check(s) after
+   * parsing.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.InvalidRule invalid_rules = 3; + */ + @java.lang.Override + public int getInvalidRulesCount() { + return invalidRules_.size(); + } + /** + * + * + *
+   * A subset of triggered rules that failed the validation check(s) after
+   * parsing.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.InvalidRule invalid_rules = 3; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.InvalidRule getInvalidRules(int index) { + return invalidRules_.get(index); + } + /** + * + * + *
+   * A subset of triggered rules that failed the validation check(s) after
+   * parsing.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.InvalidRule invalid_rules = 3; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.InvalidRuleOrBuilder getInvalidRulesOrBuilder( + int index) { + return invalidRules_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < triggeredRules_.size(); i++) { + output.writeMessage(1, triggeredRules_.get(i)); + } + for (int i = 0; i < matchedRules_.size(); i++) { + output.writeMessage(2, matchedRules_.get(i)); + } + for (int i = 0; i < invalidRules_.size(); i++) { + output.writeMessage(3, invalidRules_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < triggeredRules_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, triggeredRules_.get(i)); + } + for (int i = 0; i < matchedRules_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, matchedRules_.get(i)); + } + for (int i = 0; i < invalidRules_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, invalidRules_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput other = + (com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput) obj; + + if (!getTriggeredRulesList().equals(other.getTriggeredRulesList())) return false; + if (!getMatchedRulesList().equals(other.getMatchedRulesList())) return false; + if (!getInvalidRulesList().equals(other.getInvalidRulesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getTriggeredRulesCount() > 0) { + hash = (37 * hash) + TRIGGERED_RULES_FIELD_NUMBER; + hash = (53 * hash) + getTriggeredRulesList().hashCode(); + } + if (getMatchedRulesCount() > 0) { + hash = (37 * hash) + MATCHED_RULES_FIELD_NUMBER; + hash = (53 * hash) + getMatchedRulesList().hashCode(); + } + if (getInvalidRulesCount() > 0) { + hash = (37 * hash) + INVALID_RULES_FIELD_NUMBER; + hash = (53 * hash) + getInvalidRulesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Represents the output of the Rule Evaluator.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.RuleEvaluatorOutput} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.RuleEvaluatorOutput) + com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutputOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_RuleEvaluatorOutput_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_RuleEvaluatorOutput_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput.class, + com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (triggeredRulesBuilder_ == null) { + triggeredRules_ = java.util.Collections.emptyList(); + } else { + triggeredRules_ = null; + triggeredRulesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + if (matchedRulesBuilder_ == null) { + matchedRules_ = java.util.Collections.emptyList(); + } else { + matchedRules_ = null; + matchedRulesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + if (invalidRulesBuilder_ == null) { + invalidRules_ = java.util.Collections.emptyList(); + } else { + invalidRules_ = null; + invalidRulesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_RuleEvaluatorOutput_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput build() { + com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput buildPartial() { + com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput result = + new com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput(this); + int from_bitField0_ = bitField0_; + if (triggeredRulesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + triggeredRules_ = java.util.Collections.unmodifiableList(triggeredRules_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.triggeredRules_ = triggeredRules_; + } else { + result.triggeredRules_ = triggeredRulesBuilder_.build(); + } + if (matchedRulesBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + matchedRules_ = java.util.Collections.unmodifiableList(matchedRules_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.matchedRules_ = matchedRules_; + } else { + result.matchedRules_ = matchedRulesBuilder_.build(); + } + if (invalidRulesBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + invalidRules_ = java.util.Collections.unmodifiableList(invalidRules_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.invalidRules_ = invalidRules_; + } else { + result.invalidRules_ = invalidRulesBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput other) { + if (other == com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput.getDefaultInstance()) + return this; + if (triggeredRulesBuilder_ == null) { + if (!other.triggeredRules_.isEmpty()) { + if (triggeredRules_.isEmpty()) { + triggeredRules_ = other.triggeredRules_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureTriggeredRulesIsMutable(); + triggeredRules_.addAll(other.triggeredRules_); + } + onChanged(); + } + } else { + if (!other.triggeredRules_.isEmpty()) { + if (triggeredRulesBuilder_.isEmpty()) { + triggeredRulesBuilder_.dispose(); + triggeredRulesBuilder_ = null; + triggeredRules_ = other.triggeredRules_; + bitField0_ = (bitField0_ & ~0x00000001); + triggeredRulesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getTriggeredRulesFieldBuilder() + : null; + } else { + triggeredRulesBuilder_.addAllMessages(other.triggeredRules_); + } + } + } + if (matchedRulesBuilder_ == null) { + if (!other.matchedRules_.isEmpty()) { + if (matchedRules_.isEmpty()) { + matchedRules_ = other.matchedRules_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureMatchedRulesIsMutable(); + matchedRules_.addAll(other.matchedRules_); + } + onChanged(); + } + } else { + if (!other.matchedRules_.isEmpty()) { + if (matchedRulesBuilder_.isEmpty()) { + matchedRulesBuilder_.dispose(); + matchedRulesBuilder_ = null; + matchedRules_ = other.matchedRules_; + bitField0_ = (bitField0_ & ~0x00000002); + matchedRulesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getMatchedRulesFieldBuilder() + : null; + } else { + matchedRulesBuilder_.addAllMessages(other.matchedRules_); + } + } + } + if (invalidRulesBuilder_ == null) { + if (!other.invalidRules_.isEmpty()) { + if (invalidRules_.isEmpty()) { + invalidRules_ = other.invalidRules_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureInvalidRulesIsMutable(); + invalidRules_.addAll(other.invalidRules_); + } + onChanged(); + } + } else { + if (!other.invalidRules_.isEmpty()) { + if (invalidRulesBuilder_.isEmpty()) { + invalidRulesBuilder_.dispose(); + invalidRulesBuilder_ = null; + invalidRules_ = other.invalidRules_; + bitField0_ = (bitField0_ & ~0x00000004); + invalidRulesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getInvalidRulesFieldBuilder() + : null; + } else { + invalidRulesBuilder_.addAllMessages(other.invalidRules_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.contentwarehouse.v1.Rule m = + input.readMessage( + com.google.cloud.contentwarehouse.v1.Rule.parser(), extensionRegistry); + if (triggeredRulesBuilder_ == null) { + ensureTriggeredRulesIsMutable(); + triggeredRules_.add(m); + } else { + triggeredRulesBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + com.google.cloud.contentwarehouse.v1.Rule m = + input.readMessage( + com.google.cloud.contentwarehouse.v1.Rule.parser(), extensionRegistry); + if (matchedRulesBuilder_ == null) { + ensureMatchedRulesIsMutable(); + matchedRules_.add(m); + } else { + matchedRulesBuilder_.addMessage(m); + } + break; + } // case 18 + case 26: + { + com.google.cloud.contentwarehouse.v1.InvalidRule m = + input.readMessage( + com.google.cloud.contentwarehouse.v1.InvalidRule.parser(), + extensionRegistry); + if (invalidRulesBuilder_ == null) { + ensureInvalidRulesIsMutable(); + invalidRules_.add(m); + } else { + invalidRulesBuilder_.addMessage(m); + } + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List triggeredRules_ = + java.util.Collections.emptyList(); + + private void ensureTriggeredRulesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + triggeredRules_ = + new java.util.ArrayList(triggeredRules_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.Rule, + com.google.cloud.contentwarehouse.v1.Rule.Builder, + com.google.cloud.contentwarehouse.v1.RuleOrBuilder> + triggeredRulesBuilder_; + + /** + * + * + *
+     * List of rules fetched from database for the given request trigger type.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule triggered_rules = 1; + */ + public java.util.List getTriggeredRulesList() { + if (triggeredRulesBuilder_ == null) { + return java.util.Collections.unmodifiableList(triggeredRules_); + } else { + return triggeredRulesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * List of rules fetched from database for the given request trigger type.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule triggered_rules = 1; + */ + public int getTriggeredRulesCount() { + if (triggeredRulesBuilder_ == null) { + return triggeredRules_.size(); + } else { + return triggeredRulesBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of rules fetched from database for the given request trigger type.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule triggered_rules = 1; + */ + public com.google.cloud.contentwarehouse.v1.Rule getTriggeredRules(int index) { + if (triggeredRulesBuilder_ == null) { + return triggeredRules_.get(index); + } else { + return triggeredRulesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of rules fetched from database for the given request trigger type.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule triggered_rules = 1; + */ + public Builder setTriggeredRules(int index, com.google.cloud.contentwarehouse.v1.Rule value) { + if (triggeredRulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTriggeredRulesIsMutable(); + triggeredRules_.set(index, value); + onChanged(); + } else { + triggeredRulesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of rules fetched from database for the given request trigger type.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule triggered_rules = 1; + */ + public Builder setTriggeredRules( + int index, com.google.cloud.contentwarehouse.v1.Rule.Builder builderForValue) { + if (triggeredRulesBuilder_ == null) { + ensureTriggeredRulesIsMutable(); + triggeredRules_.set(index, builderForValue.build()); + onChanged(); + } else { + triggeredRulesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of rules fetched from database for the given request trigger type.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule triggered_rules = 1; + */ + public Builder addTriggeredRules(com.google.cloud.contentwarehouse.v1.Rule value) { + if (triggeredRulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTriggeredRulesIsMutable(); + triggeredRules_.add(value); + onChanged(); + } else { + triggeredRulesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * List of rules fetched from database for the given request trigger type.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule triggered_rules = 1; + */ + public Builder addTriggeredRules(int index, com.google.cloud.contentwarehouse.v1.Rule value) { + if (triggeredRulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTriggeredRulesIsMutable(); + triggeredRules_.add(index, value); + onChanged(); + } else { + triggeredRulesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of rules fetched from database for the given request trigger type.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule triggered_rules = 1; + */ + public Builder addTriggeredRules( + com.google.cloud.contentwarehouse.v1.Rule.Builder builderForValue) { + if (triggeredRulesBuilder_ == null) { + ensureTriggeredRulesIsMutable(); + triggeredRules_.add(builderForValue.build()); + onChanged(); + } else { + triggeredRulesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of rules fetched from database for the given request trigger type.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule triggered_rules = 1; + */ + public Builder addTriggeredRules( + int index, com.google.cloud.contentwarehouse.v1.Rule.Builder builderForValue) { + if (triggeredRulesBuilder_ == null) { + ensureTriggeredRulesIsMutable(); + triggeredRules_.add(index, builderForValue.build()); + onChanged(); + } else { + triggeredRulesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of rules fetched from database for the given request trigger type.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule triggered_rules = 1; + */ + public Builder addAllTriggeredRules( + java.lang.Iterable values) { + if (triggeredRulesBuilder_ == null) { + ensureTriggeredRulesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, triggeredRules_); + onChanged(); + } else { + triggeredRulesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * List of rules fetched from database for the given request trigger type.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule triggered_rules = 1; + */ + public Builder clearTriggeredRules() { + if (triggeredRulesBuilder_ == null) { + triggeredRules_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + triggeredRulesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of rules fetched from database for the given request trigger type.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule triggered_rules = 1; + */ + public Builder removeTriggeredRules(int index) { + if (triggeredRulesBuilder_ == null) { + ensureTriggeredRulesIsMutable(); + triggeredRules_.remove(index); + onChanged(); + } else { + triggeredRulesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * List of rules fetched from database for the given request trigger type.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule triggered_rules = 1; + */ + public com.google.cloud.contentwarehouse.v1.Rule.Builder getTriggeredRulesBuilder(int index) { + return getTriggeredRulesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of rules fetched from database for the given request trigger type.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule triggered_rules = 1; + */ + public com.google.cloud.contentwarehouse.v1.RuleOrBuilder getTriggeredRulesOrBuilder( + int index) { + if (triggeredRulesBuilder_ == null) { + return triggeredRules_.get(index); + } else { + return triggeredRulesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of rules fetched from database for the given request trigger type.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule triggered_rules = 1; + */ + public java.util.List + getTriggeredRulesOrBuilderList() { + if (triggeredRulesBuilder_ != null) { + return triggeredRulesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(triggeredRules_); + } + } + /** + * + * + *
+     * List of rules fetched from database for the given request trigger type.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule triggered_rules = 1; + */ + public com.google.cloud.contentwarehouse.v1.Rule.Builder addTriggeredRulesBuilder() { + return getTriggeredRulesFieldBuilder() + .addBuilder(com.google.cloud.contentwarehouse.v1.Rule.getDefaultInstance()); + } + /** + * + * + *
+     * List of rules fetched from database for the given request trigger type.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule triggered_rules = 1; + */ + public com.google.cloud.contentwarehouse.v1.Rule.Builder addTriggeredRulesBuilder(int index) { + return getTriggeredRulesFieldBuilder() + .addBuilder(index, com.google.cloud.contentwarehouse.v1.Rule.getDefaultInstance()); + } + /** + * + * + *
+     * List of rules fetched from database for the given request trigger type.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule triggered_rules = 1; + */ + public java.util.List + getTriggeredRulesBuilderList() { + return getTriggeredRulesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.Rule, + com.google.cloud.contentwarehouse.v1.Rule.Builder, + com.google.cloud.contentwarehouse.v1.RuleOrBuilder> + getTriggeredRulesFieldBuilder() { + if (triggeredRulesBuilder_ == null) { + triggeredRulesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.Rule, + com.google.cloud.contentwarehouse.v1.Rule.Builder, + com.google.cloud.contentwarehouse.v1.RuleOrBuilder>( + triggeredRules_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + triggeredRules_ = null; + } + return triggeredRulesBuilder_; + } + + private java.util.List matchedRules_ = + java.util.Collections.emptyList(); + + private void ensureMatchedRulesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + matchedRules_ = + new java.util.ArrayList(matchedRules_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.Rule, + com.google.cloud.contentwarehouse.v1.Rule.Builder, + com.google.cloud.contentwarehouse.v1.RuleOrBuilder> + matchedRulesBuilder_; + + /** + * + * + *
+     * A subset of triggered rules that are evaluated true for a given request.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule matched_rules = 2; + */ + public java.util.List getMatchedRulesList() { + if (matchedRulesBuilder_ == null) { + return java.util.Collections.unmodifiableList(matchedRules_); + } else { + return matchedRulesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A subset of triggered rules that are evaluated true for a given request.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule matched_rules = 2; + */ + public int getMatchedRulesCount() { + if (matchedRulesBuilder_ == null) { + return matchedRules_.size(); + } else { + return matchedRulesBuilder_.getCount(); + } + } + /** + * + * + *
+     * A subset of triggered rules that are evaluated true for a given request.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule matched_rules = 2; + */ + public com.google.cloud.contentwarehouse.v1.Rule getMatchedRules(int index) { + if (matchedRulesBuilder_ == null) { + return matchedRules_.get(index); + } else { + return matchedRulesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A subset of triggered rules that are evaluated true for a given request.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule matched_rules = 2; + */ + public Builder setMatchedRules(int index, com.google.cloud.contentwarehouse.v1.Rule value) { + if (matchedRulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMatchedRulesIsMutable(); + matchedRules_.set(index, value); + onChanged(); + } else { + matchedRulesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A subset of triggered rules that are evaluated true for a given request.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule matched_rules = 2; + */ + public Builder setMatchedRules( + int index, com.google.cloud.contentwarehouse.v1.Rule.Builder builderForValue) { + if (matchedRulesBuilder_ == null) { + ensureMatchedRulesIsMutable(); + matchedRules_.set(index, builderForValue.build()); + onChanged(); + } else { + matchedRulesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A subset of triggered rules that are evaluated true for a given request.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule matched_rules = 2; + */ + public Builder addMatchedRules(com.google.cloud.contentwarehouse.v1.Rule value) { + if (matchedRulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMatchedRulesIsMutable(); + matchedRules_.add(value); + onChanged(); + } else { + matchedRulesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A subset of triggered rules that are evaluated true for a given request.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule matched_rules = 2; + */ + public Builder addMatchedRules(int index, com.google.cloud.contentwarehouse.v1.Rule value) { + if (matchedRulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMatchedRulesIsMutable(); + matchedRules_.add(index, value); + onChanged(); + } else { + matchedRulesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A subset of triggered rules that are evaluated true for a given request.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule matched_rules = 2; + */ + public Builder addMatchedRules( + com.google.cloud.contentwarehouse.v1.Rule.Builder builderForValue) { + if (matchedRulesBuilder_ == null) { + ensureMatchedRulesIsMutable(); + matchedRules_.add(builderForValue.build()); + onChanged(); + } else { + matchedRulesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A subset of triggered rules that are evaluated true for a given request.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule matched_rules = 2; + */ + public Builder addMatchedRules( + int index, com.google.cloud.contentwarehouse.v1.Rule.Builder builderForValue) { + if (matchedRulesBuilder_ == null) { + ensureMatchedRulesIsMutable(); + matchedRules_.add(index, builderForValue.build()); + onChanged(); + } else { + matchedRulesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A subset of triggered rules that are evaluated true for a given request.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule matched_rules = 2; + */ + public Builder addAllMatchedRules( + java.lang.Iterable values) { + if (matchedRulesBuilder_ == null) { + ensureMatchedRulesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, matchedRules_); + onChanged(); + } else { + matchedRulesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A subset of triggered rules that are evaluated true for a given request.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule matched_rules = 2; + */ + public Builder clearMatchedRules() { + if (matchedRulesBuilder_ == null) { + matchedRules_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + matchedRulesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A subset of triggered rules that are evaluated true for a given request.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule matched_rules = 2; + */ + public Builder removeMatchedRules(int index) { + if (matchedRulesBuilder_ == null) { + ensureMatchedRulesIsMutable(); + matchedRules_.remove(index); + onChanged(); + } else { + matchedRulesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A subset of triggered rules that are evaluated true for a given request.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule matched_rules = 2; + */ + public com.google.cloud.contentwarehouse.v1.Rule.Builder getMatchedRulesBuilder(int index) { + return getMatchedRulesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A subset of triggered rules that are evaluated true for a given request.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule matched_rules = 2; + */ + public com.google.cloud.contentwarehouse.v1.RuleOrBuilder getMatchedRulesOrBuilder(int index) { + if (matchedRulesBuilder_ == null) { + return matchedRules_.get(index); + } else { + return matchedRulesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A subset of triggered rules that are evaluated true for a given request.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule matched_rules = 2; + */ + public java.util.List + getMatchedRulesOrBuilderList() { + if (matchedRulesBuilder_ != null) { + return matchedRulesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(matchedRules_); + } + } + /** + * + * + *
+     * A subset of triggered rules that are evaluated true for a given request.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule matched_rules = 2; + */ + public com.google.cloud.contentwarehouse.v1.Rule.Builder addMatchedRulesBuilder() { + return getMatchedRulesFieldBuilder() + .addBuilder(com.google.cloud.contentwarehouse.v1.Rule.getDefaultInstance()); + } + /** + * + * + *
+     * A subset of triggered rules that are evaluated true for a given request.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule matched_rules = 2; + */ + public com.google.cloud.contentwarehouse.v1.Rule.Builder addMatchedRulesBuilder(int index) { + return getMatchedRulesFieldBuilder() + .addBuilder(index, com.google.cloud.contentwarehouse.v1.Rule.getDefaultInstance()); + } + /** + * + * + *
+     * A subset of triggered rules that are evaluated true for a given request.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule matched_rules = 2; + */ + public java.util.List + getMatchedRulesBuilderList() { + return getMatchedRulesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.Rule, + com.google.cloud.contentwarehouse.v1.Rule.Builder, + com.google.cloud.contentwarehouse.v1.RuleOrBuilder> + getMatchedRulesFieldBuilder() { + if (matchedRulesBuilder_ == null) { + matchedRulesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.Rule, + com.google.cloud.contentwarehouse.v1.Rule.Builder, + com.google.cloud.contentwarehouse.v1.RuleOrBuilder>( + matchedRules_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + matchedRules_ = null; + } + return matchedRulesBuilder_; + } + + private java.util.List invalidRules_ = + java.util.Collections.emptyList(); + + private void ensureInvalidRulesIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + invalidRules_ = + new java.util.ArrayList( + invalidRules_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.InvalidRule, + com.google.cloud.contentwarehouse.v1.InvalidRule.Builder, + com.google.cloud.contentwarehouse.v1.InvalidRuleOrBuilder> + invalidRulesBuilder_; + + /** + * + * + *
+     * A subset of triggered rules that failed the validation check(s) after
+     * parsing.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.InvalidRule invalid_rules = 3; + */ + public java.util.List getInvalidRulesList() { + if (invalidRulesBuilder_ == null) { + return java.util.Collections.unmodifiableList(invalidRules_); + } else { + return invalidRulesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A subset of triggered rules that failed the validation check(s) after
+     * parsing.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.InvalidRule invalid_rules = 3; + */ + public int getInvalidRulesCount() { + if (invalidRulesBuilder_ == null) { + return invalidRules_.size(); + } else { + return invalidRulesBuilder_.getCount(); + } + } + /** + * + * + *
+     * A subset of triggered rules that failed the validation check(s) after
+     * parsing.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.InvalidRule invalid_rules = 3; + */ + public com.google.cloud.contentwarehouse.v1.InvalidRule getInvalidRules(int index) { + if (invalidRulesBuilder_ == null) { + return invalidRules_.get(index); + } else { + return invalidRulesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A subset of triggered rules that failed the validation check(s) after
+     * parsing.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.InvalidRule invalid_rules = 3; + */ + public Builder setInvalidRules( + int index, com.google.cloud.contentwarehouse.v1.InvalidRule value) { + if (invalidRulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInvalidRulesIsMutable(); + invalidRules_.set(index, value); + onChanged(); + } else { + invalidRulesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A subset of triggered rules that failed the validation check(s) after
+     * parsing.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.InvalidRule invalid_rules = 3; + */ + public Builder setInvalidRules( + int index, com.google.cloud.contentwarehouse.v1.InvalidRule.Builder builderForValue) { + if (invalidRulesBuilder_ == null) { + ensureInvalidRulesIsMutable(); + invalidRules_.set(index, builderForValue.build()); + onChanged(); + } else { + invalidRulesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A subset of triggered rules that failed the validation check(s) after
+     * parsing.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.InvalidRule invalid_rules = 3; + */ + public Builder addInvalidRules(com.google.cloud.contentwarehouse.v1.InvalidRule value) { + if (invalidRulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInvalidRulesIsMutable(); + invalidRules_.add(value); + onChanged(); + } else { + invalidRulesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A subset of triggered rules that failed the validation check(s) after
+     * parsing.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.InvalidRule invalid_rules = 3; + */ + public Builder addInvalidRules( + int index, com.google.cloud.contentwarehouse.v1.InvalidRule value) { + if (invalidRulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInvalidRulesIsMutable(); + invalidRules_.add(index, value); + onChanged(); + } else { + invalidRulesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A subset of triggered rules that failed the validation check(s) after
+     * parsing.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.InvalidRule invalid_rules = 3; + */ + public Builder addInvalidRules( + com.google.cloud.contentwarehouse.v1.InvalidRule.Builder builderForValue) { + if (invalidRulesBuilder_ == null) { + ensureInvalidRulesIsMutable(); + invalidRules_.add(builderForValue.build()); + onChanged(); + } else { + invalidRulesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A subset of triggered rules that failed the validation check(s) after
+     * parsing.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.InvalidRule invalid_rules = 3; + */ + public Builder addInvalidRules( + int index, com.google.cloud.contentwarehouse.v1.InvalidRule.Builder builderForValue) { + if (invalidRulesBuilder_ == null) { + ensureInvalidRulesIsMutable(); + invalidRules_.add(index, builderForValue.build()); + onChanged(); + } else { + invalidRulesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A subset of triggered rules that failed the validation check(s) after
+     * parsing.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.InvalidRule invalid_rules = 3; + */ + public Builder addAllInvalidRules( + java.lang.Iterable values) { + if (invalidRulesBuilder_ == null) { + ensureInvalidRulesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, invalidRules_); + onChanged(); + } else { + invalidRulesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A subset of triggered rules that failed the validation check(s) after
+     * parsing.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.InvalidRule invalid_rules = 3; + */ + public Builder clearInvalidRules() { + if (invalidRulesBuilder_ == null) { + invalidRules_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + invalidRulesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A subset of triggered rules that failed the validation check(s) after
+     * parsing.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.InvalidRule invalid_rules = 3; + */ + public Builder removeInvalidRules(int index) { + if (invalidRulesBuilder_ == null) { + ensureInvalidRulesIsMutable(); + invalidRules_.remove(index); + onChanged(); + } else { + invalidRulesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A subset of triggered rules that failed the validation check(s) after
+     * parsing.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.InvalidRule invalid_rules = 3; + */ + public com.google.cloud.contentwarehouse.v1.InvalidRule.Builder getInvalidRulesBuilder( + int index) { + return getInvalidRulesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A subset of triggered rules that failed the validation check(s) after
+     * parsing.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.InvalidRule invalid_rules = 3; + */ + public com.google.cloud.contentwarehouse.v1.InvalidRuleOrBuilder getInvalidRulesOrBuilder( + int index) { + if (invalidRulesBuilder_ == null) { + return invalidRules_.get(index); + } else { + return invalidRulesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A subset of triggered rules that failed the validation check(s) after
+     * parsing.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.InvalidRule invalid_rules = 3; + */ + public java.util.List + getInvalidRulesOrBuilderList() { + if (invalidRulesBuilder_ != null) { + return invalidRulesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(invalidRules_); + } + } + /** + * + * + *
+     * A subset of triggered rules that failed the validation check(s) after
+     * parsing.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.InvalidRule invalid_rules = 3; + */ + public com.google.cloud.contentwarehouse.v1.InvalidRule.Builder addInvalidRulesBuilder() { + return getInvalidRulesFieldBuilder() + .addBuilder(com.google.cloud.contentwarehouse.v1.InvalidRule.getDefaultInstance()); + } + /** + * + * + *
+     * A subset of triggered rules that failed the validation check(s) after
+     * parsing.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.InvalidRule invalid_rules = 3; + */ + public com.google.cloud.contentwarehouse.v1.InvalidRule.Builder addInvalidRulesBuilder( + int index) { + return getInvalidRulesFieldBuilder() + .addBuilder(index, com.google.cloud.contentwarehouse.v1.InvalidRule.getDefaultInstance()); + } + /** + * + * + *
+     * A subset of triggered rules that failed the validation check(s) after
+     * parsing.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.InvalidRule invalid_rules = 3; + */ + public java.util.List + getInvalidRulesBuilderList() { + return getInvalidRulesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.InvalidRule, + com.google.cloud.contentwarehouse.v1.InvalidRule.Builder, + com.google.cloud.contentwarehouse.v1.InvalidRuleOrBuilder> + getInvalidRulesFieldBuilder() { + if (invalidRulesBuilder_ == null) { + invalidRulesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.InvalidRule, + com.google.cloud.contentwarehouse.v1.InvalidRule.Builder, + com.google.cloud.contentwarehouse.v1.InvalidRuleOrBuilder>( + invalidRules_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); + invalidRules_ = null; + } + return invalidRulesBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.RuleEvaluatorOutput) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.RuleEvaluatorOutput) + private static final com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput(); + } + + public static com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RuleEvaluatorOutput parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/RuleEvaluatorOutputOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/RuleEvaluatorOutputOrBuilder.java new file mode 100644 index 000000000000..e627035b2840 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/RuleEvaluatorOutputOrBuilder.java @@ -0,0 +1,186 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/rule_engine.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface RuleEvaluatorOutputOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.RuleEvaluatorOutput) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of rules fetched from database for the given request trigger type.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule triggered_rules = 1; + */ + java.util.List getTriggeredRulesList(); + /** + * + * + *
+   * List of rules fetched from database for the given request trigger type.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule triggered_rules = 1; + */ + com.google.cloud.contentwarehouse.v1.Rule getTriggeredRules(int index); + /** + * + * + *
+   * List of rules fetched from database for the given request trigger type.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule triggered_rules = 1; + */ + int getTriggeredRulesCount(); + /** + * + * + *
+   * List of rules fetched from database for the given request trigger type.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule triggered_rules = 1; + */ + java.util.List + getTriggeredRulesOrBuilderList(); + /** + * + * + *
+   * List of rules fetched from database for the given request trigger type.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule triggered_rules = 1; + */ + com.google.cloud.contentwarehouse.v1.RuleOrBuilder getTriggeredRulesOrBuilder(int index); + + /** + * + * + *
+   * A subset of triggered rules that are evaluated true for a given request.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule matched_rules = 2; + */ + java.util.List getMatchedRulesList(); + /** + * + * + *
+   * A subset of triggered rules that are evaluated true for a given request.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule matched_rules = 2; + */ + com.google.cloud.contentwarehouse.v1.Rule getMatchedRules(int index); + /** + * + * + *
+   * A subset of triggered rules that are evaluated true for a given request.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule matched_rules = 2; + */ + int getMatchedRulesCount(); + /** + * + * + *
+   * A subset of triggered rules that are evaluated true for a given request.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule matched_rules = 2; + */ + java.util.List + getMatchedRulesOrBuilderList(); + /** + * + * + *
+   * A subset of triggered rules that are evaluated true for a given request.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule matched_rules = 2; + */ + com.google.cloud.contentwarehouse.v1.RuleOrBuilder getMatchedRulesOrBuilder(int index); + + /** + * + * + *
+   * A subset of triggered rules that failed the validation check(s) after
+   * parsing.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.InvalidRule invalid_rules = 3; + */ + java.util.List getInvalidRulesList(); + /** + * + * + *
+   * A subset of triggered rules that failed the validation check(s) after
+   * parsing.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.InvalidRule invalid_rules = 3; + */ + com.google.cloud.contentwarehouse.v1.InvalidRule getInvalidRules(int index); + /** + * + * + *
+   * A subset of triggered rules that failed the validation check(s) after
+   * parsing.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.InvalidRule invalid_rules = 3; + */ + int getInvalidRulesCount(); + /** + * + * + *
+   * A subset of triggered rules that failed the validation check(s) after
+   * parsing.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.InvalidRule invalid_rules = 3; + */ + java.util.List + getInvalidRulesOrBuilderList(); + /** + * + * + *
+   * A subset of triggered rules that failed the validation check(s) after
+   * parsing.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.InvalidRule invalid_rules = 3; + */ + com.google.cloud.contentwarehouse.v1.InvalidRuleOrBuilder getInvalidRulesOrBuilder(int index); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/RuleOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/RuleOrBuilder.java new file mode 100644 index 000000000000..ade0efb33469 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/RuleOrBuilder.java @@ -0,0 +1,185 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/rule_engine.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface RuleOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.Rule) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Short description of the rule and its context.
+   * 
+ * + * string description = 1; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * Short description of the rule and its context.
+   * 
+ * + * string description = 1; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * ID of the rule. It has to be unique across all the examples.
+   * This is managed internally.
+   * 
+ * + * string rule_id = 2; + * + * @return The ruleId. + */ + java.lang.String getRuleId(); + /** + * + * + *
+   * ID of the rule. It has to be unique across all the examples.
+   * This is managed internally.
+   * 
+ * + * string rule_id = 2; + * + * @return The bytes for ruleId. + */ + com.google.protobuf.ByteString getRuleIdBytes(); + + /** + * + * + *
+   * Identifies the trigger type for running the policy.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.Rule.TriggerType trigger_type = 3; + * + * @return The enum numeric value on the wire for triggerType. + */ + int getTriggerTypeValue(); + /** + * + * + *
+   * Identifies the trigger type for running the policy.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.Rule.TriggerType trigger_type = 3; + * + * @return The triggerType. + */ + com.google.cloud.contentwarehouse.v1.Rule.TriggerType getTriggerType(); + + /** + * + * + *
+   * Represents the conditional expression to be evaluated.
+   * Expression should evaluate to a boolean result.
+   * When the condition is true actions are executed.
+   * Example: user_role = "hsbc_role_1" AND doc.salary > 20000
+   * 
+ * + * string condition = 4; + * + * @return The condition. + */ + java.lang.String getCondition(); + /** + * + * + *
+   * Represents the conditional expression to be evaluated.
+   * Expression should evaluate to a boolean result.
+   * When the condition is true actions are executed.
+   * Example: user_role = "hsbc_role_1" AND doc.salary > 20000
+   * 
+ * + * string condition = 4; + * + * @return The bytes for condition. + */ + com.google.protobuf.ByteString getConditionBytes(); + + /** + * + * + *
+   * List of actions that are executed when the rule is satisfied.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Action actions = 5; + */ + java.util.List getActionsList(); + /** + * + * + *
+   * List of actions that are executed when the rule is satisfied.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Action actions = 5; + */ + com.google.cloud.contentwarehouse.v1.Action getActions(int index); + /** + * + * + *
+   * List of actions that are executed when the rule is satisfied.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Action actions = 5; + */ + int getActionsCount(); + /** + * + * + *
+   * List of actions that are executed when the rule is satisfied.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Action actions = 5; + */ + java.util.List + getActionsOrBuilderList(); + /** + * + * + *
+   * List of actions that are executed when the rule is satisfied.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Action actions = 5; + */ + com.google.cloud.contentwarehouse.v1.ActionOrBuilder getActionsOrBuilder(int index); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/RuleSet.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/RuleSet.java new file mode 100644 index 000000000000..626d631c9642 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/RuleSet.java @@ -0,0 +1,1479 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/rule_engine.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Represents a set of rules from a single customer.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.RuleSet} + */ +public final class RuleSet extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.RuleSet) + RuleSetOrBuilder { + private static final long serialVersionUID = 0L; + // Use RuleSet.newBuilder() to construct. + private RuleSet(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RuleSet() { + name_ = ""; + description_ = ""; + source_ = ""; + rules_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RuleSet(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_RuleSet_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_RuleSet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.RuleSet.class, + com.google.cloud.contentwarehouse.v1.RuleSet.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 6; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The resource name of the rule set. Managed internally.
+   * Format:
+   * projects/{project_number}/locations/{location}/ruleSet/{rule_set_id}.
+   * The name is ignored when creating a rule set.
+   * 
+ * + * string name = 6; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * The resource name of the rule set. Managed internally.
+   * Format:
+   * projects/{project_number}/locations/{location}/ruleSet/{rule_set_id}.
+   * The name is ignored when creating a rule set.
+   * 
+ * + * string name = 6; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 1; + private volatile java.lang.Object description_; + /** + * + * + *
+   * Short description of the rule-set.
+   * 
+ * + * string description = 1; + * + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + /** + * + * + *
+   * Short description of the rule-set.
+   * 
+ * + * string description = 1; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SOURCE_FIELD_NUMBER = 2; + private volatile java.lang.Object source_; + /** + * + * + *
+   * Source of the rules i.e., customer name.
+   * 
+ * + * string source = 2; + * + * @return The source. + */ + @java.lang.Override + public java.lang.String getSource() { + java.lang.Object ref = source_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + source_ = s; + return s; + } + } + /** + * + * + *
+   * Source of the rules i.e., customer name.
+   * 
+ * + * string source = 2; + * + * @return The bytes for source. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSourceBytes() { + java.lang.Object ref = source_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + source_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RULES_FIELD_NUMBER = 3; + private java.util.List rules_; + /** + * + * + *
+   * List of rules given by the customer.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule rules = 3; + */ + @java.lang.Override + public java.util.List getRulesList() { + return rules_; + } + /** + * + * + *
+   * List of rules given by the customer.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule rules = 3; + */ + @java.lang.Override + public java.util.List + getRulesOrBuilderList() { + return rules_; + } + /** + * + * + *
+   * List of rules given by the customer.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule rules = 3; + */ + @java.lang.Override + public int getRulesCount() { + return rules_.size(); + } + /** + * + * + *
+   * List of rules given by the customer.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule rules = 3; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.Rule getRules(int index) { + return rules_.get(index); + } + /** + * + * + *
+   * List of rules given by the customer.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule rules = 3; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RuleOrBuilder getRulesOrBuilder(int index) { + return rules_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, description_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(source_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, source_); + } + for (int i = 0; i < rules_.size(); i++) { + output.writeMessage(3, rules_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, description_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(source_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, source_); + } + for (int i = 0; i < rules_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, rules_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, name_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.RuleSet)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.RuleSet other = + (com.google.cloud.contentwarehouse.v1.RuleSet) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (!getSource().equals(other.getSource())) return false; + if (!getRulesList().equals(other.getRulesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getSource().hashCode(); + if (getRulesCount() > 0) { + hash = (37 * hash) + RULES_FIELD_NUMBER; + hash = (53 * hash) + getRulesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.RuleSet parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.RuleSet parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.RuleSet parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.RuleSet parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.RuleSet parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.RuleSet parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.RuleSet parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.RuleSet parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.RuleSet parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.RuleSet parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.RuleSet parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.RuleSet parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.contentwarehouse.v1.RuleSet prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Represents a set of rules from a single customer.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.RuleSet} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.RuleSet) + com.google.cloud.contentwarehouse.v1.RuleSetOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_RuleSet_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_RuleSet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.RuleSet.class, + com.google.cloud.contentwarehouse.v1.RuleSet.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.RuleSet.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + description_ = ""; + + source_ = ""; + + if (rulesBuilder_ == null) { + rules_ = java.util.Collections.emptyList(); + } else { + rules_ = null; + rulesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.RuleEngineProto + .internal_static_google_cloud_contentwarehouse_v1_RuleSet_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RuleSet getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.RuleSet.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RuleSet build() { + com.google.cloud.contentwarehouse.v1.RuleSet result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RuleSet buildPartial() { + com.google.cloud.contentwarehouse.v1.RuleSet result = + new com.google.cloud.contentwarehouse.v1.RuleSet(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.description_ = description_; + result.source_ = source_; + if (rulesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + rules_ = java.util.Collections.unmodifiableList(rules_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.rules_ = rules_; + } else { + result.rules_ = rulesBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.RuleSet) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.RuleSet) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.RuleSet other) { + if (other == com.google.cloud.contentwarehouse.v1.RuleSet.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (!other.getSource().isEmpty()) { + source_ = other.source_; + onChanged(); + } + if (rulesBuilder_ == null) { + if (!other.rules_.isEmpty()) { + if (rules_.isEmpty()) { + rules_ = other.rules_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureRulesIsMutable(); + rules_.addAll(other.rules_); + } + onChanged(); + } + } else { + if (!other.rules_.isEmpty()) { + if (rulesBuilder_.isEmpty()) { + rulesBuilder_.dispose(); + rulesBuilder_ = null; + rules_ = other.rules_; + bitField0_ = (bitField0_ & ~0x00000001); + rulesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getRulesFieldBuilder() + : null; + } else { + rulesBuilder_.addAllMessages(other.rules_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + description_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + source_ = input.readStringRequireUtf8(); + + break; + } // case 18 + case 26: + { + com.google.cloud.contentwarehouse.v1.Rule m = + input.readMessage( + com.google.cloud.contentwarehouse.v1.Rule.parser(), extensionRegistry); + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + rules_.add(m); + } else { + rulesBuilder_.addMessage(m); + } + break; + } // case 26 + case 50: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 50 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The resource name of the rule set. Managed internally.
+     * Format:
+     * projects/{project_number}/locations/{location}/ruleSet/{rule_set_id}.
+     * The name is ignored when creating a rule set.
+     * 
+ * + * string name = 6; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource name of the rule set. Managed internally.
+     * Format:
+     * projects/{project_number}/locations/{location}/ruleSet/{rule_set_id}.
+     * The name is ignored when creating a rule set.
+     * 
+ * + * string name = 6; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource name of the rule set. Managed internally.
+     * Format:
+     * projects/{project_number}/locations/{location}/ruleSet/{rule_set_id}.
+     * The name is ignored when creating a rule set.
+     * 
+ * + * string name = 6; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the rule set. Managed internally.
+     * Format:
+     * projects/{project_number}/locations/{location}/ruleSet/{rule_set_id}.
+     * The name is ignored when creating a rule set.
+     * 
+ * + * string name = 6; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the rule set. Managed internally.
+     * Format:
+     * projects/{project_number}/locations/{location}/ruleSet/{rule_set_id}.
+     * The name is ignored when creating a rule set.
+     * 
+ * + * string name = 6; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * Short description of the rule-set.
+     * 
+ * + * string description = 1; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Short description of the rule-set.
+     * 
+ * + * string description = 1; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Short description of the rule-set.
+     * 
+ * + * string description = 1; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Short description of the rule-set.
+     * 
+ * + * string description = 1; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+     * Short description of the rule-set.
+     * 
+ * + * string description = 1; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + private java.lang.Object source_ = ""; + /** + * + * + *
+     * Source of the rules i.e., customer name.
+     * 
+ * + * string source = 2; + * + * @return The source. + */ + public java.lang.String getSource() { + java.lang.Object ref = source_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + source_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Source of the rules i.e., customer name.
+     * 
+ * + * string source = 2; + * + * @return The bytes for source. + */ + public com.google.protobuf.ByteString getSourceBytes() { + java.lang.Object ref = source_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + source_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Source of the rules i.e., customer name.
+     * 
+ * + * string source = 2; + * + * @param value The source to set. + * @return This builder for chaining. + */ + public Builder setSource(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + source_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Source of the rules i.e., customer name.
+     * 
+ * + * string source = 2; + * + * @return This builder for chaining. + */ + public Builder clearSource() { + + source_ = getDefaultInstance().getSource(); + onChanged(); + return this; + } + /** + * + * + *
+     * Source of the rules i.e., customer name.
+     * 
+ * + * string source = 2; + * + * @param value The bytes for source to set. + * @return This builder for chaining. + */ + public Builder setSourceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + source_ = value; + onChanged(); + return this; + } + + private java.util.List rules_ = + java.util.Collections.emptyList(); + + private void ensureRulesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + rules_ = new java.util.ArrayList(rules_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.Rule, + com.google.cloud.contentwarehouse.v1.Rule.Builder, + com.google.cloud.contentwarehouse.v1.RuleOrBuilder> + rulesBuilder_; + + /** + * + * + *
+     * List of rules given by the customer.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule rules = 3; + */ + public java.util.List getRulesList() { + if (rulesBuilder_ == null) { + return java.util.Collections.unmodifiableList(rules_); + } else { + return rulesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * List of rules given by the customer.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule rules = 3; + */ + public int getRulesCount() { + if (rulesBuilder_ == null) { + return rules_.size(); + } else { + return rulesBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of rules given by the customer.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule rules = 3; + */ + public com.google.cloud.contentwarehouse.v1.Rule getRules(int index) { + if (rulesBuilder_ == null) { + return rules_.get(index); + } else { + return rulesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of rules given by the customer.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule rules = 3; + */ + public Builder setRules(int index, com.google.cloud.contentwarehouse.v1.Rule value) { + if (rulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRulesIsMutable(); + rules_.set(index, value); + onChanged(); + } else { + rulesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of rules given by the customer.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule rules = 3; + */ + public Builder setRules( + int index, com.google.cloud.contentwarehouse.v1.Rule.Builder builderForValue) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + rules_.set(index, builderForValue.build()); + onChanged(); + } else { + rulesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of rules given by the customer.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule rules = 3; + */ + public Builder addRules(com.google.cloud.contentwarehouse.v1.Rule value) { + if (rulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRulesIsMutable(); + rules_.add(value); + onChanged(); + } else { + rulesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * List of rules given by the customer.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule rules = 3; + */ + public Builder addRules(int index, com.google.cloud.contentwarehouse.v1.Rule value) { + if (rulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRulesIsMutable(); + rules_.add(index, value); + onChanged(); + } else { + rulesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of rules given by the customer.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule rules = 3; + */ + public Builder addRules(com.google.cloud.contentwarehouse.v1.Rule.Builder builderForValue) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + rules_.add(builderForValue.build()); + onChanged(); + } else { + rulesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of rules given by the customer.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule rules = 3; + */ + public Builder addRules( + int index, com.google.cloud.contentwarehouse.v1.Rule.Builder builderForValue) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + rules_.add(index, builderForValue.build()); + onChanged(); + } else { + rulesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of rules given by the customer.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule rules = 3; + */ + public Builder addAllRules( + java.lang.Iterable values) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, rules_); + onChanged(); + } else { + rulesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * List of rules given by the customer.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule rules = 3; + */ + public Builder clearRules() { + if (rulesBuilder_ == null) { + rules_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + rulesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of rules given by the customer.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule rules = 3; + */ + public Builder removeRules(int index) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + rules_.remove(index); + onChanged(); + } else { + rulesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * List of rules given by the customer.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule rules = 3; + */ + public com.google.cloud.contentwarehouse.v1.Rule.Builder getRulesBuilder(int index) { + return getRulesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of rules given by the customer.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule rules = 3; + */ + public com.google.cloud.contentwarehouse.v1.RuleOrBuilder getRulesOrBuilder(int index) { + if (rulesBuilder_ == null) { + return rules_.get(index); + } else { + return rulesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of rules given by the customer.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule rules = 3; + */ + public java.util.List + getRulesOrBuilderList() { + if (rulesBuilder_ != null) { + return rulesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(rules_); + } + } + /** + * + * + *
+     * List of rules given by the customer.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule rules = 3; + */ + public com.google.cloud.contentwarehouse.v1.Rule.Builder addRulesBuilder() { + return getRulesFieldBuilder() + .addBuilder(com.google.cloud.contentwarehouse.v1.Rule.getDefaultInstance()); + } + /** + * + * + *
+     * List of rules given by the customer.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule rules = 3; + */ + public com.google.cloud.contentwarehouse.v1.Rule.Builder addRulesBuilder(int index) { + return getRulesFieldBuilder() + .addBuilder(index, com.google.cloud.contentwarehouse.v1.Rule.getDefaultInstance()); + } + /** + * + * + *
+     * List of rules given by the customer.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule rules = 3; + */ + public java.util.List getRulesBuilderList() { + return getRulesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.Rule, + com.google.cloud.contentwarehouse.v1.Rule.Builder, + com.google.cloud.contentwarehouse.v1.RuleOrBuilder> + getRulesFieldBuilder() { + if (rulesBuilder_ == null) { + rulesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.Rule, + com.google.cloud.contentwarehouse.v1.Rule.Builder, + com.google.cloud.contentwarehouse.v1.RuleOrBuilder>( + rules_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + rules_ = null; + } + return rulesBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.RuleSet) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.RuleSet) + private static final com.google.cloud.contentwarehouse.v1.RuleSet DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.RuleSet(); + } + + public static com.google.cloud.contentwarehouse.v1.RuleSet getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RuleSet parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RuleSet getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/RuleSetName.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/RuleSetName.java new file mode 100644 index 000000000000..e26de037df02 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/RuleSetName.java @@ -0,0 +1,223 @@ +/* + * 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; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class RuleSetName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_RULE_SET = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/ruleSets/{rule_set}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String ruleSet; + + @Deprecated + protected RuleSetName() { + project = null; + location = null; + ruleSet = null; + } + + private RuleSetName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + ruleSet = Preconditions.checkNotNull(builder.getRuleSet()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getRuleSet() { + return ruleSet; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static RuleSetName of(String project, String location, String ruleSet) { + return newBuilder().setProject(project).setLocation(location).setRuleSet(ruleSet).build(); + } + + public static String format(String project, String location, String ruleSet) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setRuleSet(ruleSet) + .build() + .toString(); + } + + public static RuleSetName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_RULE_SET.validatedMatch( + formattedString, "RuleSetName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("rule_set")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (RuleSetName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_RULE_SET.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (ruleSet != null) { + fieldMapBuilder.put("rule_set", ruleSet); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_RULE_SET.instantiate( + "project", project, "location", location, "rule_set", ruleSet); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + RuleSetName that = ((RuleSetName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.ruleSet, that.ruleSet); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(ruleSet); + return h; + } + + /** Builder for projects/{project}/locations/{location}/ruleSets/{rule_set}. */ + public static class Builder { + private String project; + private String location; + private String ruleSet; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getRuleSet() { + return ruleSet; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setRuleSet(String ruleSet) { + this.ruleSet = ruleSet; + return this; + } + + private Builder(RuleSetName ruleSetName) { + this.project = ruleSetName.project; + this.location = ruleSetName.location; + this.ruleSet = ruleSetName.ruleSet; + } + + public RuleSetName build() { + return new RuleSetName(this); + } + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/RuleSetOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/RuleSetOrBuilder.java new file mode 100644 index 000000000000..c0929b729624 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/RuleSetOrBuilder.java @@ -0,0 +1,158 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/rule_engine.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface RuleSetOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.RuleSet) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resource name of the rule set. Managed internally.
+   * Format:
+   * projects/{project_number}/locations/{location}/ruleSet/{rule_set_id}.
+   * The name is ignored when creating a rule set.
+   * 
+ * + * string name = 6; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The resource name of the rule set. Managed internally.
+   * Format:
+   * projects/{project_number}/locations/{location}/ruleSet/{rule_set_id}.
+   * The name is ignored when creating a rule set.
+   * 
+ * + * string name = 6; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Short description of the rule-set.
+   * 
+ * + * string description = 1; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * Short description of the rule-set.
+   * 
+ * + * string description = 1; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Source of the rules i.e., customer name.
+   * 
+ * + * string source = 2; + * + * @return The source. + */ + java.lang.String getSource(); + /** + * + * + *
+   * Source of the rules i.e., customer name.
+   * 
+ * + * string source = 2; + * + * @return The bytes for source. + */ + com.google.protobuf.ByteString getSourceBytes(); + + /** + * + * + *
+   * List of rules given by the customer.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule rules = 3; + */ + java.util.List getRulesList(); + /** + * + * + *
+   * List of rules given by the customer.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule rules = 3; + */ + com.google.cloud.contentwarehouse.v1.Rule getRules(int index); + /** + * + * + *
+   * List of rules given by the customer.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule rules = 3; + */ + int getRulesCount(); + /** + * + * + *
+   * List of rules given by the customer.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule rules = 3; + */ + java.util.List + getRulesOrBuilderList(); + /** + * + * + *
+   * List of rules given by the customer.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.Rule rules = 3; + */ + com.google.cloud.contentwarehouse.v1.RuleOrBuilder getRulesOrBuilder(int index); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/RuleSetServiceProto.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/RuleSetServiceProto.java new file mode 100644 index 000000000000..6a35760ffed0 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/RuleSetServiceProto.java @@ -0,0 +1,102 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/ruleset_service.proto + +package com.google.cloud.contentwarehouse.v1; + +public final class RuleSetServiceProto { + private RuleSetServiceProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n6google/cloud/contentwarehouse/v1/rules" + + "et_service.proto\022 google.cloud.contentwa" + + "rehouse.v1\032\034google/api/annotations.proto" + + "\032\027google/api/client.proto\0322google/cloud/" + + "contentwarehouse/v1/rule_engine.proto\032>g" + + "oogle/cloud/contentwarehouse/v1/ruleset_" + + "service_request.proto\032\033google/protobuf/e" + + "mpty.proto2\364\007\n\016RuleSetService\022\304\001\n\rCreate" + + "RuleSet\0226.google.cloud.contentwarehouse." + + "v1.CreateRuleSetRequest\032).google.cloud.c" + + "ontentwarehouse.v1.RuleSet\"P\202\323\344\223\0028\",/v1/" + + "{parent=projects/*/locations/*}/ruleSets" + + ":\010rule_set\332A\017parent,rule_set\022\251\001\n\nGetRule" + + "Set\0223.google.cloud.contentwarehouse.v1.G" + + "etRuleSetRequest\032).google.cloud.contentw" + + "arehouse.v1.RuleSet\";\202\323\344\223\002.\022,/v1/{name=p" + + "rojects/*/locations/*/ruleSets/*}\332A\004name" + + "\022\273\001\n\rUpdateRuleSet\0226.google.cloud.conten" + + "twarehouse.v1.UpdateRuleSetRequest\032).goo" + + "gle.cloud.contentwarehouse.v1.RuleSet\"G\202" + + "\323\344\223\00212,/v1/{name=projects/*/locations/*/" + + "ruleSets/*}:\001*\332A\rname,rule_set\022\234\001\n\rDelet" + + "eRuleSet\0226.google.cloud.contentwarehouse" + + ".v1.DeleteRuleSetRequest\032\026.google.protob" + + "uf.Empty\";\202\323\344\223\002.*,/v1/{name=projects/*/l" + + "ocations/*/ruleSets/*}\332A\004name\022\274\001\n\014ListRu" + + "leSets\0225.google.cloud.contentwarehouse.v" + + "1.ListRuleSetsRequest\0326.google.cloud.con" + + "tentwarehouse.v1.ListRuleSetsResponse\"=\202" + + "\323\344\223\002.\022,/v1/{parent=projects/*/locations/" + + "*}/ruleSets\332A\006parent\032S\312A\037contentwarehous" + + "e.googleapis.com\322A.https://www.googleapi" + + "s.com/auth/cloud-platformB\217\001\n$com.google" + + ".cloud.contentwarehouse.v1B\023RuleSetServi" + + "ceProtoP\001ZPgoogle.golang.org/genproto/go" + + "ogleapis/cloud/contentwarehouse/v1;conte" + + "ntwarehouseb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.cloud.contentwarehouse.v1.RuleEngineProto.getDescriptor(), + com.google.cloud.contentwarehouse.v1.RuleSetServiceRequestProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.cloud.contentwarehouse.v1.RuleEngineProto.getDescriptor(); + com.google.cloud.contentwarehouse.v1.RuleSetServiceRequestProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/RuleSetServiceRequestProto.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/RuleSetServiceRequestProto.java new file mode 100644 index 000000000000..647148239e93 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/RuleSetServiceRequestProto.java @@ -0,0 +1,160 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/ruleset_service_request.proto + +package com.google.cloud.contentwarehouse.v1; + +public final class RuleSetServiceRequestProto { + private RuleSetServiceRequestProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_CreateRuleSetRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_CreateRuleSetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_GetRuleSetRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_GetRuleSetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_UpdateRuleSetRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_UpdateRuleSetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_DeleteRuleSetRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_DeleteRuleSetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_ListRuleSetsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_ListRuleSetsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_ListRuleSetsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_ListRuleSetsResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n>google/cloud/contentwarehouse/v1/rules" + + "et_service_request.proto\022 google.cloud.c" + + "ontentwarehouse.v1\032\037google/api/field_beh" + + "avior.proto\032\031google/api/resource.proto\0322" + + "google/cloud/contentwarehouse/v1/rule_en" + + "gine.proto\"\232\001\n\024CreateRuleSetRequest\022@\n\006p" + + "arent\030\001 \001(\tB0\340A\002\372A*\n(contentwarehouse.go" + + "ogleapis.com/Location\022@\n\010rule_set\030\002 \001(\0132" + + ").google.cloud.contentwarehouse.v1.RuleS" + + "etB\003\340A\002\"R\n\021GetRuleSetRequest\022=\n\004name\030\001 \001" + + "(\tB/\340A\002\372A)\n\'contentwarehouse.googleapis." + + "com/RuleSet\"\227\001\n\024UpdateRuleSetRequest\022=\n\004" + + "name\030\001 \001(\tB/\340A\002\372A)\n\'contentwarehouse.goo" + + "gleapis.com/RuleSet\022@\n\010rule_set\030\002 \001(\0132)." + + "google.cloud.contentwarehouse.v1.RuleSet" + + "B\003\340A\002\"U\n\024DeleteRuleSetRequest\022=\n\004name\030\001 " + + "\001(\tB/\340A\002\372A)\n\'contentwarehouse.googleapis" + + ".com/RuleSet\"~\n\023ListRuleSetsRequest\022@\n\006p" + + "arent\030\001 \001(\tB0\340A\002\372A*\n(contentwarehouse.go" + + "ogleapis.com/Location\022\021\n\tpage_size\030\002 \001(\005" + + "\022\022\n\npage_token\030\003 \001(\t\"m\n\024ListRuleSetsResp" + + "onse\022<\n\trule_sets\030\001 \003(\0132).google.cloud.c" + + "ontentwarehouse.v1.RuleSet\022\027\n\017next_page_" + + "token\030\002 \001(\tB\226\001\n$com.google.cloud.content" + + "warehouse.v1B\032RuleSetServiceRequestProto" + + "P\001ZPgoogle.golang.org/genproto/googleapi" + + "s/cloud/contentwarehouse/v1;contentwareh" + + "ouseb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.contentwarehouse.v1.RuleEngineProto.getDescriptor(), + }); + internal_static_google_cloud_contentwarehouse_v1_CreateRuleSetRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_contentwarehouse_v1_CreateRuleSetRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_CreateRuleSetRequest_descriptor, + new java.lang.String[] { + "Parent", "RuleSet", + }); + internal_static_google_cloud_contentwarehouse_v1_GetRuleSetRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_contentwarehouse_v1_GetRuleSetRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_GetRuleSetRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_contentwarehouse_v1_UpdateRuleSetRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_contentwarehouse_v1_UpdateRuleSetRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_UpdateRuleSetRequest_descriptor, + new java.lang.String[] { + "Name", "RuleSet", + }); + internal_static_google_cloud_contentwarehouse_v1_DeleteRuleSetRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_contentwarehouse_v1_DeleteRuleSetRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_DeleteRuleSetRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_contentwarehouse_v1_ListRuleSetsRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_contentwarehouse_v1_ListRuleSetsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_ListRuleSetsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_cloud_contentwarehouse_v1_ListRuleSetsResponse_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_contentwarehouse_v1_ListRuleSetsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_ListRuleSetsResponse_descriptor, + new java.lang.String[] { + "RuleSets", "NextPageToken", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.contentwarehouse.v1.RuleEngineProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/SearchDocumentsRequest.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/SearchDocumentsRequest.java new file mode 100644 index 000000000000..b817c9c89852 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/SearchDocumentsRequest.java @@ -0,0 +1,3066 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_service_request.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Request message for DocumentService.SearchDocuments.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.SearchDocumentsRequest} + */ +public final class SearchDocumentsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.SearchDocumentsRequest) + SearchDocumentsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use SearchDocumentsRequest.newBuilder() to construct. + private SearchDocumentsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SearchDocumentsRequest() { + parent_ = ""; + pageToken_ = ""; + orderBy_ = ""; + histogramQueries_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SearchDocumentsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_SearchDocumentsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_SearchDocumentsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest.class, + com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent, which owns this collection of documents.
+   * Format: projects/{project_number}/locations/{location}.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent, which owns this collection of documents.
+   * Format: projects/{project_number}/locations/{location}.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUEST_METADATA_FIELD_NUMBER = 3; + private com.google.cloud.contentwarehouse.v1.RequestMetadata requestMetadata_; + /** + * + * + *
+   * The meta information collected about the end user, used to enforce access
+   * control and improve the search quality of the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + * + * @return Whether the requestMetadata field is set. + */ + @java.lang.Override + public boolean hasRequestMetadata() { + return requestMetadata_ != null; + } + /** + * + * + *
+   * The meta information collected about the end user, used to enforce access
+   * control and improve the search quality of the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + * + * @return The requestMetadata. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RequestMetadata getRequestMetadata() { + return requestMetadata_ == null + ? com.google.cloud.contentwarehouse.v1.RequestMetadata.getDefaultInstance() + : requestMetadata_; + } + /** + * + * + *
+   * The meta information collected about the end user, used to enforce access
+   * control and improve the search quality of the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder + getRequestMetadataOrBuilder() { + return getRequestMetadata(); + } + + public static final int DOCUMENT_QUERY_FIELD_NUMBER = 4; + private com.google.cloud.contentwarehouse.v1.DocumentQuery documentQuery_; + /** + * + * + *
+   * Query used to search against documents (keyword, filters, etc.).
+   * 
+ * + * .google.cloud.contentwarehouse.v1.DocumentQuery document_query = 4; + * + * @return Whether the documentQuery field is set. + */ + @java.lang.Override + public boolean hasDocumentQuery() { + return documentQuery_ != null; + } + /** + * + * + *
+   * Query used to search against documents (keyword, filters, etc.).
+   * 
+ * + * .google.cloud.contentwarehouse.v1.DocumentQuery document_query = 4; + * + * @return The documentQuery. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DocumentQuery getDocumentQuery() { + return documentQuery_ == null + ? com.google.cloud.contentwarehouse.v1.DocumentQuery.getDefaultInstance() + : documentQuery_; + } + /** + * + * + *
+   * Query used to search against documents (keyword, filters, etc.).
+   * 
+ * + * .google.cloud.contentwarehouse.v1.DocumentQuery document_query = 4; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DocumentQueryOrBuilder getDocumentQueryOrBuilder() { + return getDocumentQuery(); + } + + public static final int OFFSET_FIELD_NUMBER = 5; + private int offset_; + /** + * + * + *
+   * An integer that specifies the current offset (that is, starting result
+   * location, amongst the documents deemed by the API as relevant) in search
+   * results. This field is only considered if [page_token][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.page_token] is unset.
+   * The maximum allowed value is 5000. Otherwise an error is thrown.
+   * For example, 0 means to  return results starting from the first matching
+   * document, and 10 means to return from the 11th document. This can be used
+   * for pagination, (for example, pageSize = 10 and offset = 10 means to return
+   * from the second page).
+   * 
+ * + * int32 offset = 5; + * + * @return The offset. + */ + @java.lang.Override + public int getOffset() { + return offset_; + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 6; + private int pageSize_; + /** + * + * + *
+   * A limit on the number of documents returned in the search results.
+   * Increasing this value above the default value of 10 can increase search
+   * response time. The value can be between 1 and 100.
+   * 
+ * + * int32 page_size = 6; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 7; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * The token specifying the current offset within search results.
+   * See [SearchDocumentsResponse.next_page_token][google.cloud.contentwarehouse.v1.SearchDocumentsResponse.next_page_token] for an explanation of how
+   * to obtain the next set of query results.
+   * 
+ * + * string page_token = 7; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * The token specifying the current offset within search results.
+   * See [SearchDocumentsResponse.next_page_token][google.cloud.contentwarehouse.v1.SearchDocumentsResponse.next_page_token] for an explanation of how
+   * to obtain the next set of query results.
+   * 
+ * + * string page_token = 7; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 8; + private volatile java.lang.Object orderBy_; + /** + * + * + *
+   * The criteria determining how search results are sorted. For non-empty
+   * query, default is `"relevance desc"`. For empty query, default is
+   * `"upload_date desc"`.
+   * Supported options are:
+   * * `"relevance desc"`: By relevance descending, as determined by the API
+   *   algorithms.
+   * * `"upload_date desc"`: By upload date descending.
+   * * `"upload_date"`: By upload date ascending.
+   * * `"update_date desc"`: By last updated date descending.
+   * * `"update_date"`: By last updated date ascending.
+   * 
+ * + * string order_by = 8; + * + * @return The orderBy. + */ + @java.lang.Override + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } + } + /** + * + * + *
+   * The criteria determining how search results are sorted. For non-empty
+   * query, default is `"relevance desc"`. For empty query, default is
+   * `"upload_date desc"`.
+   * Supported options are:
+   * * `"relevance desc"`: By relevance descending, as determined by the API
+   *   algorithms.
+   * * `"upload_date desc"`: By upload date descending.
+   * * `"upload_date"`: By upload date ascending.
+   * * `"update_date desc"`: By last updated date descending.
+   * * `"update_date"`: By last updated date ascending.
+   * 
+ * + * string order_by = 8; + * + * @return The bytes for orderBy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int HISTOGRAM_QUERIES_FIELD_NUMBER = 9; + private java.util.List histogramQueries_; + /** + * + * + *
+   * An expression specifying a histogram request against matching
+   * documents. Expression syntax is an aggregation function call with
+   * histogram facets and other options.
+   * The following aggregation functions are supported:
+   * * `count(string_histogram_facet)`: Count the number of matching entities
+   * for each distinct attribute value.
+   * Data types:
+   * * Histogram facet (aka filterable properties): Facet names with format
+   * &lt;schema id&gt;.&lt;facet&gt;. Facets will have the
+   * format of: [a-zA-Z][a-zA-Z0-9_:/-.]. If the facet is a child
+   * facet, then the parent hierarchy needs to be specified separated by
+   * dots in the prefix after the schema id. Thus, the format for a multi-
+   * level facet is: &lt;schema id&gt;.&lt;parent facet name&gt;.
+   * &lt;child facet name&gt;. Example:
+   * schema123.root_parent_facet.middle_facet.child_facet
+   * * DocumentSchemaId: (with no schema id prefix) to get
+   * histograms for each document type (returns the schema id path, e.g.
+   * projects/12345/locations/us-west/documentSchemas/abc123).
+   * Example expression:
+   * * Document type counts:
+   *   count('DocumentSchemaId')
+   * * For schema id, abc123, get the counts for MORTGAGE_TYPE:
+   *   count('abc123.MORTGAGE_TYPE')
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9; + */ + @java.lang.Override + public java.util.List + getHistogramQueriesList() { + return histogramQueries_; + } + /** + * + * + *
+   * An expression specifying a histogram request against matching
+   * documents. Expression syntax is an aggregation function call with
+   * histogram facets and other options.
+   * The following aggregation functions are supported:
+   * * `count(string_histogram_facet)`: Count the number of matching entities
+   * for each distinct attribute value.
+   * Data types:
+   * * Histogram facet (aka filterable properties): Facet names with format
+   * &lt;schema id&gt;.&lt;facet&gt;. Facets will have the
+   * format of: [a-zA-Z][a-zA-Z0-9_:/-.]. If the facet is a child
+   * facet, then the parent hierarchy needs to be specified separated by
+   * dots in the prefix after the schema id. Thus, the format for a multi-
+   * level facet is: &lt;schema id&gt;.&lt;parent facet name&gt;.
+   * &lt;child facet name&gt;. Example:
+   * schema123.root_parent_facet.middle_facet.child_facet
+   * * DocumentSchemaId: (with no schema id prefix) to get
+   * histograms for each document type (returns the schema id path, e.g.
+   * projects/12345/locations/us-west/documentSchemas/abc123).
+   * Example expression:
+   * * Document type counts:
+   *   count('DocumentSchemaId')
+   * * For schema id, abc123, get the counts for MORTGAGE_TYPE:
+   *   count('abc123.MORTGAGE_TYPE')
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9; + */ + @java.lang.Override + public java.util.List + getHistogramQueriesOrBuilderList() { + return histogramQueries_; + } + /** + * + * + *
+   * An expression specifying a histogram request against matching
+   * documents. Expression syntax is an aggregation function call with
+   * histogram facets and other options.
+   * The following aggregation functions are supported:
+   * * `count(string_histogram_facet)`: Count the number of matching entities
+   * for each distinct attribute value.
+   * Data types:
+   * * Histogram facet (aka filterable properties): Facet names with format
+   * &lt;schema id&gt;.&lt;facet&gt;. Facets will have the
+   * format of: [a-zA-Z][a-zA-Z0-9_:/-.]. If the facet is a child
+   * facet, then the parent hierarchy needs to be specified separated by
+   * dots in the prefix after the schema id. Thus, the format for a multi-
+   * level facet is: &lt;schema id&gt;.&lt;parent facet name&gt;.
+   * &lt;child facet name&gt;. Example:
+   * schema123.root_parent_facet.middle_facet.child_facet
+   * * DocumentSchemaId: (with no schema id prefix) to get
+   * histograms for each document type (returns the schema id path, e.g.
+   * projects/12345/locations/us-west/documentSchemas/abc123).
+   * Example expression:
+   * * Document type counts:
+   *   count('DocumentSchemaId')
+   * * For schema id, abc123, get the counts for MORTGAGE_TYPE:
+   *   count('abc123.MORTGAGE_TYPE')
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9; + */ + @java.lang.Override + public int getHistogramQueriesCount() { + return histogramQueries_.size(); + } + /** + * + * + *
+   * An expression specifying a histogram request against matching
+   * documents. Expression syntax is an aggregation function call with
+   * histogram facets and other options.
+   * The following aggregation functions are supported:
+   * * `count(string_histogram_facet)`: Count the number of matching entities
+   * for each distinct attribute value.
+   * Data types:
+   * * Histogram facet (aka filterable properties): Facet names with format
+   * &lt;schema id&gt;.&lt;facet&gt;. Facets will have the
+   * format of: [a-zA-Z][a-zA-Z0-9_:/-.]. If the facet is a child
+   * facet, then the parent hierarchy needs to be specified separated by
+   * dots in the prefix after the schema id. Thus, the format for a multi-
+   * level facet is: &lt;schema id&gt;.&lt;parent facet name&gt;.
+   * &lt;child facet name&gt;. Example:
+   * schema123.root_parent_facet.middle_facet.child_facet
+   * * DocumentSchemaId: (with no schema id prefix) to get
+   * histograms for each document type (returns the schema id path, e.g.
+   * projects/12345/locations/us-west/documentSchemas/abc123).
+   * Example expression:
+   * * Document type counts:
+   *   count('DocumentSchemaId')
+   * * For schema id, abc123, get the counts for MORTGAGE_TYPE:
+   *   count('abc123.MORTGAGE_TYPE')
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.HistogramQuery getHistogramQueries(int index) { + return histogramQueries_.get(index); + } + /** + * + * + *
+   * An expression specifying a histogram request against matching
+   * documents. Expression syntax is an aggregation function call with
+   * histogram facets and other options.
+   * The following aggregation functions are supported:
+   * * `count(string_histogram_facet)`: Count the number of matching entities
+   * for each distinct attribute value.
+   * Data types:
+   * * Histogram facet (aka filterable properties): Facet names with format
+   * &lt;schema id&gt;.&lt;facet&gt;. Facets will have the
+   * format of: [a-zA-Z][a-zA-Z0-9_:/-.]. If the facet is a child
+   * facet, then the parent hierarchy needs to be specified separated by
+   * dots in the prefix after the schema id. Thus, the format for a multi-
+   * level facet is: &lt;schema id&gt;.&lt;parent facet name&gt;.
+   * &lt;child facet name&gt;. Example:
+   * schema123.root_parent_facet.middle_facet.child_facet
+   * * DocumentSchemaId: (with no schema id prefix) to get
+   * histograms for each document type (returns the schema id path, e.g.
+   * projects/12345/locations/us-west/documentSchemas/abc123).
+   * Example expression:
+   * * Document type counts:
+   *   count('DocumentSchemaId')
+   * * For schema id, abc123, get the counts for MORTGAGE_TYPE:
+   *   count('abc123.MORTGAGE_TYPE')
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.HistogramQueryOrBuilder getHistogramQueriesOrBuilder( + int index) { + return histogramQueries_.get(index); + } + + public static final int REQUIRE_TOTAL_SIZE_FIELD_NUMBER = 10; + private boolean requireTotalSize_; + /** + * + * + *
+   * Optional. Controls if the search document request requires the return of a total size
+   * of matched documents. See [SearchDocumentsResponse.total_size][google.cloud.contentwarehouse.v1.SearchDocumentsResponse.total_size].
+   * Enabling this flag may adversely impact performance. Hint: If this is
+   * used with pagination, set this flag on the initial query but set this
+   * to false on subsequent page calls (keep the total count locally).
+   * Defaults to false.
+   * 
+ * + * bool require_total_size = 10; + * + * @return The requireTotalSize. + */ + @java.lang.Override + public boolean getRequireTotalSize() { + return requireTotalSize_; + } + + public static final int QA_SIZE_LIMIT_FIELD_NUMBER = 11; + private int qaSizeLimit_; + /** + * + * + *
+   * Experimental, do not use.
+   * The limit on the number of documents returned for the question-answering
+   * feature. To enable the question-answering feature, set
+   * [DocumentQuery].[is_nl_query][] to true.
+   * 
+ * + * int32 qa_size_limit = 11; + * + * @return The qaSizeLimit. + */ + @java.lang.Override + public int getQaSizeLimit() { + return qaSizeLimit_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (requestMetadata_ != null) { + output.writeMessage(3, getRequestMetadata()); + } + if (documentQuery_ != null) { + output.writeMessage(4, getDocumentQuery()); + } + if (offset_ != 0) { + output.writeInt32(5, offset_); + } + if (pageSize_ != 0) { + output.writeInt32(6, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, orderBy_); + } + for (int i = 0; i < histogramQueries_.size(); i++) { + output.writeMessage(9, histogramQueries_.get(i)); + } + if (requireTotalSize_ != false) { + output.writeBool(10, requireTotalSize_); + } + if (qaSizeLimit_ != 0) { + output.writeInt32(11, qaSizeLimit_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (requestMetadata_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getRequestMetadata()); + } + if (documentQuery_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getDocumentQuery()); + } + if (offset_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(5, offset_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(6, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, orderBy_); + } + for (int i = 0; i < histogramQueries_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, histogramQueries_.get(i)); + } + if (requireTotalSize_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(10, requireTotalSize_); + } + if (qaSizeLimit_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(11, qaSizeLimit_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest other = + (com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasRequestMetadata() != other.hasRequestMetadata()) return false; + if (hasRequestMetadata()) { + if (!getRequestMetadata().equals(other.getRequestMetadata())) return false; + } + if (hasDocumentQuery() != other.hasDocumentQuery()) return false; + if (hasDocumentQuery()) { + if (!getDocumentQuery().equals(other.getDocumentQuery())) return false; + } + if (getOffset() != other.getOffset()) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getOrderBy().equals(other.getOrderBy())) return false; + if (!getHistogramQueriesList().equals(other.getHistogramQueriesList())) return false; + if (getRequireTotalSize() != other.getRequireTotalSize()) return false; + if (getQaSizeLimit() != other.getQaSizeLimit()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasRequestMetadata()) { + hash = (37 * hash) + REQUEST_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getRequestMetadata().hashCode(); + } + if (hasDocumentQuery()) { + hash = (37 * hash) + DOCUMENT_QUERY_FIELD_NUMBER; + hash = (53 * hash) + getDocumentQuery().hashCode(); + } + hash = (37 * hash) + OFFSET_FIELD_NUMBER; + hash = (53 * hash) + getOffset(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + if (getHistogramQueriesCount() > 0) { + hash = (37 * hash) + HISTOGRAM_QUERIES_FIELD_NUMBER; + hash = (53 * hash) + getHistogramQueriesList().hashCode(); + } + hash = (37 * hash) + REQUIRE_TOTAL_SIZE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getRequireTotalSize()); + hash = (37 * hash) + QA_SIZE_LIMIT_FIELD_NUMBER; + hash = (53 * hash) + getQaSizeLimit(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for DocumentService.SearchDocuments.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.SearchDocumentsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.SearchDocumentsRequest) + com.google.cloud.contentwarehouse.v1.SearchDocumentsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_SearchDocumentsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_SearchDocumentsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest.class, + com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + if (requestMetadataBuilder_ == null) { + requestMetadata_ = null; + } else { + requestMetadata_ = null; + requestMetadataBuilder_ = null; + } + if (documentQueryBuilder_ == null) { + documentQuery_ = null; + } else { + documentQuery_ = null; + documentQueryBuilder_ = null; + } + offset_ = 0; + + pageSize_ = 0; + + pageToken_ = ""; + + orderBy_ = ""; + + if (histogramQueriesBuilder_ == null) { + histogramQueries_ = java.util.Collections.emptyList(); + } else { + histogramQueries_ = null; + histogramQueriesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + requireTotalSize_ = false; + + qaSizeLimit_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_SearchDocumentsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest build() { + com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest buildPartial() { + com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest result = + new com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest(this); + int from_bitField0_ = bitField0_; + result.parent_ = parent_; + if (requestMetadataBuilder_ == null) { + result.requestMetadata_ = requestMetadata_; + } else { + result.requestMetadata_ = requestMetadataBuilder_.build(); + } + if (documentQueryBuilder_ == null) { + result.documentQuery_ = documentQuery_; + } else { + result.documentQuery_ = documentQueryBuilder_.build(); + } + result.offset_ = offset_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + result.orderBy_ = orderBy_; + if (histogramQueriesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + histogramQueries_ = java.util.Collections.unmodifiableList(histogramQueries_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.histogramQueries_ = histogramQueries_; + } else { + result.histogramQueries_ = histogramQueriesBuilder_.build(); + } + result.requireTotalSize_ = requireTotalSize_; + result.qaSizeLimit_ = qaSizeLimit_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest other) { + if (other == com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasRequestMetadata()) { + mergeRequestMetadata(other.getRequestMetadata()); + } + if (other.hasDocumentQuery()) { + mergeDocumentQuery(other.getDocumentQuery()); + } + if (other.getOffset() != 0) { + setOffset(other.getOffset()); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + onChanged(); + } + if (histogramQueriesBuilder_ == null) { + if (!other.histogramQueries_.isEmpty()) { + if (histogramQueries_.isEmpty()) { + histogramQueries_ = other.histogramQueries_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureHistogramQueriesIsMutable(); + histogramQueries_.addAll(other.histogramQueries_); + } + onChanged(); + } + } else { + if (!other.histogramQueries_.isEmpty()) { + if (histogramQueriesBuilder_.isEmpty()) { + histogramQueriesBuilder_.dispose(); + histogramQueriesBuilder_ = null; + histogramQueries_ = other.histogramQueries_; + bitField0_ = (bitField0_ & ~0x00000001); + histogramQueriesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getHistogramQueriesFieldBuilder() + : null; + } else { + histogramQueriesBuilder_.addAllMessages(other.histogramQueries_); + } + } + } + if (other.getRequireTotalSize() != false) { + setRequireTotalSize(other.getRequireTotalSize()); + } + if (other.getQaSizeLimit() != 0) { + setQaSizeLimit(other.getQaSizeLimit()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 26: + { + input.readMessage(getRequestMetadataFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 26 + case 34: + { + input.readMessage(getDocumentQueryFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 34 + case 40: + { + offset_ = input.readInt32(); + + break; + } // case 40 + case 48: + { + pageSize_ = input.readInt32(); + + break; + } // case 48 + case 58: + { + pageToken_ = input.readStringRequireUtf8(); + + break; + } // case 58 + case 66: + { + orderBy_ = input.readStringRequireUtf8(); + + break; + } // case 66 + case 74: + { + com.google.cloud.contentwarehouse.v1.HistogramQuery m = + input.readMessage( + com.google.cloud.contentwarehouse.v1.HistogramQuery.parser(), + extensionRegistry); + if (histogramQueriesBuilder_ == null) { + ensureHistogramQueriesIsMutable(); + histogramQueries_.add(m); + } else { + histogramQueriesBuilder_.addMessage(m); + } + break; + } // case 74 + case 80: + { + requireTotalSize_ = input.readBool(); + + break; + } // case 80 + case 88: + { + qaSizeLimit_ = input.readInt32(); + + break; + } // case 88 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent, which owns this collection of documents.
+     * Format: projects/{project_number}/locations/{location}.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent, which owns this collection of documents.
+     * Format: projects/{project_number}/locations/{location}.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent, which owns this collection of documents.
+     * Format: projects/{project_number}/locations/{location}.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent, which owns this collection of documents.
+     * Format: projects/{project_number}/locations/{location}.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent, which owns this collection of documents.
+     * Format: projects/{project_number}/locations/{location}.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private com.google.cloud.contentwarehouse.v1.RequestMetadata requestMetadata_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.RequestMetadata, + com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder, + com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder> + requestMetadataBuilder_; + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control and improve the search quality of the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + * + * @return Whether the requestMetadata field is set. + */ + public boolean hasRequestMetadata() { + return requestMetadataBuilder_ != null || requestMetadata_ != null; + } + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control and improve the search quality of the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + * + * @return The requestMetadata. + */ + public com.google.cloud.contentwarehouse.v1.RequestMetadata getRequestMetadata() { + if (requestMetadataBuilder_ == null) { + return requestMetadata_ == null + ? com.google.cloud.contentwarehouse.v1.RequestMetadata.getDefaultInstance() + : requestMetadata_; + } else { + return requestMetadataBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control and improve the search quality of the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + */ + public Builder setRequestMetadata(com.google.cloud.contentwarehouse.v1.RequestMetadata value) { + if (requestMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + requestMetadata_ = value; + onChanged(); + } else { + requestMetadataBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control and improve the search quality of the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + */ + public Builder setRequestMetadata( + com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder builderForValue) { + if (requestMetadataBuilder_ == null) { + requestMetadata_ = builderForValue.build(); + onChanged(); + } else { + requestMetadataBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control and improve the search quality of the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + */ + public Builder mergeRequestMetadata( + com.google.cloud.contentwarehouse.v1.RequestMetadata value) { + if (requestMetadataBuilder_ == null) { + if (requestMetadata_ != null) { + requestMetadata_ = + com.google.cloud.contentwarehouse.v1.RequestMetadata.newBuilder(requestMetadata_) + .mergeFrom(value) + .buildPartial(); + } else { + requestMetadata_ = value; + } + onChanged(); + } else { + requestMetadataBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control and improve the search quality of the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + */ + public Builder clearRequestMetadata() { + if (requestMetadataBuilder_ == null) { + requestMetadata_ = null; + onChanged(); + } else { + requestMetadata_ = null; + requestMetadataBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control and improve the search quality of the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + */ + public com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder + getRequestMetadataBuilder() { + + onChanged(); + return getRequestMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control and improve the search quality of the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + */ + public com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder + getRequestMetadataOrBuilder() { + if (requestMetadataBuilder_ != null) { + return requestMetadataBuilder_.getMessageOrBuilder(); + } else { + return requestMetadata_ == null + ? com.google.cloud.contentwarehouse.v1.RequestMetadata.getDefaultInstance() + : requestMetadata_; + } + } + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control and improve the search quality of the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.RequestMetadata, + com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder, + com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder> + getRequestMetadataFieldBuilder() { + if (requestMetadataBuilder_ == null) { + requestMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.RequestMetadata, + com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder, + com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder>( + getRequestMetadata(), getParentForChildren(), isClean()); + requestMetadata_ = null; + } + return requestMetadataBuilder_; + } + + private com.google.cloud.contentwarehouse.v1.DocumentQuery documentQuery_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.DocumentQuery, + com.google.cloud.contentwarehouse.v1.DocumentQuery.Builder, + com.google.cloud.contentwarehouse.v1.DocumentQueryOrBuilder> + documentQueryBuilder_; + /** + * + * + *
+     * Query used to search against documents (keyword, filters, etc.).
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DocumentQuery document_query = 4; + * + * @return Whether the documentQuery field is set. + */ + public boolean hasDocumentQuery() { + return documentQueryBuilder_ != null || documentQuery_ != null; + } + /** + * + * + *
+     * Query used to search against documents (keyword, filters, etc.).
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DocumentQuery document_query = 4; + * + * @return The documentQuery. + */ + public com.google.cloud.contentwarehouse.v1.DocumentQuery getDocumentQuery() { + if (documentQueryBuilder_ == null) { + return documentQuery_ == null + ? com.google.cloud.contentwarehouse.v1.DocumentQuery.getDefaultInstance() + : documentQuery_; + } else { + return documentQueryBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Query used to search against documents (keyword, filters, etc.).
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DocumentQuery document_query = 4; + */ + public Builder setDocumentQuery(com.google.cloud.contentwarehouse.v1.DocumentQuery value) { + if (documentQueryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + documentQuery_ = value; + onChanged(); + } else { + documentQueryBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Query used to search against documents (keyword, filters, etc.).
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DocumentQuery document_query = 4; + */ + public Builder setDocumentQuery( + com.google.cloud.contentwarehouse.v1.DocumentQuery.Builder builderForValue) { + if (documentQueryBuilder_ == null) { + documentQuery_ = builderForValue.build(); + onChanged(); + } else { + documentQueryBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Query used to search against documents (keyword, filters, etc.).
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DocumentQuery document_query = 4; + */ + public Builder mergeDocumentQuery(com.google.cloud.contentwarehouse.v1.DocumentQuery value) { + if (documentQueryBuilder_ == null) { + if (documentQuery_ != null) { + documentQuery_ = + com.google.cloud.contentwarehouse.v1.DocumentQuery.newBuilder(documentQuery_) + .mergeFrom(value) + .buildPartial(); + } else { + documentQuery_ = value; + } + onChanged(); + } else { + documentQueryBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Query used to search against documents (keyword, filters, etc.).
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DocumentQuery document_query = 4; + */ + public Builder clearDocumentQuery() { + if (documentQueryBuilder_ == null) { + documentQuery_ = null; + onChanged(); + } else { + documentQuery_ = null; + documentQueryBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Query used to search against documents (keyword, filters, etc.).
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DocumentQuery document_query = 4; + */ + public com.google.cloud.contentwarehouse.v1.DocumentQuery.Builder getDocumentQueryBuilder() { + + onChanged(); + return getDocumentQueryFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Query used to search against documents (keyword, filters, etc.).
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DocumentQuery document_query = 4; + */ + public com.google.cloud.contentwarehouse.v1.DocumentQueryOrBuilder getDocumentQueryOrBuilder() { + if (documentQueryBuilder_ != null) { + return documentQueryBuilder_.getMessageOrBuilder(); + } else { + return documentQuery_ == null + ? com.google.cloud.contentwarehouse.v1.DocumentQuery.getDefaultInstance() + : documentQuery_; + } + } + /** + * + * + *
+     * Query used to search against documents (keyword, filters, etc.).
+     * 
+ * + * .google.cloud.contentwarehouse.v1.DocumentQuery document_query = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.DocumentQuery, + com.google.cloud.contentwarehouse.v1.DocumentQuery.Builder, + com.google.cloud.contentwarehouse.v1.DocumentQueryOrBuilder> + getDocumentQueryFieldBuilder() { + if (documentQueryBuilder_ == null) { + documentQueryBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.DocumentQuery, + com.google.cloud.contentwarehouse.v1.DocumentQuery.Builder, + com.google.cloud.contentwarehouse.v1.DocumentQueryOrBuilder>( + getDocumentQuery(), getParentForChildren(), isClean()); + documentQuery_ = null; + } + return documentQueryBuilder_; + } + + private int offset_; + /** + * + * + *
+     * An integer that specifies the current offset (that is, starting result
+     * location, amongst the documents deemed by the API as relevant) in search
+     * results. This field is only considered if [page_token][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.page_token] is unset.
+     * The maximum allowed value is 5000. Otherwise an error is thrown.
+     * For example, 0 means to  return results starting from the first matching
+     * document, and 10 means to return from the 11th document. This can be used
+     * for pagination, (for example, pageSize = 10 and offset = 10 means to return
+     * from the second page).
+     * 
+ * + * int32 offset = 5; + * + * @return The offset. + */ + @java.lang.Override + public int getOffset() { + return offset_; + } + /** + * + * + *
+     * An integer that specifies the current offset (that is, starting result
+     * location, amongst the documents deemed by the API as relevant) in search
+     * results. This field is only considered if [page_token][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.page_token] is unset.
+     * The maximum allowed value is 5000. Otherwise an error is thrown.
+     * For example, 0 means to  return results starting from the first matching
+     * document, and 10 means to return from the 11th document. This can be used
+     * for pagination, (for example, pageSize = 10 and offset = 10 means to return
+     * from the second page).
+     * 
+ * + * int32 offset = 5; + * + * @param value The offset to set. + * @return This builder for chaining. + */ + public Builder setOffset(int value) { + + offset_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * An integer that specifies the current offset (that is, starting result
+     * location, amongst the documents deemed by the API as relevant) in search
+     * results. This field is only considered if [page_token][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.page_token] is unset.
+     * The maximum allowed value is 5000. Otherwise an error is thrown.
+     * For example, 0 means to  return results starting from the first matching
+     * document, and 10 means to return from the 11th document. This can be used
+     * for pagination, (for example, pageSize = 10 and offset = 10 means to return
+     * from the second page).
+     * 
+ * + * int32 offset = 5; + * + * @return This builder for chaining. + */ + public Builder clearOffset() { + + offset_ = 0; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * A limit on the number of documents returned in the search results.
+     * Increasing this value above the default value of 10 can increase search
+     * response time. The value can be between 1 and 100.
+     * 
+ * + * int32 page_size = 6; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * A limit on the number of documents returned in the search results.
+     * Increasing this value above the default value of 10 can increase search
+     * response time. The value can be between 1 and 100.
+     * 
+ * + * int32 page_size = 6; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A limit on the number of documents returned in the search results.
+     * Increasing this value above the default value of 10 can increase search
+     * response time. The value can be between 1 and 100.
+     * 
+ * + * int32 page_size = 6; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * The token specifying the current offset within search results.
+     * See [SearchDocumentsResponse.next_page_token][google.cloud.contentwarehouse.v1.SearchDocumentsResponse.next_page_token] for an explanation of how
+     * to obtain the next set of query results.
+     * 
+ * + * string page_token = 7; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The token specifying the current offset within search results.
+     * See [SearchDocumentsResponse.next_page_token][google.cloud.contentwarehouse.v1.SearchDocumentsResponse.next_page_token] for an explanation of how
+     * to obtain the next set of query results.
+     * 
+ * + * string page_token = 7; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The token specifying the current offset within search results.
+     * See [SearchDocumentsResponse.next_page_token][google.cloud.contentwarehouse.v1.SearchDocumentsResponse.next_page_token] for an explanation of how
+     * to obtain the next set of query results.
+     * 
+ * + * string page_token = 7; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The token specifying the current offset within search results.
+     * See [SearchDocumentsResponse.next_page_token][google.cloud.contentwarehouse.v1.SearchDocumentsResponse.next_page_token] for an explanation of how
+     * to obtain the next set of query results.
+     * 
+ * + * string page_token = 7; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The token specifying the current offset within search results.
+     * See [SearchDocumentsResponse.next_page_token][google.cloud.contentwarehouse.v1.SearchDocumentsResponse.next_page_token] for an explanation of how
+     * to obtain the next set of query results.
+     * 
+ * + * string page_token = 7; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * The criteria determining how search results are sorted. For non-empty
+     * query, default is `"relevance desc"`. For empty query, default is
+     * `"upload_date desc"`.
+     * Supported options are:
+     * * `"relevance desc"`: By relevance descending, as determined by the API
+     *   algorithms.
+     * * `"upload_date desc"`: By upload date descending.
+     * * `"upload_date"`: By upload date ascending.
+     * * `"update_date desc"`: By last updated date descending.
+     * * `"update_date"`: By last updated date ascending.
+     * 
+ * + * string order_by = 8; + * + * @return The orderBy. + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The criteria determining how search results are sorted. For non-empty
+     * query, default is `"relevance desc"`. For empty query, default is
+     * `"upload_date desc"`.
+     * Supported options are:
+     * * `"relevance desc"`: By relevance descending, as determined by the API
+     *   algorithms.
+     * * `"upload_date desc"`: By upload date descending.
+     * * `"upload_date"`: By upload date ascending.
+     * * `"update_date desc"`: By last updated date descending.
+     * * `"update_date"`: By last updated date ascending.
+     * 
+ * + * string order_by = 8; + * + * @return The bytes for orderBy. + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The criteria determining how search results are sorted. For non-empty
+     * query, default is `"relevance desc"`. For empty query, default is
+     * `"upload_date desc"`.
+     * Supported options are:
+     * * `"relevance desc"`: By relevance descending, as determined by the API
+     *   algorithms.
+     * * `"upload_date desc"`: By upload date descending.
+     * * `"upload_date"`: By upload date ascending.
+     * * `"update_date desc"`: By last updated date descending.
+     * * `"update_date"`: By last updated date ascending.
+     * 
+ * + * string order_by = 8; + * + * @param value The orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + orderBy_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The criteria determining how search results are sorted. For non-empty
+     * query, default is `"relevance desc"`. For empty query, default is
+     * `"upload_date desc"`.
+     * Supported options are:
+     * * `"relevance desc"`: By relevance descending, as determined by the API
+     *   algorithms.
+     * * `"upload_date desc"`: By upload date descending.
+     * * `"upload_date"`: By upload date ascending.
+     * * `"update_date desc"`: By last updated date descending.
+     * * `"update_date"`: By last updated date ascending.
+     * 
+ * + * string order_by = 8; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + + orderBy_ = getDefaultInstance().getOrderBy(); + onChanged(); + return this; + } + /** + * + * + *
+     * The criteria determining how search results are sorted. For non-empty
+     * query, default is `"relevance desc"`. For empty query, default is
+     * `"upload_date desc"`.
+     * Supported options are:
+     * * `"relevance desc"`: By relevance descending, as determined by the API
+     *   algorithms.
+     * * `"upload_date desc"`: By upload date descending.
+     * * `"upload_date"`: By upload date ascending.
+     * * `"update_date desc"`: By last updated date descending.
+     * * `"update_date"`: By last updated date ascending.
+     * 
+ * + * string order_by = 8; + * + * @param value The bytes for orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + orderBy_ = value; + onChanged(); + return this; + } + + private java.util.List histogramQueries_ = + java.util.Collections.emptyList(); + + private void ensureHistogramQueriesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + histogramQueries_ = + new java.util.ArrayList( + histogramQueries_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.HistogramQuery, + com.google.cloud.contentwarehouse.v1.HistogramQuery.Builder, + com.google.cloud.contentwarehouse.v1.HistogramQueryOrBuilder> + histogramQueriesBuilder_; + + /** + * + * + *
+     * An expression specifying a histogram request against matching
+     * documents. Expression syntax is an aggregation function call with
+     * histogram facets and other options.
+     * The following aggregation functions are supported:
+     * * `count(string_histogram_facet)`: Count the number of matching entities
+     * for each distinct attribute value.
+     * Data types:
+     * * Histogram facet (aka filterable properties): Facet names with format
+     * &lt;schema id&gt;.&lt;facet&gt;. Facets will have the
+     * format of: [a-zA-Z][a-zA-Z0-9_:/-.]. If the facet is a child
+     * facet, then the parent hierarchy needs to be specified separated by
+     * dots in the prefix after the schema id. Thus, the format for a multi-
+     * level facet is: &lt;schema id&gt;.&lt;parent facet name&gt;.
+     * &lt;child facet name&gt;. Example:
+     * schema123.root_parent_facet.middle_facet.child_facet
+     * * DocumentSchemaId: (with no schema id prefix) to get
+     * histograms for each document type (returns the schema id path, e.g.
+     * projects/12345/locations/us-west/documentSchemas/abc123).
+     * Example expression:
+     * * Document type counts:
+     *   count('DocumentSchemaId')
+     * * For schema id, abc123, get the counts for MORTGAGE_TYPE:
+     *   count('abc123.MORTGAGE_TYPE')
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9; + */ + public java.util.List + getHistogramQueriesList() { + if (histogramQueriesBuilder_ == null) { + return java.util.Collections.unmodifiableList(histogramQueries_); + } else { + return histogramQueriesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * An expression specifying a histogram request against matching
+     * documents. Expression syntax is an aggregation function call with
+     * histogram facets and other options.
+     * The following aggregation functions are supported:
+     * * `count(string_histogram_facet)`: Count the number of matching entities
+     * for each distinct attribute value.
+     * Data types:
+     * * Histogram facet (aka filterable properties): Facet names with format
+     * &lt;schema id&gt;.&lt;facet&gt;. Facets will have the
+     * format of: [a-zA-Z][a-zA-Z0-9_:/-.]. If the facet is a child
+     * facet, then the parent hierarchy needs to be specified separated by
+     * dots in the prefix after the schema id. Thus, the format for a multi-
+     * level facet is: &lt;schema id&gt;.&lt;parent facet name&gt;.
+     * &lt;child facet name&gt;. Example:
+     * schema123.root_parent_facet.middle_facet.child_facet
+     * * DocumentSchemaId: (with no schema id prefix) to get
+     * histograms for each document type (returns the schema id path, e.g.
+     * projects/12345/locations/us-west/documentSchemas/abc123).
+     * Example expression:
+     * * Document type counts:
+     *   count('DocumentSchemaId')
+     * * For schema id, abc123, get the counts for MORTGAGE_TYPE:
+     *   count('abc123.MORTGAGE_TYPE')
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9; + */ + public int getHistogramQueriesCount() { + if (histogramQueriesBuilder_ == null) { + return histogramQueries_.size(); + } else { + return histogramQueriesBuilder_.getCount(); + } + } + /** + * + * + *
+     * An expression specifying a histogram request against matching
+     * documents. Expression syntax is an aggregation function call with
+     * histogram facets and other options.
+     * The following aggregation functions are supported:
+     * * `count(string_histogram_facet)`: Count the number of matching entities
+     * for each distinct attribute value.
+     * Data types:
+     * * Histogram facet (aka filterable properties): Facet names with format
+     * &lt;schema id&gt;.&lt;facet&gt;. Facets will have the
+     * format of: [a-zA-Z][a-zA-Z0-9_:/-.]. If the facet is a child
+     * facet, then the parent hierarchy needs to be specified separated by
+     * dots in the prefix after the schema id. Thus, the format for a multi-
+     * level facet is: &lt;schema id&gt;.&lt;parent facet name&gt;.
+     * &lt;child facet name&gt;. Example:
+     * schema123.root_parent_facet.middle_facet.child_facet
+     * * DocumentSchemaId: (with no schema id prefix) to get
+     * histograms for each document type (returns the schema id path, e.g.
+     * projects/12345/locations/us-west/documentSchemas/abc123).
+     * Example expression:
+     * * Document type counts:
+     *   count('DocumentSchemaId')
+     * * For schema id, abc123, get the counts for MORTGAGE_TYPE:
+     *   count('abc123.MORTGAGE_TYPE')
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9; + */ + public com.google.cloud.contentwarehouse.v1.HistogramQuery getHistogramQueries(int index) { + if (histogramQueriesBuilder_ == null) { + return histogramQueries_.get(index); + } else { + return histogramQueriesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * An expression specifying a histogram request against matching
+     * documents. Expression syntax is an aggregation function call with
+     * histogram facets and other options.
+     * The following aggregation functions are supported:
+     * * `count(string_histogram_facet)`: Count the number of matching entities
+     * for each distinct attribute value.
+     * Data types:
+     * * Histogram facet (aka filterable properties): Facet names with format
+     * &lt;schema id&gt;.&lt;facet&gt;. Facets will have the
+     * format of: [a-zA-Z][a-zA-Z0-9_:/-.]. If the facet is a child
+     * facet, then the parent hierarchy needs to be specified separated by
+     * dots in the prefix after the schema id. Thus, the format for a multi-
+     * level facet is: &lt;schema id&gt;.&lt;parent facet name&gt;.
+     * &lt;child facet name&gt;. Example:
+     * schema123.root_parent_facet.middle_facet.child_facet
+     * * DocumentSchemaId: (with no schema id prefix) to get
+     * histograms for each document type (returns the schema id path, e.g.
+     * projects/12345/locations/us-west/documentSchemas/abc123).
+     * Example expression:
+     * * Document type counts:
+     *   count('DocumentSchemaId')
+     * * For schema id, abc123, get the counts for MORTGAGE_TYPE:
+     *   count('abc123.MORTGAGE_TYPE')
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9; + */ + public Builder setHistogramQueries( + int index, com.google.cloud.contentwarehouse.v1.HistogramQuery value) { + if (histogramQueriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureHistogramQueriesIsMutable(); + histogramQueries_.set(index, value); + onChanged(); + } else { + histogramQueriesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * An expression specifying a histogram request against matching
+     * documents. Expression syntax is an aggregation function call with
+     * histogram facets and other options.
+     * The following aggregation functions are supported:
+     * * `count(string_histogram_facet)`: Count the number of matching entities
+     * for each distinct attribute value.
+     * Data types:
+     * * Histogram facet (aka filterable properties): Facet names with format
+     * &lt;schema id&gt;.&lt;facet&gt;. Facets will have the
+     * format of: [a-zA-Z][a-zA-Z0-9_:/-.]. If the facet is a child
+     * facet, then the parent hierarchy needs to be specified separated by
+     * dots in the prefix after the schema id. Thus, the format for a multi-
+     * level facet is: &lt;schema id&gt;.&lt;parent facet name&gt;.
+     * &lt;child facet name&gt;. Example:
+     * schema123.root_parent_facet.middle_facet.child_facet
+     * * DocumentSchemaId: (with no schema id prefix) to get
+     * histograms for each document type (returns the schema id path, e.g.
+     * projects/12345/locations/us-west/documentSchemas/abc123).
+     * Example expression:
+     * * Document type counts:
+     *   count('DocumentSchemaId')
+     * * For schema id, abc123, get the counts for MORTGAGE_TYPE:
+     *   count('abc123.MORTGAGE_TYPE')
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9; + */ + public Builder setHistogramQueries( + int index, com.google.cloud.contentwarehouse.v1.HistogramQuery.Builder builderForValue) { + if (histogramQueriesBuilder_ == null) { + ensureHistogramQueriesIsMutable(); + histogramQueries_.set(index, builderForValue.build()); + onChanged(); + } else { + histogramQueriesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * An expression specifying a histogram request against matching
+     * documents. Expression syntax is an aggregation function call with
+     * histogram facets and other options.
+     * The following aggregation functions are supported:
+     * * `count(string_histogram_facet)`: Count the number of matching entities
+     * for each distinct attribute value.
+     * Data types:
+     * * Histogram facet (aka filterable properties): Facet names with format
+     * &lt;schema id&gt;.&lt;facet&gt;. Facets will have the
+     * format of: [a-zA-Z][a-zA-Z0-9_:/-.]. If the facet is a child
+     * facet, then the parent hierarchy needs to be specified separated by
+     * dots in the prefix after the schema id. Thus, the format for a multi-
+     * level facet is: &lt;schema id&gt;.&lt;parent facet name&gt;.
+     * &lt;child facet name&gt;. Example:
+     * schema123.root_parent_facet.middle_facet.child_facet
+     * * DocumentSchemaId: (with no schema id prefix) to get
+     * histograms for each document type (returns the schema id path, e.g.
+     * projects/12345/locations/us-west/documentSchemas/abc123).
+     * Example expression:
+     * * Document type counts:
+     *   count('DocumentSchemaId')
+     * * For schema id, abc123, get the counts for MORTGAGE_TYPE:
+     *   count('abc123.MORTGAGE_TYPE')
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9; + */ + public Builder addHistogramQueries(com.google.cloud.contentwarehouse.v1.HistogramQuery value) { + if (histogramQueriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureHistogramQueriesIsMutable(); + histogramQueries_.add(value); + onChanged(); + } else { + histogramQueriesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * An expression specifying a histogram request against matching
+     * documents. Expression syntax is an aggregation function call with
+     * histogram facets and other options.
+     * The following aggregation functions are supported:
+     * * `count(string_histogram_facet)`: Count the number of matching entities
+     * for each distinct attribute value.
+     * Data types:
+     * * Histogram facet (aka filterable properties): Facet names with format
+     * &lt;schema id&gt;.&lt;facet&gt;. Facets will have the
+     * format of: [a-zA-Z][a-zA-Z0-9_:/-.]. If the facet is a child
+     * facet, then the parent hierarchy needs to be specified separated by
+     * dots in the prefix after the schema id. Thus, the format for a multi-
+     * level facet is: &lt;schema id&gt;.&lt;parent facet name&gt;.
+     * &lt;child facet name&gt;. Example:
+     * schema123.root_parent_facet.middle_facet.child_facet
+     * * DocumentSchemaId: (with no schema id prefix) to get
+     * histograms for each document type (returns the schema id path, e.g.
+     * projects/12345/locations/us-west/documentSchemas/abc123).
+     * Example expression:
+     * * Document type counts:
+     *   count('DocumentSchemaId')
+     * * For schema id, abc123, get the counts for MORTGAGE_TYPE:
+     *   count('abc123.MORTGAGE_TYPE')
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9; + */ + public Builder addHistogramQueries( + int index, com.google.cloud.contentwarehouse.v1.HistogramQuery value) { + if (histogramQueriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureHistogramQueriesIsMutable(); + histogramQueries_.add(index, value); + onChanged(); + } else { + histogramQueriesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * An expression specifying a histogram request against matching
+     * documents. Expression syntax is an aggregation function call with
+     * histogram facets and other options.
+     * The following aggregation functions are supported:
+     * * `count(string_histogram_facet)`: Count the number of matching entities
+     * for each distinct attribute value.
+     * Data types:
+     * * Histogram facet (aka filterable properties): Facet names with format
+     * &lt;schema id&gt;.&lt;facet&gt;. Facets will have the
+     * format of: [a-zA-Z][a-zA-Z0-9_:/-.]. If the facet is a child
+     * facet, then the parent hierarchy needs to be specified separated by
+     * dots in the prefix after the schema id. Thus, the format for a multi-
+     * level facet is: &lt;schema id&gt;.&lt;parent facet name&gt;.
+     * &lt;child facet name&gt;. Example:
+     * schema123.root_parent_facet.middle_facet.child_facet
+     * * DocumentSchemaId: (with no schema id prefix) to get
+     * histograms for each document type (returns the schema id path, e.g.
+     * projects/12345/locations/us-west/documentSchemas/abc123).
+     * Example expression:
+     * * Document type counts:
+     *   count('DocumentSchemaId')
+     * * For schema id, abc123, get the counts for MORTGAGE_TYPE:
+     *   count('abc123.MORTGAGE_TYPE')
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9; + */ + public Builder addHistogramQueries( + com.google.cloud.contentwarehouse.v1.HistogramQuery.Builder builderForValue) { + if (histogramQueriesBuilder_ == null) { + ensureHistogramQueriesIsMutable(); + histogramQueries_.add(builderForValue.build()); + onChanged(); + } else { + histogramQueriesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * An expression specifying a histogram request against matching
+     * documents. Expression syntax is an aggregation function call with
+     * histogram facets and other options.
+     * The following aggregation functions are supported:
+     * * `count(string_histogram_facet)`: Count the number of matching entities
+     * for each distinct attribute value.
+     * Data types:
+     * * Histogram facet (aka filterable properties): Facet names with format
+     * &lt;schema id&gt;.&lt;facet&gt;. Facets will have the
+     * format of: [a-zA-Z][a-zA-Z0-9_:/-.]. If the facet is a child
+     * facet, then the parent hierarchy needs to be specified separated by
+     * dots in the prefix after the schema id. Thus, the format for a multi-
+     * level facet is: &lt;schema id&gt;.&lt;parent facet name&gt;.
+     * &lt;child facet name&gt;. Example:
+     * schema123.root_parent_facet.middle_facet.child_facet
+     * * DocumentSchemaId: (with no schema id prefix) to get
+     * histograms for each document type (returns the schema id path, e.g.
+     * projects/12345/locations/us-west/documentSchemas/abc123).
+     * Example expression:
+     * * Document type counts:
+     *   count('DocumentSchemaId')
+     * * For schema id, abc123, get the counts for MORTGAGE_TYPE:
+     *   count('abc123.MORTGAGE_TYPE')
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9; + */ + public Builder addHistogramQueries( + int index, com.google.cloud.contentwarehouse.v1.HistogramQuery.Builder builderForValue) { + if (histogramQueriesBuilder_ == null) { + ensureHistogramQueriesIsMutable(); + histogramQueries_.add(index, builderForValue.build()); + onChanged(); + } else { + histogramQueriesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * An expression specifying a histogram request against matching
+     * documents. Expression syntax is an aggregation function call with
+     * histogram facets and other options.
+     * The following aggregation functions are supported:
+     * * `count(string_histogram_facet)`: Count the number of matching entities
+     * for each distinct attribute value.
+     * Data types:
+     * * Histogram facet (aka filterable properties): Facet names with format
+     * &lt;schema id&gt;.&lt;facet&gt;. Facets will have the
+     * format of: [a-zA-Z][a-zA-Z0-9_:/-.]. If the facet is a child
+     * facet, then the parent hierarchy needs to be specified separated by
+     * dots in the prefix after the schema id. Thus, the format for a multi-
+     * level facet is: &lt;schema id&gt;.&lt;parent facet name&gt;.
+     * &lt;child facet name&gt;. Example:
+     * schema123.root_parent_facet.middle_facet.child_facet
+     * * DocumentSchemaId: (with no schema id prefix) to get
+     * histograms for each document type (returns the schema id path, e.g.
+     * projects/12345/locations/us-west/documentSchemas/abc123).
+     * Example expression:
+     * * Document type counts:
+     *   count('DocumentSchemaId')
+     * * For schema id, abc123, get the counts for MORTGAGE_TYPE:
+     *   count('abc123.MORTGAGE_TYPE')
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9; + */ + public Builder addAllHistogramQueries( + java.lang.Iterable values) { + if (histogramQueriesBuilder_ == null) { + ensureHistogramQueriesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, histogramQueries_); + onChanged(); + } else { + histogramQueriesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * An expression specifying a histogram request against matching
+     * documents. Expression syntax is an aggregation function call with
+     * histogram facets and other options.
+     * The following aggregation functions are supported:
+     * * `count(string_histogram_facet)`: Count the number of matching entities
+     * for each distinct attribute value.
+     * Data types:
+     * * Histogram facet (aka filterable properties): Facet names with format
+     * &lt;schema id&gt;.&lt;facet&gt;. Facets will have the
+     * format of: [a-zA-Z][a-zA-Z0-9_:/-.]. If the facet is a child
+     * facet, then the parent hierarchy needs to be specified separated by
+     * dots in the prefix after the schema id. Thus, the format for a multi-
+     * level facet is: &lt;schema id&gt;.&lt;parent facet name&gt;.
+     * &lt;child facet name&gt;. Example:
+     * schema123.root_parent_facet.middle_facet.child_facet
+     * * DocumentSchemaId: (with no schema id prefix) to get
+     * histograms for each document type (returns the schema id path, e.g.
+     * projects/12345/locations/us-west/documentSchemas/abc123).
+     * Example expression:
+     * * Document type counts:
+     *   count('DocumentSchemaId')
+     * * For schema id, abc123, get the counts for MORTGAGE_TYPE:
+     *   count('abc123.MORTGAGE_TYPE')
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9; + */ + public Builder clearHistogramQueries() { + if (histogramQueriesBuilder_ == null) { + histogramQueries_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + histogramQueriesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * An expression specifying a histogram request against matching
+     * documents. Expression syntax is an aggregation function call with
+     * histogram facets and other options.
+     * The following aggregation functions are supported:
+     * * `count(string_histogram_facet)`: Count the number of matching entities
+     * for each distinct attribute value.
+     * Data types:
+     * * Histogram facet (aka filterable properties): Facet names with format
+     * &lt;schema id&gt;.&lt;facet&gt;. Facets will have the
+     * format of: [a-zA-Z][a-zA-Z0-9_:/-.]. If the facet is a child
+     * facet, then the parent hierarchy needs to be specified separated by
+     * dots in the prefix after the schema id. Thus, the format for a multi-
+     * level facet is: &lt;schema id&gt;.&lt;parent facet name&gt;.
+     * &lt;child facet name&gt;. Example:
+     * schema123.root_parent_facet.middle_facet.child_facet
+     * * DocumentSchemaId: (with no schema id prefix) to get
+     * histograms for each document type (returns the schema id path, e.g.
+     * projects/12345/locations/us-west/documentSchemas/abc123).
+     * Example expression:
+     * * Document type counts:
+     *   count('DocumentSchemaId')
+     * * For schema id, abc123, get the counts for MORTGAGE_TYPE:
+     *   count('abc123.MORTGAGE_TYPE')
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9; + */ + public Builder removeHistogramQueries(int index) { + if (histogramQueriesBuilder_ == null) { + ensureHistogramQueriesIsMutable(); + histogramQueries_.remove(index); + onChanged(); + } else { + histogramQueriesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * An expression specifying a histogram request against matching
+     * documents. Expression syntax is an aggregation function call with
+     * histogram facets and other options.
+     * The following aggregation functions are supported:
+     * * `count(string_histogram_facet)`: Count the number of matching entities
+     * for each distinct attribute value.
+     * Data types:
+     * * Histogram facet (aka filterable properties): Facet names with format
+     * &lt;schema id&gt;.&lt;facet&gt;. Facets will have the
+     * format of: [a-zA-Z][a-zA-Z0-9_:/-.]. If the facet is a child
+     * facet, then the parent hierarchy needs to be specified separated by
+     * dots in the prefix after the schema id. Thus, the format for a multi-
+     * level facet is: &lt;schema id&gt;.&lt;parent facet name&gt;.
+     * &lt;child facet name&gt;. Example:
+     * schema123.root_parent_facet.middle_facet.child_facet
+     * * DocumentSchemaId: (with no schema id prefix) to get
+     * histograms for each document type (returns the schema id path, e.g.
+     * projects/12345/locations/us-west/documentSchemas/abc123).
+     * Example expression:
+     * * Document type counts:
+     *   count('DocumentSchemaId')
+     * * For schema id, abc123, get the counts for MORTGAGE_TYPE:
+     *   count('abc123.MORTGAGE_TYPE')
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9; + */ + public com.google.cloud.contentwarehouse.v1.HistogramQuery.Builder getHistogramQueriesBuilder( + int index) { + return getHistogramQueriesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * An expression specifying a histogram request against matching
+     * documents. Expression syntax is an aggregation function call with
+     * histogram facets and other options.
+     * The following aggregation functions are supported:
+     * * `count(string_histogram_facet)`: Count the number of matching entities
+     * for each distinct attribute value.
+     * Data types:
+     * * Histogram facet (aka filterable properties): Facet names with format
+     * &lt;schema id&gt;.&lt;facet&gt;. Facets will have the
+     * format of: [a-zA-Z][a-zA-Z0-9_:/-.]. If the facet is a child
+     * facet, then the parent hierarchy needs to be specified separated by
+     * dots in the prefix after the schema id. Thus, the format for a multi-
+     * level facet is: &lt;schema id&gt;.&lt;parent facet name&gt;.
+     * &lt;child facet name&gt;. Example:
+     * schema123.root_parent_facet.middle_facet.child_facet
+     * * DocumentSchemaId: (with no schema id prefix) to get
+     * histograms for each document type (returns the schema id path, e.g.
+     * projects/12345/locations/us-west/documentSchemas/abc123).
+     * Example expression:
+     * * Document type counts:
+     *   count('DocumentSchemaId')
+     * * For schema id, abc123, get the counts for MORTGAGE_TYPE:
+     *   count('abc123.MORTGAGE_TYPE')
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9; + */ + public com.google.cloud.contentwarehouse.v1.HistogramQueryOrBuilder + getHistogramQueriesOrBuilder(int index) { + if (histogramQueriesBuilder_ == null) { + return histogramQueries_.get(index); + } else { + return histogramQueriesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * An expression specifying a histogram request against matching
+     * documents. Expression syntax is an aggregation function call with
+     * histogram facets and other options.
+     * The following aggregation functions are supported:
+     * * `count(string_histogram_facet)`: Count the number of matching entities
+     * for each distinct attribute value.
+     * Data types:
+     * * Histogram facet (aka filterable properties): Facet names with format
+     * &lt;schema id&gt;.&lt;facet&gt;. Facets will have the
+     * format of: [a-zA-Z][a-zA-Z0-9_:/-.]. If the facet is a child
+     * facet, then the parent hierarchy needs to be specified separated by
+     * dots in the prefix after the schema id. Thus, the format for a multi-
+     * level facet is: &lt;schema id&gt;.&lt;parent facet name&gt;.
+     * &lt;child facet name&gt;. Example:
+     * schema123.root_parent_facet.middle_facet.child_facet
+     * * DocumentSchemaId: (with no schema id prefix) to get
+     * histograms for each document type (returns the schema id path, e.g.
+     * projects/12345/locations/us-west/documentSchemas/abc123).
+     * Example expression:
+     * * Document type counts:
+     *   count('DocumentSchemaId')
+     * * For schema id, abc123, get the counts for MORTGAGE_TYPE:
+     *   count('abc123.MORTGAGE_TYPE')
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9; + */ + public java.util.List + getHistogramQueriesOrBuilderList() { + if (histogramQueriesBuilder_ != null) { + return histogramQueriesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(histogramQueries_); + } + } + /** + * + * + *
+     * An expression specifying a histogram request against matching
+     * documents. Expression syntax is an aggregation function call with
+     * histogram facets and other options.
+     * The following aggregation functions are supported:
+     * * `count(string_histogram_facet)`: Count the number of matching entities
+     * for each distinct attribute value.
+     * Data types:
+     * * Histogram facet (aka filterable properties): Facet names with format
+     * &lt;schema id&gt;.&lt;facet&gt;. Facets will have the
+     * format of: [a-zA-Z][a-zA-Z0-9_:/-.]. If the facet is a child
+     * facet, then the parent hierarchy needs to be specified separated by
+     * dots in the prefix after the schema id. Thus, the format for a multi-
+     * level facet is: &lt;schema id&gt;.&lt;parent facet name&gt;.
+     * &lt;child facet name&gt;. Example:
+     * schema123.root_parent_facet.middle_facet.child_facet
+     * * DocumentSchemaId: (with no schema id prefix) to get
+     * histograms for each document type (returns the schema id path, e.g.
+     * projects/12345/locations/us-west/documentSchemas/abc123).
+     * Example expression:
+     * * Document type counts:
+     *   count('DocumentSchemaId')
+     * * For schema id, abc123, get the counts for MORTGAGE_TYPE:
+     *   count('abc123.MORTGAGE_TYPE')
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9; + */ + public com.google.cloud.contentwarehouse.v1.HistogramQuery.Builder + addHistogramQueriesBuilder() { + return getHistogramQueriesFieldBuilder() + .addBuilder(com.google.cloud.contentwarehouse.v1.HistogramQuery.getDefaultInstance()); + } + /** + * + * + *
+     * An expression specifying a histogram request against matching
+     * documents. Expression syntax is an aggregation function call with
+     * histogram facets and other options.
+     * The following aggregation functions are supported:
+     * * `count(string_histogram_facet)`: Count the number of matching entities
+     * for each distinct attribute value.
+     * Data types:
+     * * Histogram facet (aka filterable properties): Facet names with format
+     * &lt;schema id&gt;.&lt;facet&gt;. Facets will have the
+     * format of: [a-zA-Z][a-zA-Z0-9_:/-.]. If the facet is a child
+     * facet, then the parent hierarchy needs to be specified separated by
+     * dots in the prefix after the schema id. Thus, the format for a multi-
+     * level facet is: &lt;schema id&gt;.&lt;parent facet name&gt;.
+     * &lt;child facet name&gt;. Example:
+     * schema123.root_parent_facet.middle_facet.child_facet
+     * * DocumentSchemaId: (with no schema id prefix) to get
+     * histograms for each document type (returns the schema id path, e.g.
+     * projects/12345/locations/us-west/documentSchemas/abc123).
+     * Example expression:
+     * * Document type counts:
+     *   count('DocumentSchemaId')
+     * * For schema id, abc123, get the counts for MORTGAGE_TYPE:
+     *   count('abc123.MORTGAGE_TYPE')
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9; + */ + public com.google.cloud.contentwarehouse.v1.HistogramQuery.Builder addHistogramQueriesBuilder( + int index) { + return getHistogramQueriesFieldBuilder() + .addBuilder( + index, com.google.cloud.contentwarehouse.v1.HistogramQuery.getDefaultInstance()); + } + /** + * + * + *
+     * An expression specifying a histogram request against matching
+     * documents. Expression syntax is an aggregation function call with
+     * histogram facets and other options.
+     * The following aggregation functions are supported:
+     * * `count(string_histogram_facet)`: Count the number of matching entities
+     * for each distinct attribute value.
+     * Data types:
+     * * Histogram facet (aka filterable properties): Facet names with format
+     * &lt;schema id&gt;.&lt;facet&gt;. Facets will have the
+     * format of: [a-zA-Z][a-zA-Z0-9_:/-.]. If the facet is a child
+     * facet, then the parent hierarchy needs to be specified separated by
+     * dots in the prefix after the schema id. Thus, the format for a multi-
+     * level facet is: &lt;schema id&gt;.&lt;parent facet name&gt;.
+     * &lt;child facet name&gt;. Example:
+     * schema123.root_parent_facet.middle_facet.child_facet
+     * * DocumentSchemaId: (with no schema id prefix) to get
+     * histograms for each document type (returns the schema id path, e.g.
+     * projects/12345/locations/us-west/documentSchemas/abc123).
+     * Example expression:
+     * * Document type counts:
+     *   count('DocumentSchemaId')
+     * * For schema id, abc123, get the counts for MORTGAGE_TYPE:
+     *   count('abc123.MORTGAGE_TYPE')
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9; + */ + public java.util.List + getHistogramQueriesBuilderList() { + return getHistogramQueriesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.HistogramQuery, + com.google.cloud.contentwarehouse.v1.HistogramQuery.Builder, + com.google.cloud.contentwarehouse.v1.HistogramQueryOrBuilder> + getHistogramQueriesFieldBuilder() { + if (histogramQueriesBuilder_ == null) { + histogramQueriesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.HistogramQuery, + com.google.cloud.contentwarehouse.v1.HistogramQuery.Builder, + com.google.cloud.contentwarehouse.v1.HistogramQueryOrBuilder>( + histogramQueries_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + histogramQueries_ = null; + } + return histogramQueriesBuilder_; + } + + private boolean requireTotalSize_; + /** + * + * + *
+     * Optional. Controls if the search document request requires the return of a total size
+     * of matched documents. See [SearchDocumentsResponse.total_size][google.cloud.contentwarehouse.v1.SearchDocumentsResponse.total_size].
+     * Enabling this flag may adversely impact performance. Hint: If this is
+     * used with pagination, set this flag on the initial query but set this
+     * to false on subsequent page calls (keep the total count locally).
+     * Defaults to false.
+     * 
+ * + * bool require_total_size = 10; + * + * @return The requireTotalSize. + */ + @java.lang.Override + public boolean getRequireTotalSize() { + return requireTotalSize_; + } + /** + * + * + *
+     * Optional. Controls if the search document request requires the return of a total size
+     * of matched documents. See [SearchDocumentsResponse.total_size][google.cloud.contentwarehouse.v1.SearchDocumentsResponse.total_size].
+     * Enabling this flag may adversely impact performance. Hint: If this is
+     * used with pagination, set this flag on the initial query but set this
+     * to false on subsequent page calls (keep the total count locally).
+     * Defaults to false.
+     * 
+ * + * bool require_total_size = 10; + * + * @param value The requireTotalSize to set. + * @return This builder for chaining. + */ + public Builder setRequireTotalSize(boolean value) { + + requireTotalSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Controls if the search document request requires the return of a total size
+     * of matched documents. See [SearchDocumentsResponse.total_size][google.cloud.contentwarehouse.v1.SearchDocumentsResponse.total_size].
+     * Enabling this flag may adversely impact performance. Hint: If this is
+     * used with pagination, set this flag on the initial query but set this
+     * to false on subsequent page calls (keep the total count locally).
+     * Defaults to false.
+     * 
+ * + * bool require_total_size = 10; + * + * @return This builder for chaining. + */ + public Builder clearRequireTotalSize() { + + requireTotalSize_ = false; + onChanged(); + return this; + } + + private int qaSizeLimit_; + /** + * + * + *
+     * Experimental, do not use.
+     * The limit on the number of documents returned for the question-answering
+     * feature. To enable the question-answering feature, set
+     * [DocumentQuery].[is_nl_query][] to true.
+     * 
+ * + * int32 qa_size_limit = 11; + * + * @return The qaSizeLimit. + */ + @java.lang.Override + public int getQaSizeLimit() { + return qaSizeLimit_; + } + /** + * + * + *
+     * Experimental, do not use.
+     * The limit on the number of documents returned for the question-answering
+     * feature. To enable the question-answering feature, set
+     * [DocumentQuery].[is_nl_query][] to true.
+     * 
+ * + * int32 qa_size_limit = 11; + * + * @param value The qaSizeLimit to set. + * @return This builder for chaining. + */ + public Builder setQaSizeLimit(int value) { + + qaSizeLimit_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Experimental, do not use.
+     * The limit on the number of documents returned for the question-answering
+     * feature. To enable the question-answering feature, set
+     * [DocumentQuery].[is_nl_query][] to true.
+     * 
+ * + * int32 qa_size_limit = 11; + * + * @return This builder for chaining. + */ + public Builder clearQaSizeLimit() { + + qaSizeLimit_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.SearchDocumentsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.SearchDocumentsRequest) + private static final com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest(); + } + + public static com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SearchDocumentsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/SearchDocumentsRequestOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/SearchDocumentsRequestOrBuilder.java new file mode 100644 index 000000000000..3622b71a336c --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/SearchDocumentsRequestOrBuilder.java @@ -0,0 +1,433 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_service_request.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface SearchDocumentsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.SearchDocumentsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent, which owns this collection of documents.
+   * Format: projects/{project_number}/locations/{location}.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent, which owns this collection of documents.
+   * Format: projects/{project_number}/locations/{location}.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The meta information collected about the end user, used to enforce access
+   * control and improve the search quality of the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + * + * @return Whether the requestMetadata field is set. + */ + boolean hasRequestMetadata(); + /** + * + * + *
+   * The meta information collected about the end user, used to enforce access
+   * control and improve the search quality of the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + * + * @return The requestMetadata. + */ + com.google.cloud.contentwarehouse.v1.RequestMetadata getRequestMetadata(); + /** + * + * + *
+   * The meta information collected about the end user, used to enforce access
+   * control and improve the search quality of the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + */ + com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder getRequestMetadataOrBuilder(); + + /** + * + * + *
+   * Query used to search against documents (keyword, filters, etc.).
+   * 
+ * + * .google.cloud.contentwarehouse.v1.DocumentQuery document_query = 4; + * + * @return Whether the documentQuery field is set. + */ + boolean hasDocumentQuery(); + /** + * + * + *
+   * Query used to search against documents (keyword, filters, etc.).
+   * 
+ * + * .google.cloud.contentwarehouse.v1.DocumentQuery document_query = 4; + * + * @return The documentQuery. + */ + com.google.cloud.contentwarehouse.v1.DocumentQuery getDocumentQuery(); + /** + * + * + *
+   * Query used to search against documents (keyword, filters, etc.).
+   * 
+ * + * .google.cloud.contentwarehouse.v1.DocumentQuery document_query = 4; + */ + com.google.cloud.contentwarehouse.v1.DocumentQueryOrBuilder getDocumentQueryOrBuilder(); + + /** + * + * + *
+   * An integer that specifies the current offset (that is, starting result
+   * location, amongst the documents deemed by the API as relevant) in search
+   * results. This field is only considered if [page_token][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.page_token] is unset.
+   * The maximum allowed value is 5000. Otherwise an error is thrown.
+   * For example, 0 means to  return results starting from the first matching
+   * document, and 10 means to return from the 11th document. This can be used
+   * for pagination, (for example, pageSize = 10 and offset = 10 means to return
+   * from the second page).
+   * 
+ * + * int32 offset = 5; + * + * @return The offset. + */ + int getOffset(); + + /** + * + * + *
+   * A limit on the number of documents returned in the search results.
+   * Increasing this value above the default value of 10 can increase search
+   * response time. The value can be between 1 and 100.
+   * 
+ * + * int32 page_size = 6; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * The token specifying the current offset within search results.
+   * See [SearchDocumentsResponse.next_page_token][google.cloud.contentwarehouse.v1.SearchDocumentsResponse.next_page_token] for an explanation of how
+   * to obtain the next set of query results.
+   * 
+ * + * string page_token = 7; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * The token specifying the current offset within search results.
+   * See [SearchDocumentsResponse.next_page_token][google.cloud.contentwarehouse.v1.SearchDocumentsResponse.next_page_token] for an explanation of how
+   * to obtain the next set of query results.
+   * 
+ * + * string page_token = 7; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * The criteria determining how search results are sorted. For non-empty
+   * query, default is `"relevance desc"`. For empty query, default is
+   * `"upload_date desc"`.
+   * Supported options are:
+   * * `"relevance desc"`: By relevance descending, as determined by the API
+   *   algorithms.
+   * * `"upload_date desc"`: By upload date descending.
+   * * `"upload_date"`: By upload date ascending.
+   * * `"update_date desc"`: By last updated date descending.
+   * * `"update_date"`: By last updated date ascending.
+   * 
+ * + * string order_by = 8; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * The criteria determining how search results are sorted. For non-empty
+   * query, default is `"relevance desc"`. For empty query, default is
+   * `"upload_date desc"`.
+   * Supported options are:
+   * * `"relevance desc"`: By relevance descending, as determined by the API
+   *   algorithms.
+   * * `"upload_date desc"`: By upload date descending.
+   * * `"upload_date"`: By upload date ascending.
+   * * `"update_date desc"`: By last updated date descending.
+   * * `"update_date"`: By last updated date ascending.
+   * 
+ * + * string order_by = 8; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); + + /** + * + * + *
+   * An expression specifying a histogram request against matching
+   * documents. Expression syntax is an aggregation function call with
+   * histogram facets and other options.
+   * The following aggregation functions are supported:
+   * * `count(string_histogram_facet)`: Count the number of matching entities
+   * for each distinct attribute value.
+   * Data types:
+   * * Histogram facet (aka filterable properties): Facet names with format
+   * &lt;schema id&gt;.&lt;facet&gt;. Facets will have the
+   * format of: [a-zA-Z][a-zA-Z0-9_:/-.]. If the facet is a child
+   * facet, then the parent hierarchy needs to be specified separated by
+   * dots in the prefix after the schema id. Thus, the format for a multi-
+   * level facet is: &lt;schema id&gt;.&lt;parent facet name&gt;.
+   * &lt;child facet name&gt;. Example:
+   * schema123.root_parent_facet.middle_facet.child_facet
+   * * DocumentSchemaId: (with no schema id prefix) to get
+   * histograms for each document type (returns the schema id path, e.g.
+   * projects/12345/locations/us-west/documentSchemas/abc123).
+   * Example expression:
+   * * Document type counts:
+   *   count('DocumentSchemaId')
+   * * For schema id, abc123, get the counts for MORTGAGE_TYPE:
+   *   count('abc123.MORTGAGE_TYPE')
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9; + */ + java.util.List getHistogramQueriesList(); + /** + * + * + *
+   * An expression specifying a histogram request against matching
+   * documents. Expression syntax is an aggregation function call with
+   * histogram facets and other options.
+   * The following aggregation functions are supported:
+   * * `count(string_histogram_facet)`: Count the number of matching entities
+   * for each distinct attribute value.
+   * Data types:
+   * * Histogram facet (aka filterable properties): Facet names with format
+   * &lt;schema id&gt;.&lt;facet&gt;. Facets will have the
+   * format of: [a-zA-Z][a-zA-Z0-9_:/-.]. If the facet is a child
+   * facet, then the parent hierarchy needs to be specified separated by
+   * dots in the prefix after the schema id. Thus, the format for a multi-
+   * level facet is: &lt;schema id&gt;.&lt;parent facet name&gt;.
+   * &lt;child facet name&gt;. Example:
+   * schema123.root_parent_facet.middle_facet.child_facet
+   * * DocumentSchemaId: (with no schema id prefix) to get
+   * histograms for each document type (returns the schema id path, e.g.
+   * projects/12345/locations/us-west/documentSchemas/abc123).
+   * Example expression:
+   * * Document type counts:
+   *   count('DocumentSchemaId')
+   * * For schema id, abc123, get the counts for MORTGAGE_TYPE:
+   *   count('abc123.MORTGAGE_TYPE')
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9; + */ + com.google.cloud.contentwarehouse.v1.HistogramQuery getHistogramQueries(int index); + /** + * + * + *
+   * An expression specifying a histogram request against matching
+   * documents. Expression syntax is an aggregation function call with
+   * histogram facets and other options.
+   * The following aggregation functions are supported:
+   * * `count(string_histogram_facet)`: Count the number of matching entities
+   * for each distinct attribute value.
+   * Data types:
+   * * Histogram facet (aka filterable properties): Facet names with format
+   * &lt;schema id&gt;.&lt;facet&gt;. Facets will have the
+   * format of: [a-zA-Z][a-zA-Z0-9_:/-.]. If the facet is a child
+   * facet, then the parent hierarchy needs to be specified separated by
+   * dots in the prefix after the schema id. Thus, the format for a multi-
+   * level facet is: &lt;schema id&gt;.&lt;parent facet name&gt;.
+   * &lt;child facet name&gt;. Example:
+   * schema123.root_parent_facet.middle_facet.child_facet
+   * * DocumentSchemaId: (with no schema id prefix) to get
+   * histograms for each document type (returns the schema id path, e.g.
+   * projects/12345/locations/us-west/documentSchemas/abc123).
+   * Example expression:
+   * * Document type counts:
+   *   count('DocumentSchemaId')
+   * * For schema id, abc123, get the counts for MORTGAGE_TYPE:
+   *   count('abc123.MORTGAGE_TYPE')
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9; + */ + int getHistogramQueriesCount(); + /** + * + * + *
+   * An expression specifying a histogram request against matching
+   * documents. Expression syntax is an aggregation function call with
+   * histogram facets and other options.
+   * The following aggregation functions are supported:
+   * * `count(string_histogram_facet)`: Count the number of matching entities
+   * for each distinct attribute value.
+   * Data types:
+   * * Histogram facet (aka filterable properties): Facet names with format
+   * &lt;schema id&gt;.&lt;facet&gt;. Facets will have the
+   * format of: [a-zA-Z][a-zA-Z0-9_:/-.]. If the facet is a child
+   * facet, then the parent hierarchy needs to be specified separated by
+   * dots in the prefix after the schema id. Thus, the format for a multi-
+   * level facet is: &lt;schema id&gt;.&lt;parent facet name&gt;.
+   * &lt;child facet name&gt;. Example:
+   * schema123.root_parent_facet.middle_facet.child_facet
+   * * DocumentSchemaId: (with no schema id prefix) to get
+   * histograms for each document type (returns the schema id path, e.g.
+   * projects/12345/locations/us-west/documentSchemas/abc123).
+   * Example expression:
+   * * Document type counts:
+   *   count('DocumentSchemaId')
+   * * For schema id, abc123, get the counts for MORTGAGE_TYPE:
+   *   count('abc123.MORTGAGE_TYPE')
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9; + */ + java.util.List + getHistogramQueriesOrBuilderList(); + /** + * + * + *
+   * An expression specifying a histogram request against matching
+   * documents. Expression syntax is an aggregation function call with
+   * histogram facets and other options.
+   * The following aggregation functions are supported:
+   * * `count(string_histogram_facet)`: Count the number of matching entities
+   * for each distinct attribute value.
+   * Data types:
+   * * Histogram facet (aka filterable properties): Facet names with format
+   * &lt;schema id&gt;.&lt;facet&gt;. Facets will have the
+   * format of: [a-zA-Z][a-zA-Z0-9_:/-.]. If the facet is a child
+   * facet, then the parent hierarchy needs to be specified separated by
+   * dots in the prefix after the schema id. Thus, the format for a multi-
+   * level facet is: &lt;schema id&gt;.&lt;parent facet name&gt;.
+   * &lt;child facet name&gt;. Example:
+   * schema123.root_parent_facet.middle_facet.child_facet
+   * * DocumentSchemaId: (with no schema id prefix) to get
+   * histograms for each document type (returns the schema id path, e.g.
+   * projects/12345/locations/us-west/documentSchemas/abc123).
+   * Example expression:
+   * * Document type counts:
+   *   count('DocumentSchemaId')
+   * * For schema id, abc123, get the counts for MORTGAGE_TYPE:
+   *   count('abc123.MORTGAGE_TYPE')
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9; + */ + com.google.cloud.contentwarehouse.v1.HistogramQueryOrBuilder getHistogramQueriesOrBuilder( + int index); + + /** + * + * + *
+   * Optional. Controls if the search document request requires the return of a total size
+   * of matched documents. See [SearchDocumentsResponse.total_size][google.cloud.contentwarehouse.v1.SearchDocumentsResponse.total_size].
+   * Enabling this flag may adversely impact performance. Hint: If this is
+   * used with pagination, set this flag on the initial query but set this
+   * to false on subsequent page calls (keep the total count locally).
+   * Defaults to false.
+   * 
+ * + * bool require_total_size = 10; + * + * @return The requireTotalSize. + */ + boolean getRequireTotalSize(); + + /** + * + * + *
+   * Experimental, do not use.
+   * The limit on the number of documents returned for the question-answering
+   * feature. To enable the question-answering feature, set
+   * [DocumentQuery].[is_nl_query][] to true.
+   * 
+ * + * int32 qa_size_limit = 11; + * + * @return The qaSizeLimit. + */ + int getQaSizeLimit(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/SearchDocumentsResponse.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/SearchDocumentsResponse.java new file mode 100644 index 000000000000..f07192c595fb --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/SearchDocumentsResponse.java @@ -0,0 +1,3547 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_service.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Response message for DocumentService.SearchDocuments.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.SearchDocumentsResponse} + */ +public final class SearchDocumentsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.SearchDocumentsResponse) + SearchDocumentsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use SearchDocumentsResponse.newBuilder() to construct. + private SearchDocumentsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SearchDocumentsResponse() { + matchingDocuments_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + histogramQueryResults_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SearchDocumentsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceProto + .internal_static_google_cloud_contentwarehouse_v1_SearchDocumentsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceProto + .internal_static_google_cloud_contentwarehouse_v1_SearchDocumentsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.class, + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.Builder.class); + } + + public interface MatchingDocumentOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Document that matches the specified [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest].
+     * This document only contains indexed metadata information.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.Document document = 1; + * + * @return Whether the document field is set. + */ + boolean hasDocument(); + /** + * + * + *
+     * Document that matches the specified [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest].
+     * This document only contains indexed metadata information.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.Document document = 1; + * + * @return The document. + */ + com.google.cloud.contentwarehouse.v1.Document getDocument(); + /** + * + * + *
+     * Document that matches the specified [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest].
+     * This document only contains indexed metadata information.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.Document document = 1; + */ + com.google.cloud.contentwarehouse.v1.DocumentOrBuilder getDocumentOrBuilder(); + + /** + * + * + *
+     * Contains snippets of text from the document full raw text that most
+     * closely match a search query's keywords, if available. All HTML tags in
+     * the original fields are stripped when returned in this field, and
+     * matching query keywords are enclosed in HTML bold tags.
+     * If the question-answering feature is enabled, this field will instead
+     * contain a snippet that answers the user's natural-language query. No HTML
+     * bold tags will be present, and highlights in the answer snippet can be
+     * found in [QAResult.highlights][google.cloud.contentwarehouse.v1.QAResult.highlights].
+     * 
+ * + * string search_text_snippet = 2; + * + * @return The searchTextSnippet. + */ + java.lang.String getSearchTextSnippet(); + /** + * + * + *
+     * Contains snippets of text from the document full raw text that most
+     * closely match a search query's keywords, if available. All HTML tags in
+     * the original fields are stripped when returned in this field, and
+     * matching query keywords are enclosed in HTML bold tags.
+     * If the question-answering feature is enabled, this field will instead
+     * contain a snippet that answers the user's natural-language query. No HTML
+     * bold tags will be present, and highlights in the answer snippet can be
+     * found in [QAResult.highlights][google.cloud.contentwarehouse.v1.QAResult.highlights].
+     * 
+ * + * string search_text_snippet = 2; + * + * @return The bytes for searchTextSnippet. + */ + com.google.protobuf.ByteString getSearchTextSnippetBytes(); + + /** + * + * + *
+     * Experimental.
+     * Additional result info if the question-answering feature is enabled.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.QAResult qa_result = 3; + * + * @return Whether the qaResult field is set. + */ + boolean hasQaResult(); + /** + * + * + *
+     * Experimental.
+     * Additional result info if the question-answering feature is enabled.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.QAResult qa_result = 3; + * + * @return The qaResult. + */ + com.google.cloud.contentwarehouse.v1.QAResult getQaResult(); + /** + * + * + *
+     * Experimental.
+     * Additional result info if the question-answering feature is enabled.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.QAResult qa_result = 3; + */ + com.google.cloud.contentwarehouse.v1.QAResultOrBuilder getQaResultOrBuilder(); + } + /** + * + * + *
+   * Document entry with metadata inside [SearchDocumentsResponse][google.cloud.contentwarehouse.v1.SearchDocumentsResponse]
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument} + */ + public static final class MatchingDocument extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument) + MatchingDocumentOrBuilder { + private static final long serialVersionUID = 0L; + // Use MatchingDocument.newBuilder() to construct. + private MatchingDocument(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private MatchingDocument() { + searchTextSnippet_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new MatchingDocument(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceProto + .internal_static_google_cloud_contentwarehouse_v1_SearchDocumentsResponse_MatchingDocument_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceProto + .internal_static_google_cloud_contentwarehouse_v1_SearchDocumentsResponse_MatchingDocument_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument.class, + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument.Builder + .class); + } + + public static final int DOCUMENT_FIELD_NUMBER = 1; + private com.google.cloud.contentwarehouse.v1.Document document_; + /** + * + * + *
+     * Document that matches the specified [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest].
+     * This document only contains indexed metadata information.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.Document document = 1; + * + * @return Whether the document field is set. + */ + @java.lang.Override + public boolean hasDocument() { + return document_ != null; + } + /** + * + * + *
+     * Document that matches the specified [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest].
+     * This document only contains indexed metadata information.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.Document document = 1; + * + * @return The document. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.Document getDocument() { + return document_ == null + ? com.google.cloud.contentwarehouse.v1.Document.getDefaultInstance() + : document_; + } + /** + * + * + *
+     * Document that matches the specified [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest].
+     * This document only contains indexed metadata information.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.Document document = 1; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DocumentOrBuilder getDocumentOrBuilder() { + return getDocument(); + } + + public static final int SEARCH_TEXT_SNIPPET_FIELD_NUMBER = 2; + private volatile java.lang.Object searchTextSnippet_; + /** + * + * + *
+     * Contains snippets of text from the document full raw text that most
+     * closely match a search query's keywords, if available. All HTML tags in
+     * the original fields are stripped when returned in this field, and
+     * matching query keywords are enclosed in HTML bold tags.
+     * If the question-answering feature is enabled, this field will instead
+     * contain a snippet that answers the user's natural-language query. No HTML
+     * bold tags will be present, and highlights in the answer snippet can be
+     * found in [QAResult.highlights][google.cloud.contentwarehouse.v1.QAResult.highlights].
+     * 
+ * + * string search_text_snippet = 2; + * + * @return The searchTextSnippet. + */ + @java.lang.Override + public java.lang.String getSearchTextSnippet() { + java.lang.Object ref = searchTextSnippet_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + searchTextSnippet_ = s; + return s; + } + } + /** + * + * + *
+     * Contains snippets of text from the document full raw text that most
+     * closely match a search query's keywords, if available. All HTML tags in
+     * the original fields are stripped when returned in this field, and
+     * matching query keywords are enclosed in HTML bold tags.
+     * If the question-answering feature is enabled, this field will instead
+     * contain a snippet that answers the user's natural-language query. No HTML
+     * bold tags will be present, and highlights in the answer snippet can be
+     * found in [QAResult.highlights][google.cloud.contentwarehouse.v1.QAResult.highlights].
+     * 
+ * + * string search_text_snippet = 2; + * + * @return The bytes for searchTextSnippet. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSearchTextSnippetBytes() { + java.lang.Object ref = searchTextSnippet_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + searchTextSnippet_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int QA_RESULT_FIELD_NUMBER = 3; + private com.google.cloud.contentwarehouse.v1.QAResult qaResult_; + /** + * + * + *
+     * Experimental.
+     * Additional result info if the question-answering feature is enabled.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.QAResult qa_result = 3; + * + * @return Whether the qaResult field is set. + */ + @java.lang.Override + public boolean hasQaResult() { + return qaResult_ != null; + } + /** + * + * + *
+     * Experimental.
+     * Additional result info if the question-answering feature is enabled.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.QAResult qa_result = 3; + * + * @return The qaResult. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.QAResult getQaResult() { + return qaResult_ == null + ? com.google.cloud.contentwarehouse.v1.QAResult.getDefaultInstance() + : qaResult_; + } + /** + * + * + *
+     * Experimental.
+     * Additional result info if the question-answering feature is enabled.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.QAResult qa_result = 3; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.QAResultOrBuilder getQaResultOrBuilder() { + return getQaResult(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (document_ != null) { + output.writeMessage(1, getDocument()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(searchTextSnippet_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, searchTextSnippet_); + } + if (qaResult_ != null) { + output.writeMessage(3, getQaResult()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (document_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getDocument()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(searchTextSnippet_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, searchTextSnippet_); + } + if (qaResult_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getQaResult()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument other = + (com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument) obj; + + if (hasDocument() != other.hasDocument()) return false; + if (hasDocument()) { + if (!getDocument().equals(other.getDocument())) return false; + } + if (!getSearchTextSnippet().equals(other.getSearchTextSnippet())) return false; + if (hasQaResult() != other.hasQaResult()) return false; + if (hasQaResult()) { + if (!getQaResult().equals(other.getQaResult())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasDocument()) { + hash = (37 * hash) + DOCUMENT_FIELD_NUMBER; + hash = (53 * hash) + getDocument().hashCode(); + } + hash = (37 * hash) + SEARCH_TEXT_SNIPPET_FIELD_NUMBER; + hash = (53 * hash) + getSearchTextSnippet().hashCode(); + if (hasQaResult()) { + hash = (37 * hash) + QA_RESULT_FIELD_NUMBER; + hash = (53 * hash) + getQaResult().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Document entry with metadata inside [SearchDocumentsResponse][google.cloud.contentwarehouse.v1.SearchDocumentsResponse]
+     * 
+ * + * Protobuf type {@code + * google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument) + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocumentOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceProto + .internal_static_google_cloud_contentwarehouse_v1_SearchDocumentsResponse_MatchingDocument_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceProto + .internal_static_google_cloud_contentwarehouse_v1_SearchDocumentsResponse_MatchingDocument_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument.class, + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument + .Builder.class); + } + + // Construct using + // com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (documentBuilder_ == null) { + document_ = null; + } else { + document_ = null; + documentBuilder_ = null; + } + searchTextSnippet_ = ""; + + if (qaResultBuilder_ == null) { + qaResult_ = null; + } else { + qaResult_ = null; + qaResultBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceProto + .internal_static_google_cloud_contentwarehouse_v1_SearchDocumentsResponse_MatchingDocument_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument + getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument build() { + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument + buildPartial() { + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument result = + new com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument(this); + if (documentBuilder_ == null) { + result.document_ = document_; + } else { + result.document_ = documentBuilder_.build(); + } + result.searchTextSnippet_ = searchTextSnippet_; + if (qaResultBuilder_ == null) { + result.qaResult_ = qaResult_; + } else { + result.qaResult_ = qaResultBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument) { + return mergeFrom( + (com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument other) { + if (other + == com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument + .getDefaultInstance()) return this; + if (other.hasDocument()) { + mergeDocument(other.getDocument()); + } + if (!other.getSearchTextSnippet().isEmpty()) { + searchTextSnippet_ = other.searchTextSnippet_; + onChanged(); + } + if (other.hasQaResult()) { + mergeQaResult(other.getQaResult()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getDocumentFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 18: + { + searchTextSnippet_ = input.readStringRequireUtf8(); + + break; + } // case 18 + case 26: + { + input.readMessage(getQaResultFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private com.google.cloud.contentwarehouse.v1.Document document_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.Document, + com.google.cloud.contentwarehouse.v1.Document.Builder, + com.google.cloud.contentwarehouse.v1.DocumentOrBuilder> + documentBuilder_; + /** + * + * + *
+       * Document that matches the specified [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest].
+       * This document only contains indexed metadata information.
+       * 
+ * + * .google.cloud.contentwarehouse.v1.Document document = 1; + * + * @return Whether the document field is set. + */ + public boolean hasDocument() { + return documentBuilder_ != null || document_ != null; + } + /** + * + * + *
+       * Document that matches the specified [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest].
+       * This document only contains indexed metadata information.
+       * 
+ * + * .google.cloud.contentwarehouse.v1.Document document = 1; + * + * @return The document. + */ + public com.google.cloud.contentwarehouse.v1.Document getDocument() { + if (documentBuilder_ == null) { + return document_ == null + ? com.google.cloud.contentwarehouse.v1.Document.getDefaultInstance() + : document_; + } else { + return documentBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Document that matches the specified [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest].
+       * This document only contains indexed metadata information.
+       * 
+ * + * .google.cloud.contentwarehouse.v1.Document document = 1; + */ + public Builder setDocument(com.google.cloud.contentwarehouse.v1.Document value) { + if (documentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + document_ = value; + onChanged(); + } else { + documentBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * Document that matches the specified [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest].
+       * This document only contains indexed metadata information.
+       * 
+ * + * .google.cloud.contentwarehouse.v1.Document document = 1; + */ + public Builder setDocument( + com.google.cloud.contentwarehouse.v1.Document.Builder builderForValue) { + if (documentBuilder_ == null) { + document_ = builderForValue.build(); + onChanged(); + } else { + documentBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * Document that matches the specified [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest].
+       * This document only contains indexed metadata information.
+       * 
+ * + * .google.cloud.contentwarehouse.v1.Document document = 1; + */ + public Builder mergeDocument(com.google.cloud.contentwarehouse.v1.Document value) { + if (documentBuilder_ == null) { + if (document_ != null) { + document_ = + com.google.cloud.contentwarehouse.v1.Document.newBuilder(document_) + .mergeFrom(value) + .buildPartial(); + } else { + document_ = value; + } + onChanged(); + } else { + documentBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * Document that matches the specified [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest].
+       * This document only contains indexed metadata information.
+       * 
+ * + * .google.cloud.contentwarehouse.v1.Document document = 1; + */ + public Builder clearDocument() { + if (documentBuilder_ == null) { + document_ = null; + onChanged(); + } else { + document_ = null; + documentBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * Document that matches the specified [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest].
+       * This document only contains indexed metadata information.
+       * 
+ * + * .google.cloud.contentwarehouse.v1.Document document = 1; + */ + public com.google.cloud.contentwarehouse.v1.Document.Builder getDocumentBuilder() { + + onChanged(); + return getDocumentFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Document that matches the specified [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest].
+       * This document only contains indexed metadata information.
+       * 
+ * + * .google.cloud.contentwarehouse.v1.Document document = 1; + */ + public com.google.cloud.contentwarehouse.v1.DocumentOrBuilder getDocumentOrBuilder() { + if (documentBuilder_ != null) { + return documentBuilder_.getMessageOrBuilder(); + } else { + return document_ == null + ? com.google.cloud.contentwarehouse.v1.Document.getDefaultInstance() + : document_; + } + } + /** + * + * + *
+       * Document that matches the specified [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest].
+       * This document only contains indexed metadata information.
+       * 
+ * + * .google.cloud.contentwarehouse.v1.Document document = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.Document, + com.google.cloud.contentwarehouse.v1.Document.Builder, + com.google.cloud.contentwarehouse.v1.DocumentOrBuilder> + getDocumentFieldBuilder() { + if (documentBuilder_ == null) { + documentBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.Document, + com.google.cloud.contentwarehouse.v1.Document.Builder, + com.google.cloud.contentwarehouse.v1.DocumentOrBuilder>( + getDocument(), getParentForChildren(), isClean()); + document_ = null; + } + return documentBuilder_; + } + + private java.lang.Object searchTextSnippet_ = ""; + /** + * + * + *
+       * Contains snippets of text from the document full raw text that most
+       * closely match a search query's keywords, if available. All HTML tags in
+       * the original fields are stripped when returned in this field, and
+       * matching query keywords are enclosed in HTML bold tags.
+       * If the question-answering feature is enabled, this field will instead
+       * contain a snippet that answers the user's natural-language query. No HTML
+       * bold tags will be present, and highlights in the answer snippet can be
+       * found in [QAResult.highlights][google.cloud.contentwarehouse.v1.QAResult.highlights].
+       * 
+ * + * string search_text_snippet = 2; + * + * @return The searchTextSnippet. + */ + public java.lang.String getSearchTextSnippet() { + java.lang.Object ref = searchTextSnippet_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + searchTextSnippet_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Contains snippets of text from the document full raw text that most
+       * closely match a search query's keywords, if available. All HTML tags in
+       * the original fields are stripped when returned in this field, and
+       * matching query keywords are enclosed in HTML bold tags.
+       * If the question-answering feature is enabled, this field will instead
+       * contain a snippet that answers the user's natural-language query. No HTML
+       * bold tags will be present, and highlights in the answer snippet can be
+       * found in [QAResult.highlights][google.cloud.contentwarehouse.v1.QAResult.highlights].
+       * 
+ * + * string search_text_snippet = 2; + * + * @return The bytes for searchTextSnippet. + */ + public com.google.protobuf.ByteString getSearchTextSnippetBytes() { + java.lang.Object ref = searchTextSnippet_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + searchTextSnippet_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Contains snippets of text from the document full raw text that most
+       * closely match a search query's keywords, if available. All HTML tags in
+       * the original fields are stripped when returned in this field, and
+       * matching query keywords are enclosed in HTML bold tags.
+       * If the question-answering feature is enabled, this field will instead
+       * contain a snippet that answers the user's natural-language query. No HTML
+       * bold tags will be present, and highlights in the answer snippet can be
+       * found in [QAResult.highlights][google.cloud.contentwarehouse.v1.QAResult.highlights].
+       * 
+ * + * string search_text_snippet = 2; + * + * @param value The searchTextSnippet to set. + * @return This builder for chaining. + */ + public Builder setSearchTextSnippet(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + searchTextSnippet_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Contains snippets of text from the document full raw text that most
+       * closely match a search query's keywords, if available. All HTML tags in
+       * the original fields are stripped when returned in this field, and
+       * matching query keywords are enclosed in HTML bold tags.
+       * If the question-answering feature is enabled, this field will instead
+       * contain a snippet that answers the user's natural-language query. No HTML
+       * bold tags will be present, and highlights in the answer snippet can be
+       * found in [QAResult.highlights][google.cloud.contentwarehouse.v1.QAResult.highlights].
+       * 
+ * + * string search_text_snippet = 2; + * + * @return This builder for chaining. + */ + public Builder clearSearchTextSnippet() { + + searchTextSnippet_ = getDefaultInstance().getSearchTextSnippet(); + onChanged(); + return this; + } + /** + * + * + *
+       * Contains snippets of text from the document full raw text that most
+       * closely match a search query's keywords, if available. All HTML tags in
+       * the original fields are stripped when returned in this field, and
+       * matching query keywords are enclosed in HTML bold tags.
+       * If the question-answering feature is enabled, this field will instead
+       * contain a snippet that answers the user's natural-language query. No HTML
+       * bold tags will be present, and highlights in the answer snippet can be
+       * found in [QAResult.highlights][google.cloud.contentwarehouse.v1.QAResult.highlights].
+       * 
+ * + * string search_text_snippet = 2; + * + * @param value The bytes for searchTextSnippet to set. + * @return This builder for chaining. + */ + public Builder setSearchTextSnippetBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + searchTextSnippet_ = value; + onChanged(); + return this; + } + + private com.google.cloud.contentwarehouse.v1.QAResult qaResult_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.QAResult, + com.google.cloud.contentwarehouse.v1.QAResult.Builder, + com.google.cloud.contentwarehouse.v1.QAResultOrBuilder> + qaResultBuilder_; + /** + * + * + *
+       * Experimental.
+       * Additional result info if the question-answering feature is enabled.
+       * 
+ * + * .google.cloud.contentwarehouse.v1.QAResult qa_result = 3; + * + * @return Whether the qaResult field is set. + */ + public boolean hasQaResult() { + return qaResultBuilder_ != null || qaResult_ != null; + } + /** + * + * + *
+       * Experimental.
+       * Additional result info if the question-answering feature is enabled.
+       * 
+ * + * .google.cloud.contentwarehouse.v1.QAResult qa_result = 3; + * + * @return The qaResult. + */ + public com.google.cloud.contentwarehouse.v1.QAResult getQaResult() { + if (qaResultBuilder_ == null) { + return qaResult_ == null + ? com.google.cloud.contentwarehouse.v1.QAResult.getDefaultInstance() + : qaResult_; + } else { + return qaResultBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Experimental.
+       * Additional result info if the question-answering feature is enabled.
+       * 
+ * + * .google.cloud.contentwarehouse.v1.QAResult qa_result = 3; + */ + public Builder setQaResult(com.google.cloud.contentwarehouse.v1.QAResult value) { + if (qaResultBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + qaResult_ = value; + onChanged(); + } else { + qaResultBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * Experimental.
+       * Additional result info if the question-answering feature is enabled.
+       * 
+ * + * .google.cloud.contentwarehouse.v1.QAResult qa_result = 3; + */ + public Builder setQaResult( + com.google.cloud.contentwarehouse.v1.QAResult.Builder builderForValue) { + if (qaResultBuilder_ == null) { + qaResult_ = builderForValue.build(); + onChanged(); + } else { + qaResultBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * Experimental.
+       * Additional result info if the question-answering feature is enabled.
+       * 
+ * + * .google.cloud.contentwarehouse.v1.QAResult qa_result = 3; + */ + public Builder mergeQaResult(com.google.cloud.contentwarehouse.v1.QAResult value) { + if (qaResultBuilder_ == null) { + if (qaResult_ != null) { + qaResult_ = + com.google.cloud.contentwarehouse.v1.QAResult.newBuilder(qaResult_) + .mergeFrom(value) + .buildPartial(); + } else { + qaResult_ = value; + } + onChanged(); + } else { + qaResultBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * Experimental.
+       * Additional result info if the question-answering feature is enabled.
+       * 
+ * + * .google.cloud.contentwarehouse.v1.QAResult qa_result = 3; + */ + public Builder clearQaResult() { + if (qaResultBuilder_ == null) { + qaResult_ = null; + onChanged(); + } else { + qaResult_ = null; + qaResultBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * Experimental.
+       * Additional result info if the question-answering feature is enabled.
+       * 
+ * + * .google.cloud.contentwarehouse.v1.QAResult qa_result = 3; + */ + public com.google.cloud.contentwarehouse.v1.QAResult.Builder getQaResultBuilder() { + + onChanged(); + return getQaResultFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Experimental.
+       * Additional result info if the question-answering feature is enabled.
+       * 
+ * + * .google.cloud.contentwarehouse.v1.QAResult qa_result = 3; + */ + public com.google.cloud.contentwarehouse.v1.QAResultOrBuilder getQaResultOrBuilder() { + if (qaResultBuilder_ != null) { + return qaResultBuilder_.getMessageOrBuilder(); + } else { + return qaResult_ == null + ? com.google.cloud.contentwarehouse.v1.QAResult.getDefaultInstance() + : qaResult_; + } + } + /** + * + * + *
+       * Experimental.
+       * Additional result info if the question-answering feature is enabled.
+       * 
+ * + * .google.cloud.contentwarehouse.v1.QAResult qa_result = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.QAResult, + com.google.cloud.contentwarehouse.v1.QAResult.Builder, + com.google.cloud.contentwarehouse.v1.QAResultOrBuilder> + getQaResultFieldBuilder() { + if (qaResultBuilder_ == null) { + qaResultBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.QAResult, + com.google.cloud.contentwarehouse.v1.QAResult.Builder, + com.google.cloud.contentwarehouse.v1.QAResultOrBuilder>( + getQaResult(), getParentForChildren(), isClean()); + qaResult_ = null; + } + return qaResultBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument) + private static final com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse + .MatchingDocument + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument(); + } + + public static com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MatchingDocument parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int MATCHING_DOCUMENTS_FIELD_NUMBER = 1; + private java.util.List< + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument> + matchingDocuments_; + /** + * + * + *
+   * The document entities that match the specified [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest].
+   * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument matching_documents = 1; + * + */ + @java.lang.Override + public java.util.List< + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument> + getMatchingDocumentsList() { + return matchingDocuments_; + } + /** + * + * + *
+   * The document entities that match the specified [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest].
+   * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument matching_documents = 1; + * + */ + @java.lang.Override + public java.util.List< + ? extends + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse + .MatchingDocumentOrBuilder> + getMatchingDocumentsOrBuilderList() { + return matchingDocuments_; + } + /** + * + * + *
+   * The document entities that match the specified [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest].
+   * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument matching_documents = 1; + * + */ + @java.lang.Override + public int getMatchingDocumentsCount() { + return matchingDocuments_.size(); + } + /** + * + * + *
+   * The document entities that match the specified [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest].
+   * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument matching_documents = 1; + * + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument + getMatchingDocuments(int index) { + return matchingDocuments_.get(index); + } + /** + * + * + *
+   * The document entities that match the specified [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest].
+   * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument matching_documents = 1; + * + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocumentOrBuilder + getMatchingDocumentsOrBuilder(int index) { + return matchingDocuments_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * The token that specifies the starting position of the next page of results.
+   * This field is empty if there are no more results.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * The token that specifies the starting position of the next page of results.
+   * This field is empty if there are no more results.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TOTAL_SIZE_FIELD_NUMBER = 3; + private int totalSize_; + /** + * + * + *
+   * The total number of matched documents which is available only if the client
+   * set [SearchDocumentsRequest.require_total_size][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.require_total_size] to `true`. Otherwise, the
+   * value will be `-1`. `total_size` will max at &quot;100,000&quot;. If this
+   * is returned, then it can be assumed that the count is equal to or greater
+   * than 100,000. Typically a UI would handle this condition by displaying
+   * &quot;of many&quot;, for example: &quot;Displaying 10 of many&quot;.
+   * 
+ * + * int32 total_size = 3; + * + * @return The totalSize. + */ + @java.lang.Override + public int getTotalSize() { + return totalSize_; + } + + public static final int METADATA_FIELD_NUMBER = 4; + private com.google.cloud.contentwarehouse.v1.ResponseMetadata metadata_; + /** + * + * + *
+   * Additional information for the API invocation, such as the request tracking
+   * id.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 4; + * + * @return Whether the metadata field is set. + */ + @java.lang.Override + public boolean hasMetadata() { + return metadata_ != null; + } + /** + * + * + *
+   * Additional information for the API invocation, such as the request tracking
+   * id.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 4; + * + * @return The metadata. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ResponseMetadata getMetadata() { + return metadata_ == null + ? com.google.cloud.contentwarehouse.v1.ResponseMetadata.getDefaultInstance() + : metadata_; + } + /** + * + * + *
+   * Additional information for the API invocation, such as the request tracking
+   * id.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 4; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ResponseMetadataOrBuilder getMetadataOrBuilder() { + return getMetadata(); + } + + public static final int HISTOGRAM_QUERY_RESULTS_FIELD_NUMBER = 6; + private java.util.List + histogramQueryResults_; + /** + * + * + *
+   * The histogram results that match with the specified
+   * [SearchDocumentsRequest.histogram_queries][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.histogram_queries].
+   * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.HistogramQueryResult histogram_query_results = 6; + * + */ + @java.lang.Override + public java.util.List + getHistogramQueryResultsList() { + return histogramQueryResults_; + } + /** + * + * + *
+   * The histogram results that match with the specified
+   * [SearchDocumentsRequest.histogram_queries][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.histogram_queries].
+   * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.HistogramQueryResult histogram_query_results = 6; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.contentwarehouse.v1.HistogramQueryResultOrBuilder> + getHistogramQueryResultsOrBuilderList() { + return histogramQueryResults_; + } + /** + * + * + *
+   * The histogram results that match with the specified
+   * [SearchDocumentsRequest.histogram_queries][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.histogram_queries].
+   * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.HistogramQueryResult histogram_query_results = 6; + * + */ + @java.lang.Override + public int getHistogramQueryResultsCount() { + return histogramQueryResults_.size(); + } + /** + * + * + *
+   * The histogram results that match with the specified
+   * [SearchDocumentsRequest.histogram_queries][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.histogram_queries].
+   * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.HistogramQueryResult histogram_query_results = 6; + * + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.HistogramQueryResult getHistogramQueryResults( + int index) { + return histogramQueryResults_.get(index); + } + /** + * + * + *
+   * The histogram results that match with the specified
+   * [SearchDocumentsRequest.histogram_queries][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.histogram_queries].
+   * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.HistogramQueryResult histogram_query_results = 6; + * + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.HistogramQueryResultOrBuilder + getHistogramQueryResultsOrBuilder(int index) { + return histogramQueryResults_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < matchingDocuments_.size(); i++) { + output.writeMessage(1, matchingDocuments_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + if (totalSize_ != 0) { + output.writeInt32(3, totalSize_); + } + if (metadata_ != null) { + output.writeMessage(4, getMetadata()); + } + for (int i = 0; i < histogramQueryResults_.size(); i++) { + output.writeMessage(6, histogramQueryResults_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < matchingDocuments_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(1, matchingDocuments_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + if (totalSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, totalSize_); + } + if (metadata_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getMetadata()); + } + for (int i = 0; i < histogramQueryResults_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, histogramQueryResults_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse other = + (com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse) obj; + + if (!getMatchingDocumentsList().equals(other.getMatchingDocumentsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (getTotalSize() != other.getTotalSize()) return false; + if (hasMetadata() != other.hasMetadata()) return false; + if (hasMetadata()) { + if (!getMetadata().equals(other.getMetadata())) return false; + } + if (!getHistogramQueryResultsList().equals(other.getHistogramQueryResultsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getMatchingDocumentsCount() > 0) { + hash = (37 * hash) + MATCHING_DOCUMENTS_FIELD_NUMBER; + hash = (53 * hash) + getMatchingDocumentsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (37 * hash) + TOTAL_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getTotalSize(); + if (hasMetadata()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + getMetadata().hashCode(); + } + if (getHistogramQueryResultsCount() > 0) { + hash = (37 * hash) + HISTOGRAM_QUERY_RESULTS_FIELD_NUMBER; + hash = (53 * hash) + getHistogramQueryResultsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for DocumentService.SearchDocuments.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.SearchDocumentsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.SearchDocumentsResponse) + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceProto + .internal_static_google_cloud_contentwarehouse_v1_SearchDocumentsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceProto + .internal_static_google_cloud_contentwarehouse_v1_SearchDocumentsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.class, + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (matchingDocumentsBuilder_ == null) { + matchingDocuments_ = java.util.Collections.emptyList(); + } else { + matchingDocuments_ = null; + matchingDocumentsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + + totalSize_ = 0; + + if (metadataBuilder_ == null) { + metadata_ = null; + } else { + metadata_ = null; + metadataBuilder_ = null; + } + if (histogramQueryResultsBuilder_ == null) { + histogramQueryResults_ = java.util.Collections.emptyList(); + } else { + histogramQueryResults_ = null; + histogramQueryResultsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceProto + .internal_static_google_cloud_contentwarehouse_v1_SearchDocumentsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse + getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse build() { + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse buildPartial() { + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse result = + new com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse(this); + int from_bitField0_ = bitField0_; + if (matchingDocumentsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + matchingDocuments_ = java.util.Collections.unmodifiableList(matchingDocuments_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.matchingDocuments_ = matchingDocuments_; + } else { + result.matchingDocuments_ = matchingDocumentsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + result.totalSize_ = totalSize_; + if (metadataBuilder_ == null) { + result.metadata_ = metadata_; + } else { + result.metadata_ = metadataBuilder_.build(); + } + if (histogramQueryResultsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + histogramQueryResults_ = java.util.Collections.unmodifiableList(histogramQueryResults_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.histogramQueryResults_ = histogramQueryResults_; + } else { + result.histogramQueryResults_ = histogramQueryResultsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse other) { + if (other + == com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.getDefaultInstance()) + return this; + if (matchingDocumentsBuilder_ == null) { + if (!other.matchingDocuments_.isEmpty()) { + if (matchingDocuments_.isEmpty()) { + matchingDocuments_ = other.matchingDocuments_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureMatchingDocumentsIsMutable(); + matchingDocuments_.addAll(other.matchingDocuments_); + } + onChanged(); + } + } else { + if (!other.matchingDocuments_.isEmpty()) { + if (matchingDocumentsBuilder_.isEmpty()) { + matchingDocumentsBuilder_.dispose(); + matchingDocumentsBuilder_ = null; + matchingDocuments_ = other.matchingDocuments_; + bitField0_ = (bitField0_ & ~0x00000001); + matchingDocumentsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getMatchingDocumentsFieldBuilder() + : null; + } else { + matchingDocumentsBuilder_.addAllMessages(other.matchingDocuments_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + if (other.getTotalSize() != 0) { + setTotalSize(other.getTotalSize()); + } + if (other.hasMetadata()) { + mergeMetadata(other.getMetadata()); + } + if (histogramQueryResultsBuilder_ == null) { + if (!other.histogramQueryResults_.isEmpty()) { + if (histogramQueryResults_.isEmpty()) { + histogramQueryResults_ = other.histogramQueryResults_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureHistogramQueryResultsIsMutable(); + histogramQueryResults_.addAll(other.histogramQueryResults_); + } + onChanged(); + } + } else { + if (!other.histogramQueryResults_.isEmpty()) { + if (histogramQueryResultsBuilder_.isEmpty()) { + histogramQueryResultsBuilder_.dispose(); + histogramQueryResultsBuilder_ = null; + histogramQueryResults_ = other.histogramQueryResults_; + bitField0_ = (bitField0_ & ~0x00000002); + histogramQueryResultsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getHistogramQueryResultsFieldBuilder() + : null; + } else { + histogramQueryResultsBuilder_.addAllMessages(other.histogramQueryResults_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument m = + input.readMessage( + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse + .MatchingDocument.parser(), + extensionRegistry); + if (matchingDocumentsBuilder_ == null) { + ensureMatchingDocumentsIsMutable(); + matchingDocuments_.add(m); + } else { + matchingDocumentsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + + break; + } // case 18 + case 24: + { + totalSize_ = input.readInt32(); + + break; + } // case 24 + case 34: + { + input.readMessage(getMetadataFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 34 + case 50: + { + com.google.cloud.contentwarehouse.v1.HistogramQueryResult m = + input.readMessage( + com.google.cloud.contentwarehouse.v1.HistogramQueryResult.parser(), + extensionRegistry); + if (histogramQueryResultsBuilder_ == null) { + ensureHistogramQueryResultsIsMutable(); + histogramQueryResults_.add(m); + } else { + histogramQueryResultsBuilder_.addMessage(m); + } + break; + } // case 50 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List< + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument> + matchingDocuments_ = java.util.Collections.emptyList(); + + private void ensureMatchingDocumentsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + matchingDocuments_ = + new java.util.ArrayList< + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument>( + matchingDocuments_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument, + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument.Builder, + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocumentOrBuilder> + matchingDocumentsBuilder_; + + /** + * + * + *
+     * The document entities that match the specified [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest].
+     * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument matching_documents = 1; + * + */ + public java.util.List< + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument> + getMatchingDocumentsList() { + if (matchingDocumentsBuilder_ == null) { + return java.util.Collections.unmodifiableList(matchingDocuments_); + } else { + return matchingDocumentsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The document entities that match the specified [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest].
+     * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument matching_documents = 1; + * + */ + public int getMatchingDocumentsCount() { + if (matchingDocumentsBuilder_ == null) { + return matchingDocuments_.size(); + } else { + return matchingDocumentsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The document entities that match the specified [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest].
+     * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument matching_documents = 1; + * + */ + public com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument + getMatchingDocuments(int index) { + if (matchingDocumentsBuilder_ == null) { + return matchingDocuments_.get(index); + } else { + return matchingDocumentsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The document entities that match the specified [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest].
+     * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument matching_documents = 1; + * + */ + public Builder setMatchingDocuments( + int index, + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument value) { + if (matchingDocumentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMatchingDocumentsIsMutable(); + matchingDocuments_.set(index, value); + onChanged(); + } else { + matchingDocumentsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The document entities that match the specified [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest].
+     * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument matching_documents = 1; + * + */ + public Builder setMatchingDocuments( + int index, + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument.Builder + builderForValue) { + if (matchingDocumentsBuilder_ == null) { + ensureMatchingDocumentsIsMutable(); + matchingDocuments_.set(index, builderForValue.build()); + onChanged(); + } else { + matchingDocumentsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The document entities that match the specified [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest].
+     * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument matching_documents = 1; + * + */ + public Builder addMatchingDocuments( + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument value) { + if (matchingDocumentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMatchingDocumentsIsMutable(); + matchingDocuments_.add(value); + onChanged(); + } else { + matchingDocumentsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The document entities that match the specified [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest].
+     * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument matching_documents = 1; + * + */ + public Builder addMatchingDocuments( + int index, + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument value) { + if (matchingDocumentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMatchingDocumentsIsMutable(); + matchingDocuments_.add(index, value); + onChanged(); + } else { + matchingDocumentsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The document entities that match the specified [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest].
+     * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument matching_documents = 1; + * + */ + public Builder addMatchingDocuments( + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument.Builder + builderForValue) { + if (matchingDocumentsBuilder_ == null) { + ensureMatchingDocumentsIsMutable(); + matchingDocuments_.add(builderForValue.build()); + onChanged(); + } else { + matchingDocumentsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The document entities that match the specified [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest].
+     * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument matching_documents = 1; + * + */ + public Builder addMatchingDocuments( + int index, + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument.Builder + builderForValue) { + if (matchingDocumentsBuilder_ == null) { + ensureMatchingDocumentsIsMutable(); + matchingDocuments_.add(index, builderForValue.build()); + onChanged(); + } else { + matchingDocumentsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The document entities that match the specified [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest].
+     * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument matching_documents = 1; + * + */ + public Builder addAllMatchingDocuments( + java.lang.Iterable< + ? extends + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument> + values) { + if (matchingDocumentsBuilder_ == null) { + ensureMatchingDocumentsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, matchingDocuments_); + onChanged(); + } else { + matchingDocumentsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The document entities that match the specified [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest].
+     * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument matching_documents = 1; + * + */ + public Builder clearMatchingDocuments() { + if (matchingDocumentsBuilder_ == null) { + matchingDocuments_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + matchingDocumentsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The document entities that match the specified [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest].
+     * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument matching_documents = 1; + * + */ + public Builder removeMatchingDocuments(int index) { + if (matchingDocumentsBuilder_ == null) { + ensureMatchingDocumentsIsMutable(); + matchingDocuments_.remove(index); + onChanged(); + } else { + matchingDocumentsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The document entities that match the specified [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest].
+     * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument matching_documents = 1; + * + */ + public com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument.Builder + getMatchingDocumentsBuilder(int index) { + return getMatchingDocumentsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The document entities that match the specified [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest].
+     * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument matching_documents = 1; + * + */ + public com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocumentOrBuilder + getMatchingDocumentsOrBuilder(int index) { + if (matchingDocumentsBuilder_ == null) { + return matchingDocuments_.get(index); + } else { + return matchingDocumentsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The document entities that match the specified [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest].
+     * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument matching_documents = 1; + * + */ + public java.util.List< + ? extends + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse + .MatchingDocumentOrBuilder> + getMatchingDocumentsOrBuilderList() { + if (matchingDocumentsBuilder_ != null) { + return matchingDocumentsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(matchingDocuments_); + } + } + /** + * + * + *
+     * The document entities that match the specified [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest].
+     * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument matching_documents = 1; + * + */ + public com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument.Builder + addMatchingDocumentsBuilder() { + return getMatchingDocumentsFieldBuilder() + .addBuilder( + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument + .getDefaultInstance()); + } + /** + * + * + *
+     * The document entities that match the specified [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest].
+     * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument matching_documents = 1; + * + */ + public com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument.Builder + addMatchingDocumentsBuilder(int index) { + return getMatchingDocumentsFieldBuilder() + .addBuilder( + index, + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument + .getDefaultInstance()); + } + /** + * + * + *
+     * The document entities that match the specified [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest].
+     * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument matching_documents = 1; + * + */ + public java.util.List< + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument.Builder> + getMatchingDocumentsBuilderList() { + return getMatchingDocumentsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument, + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument.Builder, + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocumentOrBuilder> + getMatchingDocumentsFieldBuilder() { + if (matchingDocumentsBuilder_ == null) { + matchingDocumentsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument, + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument + .Builder, + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse + .MatchingDocumentOrBuilder>( + matchingDocuments_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + matchingDocuments_ = null; + } + return matchingDocumentsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * The token that specifies the starting position of the next page of results.
+     * This field is empty if there are no more results.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The token that specifies the starting position of the next page of results.
+     * This field is empty if there are no more results.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The token that specifies the starting position of the next page of results.
+     * This field is empty if there are no more results.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The token that specifies the starting position of the next page of results.
+     * This field is empty if there are no more results.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The token that specifies the starting position of the next page of results.
+     * This field is empty if there are no more results.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + private int totalSize_; + /** + * + * + *
+     * The total number of matched documents which is available only if the client
+     * set [SearchDocumentsRequest.require_total_size][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.require_total_size] to `true`. Otherwise, the
+     * value will be `-1`. `total_size` will max at &quot;100,000&quot;. If this
+     * is returned, then it can be assumed that the count is equal to or greater
+     * than 100,000. Typically a UI would handle this condition by displaying
+     * &quot;of many&quot;, for example: &quot;Displaying 10 of many&quot;.
+     * 
+ * + * int32 total_size = 3; + * + * @return The totalSize. + */ + @java.lang.Override + public int getTotalSize() { + return totalSize_; + } + /** + * + * + *
+     * The total number of matched documents which is available only if the client
+     * set [SearchDocumentsRequest.require_total_size][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.require_total_size] to `true`. Otherwise, the
+     * value will be `-1`. `total_size` will max at &quot;100,000&quot;. If this
+     * is returned, then it can be assumed that the count is equal to or greater
+     * than 100,000. Typically a UI would handle this condition by displaying
+     * &quot;of many&quot;, for example: &quot;Displaying 10 of many&quot;.
+     * 
+ * + * int32 total_size = 3; + * + * @param value The totalSize to set. + * @return This builder for chaining. + */ + public Builder setTotalSize(int value) { + + totalSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The total number of matched documents which is available only if the client
+     * set [SearchDocumentsRequest.require_total_size][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.require_total_size] to `true`. Otherwise, the
+     * value will be `-1`. `total_size` will max at &quot;100,000&quot;. If this
+     * is returned, then it can be assumed that the count is equal to or greater
+     * than 100,000. Typically a UI would handle this condition by displaying
+     * &quot;of many&quot;, for example: &quot;Displaying 10 of many&quot;.
+     * 
+ * + * int32 total_size = 3; + * + * @return This builder for chaining. + */ + public Builder clearTotalSize() { + + totalSize_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.contentwarehouse.v1.ResponseMetadata metadata_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.ResponseMetadata, + com.google.cloud.contentwarehouse.v1.ResponseMetadata.Builder, + com.google.cloud.contentwarehouse.v1.ResponseMetadataOrBuilder> + metadataBuilder_; + /** + * + * + *
+     * Additional information for the API invocation, such as the request tracking
+     * id.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 4; + * + * @return Whether the metadata field is set. + */ + public boolean hasMetadata() { + return metadataBuilder_ != null || metadata_ != null; + } + /** + * + * + *
+     * Additional information for the API invocation, such as the request tracking
+     * id.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 4; + * + * @return The metadata. + */ + public com.google.cloud.contentwarehouse.v1.ResponseMetadata getMetadata() { + if (metadataBuilder_ == null) { + return metadata_ == null + ? com.google.cloud.contentwarehouse.v1.ResponseMetadata.getDefaultInstance() + : metadata_; + } else { + return metadataBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Additional information for the API invocation, such as the request tracking
+     * id.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 4; + */ + public Builder setMetadata(com.google.cloud.contentwarehouse.v1.ResponseMetadata value) { + if (metadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metadata_ = value; + onChanged(); + } else { + metadataBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Additional information for the API invocation, such as the request tracking
+     * id.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 4; + */ + public Builder setMetadata( + com.google.cloud.contentwarehouse.v1.ResponseMetadata.Builder builderForValue) { + if (metadataBuilder_ == null) { + metadata_ = builderForValue.build(); + onChanged(); + } else { + metadataBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Additional information for the API invocation, such as the request tracking
+     * id.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 4; + */ + public Builder mergeMetadata(com.google.cloud.contentwarehouse.v1.ResponseMetadata value) { + if (metadataBuilder_ == null) { + if (metadata_ != null) { + metadata_ = + com.google.cloud.contentwarehouse.v1.ResponseMetadata.newBuilder(metadata_) + .mergeFrom(value) + .buildPartial(); + } else { + metadata_ = value; + } + onChanged(); + } else { + metadataBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Additional information for the API invocation, such as the request tracking
+     * id.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 4; + */ + public Builder clearMetadata() { + if (metadataBuilder_ == null) { + metadata_ = null; + onChanged(); + } else { + metadata_ = null; + metadataBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Additional information for the API invocation, such as the request tracking
+     * id.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 4; + */ + public com.google.cloud.contentwarehouse.v1.ResponseMetadata.Builder getMetadataBuilder() { + + onChanged(); + return getMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Additional information for the API invocation, such as the request tracking
+     * id.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 4; + */ + public com.google.cloud.contentwarehouse.v1.ResponseMetadataOrBuilder getMetadataOrBuilder() { + if (metadataBuilder_ != null) { + return metadataBuilder_.getMessageOrBuilder(); + } else { + return metadata_ == null + ? com.google.cloud.contentwarehouse.v1.ResponseMetadata.getDefaultInstance() + : metadata_; + } + } + /** + * + * + *
+     * Additional information for the API invocation, such as the request tracking
+     * id.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.ResponseMetadata, + com.google.cloud.contentwarehouse.v1.ResponseMetadata.Builder, + com.google.cloud.contentwarehouse.v1.ResponseMetadataOrBuilder> + getMetadataFieldBuilder() { + if (metadataBuilder_ == null) { + metadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.ResponseMetadata, + com.google.cloud.contentwarehouse.v1.ResponseMetadata.Builder, + com.google.cloud.contentwarehouse.v1.ResponseMetadataOrBuilder>( + getMetadata(), getParentForChildren(), isClean()); + metadata_ = null; + } + return metadataBuilder_; + } + + private java.util.List + histogramQueryResults_ = java.util.Collections.emptyList(); + + private void ensureHistogramQueryResultsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + histogramQueryResults_ = + new java.util.ArrayList( + histogramQueryResults_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.HistogramQueryResult, + com.google.cloud.contentwarehouse.v1.HistogramQueryResult.Builder, + com.google.cloud.contentwarehouse.v1.HistogramQueryResultOrBuilder> + histogramQueryResultsBuilder_; + + /** + * + * + *
+     * The histogram results that match with the specified
+     * [SearchDocumentsRequest.histogram_queries][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.histogram_queries].
+     * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.HistogramQueryResult histogram_query_results = 6; + * + */ + public java.util.List + getHistogramQueryResultsList() { + if (histogramQueryResultsBuilder_ == null) { + return java.util.Collections.unmodifiableList(histogramQueryResults_); + } else { + return histogramQueryResultsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The histogram results that match with the specified
+     * [SearchDocumentsRequest.histogram_queries][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.histogram_queries].
+     * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.HistogramQueryResult histogram_query_results = 6; + * + */ + public int getHistogramQueryResultsCount() { + if (histogramQueryResultsBuilder_ == null) { + return histogramQueryResults_.size(); + } else { + return histogramQueryResultsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The histogram results that match with the specified
+     * [SearchDocumentsRequest.histogram_queries][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.histogram_queries].
+     * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.HistogramQueryResult histogram_query_results = 6; + * + */ + public com.google.cloud.contentwarehouse.v1.HistogramQueryResult getHistogramQueryResults( + int index) { + if (histogramQueryResultsBuilder_ == null) { + return histogramQueryResults_.get(index); + } else { + return histogramQueryResultsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The histogram results that match with the specified
+     * [SearchDocumentsRequest.histogram_queries][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.histogram_queries].
+     * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.HistogramQueryResult histogram_query_results = 6; + * + */ + public Builder setHistogramQueryResults( + int index, com.google.cloud.contentwarehouse.v1.HistogramQueryResult value) { + if (histogramQueryResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureHistogramQueryResultsIsMutable(); + histogramQueryResults_.set(index, value); + onChanged(); + } else { + histogramQueryResultsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The histogram results that match with the specified
+     * [SearchDocumentsRequest.histogram_queries][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.histogram_queries].
+     * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.HistogramQueryResult histogram_query_results = 6; + * + */ + public Builder setHistogramQueryResults( + int index, + com.google.cloud.contentwarehouse.v1.HistogramQueryResult.Builder builderForValue) { + if (histogramQueryResultsBuilder_ == null) { + ensureHistogramQueryResultsIsMutable(); + histogramQueryResults_.set(index, builderForValue.build()); + onChanged(); + } else { + histogramQueryResultsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The histogram results that match with the specified
+     * [SearchDocumentsRequest.histogram_queries][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.histogram_queries].
+     * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.HistogramQueryResult histogram_query_results = 6; + * + */ + public Builder addHistogramQueryResults( + com.google.cloud.contentwarehouse.v1.HistogramQueryResult value) { + if (histogramQueryResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureHistogramQueryResultsIsMutable(); + histogramQueryResults_.add(value); + onChanged(); + } else { + histogramQueryResultsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The histogram results that match with the specified
+     * [SearchDocumentsRequest.histogram_queries][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.histogram_queries].
+     * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.HistogramQueryResult histogram_query_results = 6; + * + */ + public Builder addHistogramQueryResults( + int index, com.google.cloud.contentwarehouse.v1.HistogramQueryResult value) { + if (histogramQueryResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureHistogramQueryResultsIsMutable(); + histogramQueryResults_.add(index, value); + onChanged(); + } else { + histogramQueryResultsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The histogram results that match with the specified
+     * [SearchDocumentsRequest.histogram_queries][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.histogram_queries].
+     * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.HistogramQueryResult histogram_query_results = 6; + * + */ + public Builder addHistogramQueryResults( + com.google.cloud.contentwarehouse.v1.HistogramQueryResult.Builder builderForValue) { + if (histogramQueryResultsBuilder_ == null) { + ensureHistogramQueryResultsIsMutable(); + histogramQueryResults_.add(builderForValue.build()); + onChanged(); + } else { + histogramQueryResultsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The histogram results that match with the specified
+     * [SearchDocumentsRequest.histogram_queries][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.histogram_queries].
+     * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.HistogramQueryResult histogram_query_results = 6; + * + */ + public Builder addHistogramQueryResults( + int index, + com.google.cloud.contentwarehouse.v1.HistogramQueryResult.Builder builderForValue) { + if (histogramQueryResultsBuilder_ == null) { + ensureHistogramQueryResultsIsMutable(); + histogramQueryResults_.add(index, builderForValue.build()); + onChanged(); + } else { + histogramQueryResultsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The histogram results that match with the specified
+     * [SearchDocumentsRequest.histogram_queries][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.histogram_queries].
+     * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.HistogramQueryResult histogram_query_results = 6; + * + */ + public Builder addAllHistogramQueryResults( + java.lang.Iterable + values) { + if (histogramQueryResultsBuilder_ == null) { + ensureHistogramQueryResultsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, histogramQueryResults_); + onChanged(); + } else { + histogramQueryResultsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The histogram results that match with the specified
+     * [SearchDocumentsRequest.histogram_queries][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.histogram_queries].
+     * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.HistogramQueryResult histogram_query_results = 6; + * + */ + public Builder clearHistogramQueryResults() { + if (histogramQueryResultsBuilder_ == null) { + histogramQueryResults_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + histogramQueryResultsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The histogram results that match with the specified
+     * [SearchDocumentsRequest.histogram_queries][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.histogram_queries].
+     * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.HistogramQueryResult histogram_query_results = 6; + * + */ + public Builder removeHistogramQueryResults(int index) { + if (histogramQueryResultsBuilder_ == null) { + ensureHistogramQueryResultsIsMutable(); + histogramQueryResults_.remove(index); + onChanged(); + } else { + histogramQueryResultsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The histogram results that match with the specified
+     * [SearchDocumentsRequest.histogram_queries][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.histogram_queries].
+     * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.HistogramQueryResult histogram_query_results = 6; + * + */ + public com.google.cloud.contentwarehouse.v1.HistogramQueryResult.Builder + getHistogramQueryResultsBuilder(int index) { + return getHistogramQueryResultsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The histogram results that match with the specified
+     * [SearchDocumentsRequest.histogram_queries][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.histogram_queries].
+     * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.HistogramQueryResult histogram_query_results = 6; + * + */ + public com.google.cloud.contentwarehouse.v1.HistogramQueryResultOrBuilder + getHistogramQueryResultsOrBuilder(int index) { + if (histogramQueryResultsBuilder_ == null) { + return histogramQueryResults_.get(index); + } else { + return histogramQueryResultsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The histogram results that match with the specified
+     * [SearchDocumentsRequest.histogram_queries][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.histogram_queries].
+     * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.HistogramQueryResult histogram_query_results = 6; + * + */ + public java.util.List< + ? extends com.google.cloud.contentwarehouse.v1.HistogramQueryResultOrBuilder> + getHistogramQueryResultsOrBuilderList() { + if (histogramQueryResultsBuilder_ != null) { + return histogramQueryResultsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(histogramQueryResults_); + } + } + /** + * + * + *
+     * The histogram results that match with the specified
+     * [SearchDocumentsRequest.histogram_queries][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.histogram_queries].
+     * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.HistogramQueryResult histogram_query_results = 6; + * + */ + public com.google.cloud.contentwarehouse.v1.HistogramQueryResult.Builder + addHistogramQueryResultsBuilder() { + return getHistogramQueryResultsFieldBuilder() + .addBuilder( + com.google.cloud.contentwarehouse.v1.HistogramQueryResult.getDefaultInstance()); + } + /** + * + * + *
+     * The histogram results that match with the specified
+     * [SearchDocumentsRequest.histogram_queries][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.histogram_queries].
+     * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.HistogramQueryResult histogram_query_results = 6; + * + */ + public com.google.cloud.contentwarehouse.v1.HistogramQueryResult.Builder + addHistogramQueryResultsBuilder(int index) { + return getHistogramQueryResultsFieldBuilder() + .addBuilder( + index, + com.google.cloud.contentwarehouse.v1.HistogramQueryResult.getDefaultInstance()); + } + /** + * + * + *
+     * The histogram results that match with the specified
+     * [SearchDocumentsRequest.histogram_queries][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.histogram_queries].
+     * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.HistogramQueryResult histogram_query_results = 6; + * + */ + public java.util.List + getHistogramQueryResultsBuilderList() { + return getHistogramQueryResultsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.HistogramQueryResult, + com.google.cloud.contentwarehouse.v1.HistogramQueryResult.Builder, + com.google.cloud.contentwarehouse.v1.HistogramQueryResultOrBuilder> + getHistogramQueryResultsFieldBuilder() { + if (histogramQueryResultsBuilder_ == null) { + histogramQueryResultsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.HistogramQueryResult, + com.google.cloud.contentwarehouse.v1.HistogramQueryResult.Builder, + com.google.cloud.contentwarehouse.v1.HistogramQueryResultOrBuilder>( + histogramQueryResults_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + histogramQueryResults_ = null; + } + return histogramQueryResultsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.SearchDocumentsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.SearchDocumentsResponse) + private static final com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse(); + } + + public static com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SearchDocumentsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/SearchDocumentsResponseOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/SearchDocumentsResponseOrBuilder.java new file mode 100644 index 000000000000..f884d7579ab9 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/SearchDocumentsResponseOrBuilder.java @@ -0,0 +1,245 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_service.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface SearchDocumentsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.SearchDocumentsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The document entities that match the specified [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest].
+   * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument matching_documents = 1; + * + */ + java.util.List + getMatchingDocumentsList(); + /** + * + * + *
+   * The document entities that match the specified [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest].
+   * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument matching_documents = 1; + * + */ + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument + getMatchingDocuments(int index); + /** + * + * + *
+   * The document entities that match the specified [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest].
+   * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument matching_documents = 1; + * + */ + int getMatchingDocumentsCount(); + /** + * + * + *
+   * The document entities that match the specified [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest].
+   * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument matching_documents = 1; + * + */ + java.util.List< + ? extends + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse + .MatchingDocumentOrBuilder> + getMatchingDocumentsOrBuilderList(); + /** + * + * + *
+   * The document entities that match the specified [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest].
+   * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument matching_documents = 1; + * + */ + com.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocumentOrBuilder + getMatchingDocumentsOrBuilder(int index); + + /** + * + * + *
+   * The token that specifies the starting position of the next page of results.
+   * This field is empty if there are no more results.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * The token that specifies the starting position of the next page of results.
+   * This field is empty if there are no more results.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * The total number of matched documents which is available only if the client
+   * set [SearchDocumentsRequest.require_total_size][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.require_total_size] to `true`. Otherwise, the
+   * value will be `-1`. `total_size` will max at &quot;100,000&quot;. If this
+   * is returned, then it can be assumed that the count is equal to or greater
+   * than 100,000. Typically a UI would handle this condition by displaying
+   * &quot;of many&quot;, for example: &quot;Displaying 10 of many&quot;.
+   * 
+ * + * int32 total_size = 3; + * + * @return The totalSize. + */ + int getTotalSize(); + + /** + * + * + *
+   * Additional information for the API invocation, such as the request tracking
+   * id.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 4; + * + * @return Whether the metadata field is set. + */ + boolean hasMetadata(); + /** + * + * + *
+   * Additional information for the API invocation, such as the request tracking
+   * id.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 4; + * + * @return The metadata. + */ + com.google.cloud.contentwarehouse.v1.ResponseMetadata getMetadata(); + /** + * + * + *
+   * Additional information for the API invocation, such as the request tracking
+   * id.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 4; + */ + com.google.cloud.contentwarehouse.v1.ResponseMetadataOrBuilder getMetadataOrBuilder(); + + /** + * + * + *
+   * The histogram results that match with the specified
+   * [SearchDocumentsRequest.histogram_queries][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.histogram_queries].
+   * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.HistogramQueryResult histogram_query_results = 6; + * + */ + java.util.List + getHistogramQueryResultsList(); + /** + * + * + *
+   * The histogram results that match with the specified
+   * [SearchDocumentsRequest.histogram_queries][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.histogram_queries].
+   * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.HistogramQueryResult histogram_query_results = 6; + * + */ + com.google.cloud.contentwarehouse.v1.HistogramQueryResult getHistogramQueryResults(int index); + /** + * + * + *
+   * The histogram results that match with the specified
+   * [SearchDocumentsRequest.histogram_queries][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.histogram_queries].
+   * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.HistogramQueryResult histogram_query_results = 6; + * + */ + int getHistogramQueryResultsCount(); + /** + * + * + *
+   * The histogram results that match with the specified
+   * [SearchDocumentsRequest.histogram_queries][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.histogram_queries].
+   * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.HistogramQueryResult histogram_query_results = 6; + * + */ + java.util.List + getHistogramQueryResultsOrBuilderList(); + /** + * + * + *
+   * The histogram results that match with the specified
+   * [SearchDocumentsRequest.histogram_queries][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.histogram_queries].
+   * 
+ * + * + * repeated .google.cloud.contentwarehouse.v1.HistogramQueryResult histogram_query_results = 6; + * + */ + com.google.cloud.contentwarehouse.v1.HistogramQueryResultOrBuilder + getHistogramQueryResultsOrBuilder(int index); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/SetAclRequest.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/SetAclRequest.java new file mode 100644 index 000000000000..bc344f19babc --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/SetAclRequest.java @@ -0,0 +1,1284 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_service_request.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Request message for DocumentService.SetAcl.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.SetAclRequest} + */ +public final class SetAclRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.SetAclRequest) + SetAclRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use SetAclRequest.newBuilder() to construct. + private SetAclRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SetAclRequest() { + resource_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SetAclRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_SetAclRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_SetAclRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.SetAclRequest.class, + com.google.cloud.contentwarehouse.v1.SetAclRequest.Builder.class); + } + + public static final int RESOURCE_FIELD_NUMBER = 1; + private volatile java.lang.Object 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}.
+   * 
+ * + * string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The resource. + */ + @java.lang.Override + public java.lang.String getResource() { + java.lang.Object ref = resource_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resource_ = s; + return s; + } + } + /** + * + * + *
+   * 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}.
+   * 
+ * + * string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for resource. + */ + @java.lang.Override + public com.google.protobuf.ByteString getResourceBytes() { + java.lang.Object ref = resource_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resource_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int POLICY_FIELD_NUMBER = 2; + private com.google.iam.v1.Policy 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.
+   * 
+ * + * .google.iam.v1.Policy policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the policy field is set. + */ + @java.lang.Override + public boolean hasPolicy() { + return policy_ != null; + } + /** + * + * + *
+   * Required. REQUIRED: The complete policy to be applied to the `resource`. The size of
+   * the policy is limited to a few 10s of KB.
+   * 
+ * + * .google.iam.v1.Policy policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The policy. + */ + @java.lang.Override + public com.google.iam.v1.Policy getPolicy() { + return policy_ == null ? com.google.iam.v1.Policy.getDefaultInstance() : 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.
+   * 
+ * + * .google.iam.v1.Policy policy = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + @java.lang.Override + public com.google.iam.v1.PolicyOrBuilder getPolicyOrBuilder() { + return getPolicy(); + } + + public static final int REQUEST_METADATA_FIELD_NUMBER = 3; + private com.google.cloud.contentwarehouse.v1.RequestMetadata requestMetadata_; + /** + * + * + *
+   * The meta information collected about the end user, used to enforce access
+   * control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + * + * @return Whether the requestMetadata field is set. + */ + @java.lang.Override + public boolean hasRequestMetadata() { + return requestMetadata_ != null; + } + /** + * + * + *
+   * The meta information collected about the end user, used to enforce access
+   * control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + * + * @return The requestMetadata. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RequestMetadata getRequestMetadata() { + return requestMetadata_ == null + ? com.google.cloud.contentwarehouse.v1.RequestMetadata.getDefaultInstance() + : requestMetadata_; + } + /** + * + * + *
+   * The meta information collected about the end user, used to enforce access
+   * control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder + getRequestMetadataOrBuilder() { + return getRequestMetadata(); + } + + public static final int PROJECT_OWNER_FIELD_NUMBER = 4; + private boolean projectOwner_; + /** + * + * + *
+   * For Set Project ACL only. Authorization check for end user will be ignored
+   * when project_owner=true.
+   * 
+ * + * bool project_owner = 4; + * + * @return The projectOwner. + */ + @java.lang.Override + public boolean getProjectOwner() { + return projectOwner_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resource_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, resource_); + } + if (policy_ != null) { + output.writeMessage(2, getPolicy()); + } + if (requestMetadata_ != null) { + output.writeMessage(3, getRequestMetadata()); + } + if (projectOwner_ != false) { + output.writeBool(4, projectOwner_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resource_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, resource_); + } + if (policy_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getPolicy()); + } + if (requestMetadata_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getRequestMetadata()); + } + if (projectOwner_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, projectOwner_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.SetAclRequest)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.SetAclRequest other = + (com.google.cloud.contentwarehouse.v1.SetAclRequest) obj; + + if (!getResource().equals(other.getResource())) return false; + if (hasPolicy() != other.hasPolicy()) return false; + if (hasPolicy()) { + if (!getPolicy().equals(other.getPolicy())) return false; + } + if (hasRequestMetadata() != other.hasRequestMetadata()) return false; + if (hasRequestMetadata()) { + if (!getRequestMetadata().equals(other.getRequestMetadata())) return false; + } + if (getProjectOwner() != other.getProjectOwner()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + RESOURCE_FIELD_NUMBER; + hash = (53 * hash) + getResource().hashCode(); + if (hasPolicy()) { + hash = (37 * hash) + POLICY_FIELD_NUMBER; + hash = (53 * hash) + getPolicy().hashCode(); + } + if (hasRequestMetadata()) { + hash = (37 * hash) + REQUEST_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getRequestMetadata().hashCode(); + } + hash = (37 * hash) + PROJECT_OWNER_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getProjectOwner()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.SetAclRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.SetAclRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.SetAclRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.SetAclRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.SetAclRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.SetAclRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.SetAclRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.SetAclRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.SetAclRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.SetAclRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.SetAclRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.SetAclRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.contentwarehouse.v1.SetAclRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for DocumentService.SetAcl.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.SetAclRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.SetAclRequest) + com.google.cloud.contentwarehouse.v1.SetAclRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_SetAclRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_SetAclRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.SetAclRequest.class, + com.google.cloud.contentwarehouse.v1.SetAclRequest.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.SetAclRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + resource_ = ""; + + if (policyBuilder_ == null) { + policy_ = null; + } else { + policy_ = null; + policyBuilder_ = null; + } + if (requestMetadataBuilder_ == null) { + requestMetadata_ = null; + } else { + requestMetadata_ = null; + requestMetadataBuilder_ = null; + } + projectOwner_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_SetAclRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.SetAclRequest getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.SetAclRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.SetAclRequest build() { + com.google.cloud.contentwarehouse.v1.SetAclRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.SetAclRequest buildPartial() { + com.google.cloud.contentwarehouse.v1.SetAclRequest result = + new com.google.cloud.contentwarehouse.v1.SetAclRequest(this); + result.resource_ = resource_; + if (policyBuilder_ == null) { + result.policy_ = policy_; + } else { + result.policy_ = policyBuilder_.build(); + } + if (requestMetadataBuilder_ == null) { + result.requestMetadata_ = requestMetadata_; + } else { + result.requestMetadata_ = requestMetadataBuilder_.build(); + } + result.projectOwner_ = projectOwner_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.SetAclRequest) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.SetAclRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.SetAclRequest other) { + if (other == com.google.cloud.contentwarehouse.v1.SetAclRequest.getDefaultInstance()) + return this; + if (!other.getResource().isEmpty()) { + resource_ = other.resource_; + onChanged(); + } + if (other.hasPolicy()) { + mergePolicy(other.getPolicy()); + } + if (other.hasRequestMetadata()) { + mergeRequestMetadata(other.getRequestMetadata()); + } + if (other.getProjectOwner() != false) { + setProjectOwner(other.getProjectOwner()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + resource_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + input.readMessage(getPolicyFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + case 26: + { + input.readMessage(getRequestMetadataFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 26 + case 32: + { + projectOwner_ = input.readBool(); + + break; + } // case 32 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object 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}.
+     * 
+ * + * string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The resource. + */ + public java.lang.String getResource() { + java.lang.Object ref = resource_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resource_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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}.
+     * 
+ * + * string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for resource. + */ + public com.google.protobuf.ByteString getResourceBytes() { + java.lang.Object ref = resource_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resource_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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}.
+     * 
+ * + * string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The resource to set. + * @return This builder for chaining. + */ + public Builder setResource(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + resource_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 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}.
+     * 
+ * + * string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearResource() { + + resource_ = getDefaultInstance().getResource(); + onChanged(); + return this; + } + /** + * + * + *
+     * 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}.
+     * 
+ * + * string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for resource to set. + * @return This builder for chaining. + */ + public Builder setResourceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + resource_ = value; + onChanged(); + return this; + } + + private com.google.iam.v1.Policy policy_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.iam.v1.Policy, + com.google.iam.v1.Policy.Builder, + com.google.iam.v1.PolicyOrBuilder> + policyBuilder_; + /** + * + * + *
+     * Required. REQUIRED: The complete policy to be applied to the `resource`. The size of
+     * the policy is limited to a few 10s of KB.
+     * 
+ * + * .google.iam.v1.Policy policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the policy field is set. + */ + public boolean hasPolicy() { + return policyBuilder_ != null || policy_ != null; + } + /** + * + * + *
+     * Required. REQUIRED: The complete policy to be applied to the `resource`. The size of
+     * the policy is limited to a few 10s of KB.
+     * 
+ * + * .google.iam.v1.Policy policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The policy. + */ + public com.google.iam.v1.Policy getPolicy() { + if (policyBuilder_ == null) { + return policy_ == null ? com.google.iam.v1.Policy.getDefaultInstance() : policy_; + } else { + return policyBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. REQUIRED: The complete policy to be applied to the `resource`. The size of
+     * the policy is limited to a few 10s of KB.
+     * 
+ * + * .google.iam.v1.Policy policy = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setPolicy(com.google.iam.v1.Policy value) { + if (policyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + policy_ = value; + onChanged(); + } else { + policyBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. REQUIRED: The complete policy to be applied to the `resource`. The size of
+     * the policy is limited to a few 10s of KB.
+     * 
+ * + * .google.iam.v1.Policy policy = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setPolicy(com.google.iam.v1.Policy.Builder builderForValue) { + if (policyBuilder_ == null) { + policy_ = builderForValue.build(); + onChanged(); + } else { + policyBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. REQUIRED: The complete policy to be applied to the `resource`. The size of
+     * the policy is limited to a few 10s of KB.
+     * 
+ * + * .google.iam.v1.Policy policy = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder mergePolicy(com.google.iam.v1.Policy value) { + if (policyBuilder_ == null) { + if (policy_ != null) { + policy_ = com.google.iam.v1.Policy.newBuilder(policy_).mergeFrom(value).buildPartial(); + } else { + policy_ = value; + } + onChanged(); + } else { + policyBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. REQUIRED: The complete policy to be applied to the `resource`. The size of
+     * the policy is limited to a few 10s of KB.
+     * 
+ * + * .google.iam.v1.Policy policy = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder clearPolicy() { + if (policyBuilder_ == null) { + policy_ = null; + onChanged(); + } else { + policy_ = null; + policyBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. REQUIRED: The complete policy to be applied to the `resource`. The size of
+     * the policy is limited to a few 10s of KB.
+     * 
+ * + * .google.iam.v1.Policy policy = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.iam.v1.Policy.Builder getPolicyBuilder() { + + onChanged(); + return getPolicyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. REQUIRED: The complete policy to be applied to the `resource`. The size of
+     * the policy is limited to a few 10s of KB.
+     * 
+ * + * .google.iam.v1.Policy policy = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.iam.v1.PolicyOrBuilder getPolicyOrBuilder() { + if (policyBuilder_ != null) { + return policyBuilder_.getMessageOrBuilder(); + } else { + return policy_ == null ? com.google.iam.v1.Policy.getDefaultInstance() : 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.
+     * 
+ * + * .google.iam.v1.Policy policy = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.iam.v1.Policy, + com.google.iam.v1.Policy.Builder, + com.google.iam.v1.PolicyOrBuilder> + getPolicyFieldBuilder() { + if (policyBuilder_ == null) { + policyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.iam.v1.Policy, + com.google.iam.v1.Policy.Builder, + com.google.iam.v1.PolicyOrBuilder>(getPolicy(), getParentForChildren(), isClean()); + policy_ = null; + } + return policyBuilder_; + } + + private com.google.cloud.contentwarehouse.v1.RequestMetadata requestMetadata_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.RequestMetadata, + com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder, + com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder> + requestMetadataBuilder_; + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + * + * @return Whether the requestMetadata field is set. + */ + public boolean hasRequestMetadata() { + return requestMetadataBuilder_ != null || requestMetadata_ != null; + } + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + * + * @return The requestMetadata. + */ + public com.google.cloud.contentwarehouse.v1.RequestMetadata getRequestMetadata() { + if (requestMetadataBuilder_ == null) { + return requestMetadata_ == null + ? com.google.cloud.contentwarehouse.v1.RequestMetadata.getDefaultInstance() + : requestMetadata_; + } else { + return requestMetadataBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + */ + public Builder setRequestMetadata(com.google.cloud.contentwarehouse.v1.RequestMetadata value) { + if (requestMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + requestMetadata_ = value; + onChanged(); + } else { + requestMetadataBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + */ + public Builder setRequestMetadata( + com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder builderForValue) { + if (requestMetadataBuilder_ == null) { + requestMetadata_ = builderForValue.build(); + onChanged(); + } else { + requestMetadataBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + */ + public Builder mergeRequestMetadata( + com.google.cloud.contentwarehouse.v1.RequestMetadata value) { + if (requestMetadataBuilder_ == null) { + if (requestMetadata_ != null) { + requestMetadata_ = + com.google.cloud.contentwarehouse.v1.RequestMetadata.newBuilder(requestMetadata_) + .mergeFrom(value) + .buildPartial(); + } else { + requestMetadata_ = value; + } + onChanged(); + } else { + requestMetadataBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + */ + public Builder clearRequestMetadata() { + if (requestMetadataBuilder_ == null) { + requestMetadata_ = null; + onChanged(); + } else { + requestMetadata_ = null; + requestMetadataBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + */ + public com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder + getRequestMetadataBuilder() { + + onChanged(); + return getRequestMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + */ + public com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder + getRequestMetadataOrBuilder() { + if (requestMetadataBuilder_ != null) { + return requestMetadataBuilder_.getMessageOrBuilder(); + } else { + return requestMetadata_ == null + ? com.google.cloud.contentwarehouse.v1.RequestMetadata.getDefaultInstance() + : requestMetadata_; + } + } + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.RequestMetadata, + com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder, + com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder> + getRequestMetadataFieldBuilder() { + if (requestMetadataBuilder_ == null) { + requestMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.RequestMetadata, + com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder, + com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder>( + getRequestMetadata(), getParentForChildren(), isClean()); + requestMetadata_ = null; + } + return requestMetadataBuilder_; + } + + private boolean projectOwner_; + /** + * + * + *
+     * For Set Project ACL only. Authorization check for end user will be ignored
+     * when project_owner=true.
+     * 
+ * + * bool project_owner = 4; + * + * @return The projectOwner. + */ + @java.lang.Override + public boolean getProjectOwner() { + return projectOwner_; + } + /** + * + * + *
+     * For Set Project ACL only. Authorization check for end user will be ignored
+     * when project_owner=true.
+     * 
+ * + * bool project_owner = 4; + * + * @param value The projectOwner to set. + * @return This builder for chaining. + */ + public Builder setProjectOwner(boolean value) { + + projectOwner_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * For Set Project ACL only. Authorization check for end user will be ignored
+     * when project_owner=true.
+     * 
+ * + * bool project_owner = 4; + * + * @return This builder for chaining. + */ + public Builder clearProjectOwner() { + + projectOwner_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.SetAclRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.SetAclRequest) + private static final com.google.cloud.contentwarehouse.v1.SetAclRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.SetAclRequest(); + } + + public static com.google.cloud.contentwarehouse.v1.SetAclRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SetAclRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.SetAclRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/SetAclRequestOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/SetAclRequestOrBuilder.java new file mode 100644 index 000000000000..cad2f0e111a4 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/SetAclRequestOrBuilder.java @@ -0,0 +1,146 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_service_request.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface SetAclRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.SetAclRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * 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}.
+   * 
+ * + * string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The resource. + */ + java.lang.String getResource(); + /** + * + * + *
+   * 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}.
+   * 
+ * + * string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for resource. + */ + com.google.protobuf.ByteString getResourceBytes(); + + /** + * + * + *
+   * Required. REQUIRED: The complete policy to be applied to the `resource`. The size of
+   * the policy is limited to a few 10s of KB.
+   * 
+ * + * .google.iam.v1.Policy policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the policy field is set. + */ + boolean hasPolicy(); + /** + * + * + *
+   * Required. REQUIRED: The complete policy to be applied to the `resource`. The size of
+   * the policy is limited to a few 10s of KB.
+   * 
+ * + * .google.iam.v1.Policy policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The policy. + */ + com.google.iam.v1.Policy getPolicy(); + /** + * + * + *
+   * Required. REQUIRED: The complete policy to be applied to the `resource`. The size of
+   * the policy is limited to a few 10s of KB.
+   * 
+ * + * .google.iam.v1.Policy policy = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + com.google.iam.v1.PolicyOrBuilder getPolicyOrBuilder(); + + /** + * + * + *
+   * The meta information collected about the end user, used to enforce access
+   * control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + * + * @return Whether the requestMetadata field is set. + */ + boolean hasRequestMetadata(); + /** + * + * + *
+   * The meta information collected about the end user, used to enforce access
+   * control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + * + * @return The requestMetadata. + */ + com.google.cloud.contentwarehouse.v1.RequestMetadata getRequestMetadata(); + /** + * + * + *
+   * The meta information collected about the end user, used to enforce access
+   * control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + */ + com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder getRequestMetadataOrBuilder(); + + /** + * + * + *
+   * For Set Project ACL only. Authorization check for end user will be ignored
+   * when project_owner=true.
+   * 
+ * + * bool project_owner = 4; + * + * @return The projectOwner. + */ + boolean getProjectOwner(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/SetAclResponse.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/SetAclResponse.java new file mode 100644 index 000000000000..19462f2a5220 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/SetAclResponse.java @@ -0,0 +1,973 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_service.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Response message for DocumentService.SetAcl.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.SetAclResponse} + */ +public final class SetAclResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.SetAclResponse) + SetAclResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use SetAclResponse.newBuilder() to construct. + private SetAclResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SetAclResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SetAclResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceProto + .internal_static_google_cloud_contentwarehouse_v1_SetAclResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceProto + .internal_static_google_cloud_contentwarehouse_v1_SetAclResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.SetAclResponse.class, + com.google.cloud.contentwarehouse.v1.SetAclResponse.Builder.class); + } + + public static final int POLICY_FIELD_NUMBER = 1; + private com.google.iam.v1.Policy policy_; + /** + * + * + *
+   * The policy will be attached to a resource (e.g. projecct, document).
+   * 
+ * + * .google.iam.v1.Policy policy = 1; + * + * @return Whether the policy field is set. + */ + @java.lang.Override + public boolean hasPolicy() { + return policy_ != null; + } + /** + * + * + *
+   * The policy will be attached to a resource (e.g. projecct, document).
+   * 
+ * + * .google.iam.v1.Policy policy = 1; + * + * @return The policy. + */ + @java.lang.Override + public com.google.iam.v1.Policy getPolicy() { + return policy_ == null ? com.google.iam.v1.Policy.getDefaultInstance() : policy_; + } + /** + * + * + *
+   * The policy will be attached to a resource (e.g. projecct, document).
+   * 
+ * + * .google.iam.v1.Policy policy = 1; + */ + @java.lang.Override + public com.google.iam.v1.PolicyOrBuilder getPolicyOrBuilder() { + return getPolicy(); + } + + public static final int METADATA_FIELD_NUMBER = 2; + private com.google.cloud.contentwarehouse.v1.ResponseMetadata metadata_; + /** + * + * + *
+   * Additional information for the API invocation, such as the request tracking
+   * id.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 2; + * + * @return Whether the metadata field is set. + */ + @java.lang.Override + public boolean hasMetadata() { + return metadata_ != null; + } + /** + * + * + *
+   * Additional information for the API invocation, such as the request tracking
+   * id.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 2; + * + * @return The metadata. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ResponseMetadata getMetadata() { + return metadata_ == null + ? com.google.cloud.contentwarehouse.v1.ResponseMetadata.getDefaultInstance() + : metadata_; + } + /** + * + * + *
+   * Additional information for the API invocation, such as the request tracking
+   * id.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 2; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ResponseMetadataOrBuilder getMetadataOrBuilder() { + return getMetadata(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (policy_ != null) { + output.writeMessage(1, getPolicy()); + } + if (metadata_ != null) { + output.writeMessage(2, getMetadata()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (policy_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getPolicy()); + } + if (metadata_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getMetadata()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.SetAclResponse)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.SetAclResponse other = + (com.google.cloud.contentwarehouse.v1.SetAclResponse) obj; + + if (hasPolicy() != other.hasPolicy()) return false; + if (hasPolicy()) { + if (!getPolicy().equals(other.getPolicy())) return false; + } + if (hasMetadata() != other.hasMetadata()) return false; + if (hasMetadata()) { + if (!getMetadata().equals(other.getMetadata())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasPolicy()) { + hash = (37 * hash) + POLICY_FIELD_NUMBER; + hash = (53 * hash) + getPolicy().hashCode(); + } + if (hasMetadata()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + getMetadata().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.SetAclResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.SetAclResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.SetAclResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.SetAclResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.SetAclResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.SetAclResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.SetAclResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.SetAclResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.SetAclResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.SetAclResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.SetAclResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.SetAclResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.contentwarehouse.v1.SetAclResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for DocumentService.SetAcl.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.SetAclResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.SetAclResponse) + com.google.cloud.contentwarehouse.v1.SetAclResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceProto + .internal_static_google_cloud_contentwarehouse_v1_SetAclResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceProto + .internal_static_google_cloud_contentwarehouse_v1_SetAclResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.SetAclResponse.class, + com.google.cloud.contentwarehouse.v1.SetAclResponse.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.SetAclResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (policyBuilder_ == null) { + policy_ = null; + } else { + policy_ = null; + policyBuilder_ = null; + } + if (metadataBuilder_ == null) { + metadata_ = null; + } else { + metadata_ = null; + metadataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceProto + .internal_static_google_cloud_contentwarehouse_v1_SetAclResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.SetAclResponse getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.SetAclResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.SetAclResponse build() { + com.google.cloud.contentwarehouse.v1.SetAclResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.SetAclResponse buildPartial() { + com.google.cloud.contentwarehouse.v1.SetAclResponse result = + new com.google.cloud.contentwarehouse.v1.SetAclResponse(this); + if (policyBuilder_ == null) { + result.policy_ = policy_; + } else { + result.policy_ = policyBuilder_.build(); + } + if (metadataBuilder_ == null) { + result.metadata_ = metadata_; + } else { + result.metadata_ = metadataBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.SetAclResponse) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.SetAclResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.SetAclResponse other) { + if (other == com.google.cloud.contentwarehouse.v1.SetAclResponse.getDefaultInstance()) + return this; + if (other.hasPolicy()) { + mergePolicy(other.getPolicy()); + } + if (other.hasMetadata()) { + mergeMetadata(other.getMetadata()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getPolicyFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 18: + { + input.readMessage(getMetadataFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private com.google.iam.v1.Policy policy_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.iam.v1.Policy, + com.google.iam.v1.Policy.Builder, + com.google.iam.v1.PolicyOrBuilder> + policyBuilder_; + /** + * + * + *
+     * The policy will be attached to a resource (e.g. projecct, document).
+     * 
+ * + * .google.iam.v1.Policy policy = 1; + * + * @return Whether the policy field is set. + */ + public boolean hasPolicy() { + return policyBuilder_ != null || policy_ != null; + } + /** + * + * + *
+     * The policy will be attached to a resource (e.g. projecct, document).
+     * 
+ * + * .google.iam.v1.Policy policy = 1; + * + * @return The policy. + */ + public com.google.iam.v1.Policy getPolicy() { + if (policyBuilder_ == null) { + return policy_ == null ? com.google.iam.v1.Policy.getDefaultInstance() : policy_; + } else { + return policyBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The policy will be attached to a resource (e.g. projecct, document).
+     * 
+ * + * .google.iam.v1.Policy policy = 1; + */ + public Builder setPolicy(com.google.iam.v1.Policy value) { + if (policyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + policy_ = value; + onChanged(); + } else { + policyBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The policy will be attached to a resource (e.g. projecct, document).
+     * 
+ * + * .google.iam.v1.Policy policy = 1; + */ + public Builder setPolicy(com.google.iam.v1.Policy.Builder builderForValue) { + if (policyBuilder_ == null) { + policy_ = builderForValue.build(); + onChanged(); + } else { + policyBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The policy will be attached to a resource (e.g. projecct, document).
+     * 
+ * + * .google.iam.v1.Policy policy = 1; + */ + public Builder mergePolicy(com.google.iam.v1.Policy value) { + if (policyBuilder_ == null) { + if (policy_ != null) { + policy_ = com.google.iam.v1.Policy.newBuilder(policy_).mergeFrom(value).buildPartial(); + } else { + policy_ = value; + } + onChanged(); + } else { + policyBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The policy will be attached to a resource (e.g. projecct, document).
+     * 
+ * + * .google.iam.v1.Policy policy = 1; + */ + public Builder clearPolicy() { + if (policyBuilder_ == null) { + policy_ = null; + onChanged(); + } else { + policy_ = null; + policyBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The policy will be attached to a resource (e.g. projecct, document).
+     * 
+ * + * .google.iam.v1.Policy policy = 1; + */ + public com.google.iam.v1.Policy.Builder getPolicyBuilder() { + + onChanged(); + return getPolicyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The policy will be attached to a resource (e.g. projecct, document).
+     * 
+ * + * .google.iam.v1.Policy policy = 1; + */ + public com.google.iam.v1.PolicyOrBuilder getPolicyOrBuilder() { + if (policyBuilder_ != null) { + return policyBuilder_.getMessageOrBuilder(); + } else { + return policy_ == null ? com.google.iam.v1.Policy.getDefaultInstance() : policy_; + } + } + /** + * + * + *
+     * The policy will be attached to a resource (e.g. projecct, document).
+     * 
+ * + * .google.iam.v1.Policy policy = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.iam.v1.Policy, + com.google.iam.v1.Policy.Builder, + com.google.iam.v1.PolicyOrBuilder> + getPolicyFieldBuilder() { + if (policyBuilder_ == null) { + policyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.iam.v1.Policy, + com.google.iam.v1.Policy.Builder, + com.google.iam.v1.PolicyOrBuilder>(getPolicy(), getParentForChildren(), isClean()); + policy_ = null; + } + return policyBuilder_; + } + + private com.google.cloud.contentwarehouse.v1.ResponseMetadata metadata_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.ResponseMetadata, + com.google.cloud.contentwarehouse.v1.ResponseMetadata.Builder, + com.google.cloud.contentwarehouse.v1.ResponseMetadataOrBuilder> + metadataBuilder_; + /** + * + * + *
+     * Additional information for the API invocation, such as the request tracking
+     * id.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 2; + * + * @return Whether the metadata field is set. + */ + public boolean hasMetadata() { + return metadataBuilder_ != null || metadata_ != null; + } + /** + * + * + *
+     * Additional information for the API invocation, such as the request tracking
+     * id.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 2; + * + * @return The metadata. + */ + public com.google.cloud.contentwarehouse.v1.ResponseMetadata getMetadata() { + if (metadataBuilder_ == null) { + return metadata_ == null + ? com.google.cloud.contentwarehouse.v1.ResponseMetadata.getDefaultInstance() + : metadata_; + } else { + return metadataBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Additional information for the API invocation, such as the request tracking
+     * id.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 2; + */ + public Builder setMetadata(com.google.cloud.contentwarehouse.v1.ResponseMetadata value) { + if (metadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metadata_ = value; + onChanged(); + } else { + metadataBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Additional information for the API invocation, such as the request tracking
+     * id.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 2; + */ + public Builder setMetadata( + com.google.cloud.contentwarehouse.v1.ResponseMetadata.Builder builderForValue) { + if (metadataBuilder_ == null) { + metadata_ = builderForValue.build(); + onChanged(); + } else { + metadataBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Additional information for the API invocation, such as the request tracking
+     * id.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 2; + */ + public Builder mergeMetadata(com.google.cloud.contentwarehouse.v1.ResponseMetadata value) { + if (metadataBuilder_ == null) { + if (metadata_ != null) { + metadata_ = + com.google.cloud.contentwarehouse.v1.ResponseMetadata.newBuilder(metadata_) + .mergeFrom(value) + .buildPartial(); + } else { + metadata_ = value; + } + onChanged(); + } else { + metadataBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Additional information for the API invocation, such as the request tracking
+     * id.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 2; + */ + public Builder clearMetadata() { + if (metadataBuilder_ == null) { + metadata_ = null; + onChanged(); + } else { + metadata_ = null; + metadataBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Additional information for the API invocation, such as the request tracking
+     * id.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 2; + */ + public com.google.cloud.contentwarehouse.v1.ResponseMetadata.Builder getMetadataBuilder() { + + onChanged(); + return getMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Additional information for the API invocation, such as the request tracking
+     * id.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 2; + */ + public com.google.cloud.contentwarehouse.v1.ResponseMetadataOrBuilder getMetadataOrBuilder() { + if (metadataBuilder_ != null) { + return metadataBuilder_.getMessageOrBuilder(); + } else { + return metadata_ == null + ? com.google.cloud.contentwarehouse.v1.ResponseMetadata.getDefaultInstance() + : metadata_; + } + } + /** + * + * + *
+     * Additional information for the API invocation, such as the request tracking
+     * id.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.ResponseMetadata, + com.google.cloud.contentwarehouse.v1.ResponseMetadata.Builder, + com.google.cloud.contentwarehouse.v1.ResponseMetadataOrBuilder> + getMetadataFieldBuilder() { + if (metadataBuilder_ == null) { + metadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.ResponseMetadata, + com.google.cloud.contentwarehouse.v1.ResponseMetadata.Builder, + com.google.cloud.contentwarehouse.v1.ResponseMetadataOrBuilder>( + getMetadata(), getParentForChildren(), isClean()); + metadata_ = null; + } + return metadataBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.SetAclResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.SetAclResponse) + private static final com.google.cloud.contentwarehouse.v1.SetAclResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.SetAclResponse(); + } + + public static com.google.cloud.contentwarehouse.v1.SetAclResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SetAclResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.SetAclResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/SetAclResponseOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/SetAclResponseOrBuilder.java new file mode 100644 index 000000000000..006a21ae5bc6 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/SetAclResponseOrBuilder.java @@ -0,0 +1,98 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_service.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface SetAclResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.SetAclResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The policy will be attached to a resource (e.g. projecct, document).
+   * 
+ * + * .google.iam.v1.Policy policy = 1; + * + * @return Whether the policy field is set. + */ + boolean hasPolicy(); + /** + * + * + *
+   * The policy will be attached to a resource (e.g. projecct, document).
+   * 
+ * + * .google.iam.v1.Policy policy = 1; + * + * @return The policy. + */ + com.google.iam.v1.Policy getPolicy(); + /** + * + * + *
+   * The policy will be attached to a resource (e.g. projecct, document).
+   * 
+ * + * .google.iam.v1.Policy policy = 1; + */ + com.google.iam.v1.PolicyOrBuilder getPolicyOrBuilder(); + + /** + * + * + *
+   * Additional information for the API invocation, such as the request tracking
+   * id.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 2; + * + * @return Whether the metadata field is set. + */ + boolean hasMetadata(); + /** + * + * + *
+   * Additional information for the API invocation, such as the request tracking
+   * id.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 2; + * + * @return The metadata. + */ + com.google.cloud.contentwarehouse.v1.ResponseMetadata getMetadata(); + /** + * + * + *
+   * Additional information for the API invocation, such as the request tracking
+   * id.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 2; + */ + com.google.cloud.contentwarehouse.v1.ResponseMetadataOrBuilder getMetadataOrBuilder(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/SynonymSet.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/SynonymSet.java new file mode 100644 index 000000000000..3ba978595ac8 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/SynonymSet.java @@ -0,0 +1,2099 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/synonymset.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Represents a list of synonyms for a given context.
+ * For example a context "sales" could contain:
+ * Synonym 1: sale, invoice, bill, order
+ * Synonym 2: money, credit, finance, payment
+ * Synonym 3: shipping, freight, transport
+ * Each SynonymSets should be disjoint
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.SynonymSet} + */ +public final class SynonymSet extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.SynonymSet) + SynonymSetOrBuilder { + private static final long serialVersionUID = 0L; + // Use SynonymSet.newBuilder() to construct. + private SynonymSet(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SynonymSet() { + name_ = ""; + context_ = ""; + synonyms_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SynonymSet(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.SynonymSetProto + .internal_static_google_cloud_contentwarehouse_v1_SynonymSet_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.SynonymSetProto + .internal_static_google_cloud_contentwarehouse_v1_SynonymSet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.SynonymSet.class, + com.google.cloud.contentwarehouse.v1.SynonymSet.Builder.class); + } + + public interface SynonymOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.SynonymSet.Synonym) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * For example: sale, invoice, bill, order
+     * 
+ * + * repeated string words = 1; + * + * @return A list containing the words. + */ + java.util.List getWordsList(); + /** + * + * + *
+     * For example: sale, invoice, bill, order
+     * 
+ * + * repeated string words = 1; + * + * @return The count of words. + */ + int getWordsCount(); + /** + * + * + *
+     * For example: sale, invoice, bill, order
+     * 
+ * + * repeated string words = 1; + * + * @param index The index of the element to return. + * @return The words at the given index. + */ + java.lang.String getWords(int index); + /** + * + * + *
+     * For example: sale, invoice, bill, order
+     * 
+ * + * repeated string words = 1; + * + * @param index The index of the value to return. + * @return The bytes of the words at the given index. + */ + com.google.protobuf.ByteString getWordsBytes(int index); + } + /** + * + * + *
+   * Represents a list of words given by the customer
+   * All these words are synonyms of each other.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.SynonymSet.Synonym} + */ + public static final class Synonym extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.SynonymSet.Synonym) + SynonymOrBuilder { + private static final long serialVersionUID = 0L; + // Use Synonym.newBuilder() to construct. + private Synonym(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Synonym() { + words_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Synonym(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.SynonymSetProto + .internal_static_google_cloud_contentwarehouse_v1_SynonymSet_Synonym_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.SynonymSetProto + .internal_static_google_cloud_contentwarehouse_v1_SynonymSet_Synonym_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym.class, + com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym.Builder.class); + } + + public static final int WORDS_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList words_; + /** + * + * + *
+     * For example: sale, invoice, bill, order
+     * 
+ * + * repeated string words = 1; + * + * @return A list containing the words. + */ + public com.google.protobuf.ProtocolStringList getWordsList() { + return words_; + } + /** + * + * + *
+     * For example: sale, invoice, bill, order
+     * 
+ * + * repeated string words = 1; + * + * @return The count of words. + */ + public int getWordsCount() { + return words_.size(); + } + /** + * + * + *
+     * For example: sale, invoice, bill, order
+     * 
+ * + * repeated string words = 1; + * + * @param index The index of the element to return. + * @return The words at the given index. + */ + public java.lang.String getWords(int index) { + return words_.get(index); + } + /** + * + * + *
+     * For example: sale, invoice, bill, order
+     * 
+ * + * repeated string words = 1; + * + * @param index The index of the value to return. + * @return The bytes of the words at the given index. + */ + public com.google.protobuf.ByteString getWordsBytes(int index) { + return words_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < words_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, words_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < words_.size(); i++) { + dataSize += computeStringSizeNoTag(words_.getRaw(i)); + } + size += dataSize; + size += 1 * getWordsList().size(); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym other = + (com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym) obj; + + if (!getWordsList().equals(other.getWordsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getWordsCount() > 0) { + hash = (37 * hash) + WORDS_FIELD_NUMBER; + hash = (53 * hash) + getWordsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Represents a list of words given by the customer
+     * All these words are synonyms of each other.
+     * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.SynonymSet.Synonym} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.SynonymSet.Synonym) + com.google.cloud.contentwarehouse.v1.SynonymSet.SynonymOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.SynonymSetProto + .internal_static_google_cloud_contentwarehouse_v1_SynonymSet_Synonym_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.SynonymSetProto + .internal_static_google_cloud_contentwarehouse_v1_SynonymSet_Synonym_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym.class, + com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + words_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.SynonymSetProto + .internal_static_google_cloud_contentwarehouse_v1_SynonymSet_Synonym_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym build() { + com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym buildPartial() { + com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym result = + new com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + words_ = words_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.words_ = words_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym other) { + if (other == com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym.getDefaultInstance()) + return this; + if (!other.words_.isEmpty()) { + if (words_.isEmpty()) { + words_ = other.words_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureWordsIsMutable(); + words_.addAll(other.words_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureWordsIsMutable(); + words_.add(s); + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList words_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureWordsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + words_ = new com.google.protobuf.LazyStringArrayList(words_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+       * For example: sale, invoice, bill, order
+       * 
+ * + * repeated string words = 1; + * + * @return A list containing the words. + */ + public com.google.protobuf.ProtocolStringList getWordsList() { + return words_.getUnmodifiableView(); + } + /** + * + * + *
+       * For example: sale, invoice, bill, order
+       * 
+ * + * repeated string words = 1; + * + * @return The count of words. + */ + public int getWordsCount() { + return words_.size(); + } + /** + * + * + *
+       * For example: sale, invoice, bill, order
+       * 
+ * + * repeated string words = 1; + * + * @param index The index of the element to return. + * @return The words at the given index. + */ + public java.lang.String getWords(int index) { + return words_.get(index); + } + /** + * + * + *
+       * For example: sale, invoice, bill, order
+       * 
+ * + * repeated string words = 1; + * + * @param index The index of the value to return. + * @return The bytes of the words at the given index. + */ + public com.google.protobuf.ByteString getWordsBytes(int index) { + return words_.getByteString(index); + } + /** + * + * + *
+       * For example: sale, invoice, bill, order
+       * 
+ * + * repeated string words = 1; + * + * @param index The index to set the value at. + * @param value The words to set. + * @return This builder for chaining. + */ + public Builder setWords(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureWordsIsMutable(); + words_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * For example: sale, invoice, bill, order
+       * 
+ * + * repeated string words = 1; + * + * @param value The words to add. + * @return This builder for chaining. + */ + public Builder addWords(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureWordsIsMutable(); + words_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * For example: sale, invoice, bill, order
+       * 
+ * + * repeated string words = 1; + * + * @param values The words to add. + * @return This builder for chaining. + */ + public Builder addAllWords(java.lang.Iterable values) { + ensureWordsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, words_); + onChanged(); + return this; + } + /** + * + * + *
+       * For example: sale, invoice, bill, order
+       * 
+ * + * repeated string words = 1; + * + * @return This builder for chaining. + */ + public Builder clearWords() { + words_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * For example: sale, invoice, bill, order
+       * 
+ * + * repeated string words = 1; + * + * @param value The bytes of the words to add. + * @return This builder for chaining. + */ + public Builder addWordsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureWordsIsMutable(); + words_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.SynonymSet.Synonym) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.SynonymSet.Synonym) + private static final com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym(); + } + + public static com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Synonym parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The resource name of the SynonymSet
+   * This is mandatory for google.api.resource.
+   * Format:
+   * projects/{project_number}/locations/{location}/synonymSets/{context}.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * The resource name of the SynonymSet
+   * This is mandatory for google.api.resource.
+   * Format:
+   * projects/{project_number}/locations/{location}/synonymSets/{context}.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONTEXT_FIELD_NUMBER = 2; + private volatile java.lang.Object context_; + /** + * + * + *
+   * This is a freeform field. Example contexts can be "sales," "engineering,"
+   * "real estate," "accounting," etc.
+   * The context can be supplied during search requests.
+   * 
+ * + * string context = 2; + * + * @return The context. + */ + @java.lang.Override + public java.lang.String getContext() { + java.lang.Object ref = context_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + context_ = s; + return s; + } + } + /** + * + * + *
+   * This is a freeform field. Example contexts can be "sales," "engineering,"
+   * "real estate," "accounting," etc.
+   * The context can be supplied during search requests.
+   * 
+ * + * string context = 2; + * + * @return The bytes for context. + */ + @java.lang.Override + public com.google.protobuf.ByteString getContextBytes() { + java.lang.Object ref = context_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + context_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SYNONYMS_FIELD_NUMBER = 3; + private java.util.List synonyms_; + /** + * + * + *
+   * List of Synonyms for the context.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.SynonymSet.Synonym synonyms = 3; + */ + @java.lang.Override + public java.util.List getSynonymsList() { + return synonyms_; + } + /** + * + * + *
+   * List of Synonyms for the context.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.SynonymSet.Synonym synonyms = 3; + */ + @java.lang.Override + public java.util.List + getSynonymsOrBuilderList() { + return synonyms_; + } + /** + * + * + *
+   * List of Synonyms for the context.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.SynonymSet.Synonym synonyms = 3; + */ + @java.lang.Override + public int getSynonymsCount() { + return synonyms_.size(); + } + /** + * + * + *
+   * List of Synonyms for the context.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.SynonymSet.Synonym synonyms = 3; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym getSynonyms(int index) { + return synonyms_.get(index); + } + /** + * + * + *
+   * List of Synonyms for the context.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.SynonymSet.Synonym synonyms = 3; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.SynonymSet.SynonymOrBuilder getSynonymsOrBuilder( + int index) { + return synonyms_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(context_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, context_); + } + for (int i = 0; i < synonyms_.size(); i++) { + output.writeMessage(3, synonyms_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(context_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, context_); + } + for (int i = 0; i < synonyms_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, synonyms_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.SynonymSet)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.SynonymSet other = + (com.google.cloud.contentwarehouse.v1.SynonymSet) obj; + + if (!getName().equals(other.getName())) return false; + if (!getContext().equals(other.getContext())) return false; + if (!getSynonymsList().equals(other.getSynonymsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + getContext().hashCode(); + if (getSynonymsCount() > 0) { + hash = (37 * hash) + SYNONYMS_FIELD_NUMBER; + hash = (53 * hash) + getSynonymsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.SynonymSet parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.SynonymSet parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.SynonymSet parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.SynonymSet parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.SynonymSet parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.SynonymSet parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.SynonymSet parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.SynonymSet parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.SynonymSet parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.SynonymSet parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.SynonymSet parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.SynonymSet parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.contentwarehouse.v1.SynonymSet prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Represents a list of synonyms for a given context.
+   * For example a context "sales" could contain:
+   * Synonym 1: sale, invoice, bill, order
+   * Synonym 2: money, credit, finance, payment
+   * Synonym 3: shipping, freight, transport
+   * Each SynonymSets should be disjoint
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.SynonymSet} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.SynonymSet) + com.google.cloud.contentwarehouse.v1.SynonymSetOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.SynonymSetProto + .internal_static_google_cloud_contentwarehouse_v1_SynonymSet_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.SynonymSetProto + .internal_static_google_cloud_contentwarehouse_v1_SynonymSet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.SynonymSet.class, + com.google.cloud.contentwarehouse.v1.SynonymSet.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.SynonymSet.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + context_ = ""; + + if (synonymsBuilder_ == null) { + synonyms_ = java.util.Collections.emptyList(); + } else { + synonyms_ = null; + synonymsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.SynonymSetProto + .internal_static_google_cloud_contentwarehouse_v1_SynonymSet_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.SynonymSet getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.SynonymSet.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.SynonymSet build() { + com.google.cloud.contentwarehouse.v1.SynonymSet result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.SynonymSet buildPartial() { + com.google.cloud.contentwarehouse.v1.SynonymSet result = + new com.google.cloud.contentwarehouse.v1.SynonymSet(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.context_ = context_; + if (synonymsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + synonyms_ = java.util.Collections.unmodifiableList(synonyms_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.synonyms_ = synonyms_; + } else { + result.synonyms_ = synonymsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.SynonymSet) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.SynonymSet) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.SynonymSet other) { + if (other == com.google.cloud.contentwarehouse.v1.SynonymSet.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getContext().isEmpty()) { + context_ = other.context_; + onChanged(); + } + if (synonymsBuilder_ == null) { + if (!other.synonyms_.isEmpty()) { + if (synonyms_.isEmpty()) { + synonyms_ = other.synonyms_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSynonymsIsMutable(); + synonyms_.addAll(other.synonyms_); + } + onChanged(); + } + } else { + if (!other.synonyms_.isEmpty()) { + if (synonymsBuilder_.isEmpty()) { + synonymsBuilder_.dispose(); + synonymsBuilder_ = null; + synonyms_ = other.synonyms_; + bitField0_ = (bitField0_ & ~0x00000001); + synonymsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getSynonymsFieldBuilder() + : null; + } else { + synonymsBuilder_.addAllMessages(other.synonyms_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + context_ = input.readStringRequireUtf8(); + + break; + } // case 18 + case 26: + { + com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym m = + input.readMessage( + com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym.parser(), + extensionRegistry); + if (synonymsBuilder_ == null) { + ensureSynonymsIsMutable(); + synonyms_.add(m); + } else { + synonymsBuilder_.addMessage(m); + } + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The resource name of the SynonymSet
+     * This is mandatory for google.api.resource.
+     * Format:
+     * projects/{project_number}/locations/{location}/synonymSets/{context}.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource name of the SynonymSet
+     * This is mandatory for google.api.resource.
+     * Format:
+     * projects/{project_number}/locations/{location}/synonymSets/{context}.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource name of the SynonymSet
+     * This is mandatory for google.api.resource.
+     * Format:
+     * projects/{project_number}/locations/{location}/synonymSets/{context}.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the SynonymSet
+     * This is mandatory for google.api.resource.
+     * Format:
+     * projects/{project_number}/locations/{location}/synonymSets/{context}.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the SynonymSet
+     * This is mandatory for google.api.resource.
+     * Format:
+     * projects/{project_number}/locations/{location}/synonymSets/{context}.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object context_ = ""; + /** + * + * + *
+     * This is a freeform field. Example contexts can be "sales," "engineering,"
+     * "real estate," "accounting," etc.
+     * The context can be supplied during search requests.
+     * 
+ * + * string context = 2; + * + * @return The context. + */ + public java.lang.String getContext() { + java.lang.Object ref = context_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + context_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * This is a freeform field. Example contexts can be "sales," "engineering,"
+     * "real estate," "accounting," etc.
+     * The context can be supplied during search requests.
+     * 
+ * + * string context = 2; + * + * @return The bytes for context. + */ + public com.google.protobuf.ByteString getContextBytes() { + java.lang.Object ref = context_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + context_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * This is a freeform field. Example contexts can be "sales," "engineering,"
+     * "real estate," "accounting," etc.
+     * The context can be supplied during search requests.
+     * 
+ * + * string context = 2; + * + * @param value The context to set. + * @return This builder for chaining. + */ + public Builder setContext(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + context_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * This is a freeform field. Example contexts can be "sales," "engineering,"
+     * "real estate," "accounting," etc.
+     * The context can be supplied during search requests.
+     * 
+ * + * string context = 2; + * + * @return This builder for chaining. + */ + public Builder clearContext() { + + context_ = getDefaultInstance().getContext(); + onChanged(); + return this; + } + /** + * + * + *
+     * This is a freeform field. Example contexts can be "sales," "engineering,"
+     * "real estate," "accounting," etc.
+     * The context can be supplied during search requests.
+     * 
+ * + * string context = 2; + * + * @param value The bytes for context to set. + * @return This builder for chaining. + */ + public Builder setContextBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + context_ = value; + onChanged(); + return this; + } + + private java.util.List synonyms_ = + java.util.Collections.emptyList(); + + private void ensureSynonymsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + synonyms_ = + new java.util.ArrayList( + synonyms_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym, + com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym.Builder, + com.google.cloud.contentwarehouse.v1.SynonymSet.SynonymOrBuilder> + synonymsBuilder_; + + /** + * + * + *
+     * List of Synonyms for the context.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.SynonymSet.Synonym synonyms = 3; + */ + public java.util.List + getSynonymsList() { + if (synonymsBuilder_ == null) { + return java.util.Collections.unmodifiableList(synonyms_); + } else { + return synonymsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * List of Synonyms for the context.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.SynonymSet.Synonym synonyms = 3; + */ + public int getSynonymsCount() { + if (synonymsBuilder_ == null) { + return synonyms_.size(); + } else { + return synonymsBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of Synonyms for the context.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.SynonymSet.Synonym synonyms = 3; + */ + public com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym getSynonyms(int index) { + if (synonymsBuilder_ == null) { + return synonyms_.get(index); + } else { + return synonymsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of Synonyms for the context.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.SynonymSet.Synonym synonyms = 3; + */ + public Builder setSynonyms( + int index, com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym value) { + if (synonymsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSynonymsIsMutable(); + synonyms_.set(index, value); + onChanged(); + } else { + synonymsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of Synonyms for the context.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.SynonymSet.Synonym synonyms = 3; + */ + public Builder setSynonyms( + int index, + com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym.Builder builderForValue) { + if (synonymsBuilder_ == null) { + ensureSynonymsIsMutable(); + synonyms_.set(index, builderForValue.build()); + onChanged(); + } else { + synonymsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of Synonyms for the context.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.SynonymSet.Synonym synonyms = 3; + */ + public Builder addSynonyms(com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym value) { + if (synonymsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSynonymsIsMutable(); + synonyms_.add(value); + onChanged(); + } else { + synonymsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * List of Synonyms for the context.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.SynonymSet.Synonym synonyms = 3; + */ + public Builder addSynonyms( + int index, com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym value) { + if (synonymsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSynonymsIsMutable(); + synonyms_.add(index, value); + onChanged(); + } else { + synonymsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of Synonyms for the context.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.SynonymSet.Synonym synonyms = 3; + */ + public Builder addSynonyms( + com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym.Builder builderForValue) { + if (synonymsBuilder_ == null) { + ensureSynonymsIsMutable(); + synonyms_.add(builderForValue.build()); + onChanged(); + } else { + synonymsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of Synonyms for the context.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.SynonymSet.Synonym synonyms = 3; + */ + public Builder addSynonyms( + int index, + com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym.Builder builderForValue) { + if (synonymsBuilder_ == null) { + ensureSynonymsIsMutable(); + synonyms_.add(index, builderForValue.build()); + onChanged(); + } else { + synonymsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of Synonyms for the context.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.SynonymSet.Synonym synonyms = 3; + */ + public Builder addAllSynonyms( + java.lang.Iterable + values) { + if (synonymsBuilder_ == null) { + ensureSynonymsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, synonyms_); + onChanged(); + } else { + synonymsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * List of Synonyms for the context.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.SynonymSet.Synonym synonyms = 3; + */ + public Builder clearSynonyms() { + if (synonymsBuilder_ == null) { + synonyms_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + synonymsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of Synonyms for the context.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.SynonymSet.Synonym synonyms = 3; + */ + public Builder removeSynonyms(int index) { + if (synonymsBuilder_ == null) { + ensureSynonymsIsMutable(); + synonyms_.remove(index); + onChanged(); + } else { + synonymsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * List of Synonyms for the context.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.SynonymSet.Synonym synonyms = 3; + */ + public com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym.Builder getSynonymsBuilder( + int index) { + return getSynonymsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of Synonyms for the context.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.SynonymSet.Synonym synonyms = 3; + */ + public com.google.cloud.contentwarehouse.v1.SynonymSet.SynonymOrBuilder getSynonymsOrBuilder( + int index) { + if (synonymsBuilder_ == null) { + return synonyms_.get(index); + } else { + return synonymsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of Synonyms for the context.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.SynonymSet.Synonym synonyms = 3; + */ + public java.util.List< + ? extends com.google.cloud.contentwarehouse.v1.SynonymSet.SynonymOrBuilder> + getSynonymsOrBuilderList() { + if (synonymsBuilder_ != null) { + return synonymsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(synonyms_); + } + } + /** + * + * + *
+     * List of Synonyms for the context.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.SynonymSet.Synonym synonyms = 3; + */ + public com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym.Builder addSynonymsBuilder() { + return getSynonymsFieldBuilder() + .addBuilder(com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym.getDefaultInstance()); + } + /** + * + * + *
+     * List of Synonyms for the context.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.SynonymSet.Synonym synonyms = 3; + */ + public com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym.Builder addSynonymsBuilder( + int index) { + return getSynonymsFieldBuilder() + .addBuilder( + index, com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym.getDefaultInstance()); + } + /** + * + * + *
+     * List of Synonyms for the context.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.SynonymSet.Synonym synonyms = 3; + */ + public java.util.List + getSynonymsBuilderList() { + return getSynonymsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym, + com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym.Builder, + com.google.cloud.contentwarehouse.v1.SynonymSet.SynonymOrBuilder> + getSynonymsFieldBuilder() { + if (synonymsBuilder_ == null) { + synonymsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym, + com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym.Builder, + com.google.cloud.contentwarehouse.v1.SynonymSet.SynonymOrBuilder>( + synonyms_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + synonyms_ = null; + } + return synonymsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.SynonymSet) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.SynonymSet) + private static final com.google.cloud.contentwarehouse.v1.SynonymSet DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.SynonymSet(); + } + + public static com.google.cloud.contentwarehouse.v1.SynonymSet getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SynonymSet parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.SynonymSet getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/SynonymSetName.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/SynonymSetName.java new file mode 100644 index 000000000000..bf942de6f701 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/SynonymSetName.java @@ -0,0 +1,223 @@ +/* + * 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; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class SynonymSetName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_CONTEXT = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/synonymSets/{context}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String context; + + @Deprecated + protected SynonymSetName() { + project = null; + location = null; + context = null; + } + + private SynonymSetName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + context = Preconditions.checkNotNull(builder.getContext()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getContext() { + return context; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static SynonymSetName of(String project, String location, String context) { + return newBuilder().setProject(project).setLocation(location).setContext(context).build(); + } + + public static String format(String project, String location, String context) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setContext(context) + .build() + .toString(); + } + + public static SynonymSetName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_CONTEXT.validatedMatch( + formattedString, "SynonymSetName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("context")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (SynonymSetName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_CONTEXT.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (context != null) { + fieldMapBuilder.put("context", context); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_CONTEXT.instantiate( + "project", project, "location", location, "context", context); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + SynonymSetName that = ((SynonymSetName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.context, that.context); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(context); + return h; + } + + /** Builder for projects/{project}/locations/{location}/synonymSets/{context}. */ + public static class Builder { + private String project; + private String location; + private String context; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getContext() { + return context; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setContext(String context) { + this.context = context; + return this; + } + + private Builder(SynonymSetName synonymSetName) { + this.project = synonymSetName.project; + this.location = synonymSetName.location; + this.context = synonymSetName.context; + } + + public SynonymSetName build() { + return new SynonymSetName(this); + } + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/SynonymSetOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/SynonymSetOrBuilder.java new file mode 100644 index 000000000000..031e4e3891c6 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/SynonymSetOrBuilder.java @@ -0,0 +1,137 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/synonymset.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface SynonymSetOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.SynonymSet) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resource name of the SynonymSet
+   * This is mandatory for google.api.resource.
+   * Format:
+   * projects/{project_number}/locations/{location}/synonymSets/{context}.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The resource name of the SynonymSet
+   * This is mandatory for google.api.resource.
+   * Format:
+   * projects/{project_number}/locations/{location}/synonymSets/{context}.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * This is a freeform field. Example contexts can be "sales," "engineering,"
+   * "real estate," "accounting," etc.
+   * The context can be supplied during search requests.
+   * 
+ * + * string context = 2; + * + * @return The context. + */ + java.lang.String getContext(); + /** + * + * + *
+   * This is a freeform field. Example contexts can be "sales," "engineering,"
+   * "real estate," "accounting," etc.
+   * The context can be supplied during search requests.
+   * 
+ * + * string context = 2; + * + * @return The bytes for context. + */ + com.google.protobuf.ByteString getContextBytes(); + + /** + * + * + *
+   * List of Synonyms for the context.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.SynonymSet.Synonym synonyms = 3; + */ + java.util.List getSynonymsList(); + /** + * + * + *
+   * List of Synonyms for the context.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.SynonymSet.Synonym synonyms = 3; + */ + com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym getSynonyms(int index); + /** + * + * + *
+   * List of Synonyms for the context.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.SynonymSet.Synonym synonyms = 3; + */ + int getSynonymsCount(); + /** + * + * + *
+   * List of Synonyms for the context.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.SynonymSet.Synonym synonyms = 3; + */ + java.util.List + getSynonymsOrBuilderList(); + /** + * + * + *
+   * List of Synonyms for the context.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.SynonymSet.Synonym synonyms = 3; + */ + com.google.cloud.contentwarehouse.v1.SynonymSet.SynonymOrBuilder getSynonymsOrBuilder(int index); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/SynonymSetProto.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/SynonymSetProto.java new file mode 100644 index 000000000000..21fee36b85f7 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/SynonymSetProto.java @@ -0,0 +1,94 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/synonymset.proto + +package com.google.cloud.contentwarehouse.v1; + +public final class SynonymSetProto { + private SynonymSetProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_SynonymSet_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_SynonymSet_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_SynonymSet_Synonym_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_SynonymSet_Synonym_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n1google/cloud/contentwarehouse/v1/synon" + + "ymset.proto\022 google.cloud.contentwarehou" + + "se.v1\032\031google/api/resource.proto\"\375\001\n\nSyn" + + "onymSet\022\014\n\004name\030\001 \001(\t\022\017\n\007context\030\002 \001(\t\022F" + + "\n\010synonyms\030\003 \003(\01324.google.cloud.contentw" + + "arehouse.v1.SynonymSet.Synonym\032\030\n\007Synony" + + "m\022\r\n\005words\030\001 \003(\t:n\352Ak\n*contentwarehouse." + + "googleapis.com/SynonymSet\022=projects/{pro" + + "ject}/locations/{location}/synonymSets/{" + + "context}B\213\001\n$com.google.cloud.contentwar" + + "ehouse.v1B\017SynonymSetProtoP\001ZPgoogle.gol" + + "ang.org/genproto/googleapis/cloud/conten" + + "twarehouse/v1;contentwarehouseb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.ResourceProto.getDescriptor(), + }); + internal_static_google_cloud_contentwarehouse_v1_SynonymSet_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_contentwarehouse_v1_SynonymSet_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_SynonymSet_descriptor, + new java.lang.String[] { + "Name", "Context", "Synonyms", + }); + internal_static_google_cloud_contentwarehouse_v1_SynonymSet_Synonym_descriptor = + internal_static_google_cloud_contentwarehouse_v1_SynonymSet_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_contentwarehouse_v1_SynonymSet_Synonym_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_SynonymSet_Synonym_descriptor, + new java.lang.String[] { + "Words", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ResourceProto.resource); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.ResourceProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/SynonymSetServiceProto.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/SynonymSetServiceProto.java new file mode 100644 index 000000000000..b859b78665c6 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/SynonymSetServiceProto.java @@ -0,0 +1,104 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/synonymset_service.proto + +package com.google.cloud.contentwarehouse.v1; + +public final class SynonymSetServiceProto { + private SynonymSetServiceProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n9google/cloud/contentwarehouse/v1/synon" + + "ymset_service.proto\022 google.cloud.conten" + + "twarehouse.v1\032\034google/api/annotations.pr" + + "oto\032\027google/api/client.proto\0321google/clo" + + "ud/contentwarehouse/v1/synonymset.proto\032" + + "Agoogle/cloud/contentwarehouse/v1/synony" + + "mset_service_request.proto\032\033google/proto" + + "buf/empty.proto2\303\010\n\021SynonymSetService\022\326\001" + + "\n\020CreateSynonymSet\0229.google.cloud.conten" + + "twarehouse.v1.CreateSynonymSetRequest\032,." + + "google.cloud.contentwarehouse.v1.Synonym" + + "Set\"Y\202\323\344\223\002>\"//v1/{parent=projects/*/loca" + + "tions/*}/synonymSets:\013synonym_set\332A\022pare" + + "nt,synonym_set\022\265\001\n\rGetSynonymSet\0226.googl" + + "e.cloud.contentwarehouse.v1.GetSynonymSe" + + "tRequest\032,.google.cloud.contentwarehouse" + + ".v1.SynonymSet\">\202\323\344\223\0021\022//v1/{name=projec" + + "ts/*/locations/*/synonymSets/*}\332A\004name\022\324" + + "\001\n\020UpdateSynonymSet\0229.google.cloud.conte" + + "ntwarehouse.v1.UpdateSynonymSetRequest\032," + + ".google.cloud.contentwarehouse.v1.Synony" + + "mSet\"W\202\323\344\223\002>2//v1/{name=projects/*/locat" + + "ions/*/synonymSets/*}:\013synonym_set\332A\020nam" + + "e,synonym_set\022\245\001\n\020DeleteSynonymSet\0229.goo" + + "gle.cloud.contentwarehouse.v1.DeleteSyno" + + "nymSetRequest\032\026.google.protobuf.Empty\">\202" + + "\323\344\223\0021*//v1/{name=projects/*/locations/*/" + + "synonymSets/*}\332A\004name\022\310\001\n\017ListSynonymSet" + + "s\0228.google.cloud.contentwarehouse.v1.Lis" + + "tSynonymSetsRequest\0329.google.cloud.conte" + + "ntwarehouse.v1.ListSynonymSetsResponse\"@" + + "\202\323\344\223\0021\022//v1/{parent=projects/*/locations" + + "/*}/synonymSets\332A\006parent\032S\312A\037contentware" + + "house.googleapis.com\322A.https://www.googl" + + "eapis.com/auth/cloud-platformB\222\001\n$com.go" + + "ogle.cloud.contentwarehouse.v1B\026SynonymS" + + "etServiceProtoP\001ZPgoogle.golang.org/genp" + + "roto/googleapis/cloud/contentwarehouse/v" + + "1;contentwarehouseb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.cloud.contentwarehouse.v1.SynonymSetProto.getDescriptor(), + com.google.cloud.contentwarehouse.v1.SynonymSetServiceRequestProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.cloud.contentwarehouse.v1.SynonymSetProto.getDescriptor(); + com.google.cloud.contentwarehouse.v1.SynonymSetServiceRequestProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/SynonymSetServiceRequestProto.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/SynonymSetServiceRequestProto.java new file mode 100644 index 000000000000..dc632734caf2 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/SynonymSetServiceRequestProto.java @@ -0,0 +1,161 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/synonymset_service_request.proto + +package com.google.cloud.contentwarehouse.v1; + +public final class SynonymSetServiceRequestProto { + private SynonymSetServiceRequestProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_CreateSynonymSetRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_CreateSynonymSetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_GetSynonymSetRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_GetSynonymSetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_ListSynonymSetsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_ListSynonymSetsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_ListSynonymSetsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_ListSynonymSetsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_UpdateSynonymSetRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_UpdateSynonymSetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_contentwarehouse_v1_DeleteSynonymSetRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_contentwarehouse_v1_DeleteSynonymSetRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\nAgoogle/cloud/contentwarehouse/v1/synon" + + "ymset_service_request.proto\022 google.clou" + + "d.contentwarehouse.v1\032\037google/api/field_" + + "behavior.proto\032\031google/api/resource.prot" + + "o\0321google/cloud/contentwarehouse/v1/syno" + + "nymset.proto\"\243\001\n\027CreateSynonymSetRequest" + + "\022@\n\006parent\030\001 \001(\tB0\340A\002\372A*\n(contentwarehou" + + "se.googleapis.com/Location\022F\n\013synonym_se" + + "t\030\002 \001(\0132,.google.cloud.contentwarehouse." + + "v1.SynonymSetB\003\340A\002\"X\n\024GetSynonymSetReque" + + "st\022@\n\004name\030\001 \001(\tB2\340A\002\372A,\n*contentwarehou" + + "se.googleapis.com/SynonymSet\"\201\001\n\026ListSyn" + + "onymSetsRequest\022@\n\006parent\030\001 \001(\tB0\340A\002\372A*\n" + + "(contentwarehouse.googleapis.com/Locatio" + + "n\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t" + + "\"v\n\027ListSynonymSetsResponse\022B\n\014synonym_s" + + "ets\030\001 \003(\0132,.google.cloud.contentwarehous" + + "e.v1.SynonymSet\022\027\n\017next_page_token\030\002 \001(\t" + + "\"\243\001\n\027UpdateSynonymSetRequest\022@\n\004name\030\001 \001" + + "(\tB2\340A\002\372A,\n*contentwarehouse.googleapis." + + "com/SynonymSet\022F\n\013synonym_set\030\002 \001(\0132,.go" + + "ogle.cloud.contentwarehouse.v1.SynonymSe" + + "tB\003\340A\002\"[\n\027DeleteSynonymSetRequest\022@\n\004nam" + + "e\030\001 \001(\tB2\340A\002\372A,\n*contentwarehouse.google" + + "apis.com/SynonymSetB\231\001\n$com.google.cloud" + + ".contentwarehouse.v1B\035SynonymSetServiceR" + + "equestProtoP\001ZPgoogle.golang.org/genprot" + + "o/googleapis/cloud/contentwarehouse/v1;c" + + "ontentwarehouseb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.contentwarehouse.v1.SynonymSetProto.getDescriptor(), + }); + internal_static_google_cloud_contentwarehouse_v1_CreateSynonymSetRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_contentwarehouse_v1_CreateSynonymSetRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_CreateSynonymSetRequest_descriptor, + new java.lang.String[] { + "Parent", "SynonymSet", + }); + internal_static_google_cloud_contentwarehouse_v1_GetSynonymSetRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_contentwarehouse_v1_GetSynonymSetRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_GetSynonymSetRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_contentwarehouse_v1_ListSynonymSetsRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_contentwarehouse_v1_ListSynonymSetsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_ListSynonymSetsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_cloud_contentwarehouse_v1_ListSynonymSetsResponse_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_contentwarehouse_v1_ListSynonymSetsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_ListSynonymSetsResponse_descriptor, + new java.lang.String[] { + "SynonymSets", "NextPageToken", + }); + internal_static_google_cloud_contentwarehouse_v1_UpdateSynonymSetRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_contentwarehouse_v1_UpdateSynonymSetRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_UpdateSynonymSetRequest_descriptor, + new java.lang.String[] { + "Name", "SynonymSet", + }); + internal_static_google_cloud_contentwarehouse_v1_DeleteSynonymSetRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_contentwarehouse_v1_DeleteSynonymSetRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_contentwarehouse_v1_DeleteSynonymSetRequest_descriptor, + new java.lang.String[] { + "Name", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.contentwarehouse.v1.SynonymSetProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/TextArray.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/TextArray.java new file mode 100644 index 000000000000..8d33460da16b --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/TextArray.java @@ -0,0 +1,709 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * String/text values.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.TextArray} + */ +public final class TextArray extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.TextArray) + TextArrayOrBuilder { + private static final long serialVersionUID = 0L; + // Use TextArray.newBuilder() to construct. + private TextArray(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TextArray() { + values_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TextArray(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_TextArray_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_TextArray_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.TextArray.class, + com.google.cloud.contentwarehouse.v1.TextArray.Builder.class); + } + + public static final int VALUES_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList values_; + /** + * + * + *
+   * List of text values.
+   * 
+ * + * repeated string values = 1; + * + * @return A list containing the values. + */ + public com.google.protobuf.ProtocolStringList getValuesList() { + return values_; + } + /** + * + * + *
+   * List of text values.
+   * 
+ * + * repeated string values = 1; + * + * @return The count of values. + */ + public int getValuesCount() { + return values_.size(); + } + /** + * + * + *
+   * List of text values.
+   * 
+ * + * repeated string values = 1; + * + * @param index The index of the element to return. + * @return The values at the given index. + */ + public java.lang.String getValues(int index) { + return values_.get(index); + } + /** + * + * + *
+   * List of text values.
+   * 
+ * + * repeated string values = 1; + * + * @param index The index of the value to return. + * @return The bytes of the values at the given index. + */ + public com.google.protobuf.ByteString getValuesBytes(int index) { + return values_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < values_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, values_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < values_.size(); i++) { + dataSize += computeStringSizeNoTag(values_.getRaw(i)); + } + size += dataSize; + size += 1 * getValuesList().size(); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.TextArray)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.TextArray other = + (com.google.cloud.contentwarehouse.v1.TextArray) obj; + + if (!getValuesList().equals(other.getValuesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getValuesCount() > 0) { + hash = (37 * hash) + VALUES_FIELD_NUMBER; + hash = (53 * hash) + getValuesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.TextArray parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.TextArray parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.TextArray parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.TextArray parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.TextArray parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.TextArray parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.TextArray parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.TextArray parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.TextArray parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.TextArray parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.TextArray parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.TextArray parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.contentwarehouse.v1.TextArray prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * String/text values.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.TextArray} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.TextArray) + com.google.cloud.contentwarehouse.v1.TextArrayOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_TextArray_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_TextArray_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.TextArray.class, + com.google.cloud.contentwarehouse.v1.TextArray.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.TextArray.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + values_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_TextArray_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.TextArray getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.TextArray.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.TextArray build() { + com.google.cloud.contentwarehouse.v1.TextArray result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.TextArray buildPartial() { + com.google.cloud.contentwarehouse.v1.TextArray result = + new com.google.cloud.contentwarehouse.v1.TextArray(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + values_ = values_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.values_ = values_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.TextArray) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.TextArray) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.TextArray other) { + if (other == com.google.cloud.contentwarehouse.v1.TextArray.getDefaultInstance()) return this; + if (!other.values_.isEmpty()) { + if (values_.isEmpty()) { + values_ = other.values_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureValuesIsMutable(); + values_.addAll(other.values_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureValuesIsMutable(); + values_.add(s); + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList values_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureValuesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + values_ = new com.google.protobuf.LazyStringArrayList(values_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * List of text values.
+     * 
+ * + * repeated string values = 1; + * + * @return A list containing the values. + */ + public com.google.protobuf.ProtocolStringList getValuesList() { + return values_.getUnmodifiableView(); + } + /** + * + * + *
+     * List of text values.
+     * 
+ * + * repeated string values = 1; + * + * @return The count of values. + */ + public int getValuesCount() { + return values_.size(); + } + /** + * + * + *
+     * List of text values.
+     * 
+ * + * repeated string values = 1; + * + * @param index The index of the element to return. + * @return The values at the given index. + */ + public java.lang.String getValues(int index) { + return values_.get(index); + } + /** + * + * + *
+     * List of text values.
+     * 
+ * + * repeated string values = 1; + * + * @param index The index of the value to return. + * @return The bytes of the values at the given index. + */ + public com.google.protobuf.ByteString getValuesBytes(int index) { + return values_.getByteString(index); + } + /** + * + * + *
+     * List of text values.
+     * 
+ * + * repeated string values = 1; + * + * @param index The index to set the value at. + * @param value The values to set. + * @return This builder for chaining. + */ + public Builder setValues(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * List of text values.
+     * 
+ * + * repeated string values = 1; + * + * @param value The values to add. + * @return This builder for chaining. + */ + public Builder addValues(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * List of text values.
+     * 
+ * + * repeated string values = 1; + * + * @param values The values to add. + * @return This builder for chaining. + */ + public Builder addAllValues(java.lang.Iterable values) { + ensureValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, values_); + onChanged(); + return this; + } + /** + * + * + *
+     * List of text values.
+     * 
+ * + * repeated string values = 1; + * + * @return This builder for chaining. + */ + public Builder clearValues() { + values_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * List of text values.
+     * 
+ * + * repeated string values = 1; + * + * @param value The bytes of the values to add. + * @return This builder for chaining. + */ + public Builder addValuesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureValuesIsMutable(); + values_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.TextArray) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.TextArray) + private static final com.google.cloud.contentwarehouse.v1.TextArray DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.TextArray(); + } + + public static com.google.cloud.contentwarehouse.v1.TextArray getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TextArray parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.TextArray getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/TextArrayOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/TextArrayOrBuilder.java new file mode 100644 index 000000000000..fff476994f29 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/TextArrayOrBuilder.java @@ -0,0 +1,76 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface TextArrayOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.TextArray) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of text values.
+   * 
+ * + * repeated string values = 1; + * + * @return A list containing the values. + */ + java.util.List getValuesList(); + /** + * + * + *
+   * List of text values.
+   * 
+ * + * repeated string values = 1; + * + * @return The count of values. + */ + int getValuesCount(); + /** + * + * + *
+   * List of text values.
+   * 
+ * + * repeated string values = 1; + * + * @param index The index of the element to return. + * @return The values at the given index. + */ + java.lang.String getValues(int index); + /** + * + * + *
+   * List of text values.
+   * 
+ * + * repeated string values = 1; + * + * @param index The index of the value to return. + * @return The bytes of the values at the given index. + */ + com.google.protobuf.ByteString getValuesBytes(int index); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/TextTypeOptions.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/TextTypeOptions.java new file mode 100644 index 000000000000..ce2a0b914568 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/TextTypeOptions.java @@ -0,0 +1,436 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_schema.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Configurations for a text property.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.TextTypeOptions} + */ +public final class TextTypeOptions extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.TextTypeOptions) + TextTypeOptionsOrBuilder { + private static final long serialVersionUID = 0L; + // Use TextTypeOptions.newBuilder() to construct. + private TextTypeOptions(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TextTypeOptions() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TextTypeOptions(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaProto + .internal_static_google_cloud_contentwarehouse_v1_TextTypeOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaProto + .internal_static_google_cloud_contentwarehouse_v1_TextTypeOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.TextTypeOptions.class, + com.google.cloud.contentwarehouse.v1.TextTypeOptions.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.TextTypeOptions)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.TextTypeOptions other = + (com.google.cloud.contentwarehouse.v1.TextTypeOptions) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.TextTypeOptions parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.TextTypeOptions parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.TextTypeOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.TextTypeOptions parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.TextTypeOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.TextTypeOptions parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.TextTypeOptions parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.TextTypeOptions parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.TextTypeOptions parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.TextTypeOptions parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.TextTypeOptions parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.TextTypeOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.contentwarehouse.v1.TextTypeOptions prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Configurations for a text property.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.TextTypeOptions} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.TextTypeOptions) + com.google.cloud.contentwarehouse.v1.TextTypeOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaProto + .internal_static_google_cloud_contentwarehouse_v1_TextTypeOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaProto + .internal_static_google_cloud_contentwarehouse_v1_TextTypeOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.TextTypeOptions.class, + com.google.cloud.contentwarehouse.v1.TextTypeOptions.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.TextTypeOptions.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaProto + .internal_static_google_cloud_contentwarehouse_v1_TextTypeOptions_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.TextTypeOptions getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.TextTypeOptions.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.TextTypeOptions build() { + com.google.cloud.contentwarehouse.v1.TextTypeOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.TextTypeOptions buildPartial() { + com.google.cloud.contentwarehouse.v1.TextTypeOptions result = + new com.google.cloud.contentwarehouse.v1.TextTypeOptions(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.TextTypeOptions) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.TextTypeOptions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.TextTypeOptions other) { + if (other == com.google.cloud.contentwarehouse.v1.TextTypeOptions.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.TextTypeOptions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.TextTypeOptions) + private static final com.google.cloud.contentwarehouse.v1.TextTypeOptions DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.TextTypeOptions(); + } + + public static com.google.cloud.contentwarehouse.v1.TextTypeOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TextTypeOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.TextTypeOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/TextTypeOptionsOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/TextTypeOptionsOrBuilder.java new file mode 100644 index 000000000000..6f629a72fce1 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/TextTypeOptionsOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_schema.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface TextTypeOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.TextTypeOptions) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/TimeFilter.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/TimeFilter.java new file mode 100644 index 000000000000..034b47d25e05 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/TimeFilter.java @@ -0,0 +1,929 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/filters.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Filter on create timestamp or update timestamp of documents.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.TimeFilter} + */ +public final class TimeFilter extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.TimeFilter) + TimeFilterOrBuilder { + private static final long serialVersionUID = 0L; + // Use TimeFilter.newBuilder() to construct. + private TimeFilter(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TimeFilter() { + timeField_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TimeFilter(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.FiltersProto + .internal_static_google_cloud_contentwarehouse_v1_TimeFilter_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.FiltersProto + .internal_static_google_cloud_contentwarehouse_v1_TimeFilter_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.TimeFilter.class, + com.google.cloud.contentwarehouse.v1.TimeFilter.Builder.class); + } + + /** + * + * + *
+   * Time field used in TimeFilter.
+   * 
+ * + * Protobuf enum {@code google.cloud.contentwarehouse.v1.TimeFilter.TimeField} + */ + public enum TimeField implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Default value.
+     * 
+ * + * TIME_FIELD_UNSPECIFIED = 0; + */ + TIME_FIELD_UNSPECIFIED(0), + /** + * + * + *
+     * Earliest document create time.
+     * 
+ * + * CREATE_TIME = 1; + */ + CREATE_TIME(1), + /** + * + * + *
+     * Latest document update time.
+     * 
+ * + * UPDATE_TIME = 2; + */ + UPDATE_TIME(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Default value.
+     * 
+ * + * TIME_FIELD_UNSPECIFIED = 0; + */ + public static final int TIME_FIELD_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Earliest document create time.
+     * 
+ * + * CREATE_TIME = 1; + */ + public static final int CREATE_TIME_VALUE = 1; + /** + * + * + *
+     * Latest document update time.
+     * 
+ * + * UPDATE_TIME = 2; + */ + public static final int UPDATE_TIME_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static TimeField valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static TimeField forNumber(int value) { + switch (value) { + case 0: + return TIME_FIELD_UNSPECIFIED; + case 1: + return CREATE_TIME; + case 2: + return UPDATE_TIME; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public TimeField findValueByNumber(int number) { + return TimeField.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.TimeFilter.getDescriptor().getEnumTypes().get(0); + } + + private static final TimeField[] VALUES = values(); + + public static TimeField valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private TimeField(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.contentwarehouse.v1.TimeFilter.TimeField) + } + + public static final int TIME_RANGE_FIELD_NUMBER = 1; + private com.google.type.Interval timeRange_; + /** + * .google.type.Interval time_range = 1; + * + * @return Whether the timeRange field is set. + */ + @java.lang.Override + public boolean hasTimeRange() { + return timeRange_ != null; + } + /** + * .google.type.Interval time_range = 1; + * + * @return The timeRange. + */ + @java.lang.Override + public com.google.type.Interval getTimeRange() { + return timeRange_ == null ? com.google.type.Interval.getDefaultInstance() : timeRange_; + } + /** .google.type.Interval time_range = 1; */ + @java.lang.Override + public com.google.type.IntervalOrBuilder getTimeRangeOrBuilder() { + return getTimeRange(); + } + + public static final int TIME_FIELD_FIELD_NUMBER = 2; + private int timeField_; + /** + * + * + *
+   * Specifies which time field to filter documents on.
+   * Defaults to [TimeField.UPLOAD_TIME][].
+   * 
+ * + * .google.cloud.contentwarehouse.v1.TimeFilter.TimeField time_field = 2; + * + * @return The enum numeric value on the wire for timeField. + */ + @java.lang.Override + public int getTimeFieldValue() { + return timeField_; + } + /** + * + * + *
+   * Specifies which time field to filter documents on.
+   * Defaults to [TimeField.UPLOAD_TIME][].
+   * 
+ * + * .google.cloud.contentwarehouse.v1.TimeFilter.TimeField time_field = 2; + * + * @return The timeField. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.TimeFilter.TimeField getTimeField() { + @SuppressWarnings("deprecation") + com.google.cloud.contentwarehouse.v1.TimeFilter.TimeField result = + com.google.cloud.contentwarehouse.v1.TimeFilter.TimeField.valueOf(timeField_); + return result == null + ? com.google.cloud.contentwarehouse.v1.TimeFilter.TimeField.UNRECOGNIZED + : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (timeRange_ != null) { + output.writeMessage(1, getTimeRange()); + } + if (timeField_ + != com.google.cloud.contentwarehouse.v1.TimeFilter.TimeField.TIME_FIELD_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, timeField_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (timeRange_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getTimeRange()); + } + if (timeField_ + != com.google.cloud.contentwarehouse.v1.TimeFilter.TimeField.TIME_FIELD_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, timeField_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.TimeFilter)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.TimeFilter other = + (com.google.cloud.contentwarehouse.v1.TimeFilter) obj; + + if (hasTimeRange() != other.hasTimeRange()) return false; + if (hasTimeRange()) { + if (!getTimeRange().equals(other.getTimeRange())) return false; + } + if (timeField_ != other.timeField_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasTimeRange()) { + hash = (37 * hash) + TIME_RANGE_FIELD_NUMBER; + hash = (53 * hash) + getTimeRange().hashCode(); + } + hash = (37 * hash) + TIME_FIELD_FIELD_NUMBER; + hash = (53 * hash) + timeField_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.TimeFilter parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.TimeFilter parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.TimeFilter parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.TimeFilter parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.TimeFilter parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.TimeFilter parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.TimeFilter parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.TimeFilter parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.TimeFilter parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.TimeFilter parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.TimeFilter parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.TimeFilter parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.contentwarehouse.v1.TimeFilter prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Filter on create timestamp or update timestamp of documents.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.TimeFilter} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.TimeFilter) + com.google.cloud.contentwarehouse.v1.TimeFilterOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.FiltersProto + .internal_static_google_cloud_contentwarehouse_v1_TimeFilter_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.FiltersProto + .internal_static_google_cloud_contentwarehouse_v1_TimeFilter_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.TimeFilter.class, + com.google.cloud.contentwarehouse.v1.TimeFilter.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.TimeFilter.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (timeRangeBuilder_ == null) { + timeRange_ = null; + } else { + timeRange_ = null; + timeRangeBuilder_ = null; + } + timeField_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.FiltersProto + .internal_static_google_cloud_contentwarehouse_v1_TimeFilter_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.TimeFilter getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.TimeFilter.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.TimeFilter build() { + com.google.cloud.contentwarehouse.v1.TimeFilter result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.TimeFilter buildPartial() { + com.google.cloud.contentwarehouse.v1.TimeFilter result = + new com.google.cloud.contentwarehouse.v1.TimeFilter(this); + if (timeRangeBuilder_ == null) { + result.timeRange_ = timeRange_; + } else { + result.timeRange_ = timeRangeBuilder_.build(); + } + result.timeField_ = timeField_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.TimeFilter) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.TimeFilter) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.TimeFilter other) { + if (other == com.google.cloud.contentwarehouse.v1.TimeFilter.getDefaultInstance()) + return this; + if (other.hasTimeRange()) { + mergeTimeRange(other.getTimeRange()); + } + if (other.timeField_ != 0) { + setTimeFieldValue(other.getTimeFieldValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getTimeRangeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 16: + { + timeField_ = input.readEnum(); + + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private com.google.type.Interval timeRange_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Interval, + com.google.type.Interval.Builder, + com.google.type.IntervalOrBuilder> + timeRangeBuilder_; + /** + * .google.type.Interval time_range = 1; + * + * @return Whether the timeRange field is set. + */ + public boolean hasTimeRange() { + return timeRangeBuilder_ != null || timeRange_ != null; + } + /** + * .google.type.Interval time_range = 1; + * + * @return The timeRange. + */ + public com.google.type.Interval getTimeRange() { + if (timeRangeBuilder_ == null) { + return timeRange_ == null ? com.google.type.Interval.getDefaultInstance() : timeRange_; + } else { + return timeRangeBuilder_.getMessage(); + } + } + /** .google.type.Interval time_range = 1; */ + public Builder setTimeRange(com.google.type.Interval value) { + if (timeRangeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + timeRange_ = value; + onChanged(); + } else { + timeRangeBuilder_.setMessage(value); + } + + return this; + } + /** .google.type.Interval time_range = 1; */ + public Builder setTimeRange(com.google.type.Interval.Builder builderForValue) { + if (timeRangeBuilder_ == null) { + timeRange_ = builderForValue.build(); + onChanged(); + } else { + timeRangeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** .google.type.Interval time_range = 1; */ + public Builder mergeTimeRange(com.google.type.Interval value) { + if (timeRangeBuilder_ == null) { + if (timeRange_ != null) { + timeRange_ = + com.google.type.Interval.newBuilder(timeRange_).mergeFrom(value).buildPartial(); + } else { + timeRange_ = value; + } + onChanged(); + } else { + timeRangeBuilder_.mergeFrom(value); + } + + return this; + } + /** .google.type.Interval time_range = 1; */ + public Builder clearTimeRange() { + if (timeRangeBuilder_ == null) { + timeRange_ = null; + onChanged(); + } else { + timeRange_ = null; + timeRangeBuilder_ = null; + } + + return this; + } + /** .google.type.Interval time_range = 1; */ + public com.google.type.Interval.Builder getTimeRangeBuilder() { + + onChanged(); + return getTimeRangeFieldBuilder().getBuilder(); + } + /** .google.type.Interval time_range = 1; */ + public com.google.type.IntervalOrBuilder getTimeRangeOrBuilder() { + if (timeRangeBuilder_ != null) { + return timeRangeBuilder_.getMessageOrBuilder(); + } else { + return timeRange_ == null ? com.google.type.Interval.getDefaultInstance() : timeRange_; + } + } + /** .google.type.Interval time_range = 1; */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Interval, + com.google.type.Interval.Builder, + com.google.type.IntervalOrBuilder> + getTimeRangeFieldBuilder() { + if (timeRangeBuilder_ == null) { + timeRangeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Interval, + com.google.type.Interval.Builder, + com.google.type.IntervalOrBuilder>( + getTimeRange(), getParentForChildren(), isClean()); + timeRange_ = null; + } + return timeRangeBuilder_; + } + + private int timeField_ = 0; + /** + * + * + *
+     * Specifies which time field to filter documents on.
+     * Defaults to [TimeField.UPLOAD_TIME][].
+     * 
+ * + * .google.cloud.contentwarehouse.v1.TimeFilter.TimeField time_field = 2; + * + * @return The enum numeric value on the wire for timeField. + */ + @java.lang.Override + public int getTimeFieldValue() { + return timeField_; + } + /** + * + * + *
+     * Specifies which time field to filter documents on.
+     * Defaults to [TimeField.UPLOAD_TIME][].
+     * 
+ * + * .google.cloud.contentwarehouse.v1.TimeFilter.TimeField time_field = 2; + * + * @param value The enum numeric value on the wire for timeField to set. + * @return This builder for chaining. + */ + public Builder setTimeFieldValue(int value) { + + timeField_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies which time field to filter documents on.
+     * Defaults to [TimeField.UPLOAD_TIME][].
+     * 
+ * + * .google.cloud.contentwarehouse.v1.TimeFilter.TimeField time_field = 2; + * + * @return The timeField. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.TimeFilter.TimeField getTimeField() { + @SuppressWarnings("deprecation") + com.google.cloud.contentwarehouse.v1.TimeFilter.TimeField result = + com.google.cloud.contentwarehouse.v1.TimeFilter.TimeField.valueOf(timeField_); + return result == null + ? com.google.cloud.contentwarehouse.v1.TimeFilter.TimeField.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Specifies which time field to filter documents on.
+     * Defaults to [TimeField.UPLOAD_TIME][].
+     * 
+ * + * .google.cloud.contentwarehouse.v1.TimeFilter.TimeField time_field = 2; + * + * @param value The timeField to set. + * @return This builder for chaining. + */ + public Builder setTimeField(com.google.cloud.contentwarehouse.v1.TimeFilter.TimeField value) { + if (value == null) { + throw new NullPointerException(); + } + + timeField_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies which time field to filter documents on.
+     * Defaults to [TimeField.UPLOAD_TIME][].
+     * 
+ * + * .google.cloud.contentwarehouse.v1.TimeFilter.TimeField time_field = 2; + * + * @return This builder for chaining. + */ + public Builder clearTimeField() { + + timeField_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.TimeFilter) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.TimeFilter) + private static final com.google.cloud.contentwarehouse.v1.TimeFilter DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.TimeFilter(); + } + + public static com.google.cloud.contentwarehouse.v1.TimeFilter getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TimeFilter parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.TimeFilter getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/TimeFilterOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/TimeFilterOrBuilder.java new file mode 100644 index 000000000000..c3881c68c79e --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/TimeFilterOrBuilder.java @@ -0,0 +1,67 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/filters.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface TimeFilterOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.TimeFilter) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.type.Interval time_range = 1; + * + * @return Whether the timeRange field is set. + */ + boolean hasTimeRange(); + /** + * .google.type.Interval time_range = 1; + * + * @return The timeRange. + */ + com.google.type.Interval getTimeRange(); + /** .google.type.Interval time_range = 1; */ + com.google.type.IntervalOrBuilder getTimeRangeOrBuilder(); + + /** + * + * + *
+   * Specifies which time field to filter documents on.
+   * Defaults to [TimeField.UPLOAD_TIME][].
+   * 
+ * + * .google.cloud.contentwarehouse.v1.TimeFilter.TimeField time_field = 2; + * + * @return The enum numeric value on the wire for timeField. + */ + int getTimeFieldValue(); + /** + * + * + *
+   * Specifies which time field to filter documents on.
+   * Defaults to [TimeField.UPLOAD_TIME][].
+   * 
+ * + * .google.cloud.contentwarehouse.v1.TimeFilter.TimeField time_field = 2; + * + * @return The timeField. + */ + com.google.cloud.contentwarehouse.v1.TimeFilter.TimeField getTimeField(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/TimestampArray.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/TimestampArray.java new file mode 100644 index 000000000000..136676739a8e --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/TimestampArray.java @@ -0,0 +1,932 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Timestamp values.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.TimestampArray} + */ +public final class TimestampArray extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.TimestampArray) + TimestampArrayOrBuilder { + private static final long serialVersionUID = 0L; + // Use TimestampArray.newBuilder() to construct. + private TimestampArray(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TimestampArray() { + values_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TimestampArray(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_TimestampArray_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_TimestampArray_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.TimestampArray.class, + com.google.cloud.contentwarehouse.v1.TimestampArray.Builder.class); + } + + public static final int VALUES_FIELD_NUMBER = 1; + private java.util.List values_; + /** + * + * + *
+   * List of timestamp values.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.TimestampValue values = 1; + */ + @java.lang.Override + public java.util.List getValuesList() { + return values_; + } + /** + * + * + *
+   * List of timestamp values.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.TimestampValue values = 1; + */ + @java.lang.Override + public java.util.List + getValuesOrBuilderList() { + return values_; + } + /** + * + * + *
+   * List of timestamp values.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.TimestampValue values = 1; + */ + @java.lang.Override + public int getValuesCount() { + return values_.size(); + } + /** + * + * + *
+   * List of timestamp values.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.TimestampValue values = 1; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.TimestampValue getValues(int index) { + return values_.get(index); + } + /** + * + * + *
+   * List of timestamp values.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.TimestampValue values = 1; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.TimestampValueOrBuilder getValuesOrBuilder( + int index) { + return values_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < values_.size(); i++) { + output.writeMessage(1, values_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < values_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, values_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.TimestampArray)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.TimestampArray other = + (com.google.cloud.contentwarehouse.v1.TimestampArray) obj; + + if (!getValuesList().equals(other.getValuesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getValuesCount() > 0) { + hash = (37 * hash) + VALUES_FIELD_NUMBER; + hash = (53 * hash) + getValuesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.TimestampArray parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.TimestampArray parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.TimestampArray parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.TimestampArray parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.TimestampArray parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.TimestampArray parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.TimestampArray parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.TimestampArray parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.TimestampArray parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.TimestampArray parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.TimestampArray parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.TimestampArray parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.contentwarehouse.v1.TimestampArray prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Timestamp values.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.TimestampArray} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.TimestampArray) + com.google.cloud.contentwarehouse.v1.TimestampArrayOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_TimestampArray_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_TimestampArray_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.TimestampArray.class, + com.google.cloud.contentwarehouse.v1.TimestampArray.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.TimestampArray.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (valuesBuilder_ == null) { + values_ = java.util.Collections.emptyList(); + } else { + values_ = null; + valuesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_TimestampArray_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.TimestampArray getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.TimestampArray.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.TimestampArray build() { + com.google.cloud.contentwarehouse.v1.TimestampArray result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.TimestampArray buildPartial() { + com.google.cloud.contentwarehouse.v1.TimestampArray result = + new com.google.cloud.contentwarehouse.v1.TimestampArray(this); + int from_bitField0_ = bitField0_; + if (valuesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + values_ = java.util.Collections.unmodifiableList(values_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.values_ = values_; + } else { + result.values_ = valuesBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.TimestampArray) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.TimestampArray) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.TimestampArray other) { + if (other == com.google.cloud.contentwarehouse.v1.TimestampArray.getDefaultInstance()) + return this; + if (valuesBuilder_ == null) { + if (!other.values_.isEmpty()) { + if (values_.isEmpty()) { + values_ = other.values_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureValuesIsMutable(); + values_.addAll(other.values_); + } + onChanged(); + } + } else { + if (!other.values_.isEmpty()) { + if (valuesBuilder_.isEmpty()) { + valuesBuilder_.dispose(); + valuesBuilder_ = null; + values_ = other.values_; + bitField0_ = (bitField0_ & ~0x00000001); + valuesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getValuesFieldBuilder() + : null; + } else { + valuesBuilder_.addAllMessages(other.values_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.contentwarehouse.v1.TimestampValue m = + input.readMessage( + com.google.cloud.contentwarehouse.v1.TimestampValue.parser(), + extensionRegistry); + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.add(m); + } else { + valuesBuilder_.addMessage(m); + } + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List values_ = + java.util.Collections.emptyList(); + + private void ensureValuesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + values_ = + new java.util.ArrayList(values_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.TimestampValue, + com.google.cloud.contentwarehouse.v1.TimestampValue.Builder, + com.google.cloud.contentwarehouse.v1.TimestampValueOrBuilder> + valuesBuilder_; + + /** + * + * + *
+     * List of timestamp values.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.TimestampValue values = 1; + */ + public java.util.List getValuesList() { + if (valuesBuilder_ == null) { + return java.util.Collections.unmodifiableList(values_); + } else { + return valuesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * List of timestamp values.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.TimestampValue values = 1; + */ + public int getValuesCount() { + if (valuesBuilder_ == null) { + return values_.size(); + } else { + return valuesBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of timestamp values.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.TimestampValue values = 1; + */ + public com.google.cloud.contentwarehouse.v1.TimestampValue getValues(int index) { + if (valuesBuilder_ == null) { + return values_.get(index); + } else { + return valuesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of timestamp values.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.TimestampValue values = 1; + */ + public Builder setValues(int index, com.google.cloud.contentwarehouse.v1.TimestampValue value) { + if (valuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.set(index, value); + onChanged(); + } else { + valuesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of timestamp values.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.TimestampValue values = 1; + */ + public Builder setValues( + int index, com.google.cloud.contentwarehouse.v1.TimestampValue.Builder builderForValue) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.set(index, builderForValue.build()); + onChanged(); + } else { + valuesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of timestamp values.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.TimestampValue values = 1; + */ + public Builder addValues(com.google.cloud.contentwarehouse.v1.TimestampValue value) { + if (valuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.add(value); + onChanged(); + } else { + valuesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * List of timestamp values.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.TimestampValue values = 1; + */ + public Builder addValues(int index, com.google.cloud.contentwarehouse.v1.TimestampValue value) { + if (valuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.add(index, value); + onChanged(); + } else { + valuesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of timestamp values.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.TimestampValue values = 1; + */ + public Builder addValues( + com.google.cloud.contentwarehouse.v1.TimestampValue.Builder builderForValue) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.add(builderForValue.build()); + onChanged(); + } else { + valuesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of timestamp values.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.TimestampValue values = 1; + */ + public Builder addValues( + int index, com.google.cloud.contentwarehouse.v1.TimestampValue.Builder builderForValue) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.add(index, builderForValue.build()); + onChanged(); + } else { + valuesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of timestamp values.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.TimestampValue values = 1; + */ + public Builder addAllValues( + java.lang.Iterable values) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, values_); + onChanged(); + } else { + valuesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * List of timestamp values.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.TimestampValue values = 1; + */ + public Builder clearValues() { + if (valuesBuilder_ == null) { + values_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + valuesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of timestamp values.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.TimestampValue values = 1; + */ + public Builder removeValues(int index) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.remove(index); + onChanged(); + } else { + valuesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * List of timestamp values.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.TimestampValue values = 1; + */ + public com.google.cloud.contentwarehouse.v1.TimestampValue.Builder getValuesBuilder(int index) { + return getValuesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of timestamp values.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.TimestampValue values = 1; + */ + public com.google.cloud.contentwarehouse.v1.TimestampValueOrBuilder getValuesOrBuilder( + int index) { + if (valuesBuilder_ == null) { + return values_.get(index); + } else { + return valuesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of timestamp values.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.TimestampValue values = 1; + */ + public java.util.List + getValuesOrBuilderList() { + if (valuesBuilder_ != null) { + return valuesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(values_); + } + } + /** + * + * + *
+     * List of timestamp values.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.TimestampValue values = 1; + */ + public com.google.cloud.contentwarehouse.v1.TimestampValue.Builder addValuesBuilder() { + return getValuesFieldBuilder() + .addBuilder(com.google.cloud.contentwarehouse.v1.TimestampValue.getDefaultInstance()); + } + /** + * + * + *
+     * List of timestamp values.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.TimestampValue values = 1; + */ + public com.google.cloud.contentwarehouse.v1.TimestampValue.Builder addValuesBuilder(int index) { + return getValuesFieldBuilder() + .addBuilder( + index, com.google.cloud.contentwarehouse.v1.TimestampValue.getDefaultInstance()); + } + /** + * + * + *
+     * List of timestamp values.
+     * 
+ * + * repeated .google.cloud.contentwarehouse.v1.TimestampValue values = 1; + */ + public java.util.List + getValuesBuilderList() { + return getValuesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.TimestampValue, + com.google.cloud.contentwarehouse.v1.TimestampValue.Builder, + com.google.cloud.contentwarehouse.v1.TimestampValueOrBuilder> + getValuesFieldBuilder() { + if (valuesBuilder_ == null) { + valuesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.TimestampValue, + com.google.cloud.contentwarehouse.v1.TimestampValue.Builder, + com.google.cloud.contentwarehouse.v1.TimestampValueOrBuilder>( + values_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + values_ = null; + } + return valuesBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.TimestampArray) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.TimestampArray) + private static final com.google.cloud.contentwarehouse.v1.TimestampArray DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.TimestampArray(); + } + + public static com.google.cloud.contentwarehouse.v1.TimestampArray getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TimestampArray parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.TimestampArray getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/TimestampArrayOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/TimestampArrayOrBuilder.java new file mode 100644 index 000000000000..6c7ac70b7307 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/TimestampArrayOrBuilder.java @@ -0,0 +1,77 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface TimestampArrayOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.TimestampArray) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of timestamp values.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.TimestampValue values = 1; + */ + java.util.List getValuesList(); + /** + * + * + *
+   * List of timestamp values.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.TimestampValue values = 1; + */ + com.google.cloud.contentwarehouse.v1.TimestampValue getValues(int index); + /** + * + * + *
+   * List of timestamp values.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.TimestampValue values = 1; + */ + int getValuesCount(); + /** + * + * + *
+   * List of timestamp values.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.TimestampValue values = 1; + */ + java.util.List + getValuesOrBuilderList(); + /** + * + * + *
+   * List of timestamp values.
+   * 
+ * + * repeated .google.cloud.contentwarehouse.v1.TimestampValue values = 1; + */ + com.google.cloud.contentwarehouse.v1.TimestampValueOrBuilder getValuesOrBuilder(int index); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/TimestampTypeOptions.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/TimestampTypeOptions.java new file mode 100644 index 000000000000..66ee342d685f --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/TimestampTypeOptions.java @@ -0,0 +1,437 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_schema.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Configurations for a timestamp property.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.TimestampTypeOptions} + */ +public final class TimestampTypeOptions extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.TimestampTypeOptions) + TimestampTypeOptionsOrBuilder { + private static final long serialVersionUID = 0L; + // Use TimestampTypeOptions.newBuilder() to construct. + private TimestampTypeOptions(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TimestampTypeOptions() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TimestampTypeOptions(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaProto + .internal_static_google_cloud_contentwarehouse_v1_TimestampTypeOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaProto + .internal_static_google_cloud_contentwarehouse_v1_TimestampTypeOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.TimestampTypeOptions.class, + com.google.cloud.contentwarehouse.v1.TimestampTypeOptions.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.TimestampTypeOptions)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.TimestampTypeOptions other = + (com.google.cloud.contentwarehouse.v1.TimestampTypeOptions) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.TimestampTypeOptions parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.TimestampTypeOptions parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.TimestampTypeOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.TimestampTypeOptions parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.TimestampTypeOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.TimestampTypeOptions parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.TimestampTypeOptions parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.TimestampTypeOptions parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.TimestampTypeOptions parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.TimestampTypeOptions parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.TimestampTypeOptions parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.TimestampTypeOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.TimestampTypeOptions prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Configurations for a timestamp property.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.TimestampTypeOptions} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.TimestampTypeOptions) + com.google.cloud.contentwarehouse.v1.TimestampTypeOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaProto + .internal_static_google_cloud_contentwarehouse_v1_TimestampTypeOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaProto + .internal_static_google_cloud_contentwarehouse_v1_TimestampTypeOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.TimestampTypeOptions.class, + com.google.cloud.contentwarehouse.v1.TimestampTypeOptions.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.TimestampTypeOptions.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaProto + .internal_static_google_cloud_contentwarehouse_v1_TimestampTypeOptions_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.TimestampTypeOptions getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.TimestampTypeOptions.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.TimestampTypeOptions build() { + com.google.cloud.contentwarehouse.v1.TimestampTypeOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.TimestampTypeOptions buildPartial() { + com.google.cloud.contentwarehouse.v1.TimestampTypeOptions result = + new com.google.cloud.contentwarehouse.v1.TimestampTypeOptions(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.TimestampTypeOptions) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.TimestampTypeOptions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.TimestampTypeOptions other) { + if (other == com.google.cloud.contentwarehouse.v1.TimestampTypeOptions.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.TimestampTypeOptions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.TimestampTypeOptions) + private static final com.google.cloud.contentwarehouse.v1.TimestampTypeOptions DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.TimestampTypeOptions(); + } + + public static com.google.cloud.contentwarehouse.v1.TimestampTypeOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TimestampTypeOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.TimestampTypeOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/TimestampTypeOptionsOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/TimestampTypeOptionsOrBuilder.java new file mode 100644 index 000000000000..52332ab5285b --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/TimestampTypeOptionsOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_schema.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface TimestampTypeOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.TimestampTypeOptions) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/TimestampValue.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/TimestampValue.java new file mode 100644 index 000000000000..3c8f2c38f4eb --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/TimestampValue.java @@ -0,0 +1,1059 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Timestamp value type.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.TimestampValue} + */ +public final class TimestampValue extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.TimestampValue) + TimestampValueOrBuilder { + private static final long serialVersionUID = 0L; + // Use TimestampValue.newBuilder() to construct. + private TimestampValue(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TimestampValue() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TimestampValue(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_TimestampValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_TimestampValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.TimestampValue.class, + com.google.cloud.contentwarehouse.v1.TimestampValue.Builder.class); + } + + private int valueCase_ = 0; + private java.lang.Object value_; + + public enum ValueCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + TIMESTAMP_VALUE(1), + TEXT_VALUE(2), + VALUE_NOT_SET(0); + private final int value; + + private ValueCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ValueCase valueOf(int value) { + return forNumber(value); + } + + public static ValueCase forNumber(int value) { + switch (value) { + case 1: + return TIMESTAMP_VALUE; + case 2: + return TEXT_VALUE; + case 0: + return VALUE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ValueCase getValueCase() { + return ValueCase.forNumber(valueCase_); + } + + public static final int TIMESTAMP_VALUE_FIELD_NUMBER = 1; + /** + * + * + *
+   * Timestamp value
+   * 
+ * + * .google.protobuf.Timestamp timestamp_value = 1; + * + * @return Whether the timestampValue field is set. + */ + @java.lang.Override + public boolean hasTimestampValue() { + return valueCase_ == 1; + } + /** + * + * + *
+   * Timestamp value
+   * 
+ * + * .google.protobuf.Timestamp timestamp_value = 1; + * + * @return The timestampValue. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getTimestampValue() { + if (valueCase_ == 1) { + return (com.google.protobuf.Timestamp) value_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + /** + * + * + *
+   * Timestamp value
+   * 
+ * + * .google.protobuf.Timestamp timestamp_value = 1; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getTimestampValueOrBuilder() { + if (valueCase_ == 1) { + return (com.google.protobuf.Timestamp) value_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + + public static final int TEXT_VALUE_FIELD_NUMBER = 2; + /** + * + * + *
+   * The string must represent a valid instant in UTC and is parsed using
+   * java.time.format.DateTimeFormatter.ISO_INSTANT.
+   * e.g. "2013-09-29T18:46:19Z"
+   * 
+ * + * string text_value = 2; + * + * @return Whether the textValue field is set. + */ + public boolean hasTextValue() { + return valueCase_ == 2; + } + /** + * + * + *
+   * The string must represent a valid instant in UTC and is parsed using
+   * java.time.format.DateTimeFormatter.ISO_INSTANT.
+   * e.g. "2013-09-29T18:46:19Z"
+   * 
+ * + * string text_value = 2; + * + * @return The textValue. + */ + public java.lang.String getTextValue() { + java.lang.Object ref = ""; + if (valueCase_ == 2) { + ref = value_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (valueCase_ == 2) { + value_ = s; + } + return s; + } + } + /** + * + * + *
+   * The string must represent a valid instant in UTC and is parsed using
+   * java.time.format.DateTimeFormatter.ISO_INSTANT.
+   * e.g. "2013-09-29T18:46:19Z"
+   * 
+ * + * string text_value = 2; + * + * @return The bytes for textValue. + */ + public com.google.protobuf.ByteString getTextValueBytes() { + java.lang.Object ref = ""; + if (valueCase_ == 2) { + ref = value_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (valueCase_ == 2) { + value_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (valueCase_ == 1) { + output.writeMessage(1, (com.google.protobuf.Timestamp) value_); + } + if (valueCase_ == 2) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, value_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (valueCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.protobuf.Timestamp) value_); + } + if (valueCase_ == 2) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, value_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.TimestampValue)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.TimestampValue other = + (com.google.cloud.contentwarehouse.v1.TimestampValue) obj; + + if (!getValueCase().equals(other.getValueCase())) return false; + switch (valueCase_) { + case 1: + if (!getTimestampValue().equals(other.getTimestampValue())) return false; + break; + case 2: + if (!getTextValue().equals(other.getTextValue())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (valueCase_) { + case 1: + hash = (37 * hash) + TIMESTAMP_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getTimestampValue().hashCode(); + break; + case 2: + hash = (37 * hash) + TEXT_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getTextValue().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.TimestampValue parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.TimestampValue parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.TimestampValue parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.TimestampValue parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.TimestampValue parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.TimestampValue parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.TimestampValue parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.TimestampValue parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.TimestampValue parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.TimestampValue parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.TimestampValue parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.TimestampValue parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.contentwarehouse.v1.TimestampValue prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Timestamp value type.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.TimestampValue} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.TimestampValue) + com.google.cloud.contentwarehouse.v1.TimestampValueOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_TimestampValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_TimestampValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.TimestampValue.class, + com.google.cloud.contentwarehouse.v1.TimestampValue.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.TimestampValue.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (timestampValueBuilder_ != null) { + timestampValueBuilder_.clear(); + } + valueCase_ = 0; + value_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_TimestampValue_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.TimestampValue getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.TimestampValue.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.TimestampValue build() { + com.google.cloud.contentwarehouse.v1.TimestampValue result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.TimestampValue buildPartial() { + com.google.cloud.contentwarehouse.v1.TimestampValue result = + new com.google.cloud.contentwarehouse.v1.TimestampValue(this); + if (valueCase_ == 1) { + if (timestampValueBuilder_ == null) { + result.value_ = value_; + } else { + result.value_ = timestampValueBuilder_.build(); + } + } + if (valueCase_ == 2) { + result.value_ = value_; + } + result.valueCase_ = valueCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.TimestampValue) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.TimestampValue) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.TimestampValue other) { + if (other == com.google.cloud.contentwarehouse.v1.TimestampValue.getDefaultInstance()) + return this; + switch (other.getValueCase()) { + case TIMESTAMP_VALUE: + { + mergeTimestampValue(other.getTimestampValue()); + break; + } + case TEXT_VALUE: + { + valueCase_ = 2; + value_ = other.value_; + onChanged(); + break; + } + case VALUE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getTimestampValueFieldBuilder().getBuilder(), extensionRegistry); + valueCase_ = 1; + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + valueCase_ = 2; + value_ = s; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int valueCase_ = 0; + private java.lang.Object value_; + + public ValueCase getValueCase() { + return ValueCase.forNumber(valueCase_); + } + + public Builder clearValue() { + valueCase_ = 0; + value_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + timestampValueBuilder_; + /** + * + * + *
+     * Timestamp value
+     * 
+ * + * .google.protobuf.Timestamp timestamp_value = 1; + * + * @return Whether the timestampValue field is set. + */ + @java.lang.Override + public boolean hasTimestampValue() { + return valueCase_ == 1; + } + /** + * + * + *
+     * Timestamp value
+     * 
+ * + * .google.protobuf.Timestamp timestamp_value = 1; + * + * @return The timestampValue. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getTimestampValue() { + if (timestampValueBuilder_ == null) { + if (valueCase_ == 1) { + return (com.google.protobuf.Timestamp) value_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } else { + if (valueCase_ == 1) { + return timestampValueBuilder_.getMessage(); + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + } + /** + * + * + *
+     * Timestamp value
+     * 
+ * + * .google.protobuf.Timestamp timestamp_value = 1; + */ + public Builder setTimestampValue(com.google.protobuf.Timestamp value) { + if (timestampValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + value_ = value; + onChanged(); + } else { + timestampValueBuilder_.setMessage(value); + } + valueCase_ = 1; + return this; + } + /** + * + * + *
+     * Timestamp value
+     * 
+ * + * .google.protobuf.Timestamp timestamp_value = 1; + */ + public Builder setTimestampValue(com.google.protobuf.Timestamp.Builder builderForValue) { + if (timestampValueBuilder_ == null) { + value_ = builderForValue.build(); + onChanged(); + } else { + timestampValueBuilder_.setMessage(builderForValue.build()); + } + valueCase_ = 1; + return this; + } + /** + * + * + *
+     * Timestamp value
+     * 
+ * + * .google.protobuf.Timestamp timestamp_value = 1; + */ + public Builder mergeTimestampValue(com.google.protobuf.Timestamp value) { + if (timestampValueBuilder_ == null) { + if (valueCase_ == 1 && value_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + value_ = + com.google.protobuf.Timestamp.newBuilder((com.google.protobuf.Timestamp) value_) + .mergeFrom(value) + .buildPartial(); + } else { + value_ = value; + } + onChanged(); + } else { + if (valueCase_ == 1) { + timestampValueBuilder_.mergeFrom(value); + } else { + timestampValueBuilder_.setMessage(value); + } + } + valueCase_ = 1; + return this; + } + /** + * + * + *
+     * Timestamp value
+     * 
+ * + * .google.protobuf.Timestamp timestamp_value = 1; + */ + public Builder clearTimestampValue() { + if (timestampValueBuilder_ == null) { + if (valueCase_ == 1) { + valueCase_ = 0; + value_ = null; + onChanged(); + } + } else { + if (valueCase_ == 1) { + valueCase_ = 0; + value_ = null; + } + timestampValueBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Timestamp value
+     * 
+ * + * .google.protobuf.Timestamp timestamp_value = 1; + */ + public com.google.protobuf.Timestamp.Builder getTimestampValueBuilder() { + return getTimestampValueFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Timestamp value
+     * 
+ * + * .google.protobuf.Timestamp timestamp_value = 1; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getTimestampValueOrBuilder() { + if ((valueCase_ == 1) && (timestampValueBuilder_ != null)) { + return timestampValueBuilder_.getMessageOrBuilder(); + } else { + if (valueCase_ == 1) { + return (com.google.protobuf.Timestamp) value_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + } + /** + * + * + *
+     * Timestamp value
+     * 
+ * + * .google.protobuf.Timestamp timestamp_value = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getTimestampValueFieldBuilder() { + if (timestampValueBuilder_ == null) { + if (!(valueCase_ == 1)) { + value_ = com.google.protobuf.Timestamp.getDefaultInstance(); + } + timestampValueBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + (com.google.protobuf.Timestamp) value_, getParentForChildren(), isClean()); + value_ = null; + } + valueCase_ = 1; + onChanged(); + ; + return timestampValueBuilder_; + } + + /** + * + * + *
+     * The string must represent a valid instant in UTC and is parsed using
+     * java.time.format.DateTimeFormatter.ISO_INSTANT.
+     * e.g. "2013-09-29T18:46:19Z"
+     * 
+ * + * string text_value = 2; + * + * @return Whether the textValue field is set. + */ + @java.lang.Override + public boolean hasTextValue() { + return valueCase_ == 2; + } + /** + * + * + *
+     * The string must represent a valid instant in UTC and is parsed using
+     * java.time.format.DateTimeFormatter.ISO_INSTANT.
+     * e.g. "2013-09-29T18:46:19Z"
+     * 
+ * + * string text_value = 2; + * + * @return The textValue. + */ + @java.lang.Override + public java.lang.String getTextValue() { + java.lang.Object ref = ""; + if (valueCase_ == 2) { + ref = value_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (valueCase_ == 2) { + value_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The string must represent a valid instant in UTC and is parsed using
+     * java.time.format.DateTimeFormatter.ISO_INSTANT.
+     * e.g. "2013-09-29T18:46:19Z"
+     * 
+ * + * string text_value = 2; + * + * @return The bytes for textValue. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTextValueBytes() { + java.lang.Object ref = ""; + if (valueCase_ == 2) { + ref = value_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (valueCase_ == 2) { + value_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The string must represent a valid instant in UTC and is parsed using
+     * java.time.format.DateTimeFormatter.ISO_INSTANT.
+     * e.g. "2013-09-29T18:46:19Z"
+     * 
+ * + * string text_value = 2; + * + * @param value The textValue to set. + * @return This builder for chaining. + */ + public Builder setTextValue(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + valueCase_ = 2; + value_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The string must represent a valid instant in UTC and is parsed using
+     * java.time.format.DateTimeFormatter.ISO_INSTANT.
+     * e.g. "2013-09-29T18:46:19Z"
+     * 
+ * + * string text_value = 2; + * + * @return This builder for chaining. + */ + public Builder clearTextValue() { + if (valueCase_ == 2) { + valueCase_ = 0; + value_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The string must represent a valid instant in UTC and is parsed using
+     * java.time.format.DateTimeFormatter.ISO_INSTANT.
+     * e.g. "2013-09-29T18:46:19Z"
+     * 
+ * + * string text_value = 2; + * + * @param value The bytes for textValue to set. + * @return This builder for chaining. + */ + public Builder setTextValueBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + valueCase_ = 2; + value_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.TimestampValue) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.TimestampValue) + private static final com.google.cloud.contentwarehouse.v1.TimestampValue DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.TimestampValue(); + } + + public static com.google.cloud.contentwarehouse.v1.TimestampValue getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TimestampValue parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.TimestampValue getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/TimestampValueOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/TimestampValueOrBuilder.java new file mode 100644 index 000000000000..71c6a244b632 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/TimestampValueOrBuilder.java @@ -0,0 +1,105 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface TimestampValueOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.TimestampValue) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Timestamp value
+   * 
+ * + * .google.protobuf.Timestamp timestamp_value = 1; + * + * @return Whether the timestampValue field is set. + */ + boolean hasTimestampValue(); + /** + * + * + *
+   * Timestamp value
+   * 
+ * + * .google.protobuf.Timestamp timestamp_value = 1; + * + * @return The timestampValue. + */ + com.google.protobuf.Timestamp getTimestampValue(); + /** + * + * + *
+   * Timestamp value
+   * 
+ * + * .google.protobuf.Timestamp timestamp_value = 1; + */ + com.google.protobuf.TimestampOrBuilder getTimestampValueOrBuilder(); + + /** + * + * + *
+   * The string must represent a valid instant in UTC and is parsed using
+   * java.time.format.DateTimeFormatter.ISO_INSTANT.
+   * e.g. "2013-09-29T18:46:19Z"
+   * 
+ * + * string text_value = 2; + * + * @return Whether the textValue field is set. + */ + boolean hasTextValue(); + /** + * + * + *
+   * The string must represent a valid instant in UTC and is parsed using
+   * java.time.format.DateTimeFormatter.ISO_INSTANT.
+   * e.g. "2013-09-29T18:46:19Z"
+   * 
+ * + * string text_value = 2; + * + * @return The textValue. + */ + java.lang.String getTextValue(); + /** + * + * + *
+   * The string must represent a valid instant in UTC and is parsed using
+   * java.time.format.DateTimeFormatter.ISO_INSTANT.
+   * e.g. "2013-09-29T18:46:19Z"
+   * 
+ * + * string text_value = 2; + * + * @return The bytes for textValue. + */ + com.google.protobuf.ByteString getTextValueBytes(); + + public com.google.cloud.contentwarehouse.v1.TimestampValue.ValueCase getValueCase(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/UpdateDocumentMetadata.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/UpdateDocumentMetadata.java new file mode 100644 index 000000000000..95e409432972 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/UpdateDocumentMetadata.java @@ -0,0 +1,437 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/async_document_service_request.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Metadata object for UpdateDocument request (currently empty).
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.UpdateDocumentMetadata} + */ +public final class UpdateDocumentMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.UpdateDocumentMetadata) + UpdateDocumentMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateDocumentMetadata.newBuilder() to construct. + private UpdateDocumentMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateDocumentMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateDocumentMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.AsyncDocumentServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_UpdateDocumentMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.AsyncDocumentServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_UpdateDocumentMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.UpdateDocumentMetadata.class, + com.google.cloud.contentwarehouse.v1.UpdateDocumentMetadata.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.UpdateDocumentMetadata)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.UpdateDocumentMetadata other = + (com.google.cloud.contentwarehouse.v1.UpdateDocumentMetadata) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.UpdateDocumentMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateDocumentMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateDocumentMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateDocumentMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateDocumentMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateDocumentMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateDocumentMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateDocumentMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateDocumentMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateDocumentMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateDocumentMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateDocumentMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.UpdateDocumentMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Metadata object for UpdateDocument request (currently empty).
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.UpdateDocumentMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.UpdateDocumentMetadata) + com.google.cloud.contentwarehouse.v1.UpdateDocumentMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.AsyncDocumentServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_UpdateDocumentMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.AsyncDocumentServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_UpdateDocumentMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.UpdateDocumentMetadata.class, + com.google.cloud.contentwarehouse.v1.UpdateDocumentMetadata.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.UpdateDocumentMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.AsyncDocumentServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_UpdateDocumentMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.UpdateDocumentMetadata getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.UpdateDocumentMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.UpdateDocumentMetadata build() { + com.google.cloud.contentwarehouse.v1.UpdateDocumentMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.UpdateDocumentMetadata buildPartial() { + com.google.cloud.contentwarehouse.v1.UpdateDocumentMetadata result = + new com.google.cloud.contentwarehouse.v1.UpdateDocumentMetadata(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.UpdateDocumentMetadata) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.UpdateDocumentMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.UpdateDocumentMetadata other) { + if (other == com.google.cloud.contentwarehouse.v1.UpdateDocumentMetadata.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.UpdateDocumentMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.UpdateDocumentMetadata) + private static final com.google.cloud.contentwarehouse.v1.UpdateDocumentMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.UpdateDocumentMetadata(); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateDocumentMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateDocumentMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.UpdateDocumentMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/UpdateDocumentMetadataOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/UpdateDocumentMetadataOrBuilder.java new file mode 100644 index 000000000000..33462cba9528 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/UpdateDocumentMetadataOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/async_document_service_request.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface UpdateDocumentMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.UpdateDocumentMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/UpdateDocumentRequest.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/UpdateDocumentRequest.java new file mode 100644 index 000000000000..cf9de4004668 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/UpdateDocumentRequest.java @@ -0,0 +1,1790 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_service_request.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Request message for DocumentService.UpdateDocument.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.UpdateDocumentRequest} + */ +public final class UpdateDocumentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.UpdateDocumentRequest) + UpdateDocumentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateDocumentRequest.newBuilder() to construct. + private UpdateDocumentRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateDocumentRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateDocumentRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_UpdateDocumentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_UpdateDocumentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.UpdateDocumentRequest.class, + com.google.cloud.contentwarehouse.v1.UpdateDocumentRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object 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}.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * 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}.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DOCUMENT_FIELD_NUMBER = 2; + private com.google.cloud.contentwarehouse.v1.Document document_; + /** + * + * + *
+   * Required. The document to update.
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.Document document = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the document field is set. + */ + @java.lang.Override + public boolean hasDocument() { + return document_ != null; + } + /** + * + * + *
+   * Required. The document to update.
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.Document document = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The document. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.Document getDocument() { + return document_ == null + ? com.google.cloud.contentwarehouse.v1.Document.getDefaultInstance() + : document_; + } + /** + * + * + *
+   * Required. The document to update.
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.Document document = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DocumentOrBuilder getDocumentOrBuilder() { + return getDocument(); + } + + public static final int REQUEST_METADATA_FIELD_NUMBER = 3; + private com.google.cloud.contentwarehouse.v1.RequestMetadata requestMetadata_; + /** + * + * + *
+   * The meta information collected about the end user, used to enforce access
+   * control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + * + * @return Whether the requestMetadata field is set. + */ + @java.lang.Override + public boolean hasRequestMetadata() { + return requestMetadata_ != null; + } + /** + * + * + *
+   * The meta information collected about the end user, used to enforce access
+   * control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + * + * @return The requestMetadata. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RequestMetadata getRequestMetadata() { + return requestMetadata_ == null + ? com.google.cloud.contentwarehouse.v1.RequestMetadata.getDefaultInstance() + : requestMetadata_; + } + /** + * + * + *
+   * The meta information collected about the end user, used to enforce access
+   * control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder + getRequestMetadataOrBuilder() { + return getRequestMetadata(); + } + + public static final int CLOUD_AI_DOCUMENT_OPTION_FIELD_NUMBER = 5; + private com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption cloudAiDocumentOption_; + /** + * + * + *
+   * Request Option for processing Cloud AI Document in CW Document.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.CloudAIDocumentOption cloud_ai_document_option = 5; + * + * + * @return Whether the cloudAiDocumentOption field is set. + */ + @java.lang.Override + public boolean hasCloudAiDocumentOption() { + return cloudAiDocumentOption_ != null; + } + /** + * + * + *
+   * Request Option for processing Cloud AI Document in CW Document.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.CloudAIDocumentOption cloud_ai_document_option = 5; + * + * + * @return The cloudAiDocumentOption. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption getCloudAiDocumentOption() { + return cloudAiDocumentOption_ == null + ? com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption.getDefaultInstance() + : cloudAiDocumentOption_; + } + /** + * + * + *
+   * Request Option for processing Cloud AI Document in CW Document.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.CloudAIDocumentOption cloud_ai_document_option = 5; + * + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.CloudAIDocumentOptionOrBuilder + getCloudAiDocumentOptionOrBuilder() { + return getCloudAiDocumentOption(); + } + + public static final int UPDATE_OPTIONS_FIELD_NUMBER = 6; + private com.google.cloud.contentwarehouse.v1.UpdateOptions updateOptions_; + /** + * + * + *
+   * Options for the update operation.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.UpdateOptions update_options = 6; + * + * @return Whether the updateOptions field is set. + */ + @java.lang.Override + public boolean hasUpdateOptions() { + return updateOptions_ != null; + } + /** + * + * + *
+   * Options for the update operation.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.UpdateOptions update_options = 6; + * + * @return The updateOptions. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.UpdateOptions getUpdateOptions() { + return updateOptions_ == null + ? com.google.cloud.contentwarehouse.v1.UpdateOptions.getDefaultInstance() + : updateOptions_; + } + /** + * + * + *
+   * Options for the update operation.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.UpdateOptions update_options = 6; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.UpdateOptionsOrBuilder getUpdateOptionsOrBuilder() { + return getUpdateOptions(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (document_ != null) { + output.writeMessage(2, getDocument()); + } + if (requestMetadata_ != null) { + output.writeMessage(3, getRequestMetadata()); + } + if (cloudAiDocumentOption_ != null) { + output.writeMessage(5, getCloudAiDocumentOption()); + } + if (updateOptions_ != null) { + output.writeMessage(6, getUpdateOptions()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (document_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getDocument()); + } + if (requestMetadata_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getRequestMetadata()); + } + if (cloudAiDocumentOption_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(5, getCloudAiDocumentOption()); + } + if (updateOptions_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getUpdateOptions()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.UpdateDocumentRequest)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.UpdateDocumentRequest other = + (com.google.cloud.contentwarehouse.v1.UpdateDocumentRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (hasDocument() != other.hasDocument()) return false; + if (hasDocument()) { + if (!getDocument().equals(other.getDocument())) return false; + } + if (hasRequestMetadata() != other.hasRequestMetadata()) return false; + if (hasRequestMetadata()) { + if (!getRequestMetadata().equals(other.getRequestMetadata())) return false; + } + if (hasCloudAiDocumentOption() != other.hasCloudAiDocumentOption()) return false; + if (hasCloudAiDocumentOption()) { + if (!getCloudAiDocumentOption().equals(other.getCloudAiDocumentOption())) return false; + } + if (hasUpdateOptions() != other.hasUpdateOptions()) return false; + if (hasUpdateOptions()) { + if (!getUpdateOptions().equals(other.getUpdateOptions())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasDocument()) { + hash = (37 * hash) + DOCUMENT_FIELD_NUMBER; + hash = (53 * hash) + getDocument().hashCode(); + } + if (hasRequestMetadata()) { + hash = (37 * hash) + REQUEST_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getRequestMetadata().hashCode(); + } + if (hasCloudAiDocumentOption()) { + hash = (37 * hash) + CLOUD_AI_DOCUMENT_OPTION_FIELD_NUMBER; + hash = (53 * hash) + getCloudAiDocumentOption().hashCode(); + } + if (hasUpdateOptions()) { + hash = (37 * hash) + UPDATE_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getUpdateOptions().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.UpdateDocumentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateDocumentRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateDocumentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateDocumentRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateDocumentRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateDocumentRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateDocumentRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateDocumentRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateDocumentRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateDocumentRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateDocumentRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateDocumentRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.UpdateDocumentRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for DocumentService.UpdateDocument.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.UpdateDocumentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.UpdateDocumentRequest) + com.google.cloud.contentwarehouse.v1.UpdateDocumentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_UpdateDocumentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_UpdateDocumentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.UpdateDocumentRequest.class, + com.google.cloud.contentwarehouse.v1.UpdateDocumentRequest.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.UpdateDocumentRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (documentBuilder_ == null) { + document_ = null; + } else { + document_ = null; + documentBuilder_ = null; + } + if (requestMetadataBuilder_ == null) { + requestMetadata_ = null; + } else { + requestMetadata_ = null; + requestMetadataBuilder_ = null; + } + if (cloudAiDocumentOptionBuilder_ == null) { + cloudAiDocumentOption_ = null; + } else { + cloudAiDocumentOption_ = null; + cloudAiDocumentOptionBuilder_ = null; + } + if (updateOptionsBuilder_ == null) { + updateOptions_ = null; + } else { + updateOptions_ = null; + updateOptionsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_UpdateDocumentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.UpdateDocumentRequest getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.UpdateDocumentRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.UpdateDocumentRequest build() { + com.google.cloud.contentwarehouse.v1.UpdateDocumentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.UpdateDocumentRequest buildPartial() { + com.google.cloud.contentwarehouse.v1.UpdateDocumentRequest result = + new com.google.cloud.contentwarehouse.v1.UpdateDocumentRequest(this); + result.name_ = name_; + if (documentBuilder_ == null) { + result.document_ = document_; + } else { + result.document_ = documentBuilder_.build(); + } + if (requestMetadataBuilder_ == null) { + result.requestMetadata_ = requestMetadata_; + } else { + result.requestMetadata_ = requestMetadataBuilder_.build(); + } + if (cloudAiDocumentOptionBuilder_ == null) { + result.cloudAiDocumentOption_ = cloudAiDocumentOption_; + } else { + result.cloudAiDocumentOption_ = cloudAiDocumentOptionBuilder_.build(); + } + if (updateOptionsBuilder_ == null) { + result.updateOptions_ = updateOptions_; + } else { + result.updateOptions_ = updateOptionsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.UpdateDocumentRequest) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.UpdateDocumentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.UpdateDocumentRequest other) { + if (other == com.google.cloud.contentwarehouse.v1.UpdateDocumentRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasDocument()) { + mergeDocument(other.getDocument()); + } + if (other.hasRequestMetadata()) { + mergeRequestMetadata(other.getRequestMetadata()); + } + if (other.hasCloudAiDocumentOption()) { + mergeCloudAiDocumentOption(other.getCloudAiDocumentOption()); + } + if (other.hasUpdateOptions()) { + mergeUpdateOptions(other.getUpdateOptions()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + input.readMessage(getDocumentFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + case 26: + { + input.readMessage(getRequestMetadataFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 26 + case 42: + { + input.readMessage( + getCloudAiDocumentOptionFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 42 + case 50: + { + input.readMessage(getUpdateOptionsFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 50 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object 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}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 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}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * 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}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.cloud.contentwarehouse.v1.Document document_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.Document, + com.google.cloud.contentwarehouse.v1.Document.Builder, + com.google.cloud.contentwarehouse.v1.DocumentOrBuilder> + documentBuilder_; + /** + * + * + *
+     * Required. The document to update.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.Document document = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the document field is set. + */ + public boolean hasDocument() { + return documentBuilder_ != null || document_ != null; + } + /** + * + * + *
+     * Required. The document to update.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.Document document = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The document. + */ + public com.google.cloud.contentwarehouse.v1.Document getDocument() { + if (documentBuilder_ == null) { + return document_ == null + ? com.google.cloud.contentwarehouse.v1.Document.getDefaultInstance() + : document_; + } else { + return documentBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The document to update.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.Document document = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDocument(com.google.cloud.contentwarehouse.v1.Document value) { + if (documentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + document_ = value; + onChanged(); + } else { + documentBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The document to update.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.Document document = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDocument( + com.google.cloud.contentwarehouse.v1.Document.Builder builderForValue) { + if (documentBuilder_ == null) { + document_ = builderForValue.build(); + onChanged(); + } else { + documentBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The document to update.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.Document document = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeDocument(com.google.cloud.contentwarehouse.v1.Document value) { + if (documentBuilder_ == null) { + if (document_ != null) { + document_ = + com.google.cloud.contentwarehouse.v1.Document.newBuilder(document_) + .mergeFrom(value) + .buildPartial(); + } else { + document_ = value; + } + onChanged(); + } else { + documentBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The document to update.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.Document document = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearDocument() { + if (documentBuilder_ == null) { + document_ = null; + onChanged(); + } else { + document_ = null; + documentBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The document to update.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.Document document = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.contentwarehouse.v1.Document.Builder getDocumentBuilder() { + + onChanged(); + return getDocumentFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The document to update.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.Document document = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.contentwarehouse.v1.DocumentOrBuilder getDocumentOrBuilder() { + if (documentBuilder_ != null) { + return documentBuilder_.getMessageOrBuilder(); + } else { + return document_ == null + ? com.google.cloud.contentwarehouse.v1.Document.getDefaultInstance() + : document_; + } + } + /** + * + * + *
+     * Required. The document to update.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.Document document = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.Document, + com.google.cloud.contentwarehouse.v1.Document.Builder, + com.google.cloud.contentwarehouse.v1.DocumentOrBuilder> + getDocumentFieldBuilder() { + if (documentBuilder_ == null) { + documentBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.Document, + com.google.cloud.contentwarehouse.v1.Document.Builder, + com.google.cloud.contentwarehouse.v1.DocumentOrBuilder>( + getDocument(), getParentForChildren(), isClean()); + document_ = null; + } + return documentBuilder_; + } + + private com.google.cloud.contentwarehouse.v1.RequestMetadata requestMetadata_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.RequestMetadata, + com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder, + com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder> + requestMetadataBuilder_; + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + * + * @return Whether the requestMetadata field is set. + */ + public boolean hasRequestMetadata() { + return requestMetadataBuilder_ != null || requestMetadata_ != null; + } + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + * + * @return The requestMetadata. + */ + public com.google.cloud.contentwarehouse.v1.RequestMetadata getRequestMetadata() { + if (requestMetadataBuilder_ == null) { + return requestMetadata_ == null + ? com.google.cloud.contentwarehouse.v1.RequestMetadata.getDefaultInstance() + : requestMetadata_; + } else { + return requestMetadataBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + */ + public Builder setRequestMetadata(com.google.cloud.contentwarehouse.v1.RequestMetadata value) { + if (requestMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + requestMetadata_ = value; + onChanged(); + } else { + requestMetadataBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + */ + public Builder setRequestMetadata( + com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder builderForValue) { + if (requestMetadataBuilder_ == null) { + requestMetadata_ = builderForValue.build(); + onChanged(); + } else { + requestMetadataBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + */ + public Builder mergeRequestMetadata( + com.google.cloud.contentwarehouse.v1.RequestMetadata value) { + if (requestMetadataBuilder_ == null) { + if (requestMetadata_ != null) { + requestMetadata_ = + com.google.cloud.contentwarehouse.v1.RequestMetadata.newBuilder(requestMetadata_) + .mergeFrom(value) + .buildPartial(); + } else { + requestMetadata_ = value; + } + onChanged(); + } else { + requestMetadataBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + */ + public Builder clearRequestMetadata() { + if (requestMetadataBuilder_ == null) { + requestMetadata_ = null; + onChanged(); + } else { + requestMetadata_ = null; + requestMetadataBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + */ + public com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder + getRequestMetadataBuilder() { + + onChanged(); + return getRequestMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + */ + public com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder + getRequestMetadataOrBuilder() { + if (requestMetadataBuilder_ != null) { + return requestMetadataBuilder_.getMessageOrBuilder(); + } else { + return requestMetadata_ == null + ? com.google.cloud.contentwarehouse.v1.RequestMetadata.getDefaultInstance() + : requestMetadata_; + } + } + /** + * + * + *
+     * The meta information collected about the end user, used to enforce access
+     * control for the service.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.RequestMetadata, + com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder, + com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder> + getRequestMetadataFieldBuilder() { + if (requestMetadataBuilder_ == null) { + requestMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.RequestMetadata, + com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder, + com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder>( + getRequestMetadata(), getParentForChildren(), isClean()); + requestMetadata_ = null; + } + return requestMetadataBuilder_; + } + + private com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption cloudAiDocumentOption_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption, + com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption.Builder, + com.google.cloud.contentwarehouse.v1.CloudAIDocumentOptionOrBuilder> + cloudAiDocumentOptionBuilder_; + /** + * + * + *
+     * Request Option for processing Cloud AI Document in CW Document.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.CloudAIDocumentOption cloud_ai_document_option = 5; + * + * + * @return Whether the cloudAiDocumentOption field is set. + */ + public boolean hasCloudAiDocumentOption() { + return cloudAiDocumentOptionBuilder_ != null || cloudAiDocumentOption_ != null; + } + /** + * + * + *
+     * Request Option for processing Cloud AI Document in CW Document.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.CloudAIDocumentOption cloud_ai_document_option = 5; + * + * + * @return The cloudAiDocumentOption. + */ + public com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption getCloudAiDocumentOption() { + if (cloudAiDocumentOptionBuilder_ == null) { + return cloudAiDocumentOption_ == null + ? com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption.getDefaultInstance() + : cloudAiDocumentOption_; + } else { + return cloudAiDocumentOptionBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Request Option for processing Cloud AI Document in CW Document.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.CloudAIDocumentOption cloud_ai_document_option = 5; + * + */ + public Builder setCloudAiDocumentOption( + com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption value) { + if (cloudAiDocumentOptionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + cloudAiDocumentOption_ = value; + onChanged(); + } else { + cloudAiDocumentOptionBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Request Option for processing Cloud AI Document in CW Document.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.CloudAIDocumentOption cloud_ai_document_option = 5; + * + */ + public Builder setCloudAiDocumentOption( + com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption.Builder builderForValue) { + if (cloudAiDocumentOptionBuilder_ == null) { + cloudAiDocumentOption_ = builderForValue.build(); + onChanged(); + } else { + cloudAiDocumentOptionBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Request Option for processing Cloud AI Document in CW Document.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.CloudAIDocumentOption cloud_ai_document_option = 5; + * + */ + public Builder mergeCloudAiDocumentOption( + com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption value) { + if (cloudAiDocumentOptionBuilder_ == null) { + if (cloudAiDocumentOption_ != null) { + cloudAiDocumentOption_ = + com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption.newBuilder( + cloudAiDocumentOption_) + .mergeFrom(value) + .buildPartial(); + } else { + cloudAiDocumentOption_ = value; + } + onChanged(); + } else { + cloudAiDocumentOptionBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Request Option for processing Cloud AI Document in CW Document.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.CloudAIDocumentOption cloud_ai_document_option = 5; + * + */ + public Builder clearCloudAiDocumentOption() { + if (cloudAiDocumentOptionBuilder_ == null) { + cloudAiDocumentOption_ = null; + onChanged(); + } else { + cloudAiDocumentOption_ = null; + cloudAiDocumentOptionBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Request Option for processing Cloud AI Document in CW Document.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.CloudAIDocumentOption cloud_ai_document_option = 5; + * + */ + public com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption.Builder + getCloudAiDocumentOptionBuilder() { + + onChanged(); + return getCloudAiDocumentOptionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Request Option for processing Cloud AI Document in CW Document.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.CloudAIDocumentOption cloud_ai_document_option = 5; + * + */ + public com.google.cloud.contentwarehouse.v1.CloudAIDocumentOptionOrBuilder + getCloudAiDocumentOptionOrBuilder() { + if (cloudAiDocumentOptionBuilder_ != null) { + return cloudAiDocumentOptionBuilder_.getMessageOrBuilder(); + } else { + return cloudAiDocumentOption_ == null + ? com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption.getDefaultInstance() + : cloudAiDocumentOption_; + } + } + /** + * + * + *
+     * Request Option for processing Cloud AI Document in CW Document.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.CloudAIDocumentOption cloud_ai_document_option = 5; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption, + com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption.Builder, + com.google.cloud.contentwarehouse.v1.CloudAIDocumentOptionOrBuilder> + getCloudAiDocumentOptionFieldBuilder() { + if (cloudAiDocumentOptionBuilder_ == null) { + cloudAiDocumentOptionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption, + com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption.Builder, + com.google.cloud.contentwarehouse.v1.CloudAIDocumentOptionOrBuilder>( + getCloudAiDocumentOption(), getParentForChildren(), isClean()); + cloudAiDocumentOption_ = null; + } + return cloudAiDocumentOptionBuilder_; + } + + private com.google.cloud.contentwarehouse.v1.UpdateOptions updateOptions_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.UpdateOptions, + com.google.cloud.contentwarehouse.v1.UpdateOptions.Builder, + com.google.cloud.contentwarehouse.v1.UpdateOptionsOrBuilder> + updateOptionsBuilder_; + /** + * + * + *
+     * Options for the update operation.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.UpdateOptions update_options = 6; + * + * @return Whether the updateOptions field is set. + */ + public boolean hasUpdateOptions() { + return updateOptionsBuilder_ != null || updateOptions_ != null; + } + /** + * + * + *
+     * Options for the update operation.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.UpdateOptions update_options = 6; + * + * @return The updateOptions. + */ + public com.google.cloud.contentwarehouse.v1.UpdateOptions getUpdateOptions() { + if (updateOptionsBuilder_ == null) { + return updateOptions_ == null + ? com.google.cloud.contentwarehouse.v1.UpdateOptions.getDefaultInstance() + : updateOptions_; + } else { + return updateOptionsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Options for the update operation.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.UpdateOptions update_options = 6; + */ + public Builder setUpdateOptions(com.google.cloud.contentwarehouse.v1.UpdateOptions value) { + if (updateOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateOptions_ = value; + onChanged(); + } else { + updateOptionsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Options for the update operation.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.UpdateOptions update_options = 6; + */ + public Builder setUpdateOptions( + com.google.cloud.contentwarehouse.v1.UpdateOptions.Builder builderForValue) { + if (updateOptionsBuilder_ == null) { + updateOptions_ = builderForValue.build(); + onChanged(); + } else { + updateOptionsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Options for the update operation.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.UpdateOptions update_options = 6; + */ + public Builder mergeUpdateOptions(com.google.cloud.contentwarehouse.v1.UpdateOptions value) { + if (updateOptionsBuilder_ == null) { + if (updateOptions_ != null) { + updateOptions_ = + com.google.cloud.contentwarehouse.v1.UpdateOptions.newBuilder(updateOptions_) + .mergeFrom(value) + .buildPartial(); + } else { + updateOptions_ = value; + } + onChanged(); + } else { + updateOptionsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Options for the update operation.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.UpdateOptions update_options = 6; + */ + public Builder clearUpdateOptions() { + if (updateOptionsBuilder_ == null) { + updateOptions_ = null; + onChanged(); + } else { + updateOptions_ = null; + updateOptionsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Options for the update operation.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.UpdateOptions update_options = 6; + */ + public com.google.cloud.contentwarehouse.v1.UpdateOptions.Builder getUpdateOptionsBuilder() { + + onChanged(); + return getUpdateOptionsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Options for the update operation.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.UpdateOptions update_options = 6; + */ + public com.google.cloud.contentwarehouse.v1.UpdateOptionsOrBuilder getUpdateOptionsOrBuilder() { + if (updateOptionsBuilder_ != null) { + return updateOptionsBuilder_.getMessageOrBuilder(); + } else { + return updateOptions_ == null + ? com.google.cloud.contentwarehouse.v1.UpdateOptions.getDefaultInstance() + : updateOptions_; + } + } + /** + * + * + *
+     * Options for the update operation.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.UpdateOptions update_options = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.UpdateOptions, + com.google.cloud.contentwarehouse.v1.UpdateOptions.Builder, + com.google.cloud.contentwarehouse.v1.UpdateOptionsOrBuilder> + getUpdateOptionsFieldBuilder() { + if (updateOptionsBuilder_ == null) { + updateOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.UpdateOptions, + com.google.cloud.contentwarehouse.v1.UpdateOptions.Builder, + com.google.cloud.contentwarehouse.v1.UpdateOptionsOrBuilder>( + getUpdateOptions(), getParentForChildren(), isClean()); + updateOptions_ = null; + } + return updateOptionsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.UpdateDocumentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.UpdateDocumentRequest) + private static final com.google.cloud.contentwarehouse.v1.UpdateDocumentRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.UpdateDocumentRequest(); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateDocumentRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateDocumentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.UpdateDocumentRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/UpdateDocumentRequestOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/UpdateDocumentRequestOrBuilder.java new file mode 100644 index 000000000000..cf2b2c6240e3 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/UpdateDocumentRequestOrBuilder.java @@ -0,0 +1,215 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_service_request.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface UpdateDocumentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.UpdateDocumentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * 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}.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * 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}.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The document to update.
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.Document document = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the document field is set. + */ + boolean hasDocument(); + /** + * + * + *
+   * Required. The document to update.
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.Document document = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The document. + */ + com.google.cloud.contentwarehouse.v1.Document getDocument(); + /** + * + * + *
+   * Required. The document to update.
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.Document document = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.contentwarehouse.v1.DocumentOrBuilder getDocumentOrBuilder(); + + /** + * + * + *
+   * The meta information collected about the end user, used to enforce access
+   * control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + * + * @return Whether the requestMetadata field is set. + */ + boolean hasRequestMetadata(); + /** + * + * + *
+   * The meta information collected about the end user, used to enforce access
+   * control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + * + * @return The requestMetadata. + */ + com.google.cloud.contentwarehouse.v1.RequestMetadata getRequestMetadata(); + /** + * + * + *
+   * The meta information collected about the end user, used to enforce access
+   * control for the service.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3; + */ + com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder getRequestMetadataOrBuilder(); + + /** + * + * + *
+   * Request Option for processing Cloud AI Document in CW Document.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.CloudAIDocumentOption cloud_ai_document_option = 5; + * + * + * @return Whether the cloudAiDocumentOption field is set. + */ + boolean hasCloudAiDocumentOption(); + /** + * + * + *
+   * Request Option for processing Cloud AI Document in CW Document.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.CloudAIDocumentOption cloud_ai_document_option = 5; + * + * + * @return The cloudAiDocumentOption. + */ + com.google.cloud.contentwarehouse.v1.CloudAIDocumentOption getCloudAiDocumentOption(); + /** + * + * + *
+   * Request Option for processing Cloud AI Document in CW Document.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.CloudAIDocumentOption cloud_ai_document_option = 5; + * + */ + com.google.cloud.contentwarehouse.v1.CloudAIDocumentOptionOrBuilder + getCloudAiDocumentOptionOrBuilder(); + + /** + * + * + *
+   * Options for the update operation.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.UpdateOptions update_options = 6; + * + * @return Whether the updateOptions field is set. + */ + boolean hasUpdateOptions(); + /** + * + * + *
+   * Options for the update operation.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.UpdateOptions update_options = 6; + * + * @return The updateOptions. + */ + com.google.cloud.contentwarehouse.v1.UpdateOptions getUpdateOptions(); + /** + * + * + *
+   * Options for the update operation.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.UpdateOptions update_options = 6; + */ + com.google.cloud.contentwarehouse.v1.UpdateOptionsOrBuilder getUpdateOptionsOrBuilder(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/UpdateDocumentResponse.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/UpdateDocumentResponse.java new file mode 100644 index 000000000000..0a6870f55d49 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/UpdateDocumentResponse.java @@ -0,0 +1,1283 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_service.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Response message for DocumentService.UpdateDocument.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.UpdateDocumentResponse} + */ +public final class UpdateDocumentResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.UpdateDocumentResponse) + UpdateDocumentResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateDocumentResponse.newBuilder() to construct. + private UpdateDocumentResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateDocumentResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateDocumentResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceProto + .internal_static_google_cloud_contentwarehouse_v1_UpdateDocumentResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceProto + .internal_static_google_cloud_contentwarehouse_v1_UpdateDocumentResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.UpdateDocumentResponse.class, + com.google.cloud.contentwarehouse.v1.UpdateDocumentResponse.Builder.class); + } + + public static final int DOCUMENT_FIELD_NUMBER = 1; + private com.google.cloud.contentwarehouse.v1.Document document_; + /** + * + * + *
+   * Updated document after executing update request.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.Document document = 1; + * + * @return Whether the document field is set. + */ + @java.lang.Override + public boolean hasDocument() { + return document_ != null; + } + /** + * + * + *
+   * Updated document after executing update request.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.Document document = 1; + * + * @return The document. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.Document getDocument() { + return document_ == null + ? com.google.cloud.contentwarehouse.v1.Document.getDefaultInstance() + : document_; + } + /** + * + * + *
+   * Updated document after executing update request.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.Document document = 1; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DocumentOrBuilder getDocumentOrBuilder() { + return getDocument(); + } + + public static final int RULE_ENGINE_OUTPUT_FIELD_NUMBER = 2; + private com.google.cloud.contentwarehouse.v1.RuleEngineOutput ruleEngineOutput_; + /** + * + * + *
+   * Output from Rule Engine recording the rule evaluator and action executor's
+   * output.
+   * Refer format in: google/cloud/contentwarehouse/v1/rule_engine.proto
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RuleEngineOutput rule_engine_output = 2; + * + * @return Whether the ruleEngineOutput field is set. + */ + @java.lang.Override + public boolean hasRuleEngineOutput() { + return ruleEngineOutput_ != null; + } + /** + * + * + *
+   * Output from Rule Engine recording the rule evaluator and action executor's
+   * output.
+   * Refer format in: google/cloud/contentwarehouse/v1/rule_engine.proto
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RuleEngineOutput rule_engine_output = 2; + * + * @return The ruleEngineOutput. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RuleEngineOutput getRuleEngineOutput() { + return ruleEngineOutput_ == null + ? com.google.cloud.contentwarehouse.v1.RuleEngineOutput.getDefaultInstance() + : ruleEngineOutput_; + } + /** + * + * + *
+   * Output from Rule Engine recording the rule evaluator and action executor's
+   * output.
+   * Refer format in: google/cloud/contentwarehouse/v1/rule_engine.proto
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RuleEngineOutput rule_engine_output = 2; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RuleEngineOutputOrBuilder + getRuleEngineOutputOrBuilder() { + return getRuleEngineOutput(); + } + + public static final int METADATA_FIELD_NUMBER = 3; + private com.google.cloud.contentwarehouse.v1.ResponseMetadata metadata_; + /** + * + * + *
+   * Additional information for the API invocation, such as the request tracking
+   * id.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 3; + * + * @return Whether the metadata field is set. + */ + @java.lang.Override + public boolean hasMetadata() { + return metadata_ != null; + } + /** + * + * + *
+   * Additional information for the API invocation, such as the request tracking
+   * id.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 3; + * + * @return The metadata. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ResponseMetadata getMetadata() { + return metadata_ == null + ? com.google.cloud.contentwarehouse.v1.ResponseMetadata.getDefaultInstance() + : metadata_; + } + /** + * + * + *
+   * Additional information for the API invocation, such as the request tracking
+   * id.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 3; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.ResponseMetadataOrBuilder getMetadataOrBuilder() { + return getMetadata(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (document_ != null) { + output.writeMessage(1, getDocument()); + } + if (ruleEngineOutput_ != null) { + output.writeMessage(2, getRuleEngineOutput()); + } + if (metadata_ != null) { + output.writeMessage(3, getMetadata()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (document_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getDocument()); + } + if (ruleEngineOutput_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getRuleEngineOutput()); + } + if (metadata_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getMetadata()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.UpdateDocumentResponse)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.UpdateDocumentResponse other = + (com.google.cloud.contentwarehouse.v1.UpdateDocumentResponse) obj; + + if (hasDocument() != other.hasDocument()) return false; + if (hasDocument()) { + if (!getDocument().equals(other.getDocument())) return false; + } + if (hasRuleEngineOutput() != other.hasRuleEngineOutput()) return false; + if (hasRuleEngineOutput()) { + if (!getRuleEngineOutput().equals(other.getRuleEngineOutput())) return false; + } + if (hasMetadata() != other.hasMetadata()) return false; + if (hasMetadata()) { + if (!getMetadata().equals(other.getMetadata())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasDocument()) { + hash = (37 * hash) + DOCUMENT_FIELD_NUMBER; + hash = (53 * hash) + getDocument().hashCode(); + } + if (hasRuleEngineOutput()) { + hash = (37 * hash) + RULE_ENGINE_OUTPUT_FIELD_NUMBER; + hash = (53 * hash) + getRuleEngineOutput().hashCode(); + } + if (hasMetadata()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + getMetadata().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.UpdateDocumentResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateDocumentResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateDocumentResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateDocumentResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateDocumentResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateDocumentResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateDocumentResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateDocumentResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateDocumentResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateDocumentResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateDocumentResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateDocumentResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.UpdateDocumentResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for DocumentService.UpdateDocument.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.UpdateDocumentResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.UpdateDocumentResponse) + com.google.cloud.contentwarehouse.v1.UpdateDocumentResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceProto + .internal_static_google_cloud_contentwarehouse_v1_UpdateDocumentResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceProto + .internal_static_google_cloud_contentwarehouse_v1_UpdateDocumentResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.UpdateDocumentResponse.class, + com.google.cloud.contentwarehouse.v1.UpdateDocumentResponse.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.UpdateDocumentResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (documentBuilder_ == null) { + document_ = null; + } else { + document_ = null; + documentBuilder_ = null; + } + if (ruleEngineOutputBuilder_ == null) { + ruleEngineOutput_ = null; + } else { + ruleEngineOutput_ = null; + ruleEngineOutputBuilder_ = null; + } + if (metadataBuilder_ == null) { + metadata_ = null; + } else { + metadata_ = null; + metadataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.DocumentServiceProto + .internal_static_google_cloud_contentwarehouse_v1_UpdateDocumentResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.UpdateDocumentResponse getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.UpdateDocumentResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.UpdateDocumentResponse build() { + com.google.cloud.contentwarehouse.v1.UpdateDocumentResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.UpdateDocumentResponse buildPartial() { + com.google.cloud.contentwarehouse.v1.UpdateDocumentResponse result = + new com.google.cloud.contentwarehouse.v1.UpdateDocumentResponse(this); + if (documentBuilder_ == null) { + result.document_ = document_; + } else { + result.document_ = documentBuilder_.build(); + } + if (ruleEngineOutputBuilder_ == null) { + result.ruleEngineOutput_ = ruleEngineOutput_; + } else { + result.ruleEngineOutput_ = ruleEngineOutputBuilder_.build(); + } + if (metadataBuilder_ == null) { + result.metadata_ = metadata_; + } else { + result.metadata_ = metadataBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.UpdateDocumentResponse) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.UpdateDocumentResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.UpdateDocumentResponse other) { + if (other == com.google.cloud.contentwarehouse.v1.UpdateDocumentResponse.getDefaultInstance()) + return this; + if (other.hasDocument()) { + mergeDocument(other.getDocument()); + } + if (other.hasRuleEngineOutput()) { + mergeRuleEngineOutput(other.getRuleEngineOutput()); + } + if (other.hasMetadata()) { + mergeMetadata(other.getMetadata()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getDocumentFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 18: + { + input.readMessage( + getRuleEngineOutputFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + case 26: + { + input.readMessage(getMetadataFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private com.google.cloud.contentwarehouse.v1.Document document_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.Document, + com.google.cloud.contentwarehouse.v1.Document.Builder, + com.google.cloud.contentwarehouse.v1.DocumentOrBuilder> + documentBuilder_; + /** + * + * + *
+     * Updated document after executing update request.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.Document document = 1; + * + * @return Whether the document field is set. + */ + public boolean hasDocument() { + return documentBuilder_ != null || document_ != null; + } + /** + * + * + *
+     * Updated document after executing update request.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.Document document = 1; + * + * @return The document. + */ + public com.google.cloud.contentwarehouse.v1.Document getDocument() { + if (documentBuilder_ == null) { + return document_ == null + ? com.google.cloud.contentwarehouse.v1.Document.getDefaultInstance() + : document_; + } else { + return documentBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Updated document after executing update request.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.Document document = 1; + */ + public Builder setDocument(com.google.cloud.contentwarehouse.v1.Document value) { + if (documentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + document_ = value; + onChanged(); + } else { + documentBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Updated document after executing update request.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.Document document = 1; + */ + public Builder setDocument( + com.google.cloud.contentwarehouse.v1.Document.Builder builderForValue) { + if (documentBuilder_ == null) { + document_ = builderForValue.build(); + onChanged(); + } else { + documentBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Updated document after executing update request.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.Document document = 1; + */ + public Builder mergeDocument(com.google.cloud.contentwarehouse.v1.Document value) { + if (documentBuilder_ == null) { + if (document_ != null) { + document_ = + com.google.cloud.contentwarehouse.v1.Document.newBuilder(document_) + .mergeFrom(value) + .buildPartial(); + } else { + document_ = value; + } + onChanged(); + } else { + documentBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Updated document after executing update request.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.Document document = 1; + */ + public Builder clearDocument() { + if (documentBuilder_ == null) { + document_ = null; + onChanged(); + } else { + document_ = null; + documentBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Updated document after executing update request.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.Document document = 1; + */ + public com.google.cloud.contentwarehouse.v1.Document.Builder getDocumentBuilder() { + + onChanged(); + return getDocumentFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Updated document after executing update request.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.Document document = 1; + */ + public com.google.cloud.contentwarehouse.v1.DocumentOrBuilder getDocumentOrBuilder() { + if (documentBuilder_ != null) { + return documentBuilder_.getMessageOrBuilder(); + } else { + return document_ == null + ? com.google.cloud.contentwarehouse.v1.Document.getDefaultInstance() + : document_; + } + } + /** + * + * + *
+     * Updated document after executing update request.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.Document document = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.Document, + com.google.cloud.contentwarehouse.v1.Document.Builder, + com.google.cloud.contentwarehouse.v1.DocumentOrBuilder> + getDocumentFieldBuilder() { + if (documentBuilder_ == null) { + documentBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.Document, + com.google.cloud.contentwarehouse.v1.Document.Builder, + com.google.cloud.contentwarehouse.v1.DocumentOrBuilder>( + getDocument(), getParentForChildren(), isClean()); + document_ = null; + } + return documentBuilder_; + } + + private com.google.cloud.contentwarehouse.v1.RuleEngineOutput ruleEngineOutput_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.RuleEngineOutput, + com.google.cloud.contentwarehouse.v1.RuleEngineOutput.Builder, + com.google.cloud.contentwarehouse.v1.RuleEngineOutputOrBuilder> + ruleEngineOutputBuilder_; + /** + * + * + *
+     * Output from Rule Engine recording the rule evaluator and action executor's
+     * output.
+     * Refer format in: google/cloud/contentwarehouse/v1/rule_engine.proto
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RuleEngineOutput rule_engine_output = 2; + * + * @return Whether the ruleEngineOutput field is set. + */ + public boolean hasRuleEngineOutput() { + return ruleEngineOutputBuilder_ != null || ruleEngineOutput_ != null; + } + /** + * + * + *
+     * Output from Rule Engine recording the rule evaluator and action executor's
+     * output.
+     * Refer format in: google/cloud/contentwarehouse/v1/rule_engine.proto
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RuleEngineOutput rule_engine_output = 2; + * + * @return The ruleEngineOutput. + */ + public com.google.cloud.contentwarehouse.v1.RuleEngineOutput getRuleEngineOutput() { + if (ruleEngineOutputBuilder_ == null) { + return ruleEngineOutput_ == null + ? com.google.cloud.contentwarehouse.v1.RuleEngineOutput.getDefaultInstance() + : ruleEngineOutput_; + } else { + return ruleEngineOutputBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output from Rule Engine recording the rule evaluator and action executor's
+     * output.
+     * Refer format in: google/cloud/contentwarehouse/v1/rule_engine.proto
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RuleEngineOutput rule_engine_output = 2; + */ + public Builder setRuleEngineOutput( + com.google.cloud.contentwarehouse.v1.RuleEngineOutput value) { + if (ruleEngineOutputBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ruleEngineOutput_ = value; + onChanged(); + } else { + ruleEngineOutputBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output from Rule Engine recording the rule evaluator and action executor's
+     * output.
+     * Refer format in: google/cloud/contentwarehouse/v1/rule_engine.proto
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RuleEngineOutput rule_engine_output = 2; + */ + public Builder setRuleEngineOutput( + com.google.cloud.contentwarehouse.v1.RuleEngineOutput.Builder builderForValue) { + if (ruleEngineOutputBuilder_ == null) { + ruleEngineOutput_ = builderForValue.build(); + onChanged(); + } else { + ruleEngineOutputBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output from Rule Engine recording the rule evaluator and action executor's
+     * output.
+     * Refer format in: google/cloud/contentwarehouse/v1/rule_engine.proto
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RuleEngineOutput rule_engine_output = 2; + */ + public Builder mergeRuleEngineOutput( + com.google.cloud.contentwarehouse.v1.RuleEngineOutput value) { + if (ruleEngineOutputBuilder_ == null) { + if (ruleEngineOutput_ != null) { + ruleEngineOutput_ = + com.google.cloud.contentwarehouse.v1.RuleEngineOutput.newBuilder(ruleEngineOutput_) + .mergeFrom(value) + .buildPartial(); + } else { + ruleEngineOutput_ = value; + } + onChanged(); + } else { + ruleEngineOutputBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output from Rule Engine recording the rule evaluator and action executor's
+     * output.
+     * Refer format in: google/cloud/contentwarehouse/v1/rule_engine.proto
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RuleEngineOutput rule_engine_output = 2; + */ + public Builder clearRuleEngineOutput() { + if (ruleEngineOutputBuilder_ == null) { + ruleEngineOutput_ = null; + onChanged(); + } else { + ruleEngineOutput_ = null; + ruleEngineOutputBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output from Rule Engine recording the rule evaluator and action executor's
+     * output.
+     * Refer format in: google/cloud/contentwarehouse/v1/rule_engine.proto
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RuleEngineOutput rule_engine_output = 2; + */ + public com.google.cloud.contentwarehouse.v1.RuleEngineOutput.Builder + getRuleEngineOutputBuilder() { + + onChanged(); + return getRuleEngineOutputFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output from Rule Engine recording the rule evaluator and action executor's
+     * output.
+     * Refer format in: google/cloud/contentwarehouse/v1/rule_engine.proto
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RuleEngineOutput rule_engine_output = 2; + */ + public com.google.cloud.contentwarehouse.v1.RuleEngineOutputOrBuilder + getRuleEngineOutputOrBuilder() { + if (ruleEngineOutputBuilder_ != null) { + return ruleEngineOutputBuilder_.getMessageOrBuilder(); + } else { + return ruleEngineOutput_ == null + ? com.google.cloud.contentwarehouse.v1.RuleEngineOutput.getDefaultInstance() + : ruleEngineOutput_; + } + } + /** + * + * + *
+     * Output from Rule Engine recording the rule evaluator and action executor's
+     * output.
+     * Refer format in: google/cloud/contentwarehouse/v1/rule_engine.proto
+     * 
+ * + * .google.cloud.contentwarehouse.v1.RuleEngineOutput rule_engine_output = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.RuleEngineOutput, + com.google.cloud.contentwarehouse.v1.RuleEngineOutput.Builder, + com.google.cloud.contentwarehouse.v1.RuleEngineOutputOrBuilder> + getRuleEngineOutputFieldBuilder() { + if (ruleEngineOutputBuilder_ == null) { + ruleEngineOutputBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.RuleEngineOutput, + com.google.cloud.contentwarehouse.v1.RuleEngineOutput.Builder, + com.google.cloud.contentwarehouse.v1.RuleEngineOutputOrBuilder>( + getRuleEngineOutput(), getParentForChildren(), isClean()); + ruleEngineOutput_ = null; + } + return ruleEngineOutputBuilder_; + } + + private com.google.cloud.contentwarehouse.v1.ResponseMetadata metadata_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.ResponseMetadata, + com.google.cloud.contentwarehouse.v1.ResponseMetadata.Builder, + com.google.cloud.contentwarehouse.v1.ResponseMetadataOrBuilder> + metadataBuilder_; + /** + * + * + *
+     * Additional information for the API invocation, such as the request tracking
+     * id.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 3; + * + * @return Whether the metadata field is set. + */ + public boolean hasMetadata() { + return metadataBuilder_ != null || metadata_ != null; + } + /** + * + * + *
+     * Additional information for the API invocation, such as the request tracking
+     * id.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 3; + * + * @return The metadata. + */ + public com.google.cloud.contentwarehouse.v1.ResponseMetadata getMetadata() { + if (metadataBuilder_ == null) { + return metadata_ == null + ? com.google.cloud.contentwarehouse.v1.ResponseMetadata.getDefaultInstance() + : metadata_; + } else { + return metadataBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Additional information for the API invocation, such as the request tracking
+     * id.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 3; + */ + public Builder setMetadata(com.google.cloud.contentwarehouse.v1.ResponseMetadata value) { + if (metadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metadata_ = value; + onChanged(); + } else { + metadataBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Additional information for the API invocation, such as the request tracking
+     * id.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 3; + */ + public Builder setMetadata( + com.google.cloud.contentwarehouse.v1.ResponseMetadata.Builder builderForValue) { + if (metadataBuilder_ == null) { + metadata_ = builderForValue.build(); + onChanged(); + } else { + metadataBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Additional information for the API invocation, such as the request tracking
+     * id.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 3; + */ + public Builder mergeMetadata(com.google.cloud.contentwarehouse.v1.ResponseMetadata value) { + if (metadataBuilder_ == null) { + if (metadata_ != null) { + metadata_ = + com.google.cloud.contentwarehouse.v1.ResponseMetadata.newBuilder(metadata_) + .mergeFrom(value) + .buildPartial(); + } else { + metadata_ = value; + } + onChanged(); + } else { + metadataBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Additional information for the API invocation, such as the request tracking
+     * id.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 3; + */ + public Builder clearMetadata() { + if (metadataBuilder_ == null) { + metadata_ = null; + onChanged(); + } else { + metadata_ = null; + metadataBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Additional information for the API invocation, such as the request tracking
+     * id.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 3; + */ + public com.google.cloud.contentwarehouse.v1.ResponseMetadata.Builder getMetadataBuilder() { + + onChanged(); + return getMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Additional information for the API invocation, such as the request tracking
+     * id.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 3; + */ + public com.google.cloud.contentwarehouse.v1.ResponseMetadataOrBuilder getMetadataOrBuilder() { + if (metadataBuilder_ != null) { + return metadataBuilder_.getMessageOrBuilder(); + } else { + return metadata_ == null + ? com.google.cloud.contentwarehouse.v1.ResponseMetadata.getDefaultInstance() + : metadata_; + } + } + /** + * + * + *
+     * Additional information for the API invocation, such as the request tracking
+     * id.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.ResponseMetadata, + com.google.cloud.contentwarehouse.v1.ResponseMetadata.Builder, + com.google.cloud.contentwarehouse.v1.ResponseMetadataOrBuilder> + getMetadataFieldBuilder() { + if (metadataBuilder_ == null) { + metadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.ResponseMetadata, + com.google.cloud.contentwarehouse.v1.ResponseMetadata.Builder, + com.google.cloud.contentwarehouse.v1.ResponseMetadataOrBuilder>( + getMetadata(), getParentForChildren(), isClean()); + metadata_ = null; + } + return metadataBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.UpdateDocumentResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.UpdateDocumentResponse) + private static final com.google.cloud.contentwarehouse.v1.UpdateDocumentResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.UpdateDocumentResponse(); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateDocumentResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateDocumentResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.UpdateDocumentResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/UpdateDocumentResponseOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/UpdateDocumentResponseOrBuilder.java new file mode 100644 index 000000000000..e119cfd0ceee --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/UpdateDocumentResponseOrBuilder.java @@ -0,0 +1,139 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_service.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface UpdateDocumentResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.UpdateDocumentResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Updated document after executing update request.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.Document document = 1; + * + * @return Whether the document field is set. + */ + boolean hasDocument(); + /** + * + * + *
+   * Updated document after executing update request.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.Document document = 1; + * + * @return The document. + */ + com.google.cloud.contentwarehouse.v1.Document getDocument(); + /** + * + * + *
+   * Updated document after executing update request.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.Document document = 1; + */ + com.google.cloud.contentwarehouse.v1.DocumentOrBuilder getDocumentOrBuilder(); + + /** + * + * + *
+   * Output from Rule Engine recording the rule evaluator and action executor's
+   * output.
+   * Refer format in: google/cloud/contentwarehouse/v1/rule_engine.proto
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RuleEngineOutput rule_engine_output = 2; + * + * @return Whether the ruleEngineOutput field is set. + */ + boolean hasRuleEngineOutput(); + /** + * + * + *
+   * Output from Rule Engine recording the rule evaluator and action executor's
+   * output.
+   * Refer format in: google/cloud/contentwarehouse/v1/rule_engine.proto
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RuleEngineOutput rule_engine_output = 2; + * + * @return The ruleEngineOutput. + */ + com.google.cloud.contentwarehouse.v1.RuleEngineOutput getRuleEngineOutput(); + /** + * + * + *
+   * Output from Rule Engine recording the rule evaluator and action executor's
+   * output.
+   * Refer format in: google/cloud/contentwarehouse/v1/rule_engine.proto
+   * 
+ * + * .google.cloud.contentwarehouse.v1.RuleEngineOutput rule_engine_output = 2; + */ + com.google.cloud.contentwarehouse.v1.RuleEngineOutputOrBuilder getRuleEngineOutputOrBuilder(); + + /** + * + * + *
+   * Additional information for the API invocation, such as the request tracking
+   * id.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 3; + * + * @return Whether the metadata field is set. + */ + boolean hasMetadata(); + /** + * + * + *
+   * Additional information for the API invocation, such as the request tracking
+   * id.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 3; + * + * @return The metadata. + */ + com.google.cloud.contentwarehouse.v1.ResponseMetadata getMetadata(); + /** + * + * + *
+   * Additional information for the API invocation, such as the request tracking
+   * id.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.ResponseMetadata metadata = 3; + */ + com.google.cloud.contentwarehouse.v1.ResponseMetadataOrBuilder getMetadataOrBuilder(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/UpdateDocumentSchemaRequest.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/UpdateDocumentSchemaRequest.java new file mode 100644 index 000000000000..3b891696bf38 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/UpdateDocumentSchemaRequest.java @@ -0,0 +1,943 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_schema_service.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Request message for DocumentSchemaService.UpdateDocumentSchema.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest} + */ +public final class UpdateDocumentSchemaRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest) + UpdateDocumentSchemaRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateDocumentSchemaRequest.newBuilder() to construct. + private UpdateDocumentSchemaRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateDocumentSchemaRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateDocumentSchemaRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaServiceProto + .internal_static_google_cloud_contentwarehouse_v1_UpdateDocumentSchemaRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaServiceProto + .internal_static_google_cloud_contentwarehouse_v1_UpdateDocumentSchemaRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest.class, + com.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the document schema to update.
+   * Format:
+   * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the document schema to update.
+   * Format:
+   * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DOCUMENT_SCHEMA_FIELD_NUMBER = 2; + private com.google.cloud.contentwarehouse.v1.DocumentSchema documentSchema_; + /** + * + * + *
+   * Required. The document schema to update with.
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.DocumentSchema document_schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the documentSchema field is set. + */ + @java.lang.Override + public boolean hasDocumentSchema() { + return documentSchema_ != null; + } + /** + * + * + *
+   * Required. The document schema to update with.
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.DocumentSchema document_schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The documentSchema. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DocumentSchema getDocumentSchema() { + return documentSchema_ == null + ? com.google.cloud.contentwarehouse.v1.DocumentSchema.getDefaultInstance() + : documentSchema_; + } + /** + * + * + *
+   * Required. The document schema to update with.
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.DocumentSchema document_schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.DocumentSchemaOrBuilder getDocumentSchemaOrBuilder() { + return getDocumentSchema(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (documentSchema_ != null) { + output.writeMessage(2, getDocumentSchema()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (documentSchema_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getDocumentSchema()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest other = + (com.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (hasDocumentSchema() != other.hasDocumentSchema()) return false; + if (hasDocumentSchema()) { + if (!getDocumentSchema().equals(other.getDocumentSchema())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasDocumentSchema()) { + hash = (37 * hash) + DOCUMENT_SCHEMA_FIELD_NUMBER; + hash = (53 * hash) + getDocumentSchema().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for DocumentSchemaService.UpdateDocumentSchema.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest) + com.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaServiceProto + .internal_static_google_cloud_contentwarehouse_v1_UpdateDocumentSchemaRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaServiceProto + .internal_static_google_cloud_contentwarehouse_v1_UpdateDocumentSchemaRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest.class, + com.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (documentSchemaBuilder_ == null) { + documentSchema_ = null; + } else { + documentSchema_ = null; + documentSchemaBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.DocumentSchemaServiceProto + .internal_static_google_cloud_contentwarehouse_v1_UpdateDocumentSchemaRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest + getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest build() { + com.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest buildPartial() { + com.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest result = + new com.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest(this); + result.name_ = name_; + if (documentSchemaBuilder_ == null) { + result.documentSchema_ = documentSchema_; + } else { + result.documentSchema_ = documentSchemaBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest other) { + if (other + == com.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasDocumentSchema()) { + mergeDocumentSchema(other.getDocumentSchema()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + input.readMessage(getDocumentSchemaFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the document schema to update.
+     * Format:
+     * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the document schema to update.
+     * Format:
+     * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the document schema to update.
+     * Format:
+     * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the document schema to update.
+     * Format:
+     * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the document schema to update.
+     * Format:
+     * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.cloud.contentwarehouse.v1.DocumentSchema documentSchema_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.DocumentSchema, + com.google.cloud.contentwarehouse.v1.DocumentSchema.Builder, + com.google.cloud.contentwarehouse.v1.DocumentSchemaOrBuilder> + documentSchemaBuilder_; + /** + * + * + *
+     * Required. The document schema to update with.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.DocumentSchema document_schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the documentSchema field is set. + */ + public boolean hasDocumentSchema() { + return documentSchemaBuilder_ != null || documentSchema_ != null; + } + /** + * + * + *
+     * Required. The document schema to update with.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.DocumentSchema document_schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The documentSchema. + */ + public com.google.cloud.contentwarehouse.v1.DocumentSchema getDocumentSchema() { + if (documentSchemaBuilder_ == null) { + return documentSchema_ == null + ? com.google.cloud.contentwarehouse.v1.DocumentSchema.getDefaultInstance() + : documentSchema_; + } else { + return documentSchemaBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The document schema to update with.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.DocumentSchema document_schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDocumentSchema(com.google.cloud.contentwarehouse.v1.DocumentSchema value) { + if (documentSchemaBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + documentSchema_ = value; + onChanged(); + } else { + documentSchemaBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The document schema to update with.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.DocumentSchema document_schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDocumentSchema( + com.google.cloud.contentwarehouse.v1.DocumentSchema.Builder builderForValue) { + if (documentSchemaBuilder_ == null) { + documentSchema_ = builderForValue.build(); + onChanged(); + } else { + documentSchemaBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The document schema to update with.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.DocumentSchema document_schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeDocumentSchema(com.google.cloud.contentwarehouse.v1.DocumentSchema value) { + if (documentSchemaBuilder_ == null) { + if (documentSchema_ != null) { + documentSchema_ = + com.google.cloud.contentwarehouse.v1.DocumentSchema.newBuilder(documentSchema_) + .mergeFrom(value) + .buildPartial(); + } else { + documentSchema_ = value; + } + onChanged(); + } else { + documentSchemaBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The document schema to update with.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.DocumentSchema document_schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearDocumentSchema() { + if (documentSchemaBuilder_ == null) { + documentSchema_ = null; + onChanged(); + } else { + documentSchema_ = null; + documentSchemaBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The document schema to update with.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.DocumentSchema document_schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.contentwarehouse.v1.DocumentSchema.Builder getDocumentSchemaBuilder() { + + onChanged(); + return getDocumentSchemaFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The document schema to update with.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.DocumentSchema document_schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.contentwarehouse.v1.DocumentSchemaOrBuilder + getDocumentSchemaOrBuilder() { + if (documentSchemaBuilder_ != null) { + return documentSchemaBuilder_.getMessageOrBuilder(); + } else { + return documentSchema_ == null + ? com.google.cloud.contentwarehouse.v1.DocumentSchema.getDefaultInstance() + : documentSchema_; + } + } + /** + * + * + *
+     * Required. The document schema to update with.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.DocumentSchema document_schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.DocumentSchema, + com.google.cloud.contentwarehouse.v1.DocumentSchema.Builder, + com.google.cloud.contentwarehouse.v1.DocumentSchemaOrBuilder> + getDocumentSchemaFieldBuilder() { + if (documentSchemaBuilder_ == null) { + documentSchemaBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.DocumentSchema, + com.google.cloud.contentwarehouse.v1.DocumentSchema.Builder, + com.google.cloud.contentwarehouse.v1.DocumentSchemaOrBuilder>( + getDocumentSchema(), getParentForChildren(), isClean()); + documentSchema_ = null; + } + return documentSchemaBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest) + private static final com.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest(); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateDocumentSchemaRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/UpdateDocumentSchemaRequestOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/UpdateDocumentSchemaRequestOrBuilder.java new file mode 100644 index 000000000000..95ee8c105206 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/UpdateDocumentSchemaRequestOrBuilder.java @@ -0,0 +1,99 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document_schema_service.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface UpdateDocumentSchemaRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the document schema to update.
+   * Format:
+   * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the document schema to update.
+   * Format:
+   * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The document schema to update with.
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.DocumentSchema document_schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the documentSchema field is set. + */ + boolean hasDocumentSchema(); + /** + * + * + *
+   * Required. The document schema to update with.
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.DocumentSchema document_schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The documentSchema. + */ + com.google.cloud.contentwarehouse.v1.DocumentSchema getDocumentSchema(); + /** + * + * + *
+   * Required. The document schema to update with.
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.DocumentSchema document_schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.contentwarehouse.v1.DocumentSchemaOrBuilder getDocumentSchemaOrBuilder(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/UpdateOptions.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/UpdateOptions.java new file mode 100644 index 000000000000..c7924732d690 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/UpdateOptions.java @@ -0,0 +1,1162 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/common.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Options for Update operations.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.UpdateOptions} + */ +public final class UpdateOptions extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.UpdateOptions) + UpdateOptionsOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateOptions.newBuilder() to construct. + private UpdateOptions(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateOptions() { + updateType_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateOptions(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.CommonProto + .internal_static_google_cloud_contentwarehouse_v1_UpdateOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.CommonProto + .internal_static_google_cloud_contentwarehouse_v1_UpdateOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.UpdateOptions.class, + com.google.cloud.contentwarehouse.v1.UpdateOptions.Builder.class); + } + + public static final int UPDATE_TYPE_FIELD_NUMBER = 1; + private int updateType_; + /** + * + * + *
+   * Type for update.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.UpdateType update_type = 1; + * + * @return The enum numeric value on the wire for updateType. + */ + @java.lang.Override + public int getUpdateTypeValue() { + return updateType_; + } + /** + * + * + *
+   * Type for update.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.UpdateType update_type = 1; + * + * @return The updateType. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.UpdateType getUpdateType() { + @SuppressWarnings("deprecation") + com.google.cloud.contentwarehouse.v1.UpdateType result = + com.google.cloud.contentwarehouse.v1.UpdateType.valueOf(updateType_); + return result == null ? com.google.cloud.contentwarehouse.v1.UpdateType.UNRECOGNIZED : result; + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Field mask for merging Document fields.
+   * For the `FieldMask` definition,
+   * see
+   * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Field mask for merging Document fields.
+   * For the `FieldMask` definition,
+   * see
+   * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Field mask for merging Document fields.
+   * For the `FieldMask` definition,
+   * see
+   * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + public static final int MERGE_FIELDS_OPTIONS_FIELD_NUMBER = 3; + private com.google.cloud.contentwarehouse.v1.MergeFieldsOptions mergeFieldsOptions_; + /** + * + * + *
+   * Options for merging.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.MergeFieldsOptions merge_fields_options = 3; + * + * @return Whether the mergeFieldsOptions field is set. + */ + @java.lang.Override + public boolean hasMergeFieldsOptions() { + return mergeFieldsOptions_ != null; + } + /** + * + * + *
+   * Options for merging.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.MergeFieldsOptions merge_fields_options = 3; + * + * @return The mergeFieldsOptions. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.MergeFieldsOptions getMergeFieldsOptions() { + return mergeFieldsOptions_ == null + ? com.google.cloud.contentwarehouse.v1.MergeFieldsOptions.getDefaultInstance() + : mergeFieldsOptions_; + } + /** + * + * + *
+   * Options for merging.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.MergeFieldsOptions merge_fields_options = 3; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.MergeFieldsOptionsOrBuilder + getMergeFieldsOptionsOrBuilder() { + return getMergeFieldsOptions(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (updateType_ + != com.google.cloud.contentwarehouse.v1.UpdateType.UPDATE_TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(1, updateType_); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + if (mergeFieldsOptions_ != null) { + output.writeMessage(3, getMergeFieldsOptions()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (updateType_ + != com.google.cloud.contentwarehouse.v1.UpdateType.UPDATE_TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, updateType_); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + if (mergeFieldsOptions_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getMergeFieldsOptions()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.UpdateOptions)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.UpdateOptions other = + (com.google.cloud.contentwarehouse.v1.UpdateOptions) obj; + + if (updateType_ != other.updateType_) return false; + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (hasMergeFieldsOptions() != other.hasMergeFieldsOptions()) return false; + if (hasMergeFieldsOptions()) { + if (!getMergeFieldsOptions().equals(other.getMergeFieldsOptions())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + UPDATE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + updateType_; + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + if (hasMergeFieldsOptions()) { + hash = (37 * hash) + MERGE_FIELDS_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getMergeFieldsOptions().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.UpdateOptions parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateOptions parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateOptions parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateOptions parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateOptions parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateOptions parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateOptions parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateOptions parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateOptions parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.contentwarehouse.v1.UpdateOptions prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Options for Update operations.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.UpdateOptions} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.UpdateOptions) + com.google.cloud.contentwarehouse.v1.UpdateOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.CommonProto + .internal_static_google_cloud_contentwarehouse_v1_UpdateOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.CommonProto + .internal_static_google_cloud_contentwarehouse_v1_UpdateOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.UpdateOptions.class, + com.google.cloud.contentwarehouse.v1.UpdateOptions.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.UpdateOptions.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + updateType_ = 0; + + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + if (mergeFieldsOptionsBuilder_ == null) { + mergeFieldsOptions_ = null; + } else { + mergeFieldsOptions_ = null; + mergeFieldsOptionsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.CommonProto + .internal_static_google_cloud_contentwarehouse_v1_UpdateOptions_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.UpdateOptions getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.UpdateOptions.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.UpdateOptions build() { + com.google.cloud.contentwarehouse.v1.UpdateOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.UpdateOptions buildPartial() { + com.google.cloud.contentwarehouse.v1.UpdateOptions result = + new com.google.cloud.contentwarehouse.v1.UpdateOptions(this); + result.updateType_ = updateType_; + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + if (mergeFieldsOptionsBuilder_ == null) { + result.mergeFieldsOptions_ = mergeFieldsOptions_; + } else { + result.mergeFieldsOptions_ = mergeFieldsOptionsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.UpdateOptions) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.UpdateOptions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.UpdateOptions other) { + if (other == com.google.cloud.contentwarehouse.v1.UpdateOptions.getDefaultInstance()) + return this; + if (other.updateType_ != 0) { + setUpdateTypeValue(other.getUpdateTypeValue()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (other.hasMergeFieldsOptions()) { + mergeMergeFieldsOptions(other.getMergeFieldsOptions()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + updateType_ = input.readEnum(); + + break; + } // case 8 + case 18: + { + input.readMessage(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + case 26: + { + input.readMessage( + getMergeFieldsOptionsFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int updateType_ = 0; + /** + * + * + *
+     * Type for update.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.UpdateType update_type = 1; + * + * @return The enum numeric value on the wire for updateType. + */ + @java.lang.Override + public int getUpdateTypeValue() { + return updateType_; + } + /** + * + * + *
+     * Type for update.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.UpdateType update_type = 1; + * + * @param value The enum numeric value on the wire for updateType to set. + * @return This builder for chaining. + */ + public Builder setUpdateTypeValue(int value) { + + updateType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Type for update.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.UpdateType update_type = 1; + * + * @return The updateType. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.UpdateType getUpdateType() { + @SuppressWarnings("deprecation") + com.google.cloud.contentwarehouse.v1.UpdateType result = + com.google.cloud.contentwarehouse.v1.UpdateType.valueOf(updateType_); + return result == null ? com.google.cloud.contentwarehouse.v1.UpdateType.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Type for update.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.UpdateType update_type = 1; + * + * @param value The updateType to set. + * @return This builder for chaining. + */ + public Builder setUpdateType(com.google.cloud.contentwarehouse.v1.UpdateType value) { + if (value == null) { + throw new NullPointerException(); + } + + updateType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Type for update.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.UpdateType update_type = 1; + * + * @return This builder for chaining. + */ + public Builder clearUpdateType() { + + updateType_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * Field mask for merging Document fields.
+     * For the `FieldMask` definition,
+     * see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * Field mask for merging Document fields.
+     * For the `FieldMask` definition,
+     * see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Field mask for merging Document fields.
+     * For the `FieldMask` definition,
+     * see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Field mask for merging Document fields.
+     * For the `FieldMask` definition,
+     * see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Field mask for merging Document fields.
+     * For the `FieldMask` definition,
+     * see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Field mask for merging Document fields.
+     * For the `FieldMask` definition,
+     * see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Field mask for merging Document fields.
+     * For the `FieldMask` definition,
+     * see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Field mask for merging Document fields.
+     * For the `FieldMask` definition,
+     * see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Field mask for merging Document fields.
+     * For the `FieldMask` definition,
+     * see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + private com.google.cloud.contentwarehouse.v1.MergeFieldsOptions mergeFieldsOptions_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.MergeFieldsOptions, + com.google.cloud.contentwarehouse.v1.MergeFieldsOptions.Builder, + com.google.cloud.contentwarehouse.v1.MergeFieldsOptionsOrBuilder> + mergeFieldsOptionsBuilder_; + /** + * + * + *
+     * Options for merging.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.MergeFieldsOptions merge_fields_options = 3; + * + * @return Whether the mergeFieldsOptions field is set. + */ + public boolean hasMergeFieldsOptions() { + return mergeFieldsOptionsBuilder_ != null || mergeFieldsOptions_ != null; + } + /** + * + * + *
+     * Options for merging.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.MergeFieldsOptions merge_fields_options = 3; + * + * @return The mergeFieldsOptions. + */ + public com.google.cloud.contentwarehouse.v1.MergeFieldsOptions getMergeFieldsOptions() { + if (mergeFieldsOptionsBuilder_ == null) { + return mergeFieldsOptions_ == null + ? com.google.cloud.contentwarehouse.v1.MergeFieldsOptions.getDefaultInstance() + : mergeFieldsOptions_; + } else { + return mergeFieldsOptionsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Options for merging.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.MergeFieldsOptions merge_fields_options = 3; + */ + public Builder setMergeFieldsOptions( + com.google.cloud.contentwarehouse.v1.MergeFieldsOptions value) { + if (mergeFieldsOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + mergeFieldsOptions_ = value; + onChanged(); + } else { + mergeFieldsOptionsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Options for merging.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.MergeFieldsOptions merge_fields_options = 3; + */ + public Builder setMergeFieldsOptions( + com.google.cloud.contentwarehouse.v1.MergeFieldsOptions.Builder builderForValue) { + if (mergeFieldsOptionsBuilder_ == null) { + mergeFieldsOptions_ = builderForValue.build(); + onChanged(); + } else { + mergeFieldsOptionsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Options for merging.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.MergeFieldsOptions merge_fields_options = 3; + */ + public Builder mergeMergeFieldsOptions( + com.google.cloud.contentwarehouse.v1.MergeFieldsOptions value) { + if (mergeFieldsOptionsBuilder_ == null) { + if (mergeFieldsOptions_ != null) { + mergeFieldsOptions_ = + com.google.cloud.contentwarehouse.v1.MergeFieldsOptions.newBuilder( + mergeFieldsOptions_) + .mergeFrom(value) + .buildPartial(); + } else { + mergeFieldsOptions_ = value; + } + onChanged(); + } else { + mergeFieldsOptionsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Options for merging.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.MergeFieldsOptions merge_fields_options = 3; + */ + public Builder clearMergeFieldsOptions() { + if (mergeFieldsOptionsBuilder_ == null) { + mergeFieldsOptions_ = null; + onChanged(); + } else { + mergeFieldsOptions_ = null; + mergeFieldsOptionsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Options for merging.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.MergeFieldsOptions merge_fields_options = 3; + */ + public com.google.cloud.contentwarehouse.v1.MergeFieldsOptions.Builder + getMergeFieldsOptionsBuilder() { + + onChanged(); + return getMergeFieldsOptionsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Options for merging.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.MergeFieldsOptions merge_fields_options = 3; + */ + public com.google.cloud.contentwarehouse.v1.MergeFieldsOptionsOrBuilder + getMergeFieldsOptionsOrBuilder() { + if (mergeFieldsOptionsBuilder_ != null) { + return mergeFieldsOptionsBuilder_.getMessageOrBuilder(); + } else { + return mergeFieldsOptions_ == null + ? com.google.cloud.contentwarehouse.v1.MergeFieldsOptions.getDefaultInstance() + : mergeFieldsOptions_; + } + } + /** + * + * + *
+     * Options for merging.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.MergeFieldsOptions merge_fields_options = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.MergeFieldsOptions, + com.google.cloud.contentwarehouse.v1.MergeFieldsOptions.Builder, + com.google.cloud.contentwarehouse.v1.MergeFieldsOptionsOrBuilder> + getMergeFieldsOptionsFieldBuilder() { + if (mergeFieldsOptionsBuilder_ == null) { + mergeFieldsOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.MergeFieldsOptions, + com.google.cloud.contentwarehouse.v1.MergeFieldsOptions.Builder, + com.google.cloud.contentwarehouse.v1.MergeFieldsOptionsOrBuilder>( + getMergeFieldsOptions(), getParentForChildren(), isClean()); + mergeFieldsOptions_ = null; + } + return mergeFieldsOptionsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.UpdateOptions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.UpdateOptions) + private static final com.google.cloud.contentwarehouse.v1.UpdateOptions DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.UpdateOptions(); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.UpdateOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/UpdateOptionsOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/UpdateOptionsOrBuilder.java new file mode 100644 index 000000000000..88d85a5bd7d1 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/UpdateOptionsOrBuilder.java @@ -0,0 +1,129 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/common.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface UpdateOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.UpdateOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Type for update.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.UpdateType update_type = 1; + * + * @return The enum numeric value on the wire for updateType. + */ + int getUpdateTypeValue(); + /** + * + * + *
+   * Type for update.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.UpdateType update_type = 1; + * + * @return The updateType. + */ + com.google.cloud.contentwarehouse.v1.UpdateType getUpdateType(); + + /** + * + * + *
+   * Field mask for merging Document fields.
+   * For the `FieldMask` definition,
+   * see
+   * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Field mask for merging Document fields.
+   * For the `FieldMask` definition,
+   * see
+   * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Field mask for merging Document fields.
+   * For the `FieldMask` definition,
+   * see
+   * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * Options for merging.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.MergeFieldsOptions merge_fields_options = 3; + * + * @return Whether the mergeFieldsOptions field is set. + */ + boolean hasMergeFieldsOptions(); + /** + * + * + *
+   * Options for merging.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.MergeFieldsOptions merge_fields_options = 3; + * + * @return The mergeFieldsOptions. + */ + com.google.cloud.contentwarehouse.v1.MergeFieldsOptions getMergeFieldsOptions(); + /** + * + * + *
+   * Options for merging.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.MergeFieldsOptions merge_fields_options = 3; + */ + com.google.cloud.contentwarehouse.v1.MergeFieldsOptionsOrBuilder getMergeFieldsOptionsOrBuilder(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/UpdateRuleSetRequest.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/UpdateRuleSetRequest.java new file mode 100644 index 000000000000..f8687f833c0e --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/UpdateRuleSetRequest.java @@ -0,0 +1,936 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/ruleset_service_request.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Request message for RuleSetService.UpdateRuleSet.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.UpdateRuleSetRequest} + */ +public final class UpdateRuleSetRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.UpdateRuleSetRequest) + UpdateRuleSetRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateRuleSetRequest.newBuilder() to construct. + private UpdateRuleSetRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateRuleSetRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateRuleSetRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.RuleSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_UpdateRuleSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.RuleSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_UpdateRuleSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest.class, + com.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the rule set to update.
+   * Format:
+   * projects/{project_number}/locations/{location}/ruleSets/{rule_set_id}.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the rule set to update.
+   * Format:
+   * projects/{project_number}/locations/{location}/ruleSets/{rule_set_id}.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RULE_SET_FIELD_NUMBER = 2; + private com.google.cloud.contentwarehouse.v1.RuleSet ruleSet_; + /** + * + * + *
+   * Required. The rule set to update.
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.RuleSet rule_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the ruleSet field is set. + */ + @java.lang.Override + public boolean hasRuleSet() { + return ruleSet_ != null; + } + /** + * + * + *
+   * Required. The rule set to update.
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.RuleSet rule_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The ruleSet. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RuleSet getRuleSet() { + return ruleSet_ == null + ? com.google.cloud.contentwarehouse.v1.RuleSet.getDefaultInstance() + : ruleSet_; + } + /** + * + * + *
+   * Required. The rule set to update.
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.RuleSet rule_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.RuleSetOrBuilder getRuleSetOrBuilder() { + return getRuleSet(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (ruleSet_ != null) { + output.writeMessage(2, getRuleSet()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (ruleSet_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getRuleSet()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest other = + (com.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (hasRuleSet() != other.hasRuleSet()) return false; + if (hasRuleSet()) { + if (!getRuleSet().equals(other.getRuleSet())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasRuleSet()) { + hash = (37 * hash) + RULE_SET_FIELD_NUMBER; + hash = (53 * hash) + getRuleSet().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for RuleSetService.UpdateRuleSet.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.UpdateRuleSetRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.UpdateRuleSetRequest) + com.google.cloud.contentwarehouse.v1.UpdateRuleSetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.RuleSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_UpdateRuleSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.RuleSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_UpdateRuleSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest.class, + com.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (ruleSetBuilder_ == null) { + ruleSet_ = null; + } else { + ruleSet_ = null; + ruleSetBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.RuleSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_UpdateRuleSetRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest build() { + com.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest buildPartial() { + com.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest result = + new com.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest(this); + result.name_ = name_; + if (ruleSetBuilder_ == null) { + result.ruleSet_ = ruleSet_; + } else { + result.ruleSet_ = ruleSetBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest other) { + if (other == com.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasRuleSet()) { + mergeRuleSet(other.getRuleSet()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + input.readMessage(getRuleSetFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the rule set to update.
+     * Format:
+     * projects/{project_number}/locations/{location}/ruleSets/{rule_set_id}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the rule set to update.
+     * Format:
+     * projects/{project_number}/locations/{location}/ruleSets/{rule_set_id}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the rule set to update.
+     * Format:
+     * projects/{project_number}/locations/{location}/ruleSets/{rule_set_id}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the rule set to update.
+     * Format:
+     * projects/{project_number}/locations/{location}/ruleSets/{rule_set_id}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the rule set to update.
+     * Format:
+     * projects/{project_number}/locations/{location}/ruleSets/{rule_set_id}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.cloud.contentwarehouse.v1.RuleSet ruleSet_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.RuleSet, + com.google.cloud.contentwarehouse.v1.RuleSet.Builder, + com.google.cloud.contentwarehouse.v1.RuleSetOrBuilder> + ruleSetBuilder_; + /** + * + * + *
+     * Required. The rule set to update.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.RuleSet rule_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the ruleSet field is set. + */ + public boolean hasRuleSet() { + return ruleSetBuilder_ != null || ruleSet_ != null; + } + /** + * + * + *
+     * Required. The rule set to update.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.RuleSet rule_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The ruleSet. + */ + public com.google.cloud.contentwarehouse.v1.RuleSet getRuleSet() { + if (ruleSetBuilder_ == null) { + return ruleSet_ == null + ? com.google.cloud.contentwarehouse.v1.RuleSet.getDefaultInstance() + : ruleSet_; + } else { + return ruleSetBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The rule set to update.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.RuleSet rule_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setRuleSet(com.google.cloud.contentwarehouse.v1.RuleSet value) { + if (ruleSetBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ruleSet_ = value; + onChanged(); + } else { + ruleSetBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The rule set to update.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.RuleSet rule_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setRuleSet( + com.google.cloud.contentwarehouse.v1.RuleSet.Builder builderForValue) { + if (ruleSetBuilder_ == null) { + ruleSet_ = builderForValue.build(); + onChanged(); + } else { + ruleSetBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The rule set to update.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.RuleSet rule_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeRuleSet(com.google.cloud.contentwarehouse.v1.RuleSet value) { + if (ruleSetBuilder_ == null) { + if (ruleSet_ != null) { + ruleSet_ = + com.google.cloud.contentwarehouse.v1.RuleSet.newBuilder(ruleSet_) + .mergeFrom(value) + .buildPartial(); + } else { + ruleSet_ = value; + } + onChanged(); + } else { + ruleSetBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The rule set to update.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.RuleSet rule_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearRuleSet() { + if (ruleSetBuilder_ == null) { + ruleSet_ = null; + onChanged(); + } else { + ruleSet_ = null; + ruleSetBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The rule set to update.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.RuleSet rule_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.contentwarehouse.v1.RuleSet.Builder getRuleSetBuilder() { + + onChanged(); + return getRuleSetFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The rule set to update.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.RuleSet rule_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.contentwarehouse.v1.RuleSetOrBuilder getRuleSetOrBuilder() { + if (ruleSetBuilder_ != null) { + return ruleSetBuilder_.getMessageOrBuilder(); + } else { + return ruleSet_ == null + ? com.google.cloud.contentwarehouse.v1.RuleSet.getDefaultInstance() + : ruleSet_; + } + } + /** + * + * + *
+     * Required. The rule set to update.
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.RuleSet rule_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.RuleSet, + com.google.cloud.contentwarehouse.v1.RuleSet.Builder, + com.google.cloud.contentwarehouse.v1.RuleSetOrBuilder> + getRuleSetFieldBuilder() { + if (ruleSetBuilder_ == null) { + ruleSetBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.RuleSet, + com.google.cloud.contentwarehouse.v1.RuleSet.Builder, + com.google.cloud.contentwarehouse.v1.RuleSetOrBuilder>( + getRuleSet(), getParentForChildren(), isClean()); + ruleSet_ = null; + } + return ruleSetBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.UpdateRuleSetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.UpdateRuleSetRequest) + private static final com.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest(); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateRuleSetRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/UpdateRuleSetRequestOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/UpdateRuleSetRequestOrBuilder.java new file mode 100644 index 000000000000..db3580b5d57b --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/UpdateRuleSetRequestOrBuilder.java @@ -0,0 +1,99 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/ruleset_service_request.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface UpdateRuleSetRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.UpdateRuleSetRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the rule set to update.
+   * Format:
+   * projects/{project_number}/locations/{location}/ruleSets/{rule_set_id}.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the rule set to update.
+   * Format:
+   * projects/{project_number}/locations/{location}/ruleSets/{rule_set_id}.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The rule set to update.
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.RuleSet rule_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the ruleSet field is set. + */ + boolean hasRuleSet(); + /** + * + * + *
+   * Required. The rule set to update.
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.RuleSet rule_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The ruleSet. + */ + com.google.cloud.contentwarehouse.v1.RuleSet getRuleSet(); + /** + * + * + *
+   * Required. The rule set to update.
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.RuleSet rule_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.contentwarehouse.v1.RuleSetOrBuilder getRuleSetOrBuilder(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/UpdateSynonymSetRequest.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/UpdateSynonymSetRequest.java new file mode 100644 index 000000000000..a7b0cef63a89 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/UpdateSynonymSetRequest.java @@ -0,0 +1,943 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/synonymset_service_request.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Request message for SynonymSetService.UpdateSynonymSet.
+ * Removes the SynonymSet for the specified context and replaces
+ * it with the SynonymSet in this request.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest} + */ +public final class UpdateSynonymSetRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest) + UpdateSynonymSetRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateSynonymSetRequest.newBuilder() to construct. + private UpdateSynonymSetRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateSynonymSetRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateSynonymSetRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.SynonymSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_UpdateSynonymSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.SynonymSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_UpdateSynonymSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest.class, + com.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the synonymSet to update
+   * Format:
+   * projects/{project_number}/locations/{location}/synonymSets/{context}.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the synonymSet to update
+   * Format:
+   * projects/{project_number}/locations/{location}/synonymSets/{context}.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SYNONYM_SET_FIELD_NUMBER = 2; + private com.google.cloud.contentwarehouse.v1.SynonymSet synonymSet_; + /** + * + * + *
+   * Required. The synonymSet to be updated for the customer
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.SynonymSet synonym_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the synonymSet field is set. + */ + @java.lang.Override + public boolean hasSynonymSet() { + return synonymSet_ != null; + } + /** + * + * + *
+   * Required. The synonymSet to be updated for the customer
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.SynonymSet synonym_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The synonymSet. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.SynonymSet getSynonymSet() { + return synonymSet_ == null + ? com.google.cloud.contentwarehouse.v1.SynonymSet.getDefaultInstance() + : synonymSet_; + } + /** + * + * + *
+   * Required. The synonymSet to be updated for the customer
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.SynonymSet synonym_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.SynonymSetOrBuilder getSynonymSetOrBuilder() { + return getSynonymSet(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (synonymSet_ != null) { + output.writeMessage(2, getSynonymSet()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (synonymSet_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getSynonymSet()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest other = + (com.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (hasSynonymSet() != other.hasSynonymSet()) return false; + if (hasSynonymSet()) { + if (!getSynonymSet().equals(other.getSynonymSet())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasSynonymSet()) { + hash = (37 * hash) + SYNONYM_SET_FIELD_NUMBER; + hash = (53 * hash) + getSynonymSet().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for SynonymSetService.UpdateSynonymSet.
+   * Removes the SynonymSet for the specified context and replaces
+   * it with the SynonymSet in this request.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest) + com.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.SynonymSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_UpdateSynonymSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.SynonymSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_UpdateSynonymSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest.class, + com.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (synonymSetBuilder_ == null) { + synonymSet_ = null; + } else { + synonymSet_ = null; + synonymSetBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.SynonymSetServiceRequestProto + .internal_static_google_cloud_contentwarehouse_v1_UpdateSynonymSetRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest + getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest build() { + com.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest buildPartial() { + com.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest result = + new com.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest(this); + result.name_ = name_; + if (synonymSetBuilder_ == null) { + result.synonymSet_ = synonymSet_; + } else { + result.synonymSet_ = synonymSetBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest other) { + if (other + == com.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasSynonymSet()) { + mergeSynonymSet(other.getSynonymSet()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + input.readMessage(getSynonymSetFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the synonymSet to update
+     * Format:
+     * projects/{project_number}/locations/{location}/synonymSets/{context}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the synonymSet to update
+     * Format:
+     * projects/{project_number}/locations/{location}/synonymSets/{context}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the synonymSet to update
+     * Format:
+     * projects/{project_number}/locations/{location}/synonymSets/{context}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the synonymSet to update
+     * Format:
+     * projects/{project_number}/locations/{location}/synonymSets/{context}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the synonymSet to update
+     * Format:
+     * projects/{project_number}/locations/{location}/synonymSets/{context}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.cloud.contentwarehouse.v1.SynonymSet synonymSet_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.SynonymSet, + com.google.cloud.contentwarehouse.v1.SynonymSet.Builder, + com.google.cloud.contentwarehouse.v1.SynonymSetOrBuilder> + synonymSetBuilder_; + /** + * + * + *
+     * Required. The synonymSet to be updated for the customer
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.SynonymSet synonym_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the synonymSet field is set. + */ + public boolean hasSynonymSet() { + return synonymSetBuilder_ != null || synonymSet_ != null; + } + /** + * + * + *
+     * Required. The synonymSet to be updated for the customer
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.SynonymSet synonym_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The synonymSet. + */ + public com.google.cloud.contentwarehouse.v1.SynonymSet getSynonymSet() { + if (synonymSetBuilder_ == null) { + return synonymSet_ == null + ? com.google.cloud.contentwarehouse.v1.SynonymSet.getDefaultInstance() + : synonymSet_; + } else { + return synonymSetBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The synonymSet to be updated for the customer
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.SynonymSet synonym_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSynonymSet(com.google.cloud.contentwarehouse.v1.SynonymSet value) { + if (synonymSetBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + synonymSet_ = value; + onChanged(); + } else { + synonymSetBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The synonymSet to be updated for the customer
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.SynonymSet synonym_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSynonymSet( + com.google.cloud.contentwarehouse.v1.SynonymSet.Builder builderForValue) { + if (synonymSetBuilder_ == null) { + synonymSet_ = builderForValue.build(); + onChanged(); + } else { + synonymSetBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The synonymSet to be updated for the customer
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.SynonymSet synonym_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeSynonymSet(com.google.cloud.contentwarehouse.v1.SynonymSet value) { + if (synonymSetBuilder_ == null) { + if (synonymSet_ != null) { + synonymSet_ = + com.google.cloud.contentwarehouse.v1.SynonymSet.newBuilder(synonymSet_) + .mergeFrom(value) + .buildPartial(); + } else { + synonymSet_ = value; + } + onChanged(); + } else { + synonymSetBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The synonymSet to be updated for the customer
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.SynonymSet synonym_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearSynonymSet() { + if (synonymSetBuilder_ == null) { + synonymSet_ = null; + onChanged(); + } else { + synonymSet_ = null; + synonymSetBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The synonymSet to be updated for the customer
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.SynonymSet synonym_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.contentwarehouse.v1.SynonymSet.Builder getSynonymSetBuilder() { + + onChanged(); + return getSynonymSetFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The synonymSet to be updated for the customer
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.SynonymSet synonym_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.contentwarehouse.v1.SynonymSetOrBuilder getSynonymSetOrBuilder() { + if (synonymSetBuilder_ != null) { + return synonymSetBuilder_.getMessageOrBuilder(); + } else { + return synonymSet_ == null + ? com.google.cloud.contentwarehouse.v1.SynonymSet.getDefaultInstance() + : synonymSet_; + } + } + /** + * + * + *
+     * Required. The synonymSet to be updated for the customer
+     * 
+ * + * + * .google.cloud.contentwarehouse.v1.SynonymSet synonym_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.SynonymSet, + com.google.cloud.contentwarehouse.v1.SynonymSet.Builder, + com.google.cloud.contentwarehouse.v1.SynonymSetOrBuilder> + getSynonymSetFieldBuilder() { + if (synonymSetBuilder_ == null) { + synonymSetBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.SynonymSet, + com.google.cloud.contentwarehouse.v1.SynonymSet.Builder, + com.google.cloud.contentwarehouse.v1.SynonymSetOrBuilder>( + getSynonymSet(), getParentForChildren(), isClean()); + synonymSet_ = null; + } + return synonymSetBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest) + private static final com.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest(); + } + + public static com.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateSynonymSetRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/UpdateSynonymSetRequestOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/UpdateSynonymSetRequestOrBuilder.java new file mode 100644 index 000000000000..9c9afff269cf --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/UpdateSynonymSetRequestOrBuilder.java @@ -0,0 +1,99 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/synonymset_service_request.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface UpdateSynonymSetRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the synonymSet to update
+   * Format:
+   * projects/{project_number}/locations/{location}/synonymSets/{context}.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the synonymSet to update
+   * Format:
+   * projects/{project_number}/locations/{location}/synonymSets/{context}.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The synonymSet to be updated for the customer
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.SynonymSet synonym_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the synonymSet field is set. + */ + boolean hasSynonymSet(); + /** + * + * + *
+   * Required. The synonymSet to be updated for the customer
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.SynonymSet synonym_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The synonymSet. + */ + com.google.cloud.contentwarehouse.v1.SynonymSet getSynonymSet(); + /** + * + * + *
+   * Required. The synonymSet to be updated for the customer
+   * 
+ * + * + * .google.cloud.contentwarehouse.v1.SynonymSet synonym_set = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.contentwarehouse.v1.SynonymSetOrBuilder getSynonymSetOrBuilder(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/UpdateType.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/UpdateType.java new file mode 100644 index 000000000000..7ffb1aad9d7e --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/UpdateType.java @@ -0,0 +1,242 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/common.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * Update type of the requests.
+ * 
+ * + * Protobuf enum {@code google.cloud.contentwarehouse.v1.UpdateType} + */ +public enum UpdateType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Defaults to full replace behavior, ie. FULL_REPLACE.
+   * 
+ * + * UPDATE_TYPE_UNSPECIFIED = 0; + */ + UPDATE_TYPE_UNSPECIFIED(0), + /** + * + * + *
+   * Fully replace all the fields. Any field masks will be ignored.
+   * 
+ * + * UPDATE_TYPE_REPLACE = 1; + */ + UPDATE_TYPE_REPLACE(1), + /** + * + * + *
+   * Merge the fields into the existing entities.
+   * 
+ * + * UPDATE_TYPE_MERGE = 2; + */ + UPDATE_TYPE_MERGE(2), + /** + * + * + *
+   * Inserts the properties by names.
+   * 
+ * + * UPDATE_TYPE_INSERT_PROPERTIES_BY_NAMES = 3; + */ + UPDATE_TYPE_INSERT_PROPERTIES_BY_NAMES(3), + /** + * + * + *
+   * Replace the properties by names.
+   * 
+ * + * UPDATE_TYPE_REPLACE_PROPERTIES_BY_NAMES = 4; + */ + UPDATE_TYPE_REPLACE_PROPERTIES_BY_NAMES(4), + /** + * + * + *
+   * Delete the properties by names.
+   * 
+ * + * UPDATE_TYPE_DELETE_PROPERTIES_BY_NAMES = 5; + */ + UPDATE_TYPE_DELETE_PROPERTIES_BY_NAMES(5), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * Defaults to full replace behavior, ie. FULL_REPLACE.
+   * 
+ * + * UPDATE_TYPE_UNSPECIFIED = 0; + */ + public static final int UPDATE_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * Fully replace all the fields. Any field masks will be ignored.
+   * 
+ * + * UPDATE_TYPE_REPLACE = 1; + */ + public static final int UPDATE_TYPE_REPLACE_VALUE = 1; + /** + * + * + *
+   * Merge the fields into the existing entities.
+   * 
+ * + * UPDATE_TYPE_MERGE = 2; + */ + public static final int UPDATE_TYPE_MERGE_VALUE = 2; + /** + * + * + *
+   * Inserts the properties by names.
+   * 
+ * + * UPDATE_TYPE_INSERT_PROPERTIES_BY_NAMES = 3; + */ + public static final int UPDATE_TYPE_INSERT_PROPERTIES_BY_NAMES_VALUE = 3; + /** + * + * + *
+   * Replace the properties by names.
+   * 
+ * + * UPDATE_TYPE_REPLACE_PROPERTIES_BY_NAMES = 4; + */ + public static final int UPDATE_TYPE_REPLACE_PROPERTIES_BY_NAMES_VALUE = 4; + /** + * + * + *
+   * Delete the properties by names.
+   * 
+ * + * UPDATE_TYPE_DELETE_PROPERTIES_BY_NAMES = 5; + */ + public static final int UPDATE_TYPE_DELETE_PROPERTIES_BY_NAMES_VALUE = 5; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static UpdateType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static UpdateType forNumber(int value) { + switch (value) { + case 0: + return UPDATE_TYPE_UNSPECIFIED; + case 1: + return UPDATE_TYPE_REPLACE; + case 2: + return UPDATE_TYPE_MERGE; + case 3: + return UPDATE_TYPE_INSERT_PROPERTIES_BY_NAMES; + case 4: + return UPDATE_TYPE_REPLACE_PROPERTIES_BY_NAMES; + case 5: + return UPDATE_TYPE_DELETE_PROPERTIES_BY_NAMES; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public UpdateType findValueByNumber(int number) { + return UpdateType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.CommonProto.getDescriptor().getEnumTypes().get(0); + } + + private static final UpdateType[] VALUES = values(); + + public static UpdateType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private UpdateType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.contentwarehouse.v1.UpdateType) +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/UserInfo.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/UserInfo.java new file mode 100644 index 000000000000..21313c364170 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/UserInfo.java @@ -0,0 +1,912 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/common.proto + +package com.google.cloud.contentwarehouse.v1; + +/** Protobuf type {@code google.cloud.contentwarehouse.v1.UserInfo} */ +public final class UserInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.UserInfo) + UserInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use UserInfo.newBuilder() to construct. + private UserInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UserInfo() { + id_ = ""; + groupIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UserInfo(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.CommonProto + .internal_static_google_cloud_contentwarehouse_v1_UserInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.CommonProto + .internal_static_google_cloud_contentwarehouse_v1_UserInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.UserInfo.class, + com.google.cloud.contentwarehouse.v1.UserInfo.Builder.class); + } + + public static final int ID_FIELD_NUMBER = 1; + private volatile java.lang.Object id_; + /** + * + * + *
+   * A unique user identification string, as determined by the client.
+   * The maximum number of allowed characters is 255.
+   * Allowed characters include numbers 0 to 9, uppercase and lowercase letters,
+   * and restricted special symbols (:, @, +, -, _, ~)
+   * The format is "user:xxxx@example.com";
+   * 
+ * + * string id = 1; + * + * @return The id. + */ + @java.lang.Override + public java.lang.String getId() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } + } + /** + * + * + *
+   * A unique user identification string, as determined by the client.
+   * The maximum number of allowed characters is 255.
+   * Allowed characters include numbers 0 to 9, uppercase and lowercase letters,
+   * and restricted special symbols (:, @, +, -, _, ~)
+   * The format is "user:xxxx@example.com";
+   * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GROUP_IDS_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList groupIds_; + /** + * + * + *
+   * The unique group identifications which the user is belong to.
+   * The format is "group:yyyy@example.com";
+   * 
+ * + * repeated string group_ids = 2; + * + * @return A list containing the groupIds. + */ + public com.google.protobuf.ProtocolStringList getGroupIdsList() { + return groupIds_; + } + /** + * + * + *
+   * The unique group identifications which the user is belong to.
+   * The format is "group:yyyy@example.com";
+   * 
+ * + * repeated string group_ids = 2; + * + * @return The count of groupIds. + */ + public int getGroupIdsCount() { + return groupIds_.size(); + } + /** + * + * + *
+   * The unique group identifications which the user is belong to.
+   * The format is "group:yyyy@example.com";
+   * 
+ * + * repeated string group_ids = 2; + * + * @param index The index of the element to return. + * @return The groupIds at the given index. + */ + public java.lang.String getGroupIds(int index) { + return groupIds_.get(index); + } + /** + * + * + *
+   * The unique group identifications which the user is belong to.
+   * The format is "group:yyyy@example.com";
+   * 
+ * + * repeated string group_ids = 2; + * + * @param index The index of the value to return. + * @return The bytes of the groupIds at the given index. + */ + public com.google.protobuf.ByteString getGroupIdsBytes(int index) { + return groupIds_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_); + } + for (int i = 0; i < groupIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, groupIds_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_); + } + { + int dataSize = 0; + for (int i = 0; i < groupIds_.size(); i++) { + dataSize += computeStringSizeNoTag(groupIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getGroupIdsList().size(); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.UserInfo)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.UserInfo other = + (com.google.cloud.contentwarehouse.v1.UserInfo) obj; + + if (!getId().equals(other.getId())) return false; + if (!getGroupIdsList().equals(other.getGroupIdsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + if (getGroupIdsCount() > 0) { + hash = (37 * hash) + GROUP_IDS_FIELD_NUMBER; + hash = (53 * hash) + getGroupIdsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.UserInfo parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.UserInfo parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.UserInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.UserInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.UserInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.UserInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.UserInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.UserInfo parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.UserInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.UserInfo parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.UserInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.UserInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.contentwarehouse.v1.UserInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** Protobuf type {@code google.cloud.contentwarehouse.v1.UserInfo} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.UserInfo) + com.google.cloud.contentwarehouse.v1.UserInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.CommonProto + .internal_static_google_cloud_contentwarehouse_v1_UserInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.CommonProto + .internal_static_google_cloud_contentwarehouse_v1_UserInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.UserInfo.class, + com.google.cloud.contentwarehouse.v1.UserInfo.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.UserInfo.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + id_ = ""; + + groupIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.CommonProto + .internal_static_google_cloud_contentwarehouse_v1_UserInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.UserInfo getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.UserInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.UserInfo build() { + com.google.cloud.contentwarehouse.v1.UserInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.UserInfo buildPartial() { + com.google.cloud.contentwarehouse.v1.UserInfo result = + new com.google.cloud.contentwarehouse.v1.UserInfo(this); + int from_bitField0_ = bitField0_; + result.id_ = id_; + if (((bitField0_ & 0x00000001) != 0)) { + groupIds_ = groupIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.groupIds_ = groupIds_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.UserInfo) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.UserInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.UserInfo other) { + if (other == com.google.cloud.contentwarehouse.v1.UserInfo.getDefaultInstance()) return this; + if (!other.getId().isEmpty()) { + id_ = other.id_; + onChanged(); + } + if (!other.groupIds_.isEmpty()) { + if (groupIds_.isEmpty()) { + groupIds_ = other.groupIds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureGroupIdsIsMutable(); + groupIds_.addAll(other.groupIds_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + id_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureGroupIdsIsMutable(); + groupIds_.add(s); + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object id_ = ""; + /** + * + * + *
+     * A unique user identification string, as determined by the client.
+     * The maximum number of allowed characters is 255.
+     * Allowed characters include numbers 0 to 9, uppercase and lowercase letters,
+     * and restricted special symbols (:, @, +, -, _, ~)
+     * The format is "user:xxxx@example.com";
+     * 
+ * + * string id = 1; + * + * @return The id. + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A unique user identification string, as determined by the client.
+     * The maximum number of allowed characters is 255.
+     * Allowed characters include numbers 0 to 9, uppercase and lowercase letters,
+     * and restricted special symbols (:, @, +, -, _, ~)
+     * The format is "user:xxxx@example.com";
+     * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A unique user identification string, as determined by the client.
+     * The maximum number of allowed characters is 255.
+     * Allowed characters include numbers 0 to 9, uppercase and lowercase letters,
+     * and restricted special symbols (:, @, +, -, _, ~)
+     * The format is "user:xxxx@example.com";
+     * 
+ * + * string id = 1; + * + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + id_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A unique user identification string, as determined by the client.
+     * The maximum number of allowed characters is 255.
+     * Allowed characters include numbers 0 to 9, uppercase and lowercase letters,
+     * and restricted special symbols (:, @, +, -, _, ~)
+     * The format is "user:xxxx@example.com";
+     * 
+ * + * string id = 1; + * + * @return This builder for chaining. + */ + public Builder clearId() { + + id_ = getDefaultInstance().getId(); + onChanged(); + return this; + } + /** + * + * + *
+     * A unique user identification string, as determined by the client.
+     * The maximum number of allowed characters is 255.
+     * Allowed characters include numbers 0 to 9, uppercase and lowercase letters,
+     * and restricted special symbols (:, @, +, -, _, ~)
+     * The format is "user:xxxx@example.com";
+     * 
+ * + * string id = 1; + * + * @param value The bytes for id to set. + * @return This builder for chaining. + */ + public Builder setIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + id_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList groupIds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureGroupIdsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + groupIds_ = new com.google.protobuf.LazyStringArrayList(groupIds_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * The unique group identifications which the user is belong to.
+     * The format is "group:yyyy@example.com";
+     * 
+ * + * repeated string group_ids = 2; + * + * @return A list containing the groupIds. + */ + public com.google.protobuf.ProtocolStringList getGroupIdsList() { + return groupIds_.getUnmodifiableView(); + } + /** + * + * + *
+     * The unique group identifications which the user is belong to.
+     * The format is "group:yyyy@example.com";
+     * 
+ * + * repeated string group_ids = 2; + * + * @return The count of groupIds. + */ + public int getGroupIdsCount() { + return groupIds_.size(); + } + /** + * + * + *
+     * The unique group identifications which the user is belong to.
+     * The format is "group:yyyy@example.com";
+     * 
+ * + * repeated string group_ids = 2; + * + * @param index The index of the element to return. + * @return The groupIds at the given index. + */ + public java.lang.String getGroupIds(int index) { + return groupIds_.get(index); + } + /** + * + * + *
+     * The unique group identifications which the user is belong to.
+     * The format is "group:yyyy@example.com";
+     * 
+ * + * repeated string group_ids = 2; + * + * @param index The index of the value to return. + * @return The bytes of the groupIds at the given index. + */ + public com.google.protobuf.ByteString getGroupIdsBytes(int index) { + return groupIds_.getByteString(index); + } + /** + * + * + *
+     * The unique group identifications which the user is belong to.
+     * The format is "group:yyyy@example.com";
+     * 
+ * + * repeated string group_ids = 2; + * + * @param index The index to set the value at. + * @param value The groupIds to set. + * @return This builder for chaining. + */ + public Builder setGroupIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureGroupIdsIsMutable(); + groupIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The unique group identifications which the user is belong to.
+     * The format is "group:yyyy@example.com";
+     * 
+ * + * repeated string group_ids = 2; + * + * @param value The groupIds to add. + * @return This builder for chaining. + */ + public Builder addGroupIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureGroupIdsIsMutable(); + groupIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The unique group identifications which the user is belong to.
+     * The format is "group:yyyy@example.com";
+     * 
+ * + * repeated string group_ids = 2; + * + * @param values The groupIds to add. + * @return This builder for chaining. + */ + public Builder addAllGroupIds(java.lang.Iterable values) { + ensureGroupIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, groupIds_); + onChanged(); + return this; + } + /** + * + * + *
+     * The unique group identifications which the user is belong to.
+     * The format is "group:yyyy@example.com";
+     * 
+ * + * repeated string group_ids = 2; + * + * @return This builder for chaining. + */ + public Builder clearGroupIds() { + groupIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The unique group identifications which the user is belong to.
+     * The format is "group:yyyy@example.com";
+     * 
+ * + * repeated string group_ids = 2; + * + * @param value The bytes of the groupIds to add. + * @return This builder for chaining. + */ + public Builder addGroupIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureGroupIdsIsMutable(); + groupIds_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.UserInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.UserInfo) + private static final com.google.cloud.contentwarehouse.v1.UserInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.UserInfo(); + } + + public static com.google.cloud.contentwarehouse.v1.UserInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UserInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.UserInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/UserInfoOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/UserInfoOrBuilder.java new file mode 100644 index 000000000000..3a90780e8b66 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/UserInfoOrBuilder.java @@ -0,0 +1,113 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/common.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface UserInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.UserInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A unique user identification string, as determined by the client.
+   * The maximum number of allowed characters is 255.
+   * Allowed characters include numbers 0 to 9, uppercase and lowercase letters,
+   * and restricted special symbols (:, @, +, -, _, ~)
+   * The format is "user:xxxx@example.com";
+   * 
+ * + * string id = 1; + * + * @return The id. + */ + java.lang.String getId(); + /** + * + * + *
+   * A unique user identification string, as determined by the client.
+   * The maximum number of allowed characters is 255.
+   * Allowed characters include numbers 0 to 9, uppercase and lowercase letters,
+   * and restricted special symbols (:, @, +, -, _, ~)
+   * The format is "user:xxxx@example.com";
+   * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + com.google.protobuf.ByteString getIdBytes(); + + /** + * + * + *
+   * The unique group identifications which the user is belong to.
+   * The format is "group:yyyy@example.com";
+   * 
+ * + * repeated string group_ids = 2; + * + * @return A list containing the groupIds. + */ + java.util.List getGroupIdsList(); + /** + * + * + *
+   * The unique group identifications which the user is belong to.
+   * The format is "group:yyyy@example.com";
+   * 
+ * + * repeated string group_ids = 2; + * + * @return The count of groupIds. + */ + int getGroupIdsCount(); + /** + * + * + *
+   * The unique group identifications which the user is belong to.
+   * The format is "group:yyyy@example.com";
+   * 
+ * + * repeated string group_ids = 2; + * + * @param index The index of the element to return. + * @return The groupIds at the given index. + */ + java.lang.String getGroupIds(int index); + /** + * + * + *
+   * The unique group identifications which the user is belong to.
+   * The format is "group:yyyy@example.com";
+   * 
+ * + * repeated string group_ids = 2; + * + * @param index The index of the value to return. + * @return The bytes of the groupIds at the given index. + */ + com.google.protobuf.ByteString getGroupIdsBytes(int index); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/Value.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/Value.java new file mode 100644 index 000000000000..ed864f2e38ca --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/Value.java @@ -0,0 +1,2056 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document.proto + +package com.google.cloud.contentwarehouse.v1; + +/** + * + * + *
+ * `Value` represents a dynamically typed value which can be either be
+ * a float, a integer, a string, or a datetime value. A producer of value is
+ * expected to set one of these variants. Absence of any variant indicates an
+ * error.
+ * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.Value} + */ +public final class Value extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.Value) + ValueOrBuilder { + private static final long serialVersionUID = 0L; + // Use Value.newBuilder() to construct. + private Value(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Value() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Value(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_Value_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_Value_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.Value.class, + com.google.cloud.contentwarehouse.v1.Value.Builder.class); + } + + private int kindCase_ = 0; + private java.lang.Object kind_; + + public enum KindCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + FLOAT_VALUE(1), + INT_VALUE(2), + STRING_VALUE(3), + ENUM_VALUE(4), + DATETIME_VALUE(5), + TIMESTAMP_VALUE(6), + BOOLEAN_VALUE(7), + KIND_NOT_SET(0); + private final int value; + + private KindCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static KindCase valueOf(int value) { + return forNumber(value); + } + + public static KindCase forNumber(int value) { + switch (value) { + case 1: + return FLOAT_VALUE; + case 2: + return INT_VALUE; + case 3: + return STRING_VALUE; + case 4: + return ENUM_VALUE; + case 5: + return DATETIME_VALUE; + case 6: + return TIMESTAMP_VALUE; + case 7: + return BOOLEAN_VALUE; + case 0: + return KIND_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public KindCase getKindCase() { + return KindCase.forNumber(kindCase_); + } + + public static final int FLOAT_VALUE_FIELD_NUMBER = 1; + /** + * + * + *
+   * Represents a float value.
+   * 
+ * + * float float_value = 1; + * + * @return Whether the floatValue field is set. + */ + @java.lang.Override + public boolean hasFloatValue() { + return kindCase_ == 1; + } + /** + * + * + *
+   * Represents a float value.
+   * 
+ * + * float float_value = 1; + * + * @return The floatValue. + */ + @java.lang.Override + public float getFloatValue() { + if (kindCase_ == 1) { + return (java.lang.Float) kind_; + } + return 0F; + } + + public static final int INT_VALUE_FIELD_NUMBER = 2; + /** + * + * + *
+   * Represents a integer value.
+   * 
+ * + * int32 int_value = 2; + * + * @return Whether the intValue field is set. + */ + @java.lang.Override + public boolean hasIntValue() { + return kindCase_ == 2; + } + /** + * + * + *
+   * Represents a integer value.
+   * 
+ * + * int32 int_value = 2; + * + * @return The intValue. + */ + @java.lang.Override + public int getIntValue() { + if (kindCase_ == 2) { + return (java.lang.Integer) kind_; + } + return 0; + } + + public static final int STRING_VALUE_FIELD_NUMBER = 3; + /** + * + * + *
+   * Represents a string value.
+   * 
+ * + * string string_value = 3; + * + * @return Whether the stringValue field is set. + */ + public boolean hasStringValue() { + return kindCase_ == 3; + } + /** + * + * + *
+   * Represents a string value.
+   * 
+ * + * string string_value = 3; + * + * @return The stringValue. + */ + public java.lang.String getStringValue() { + java.lang.Object ref = ""; + if (kindCase_ == 3) { + ref = kind_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (kindCase_ == 3) { + kind_ = s; + } + return s; + } + } + /** + * + * + *
+   * Represents a string value.
+   * 
+ * + * string string_value = 3; + * + * @return The bytes for stringValue. + */ + public com.google.protobuf.ByteString getStringValueBytes() { + java.lang.Object ref = ""; + if (kindCase_ == 3) { + ref = kind_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (kindCase_ == 3) { + kind_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ENUM_VALUE_FIELD_NUMBER = 4; + /** + * + * + *
+   * Represents an enum value.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.EnumValue enum_value = 4; + * + * @return Whether the enumValue field is set. + */ + @java.lang.Override + public boolean hasEnumValue() { + return kindCase_ == 4; + } + /** + * + * + *
+   * Represents an enum value.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.EnumValue enum_value = 4; + * + * @return The enumValue. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.EnumValue getEnumValue() { + if (kindCase_ == 4) { + return (com.google.cloud.contentwarehouse.v1.EnumValue) kind_; + } + return com.google.cloud.contentwarehouse.v1.EnumValue.getDefaultInstance(); + } + /** + * + * + *
+   * Represents an enum value.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.EnumValue enum_value = 4; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.EnumValueOrBuilder getEnumValueOrBuilder() { + if (kindCase_ == 4) { + return (com.google.cloud.contentwarehouse.v1.EnumValue) kind_; + } + return com.google.cloud.contentwarehouse.v1.EnumValue.getDefaultInstance(); + } + + public static final int DATETIME_VALUE_FIELD_NUMBER = 5; + /** + * + * + *
+   * Represents a datetime value.
+   * 
+ * + * .google.type.DateTime datetime_value = 5; + * + * @return Whether the datetimeValue field is set. + */ + @java.lang.Override + public boolean hasDatetimeValue() { + return kindCase_ == 5; + } + /** + * + * + *
+   * Represents a datetime value.
+   * 
+ * + * .google.type.DateTime datetime_value = 5; + * + * @return The datetimeValue. + */ + @java.lang.Override + public com.google.type.DateTime getDatetimeValue() { + if (kindCase_ == 5) { + return (com.google.type.DateTime) kind_; + } + return com.google.type.DateTime.getDefaultInstance(); + } + /** + * + * + *
+   * Represents a datetime value.
+   * 
+ * + * .google.type.DateTime datetime_value = 5; + */ + @java.lang.Override + public com.google.type.DateTimeOrBuilder getDatetimeValueOrBuilder() { + if (kindCase_ == 5) { + return (com.google.type.DateTime) kind_; + } + return com.google.type.DateTime.getDefaultInstance(); + } + + public static final int TIMESTAMP_VALUE_FIELD_NUMBER = 6; + /** + * + * + *
+   * Represents a timestamp value.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.TimestampValue timestamp_value = 6; + * + * @return Whether the timestampValue field is set. + */ + @java.lang.Override + public boolean hasTimestampValue() { + return kindCase_ == 6; + } + /** + * + * + *
+   * Represents a timestamp value.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.TimestampValue timestamp_value = 6; + * + * @return The timestampValue. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.TimestampValue getTimestampValue() { + if (kindCase_ == 6) { + return (com.google.cloud.contentwarehouse.v1.TimestampValue) kind_; + } + return com.google.cloud.contentwarehouse.v1.TimestampValue.getDefaultInstance(); + } + /** + * + * + *
+   * Represents a timestamp value.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.TimestampValue timestamp_value = 6; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.TimestampValueOrBuilder getTimestampValueOrBuilder() { + if (kindCase_ == 6) { + return (com.google.cloud.contentwarehouse.v1.TimestampValue) kind_; + } + return com.google.cloud.contentwarehouse.v1.TimestampValue.getDefaultInstance(); + } + + public static final int BOOLEAN_VALUE_FIELD_NUMBER = 7; + /** + * + * + *
+   * Represents a boolean value.
+   * 
+ * + * bool boolean_value = 7; + * + * @return Whether the booleanValue field is set. + */ + @java.lang.Override + public boolean hasBooleanValue() { + return kindCase_ == 7; + } + /** + * + * + *
+   * Represents a boolean value.
+   * 
+ * + * bool boolean_value = 7; + * + * @return The booleanValue. + */ + @java.lang.Override + public boolean getBooleanValue() { + if (kindCase_ == 7) { + return (java.lang.Boolean) kind_; + } + return false; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (kindCase_ == 1) { + output.writeFloat(1, (float) ((java.lang.Float) kind_)); + } + if (kindCase_ == 2) { + output.writeInt32(2, (int) ((java.lang.Integer) kind_)); + } + if (kindCase_ == 3) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, kind_); + } + if (kindCase_ == 4) { + output.writeMessage(4, (com.google.cloud.contentwarehouse.v1.EnumValue) kind_); + } + if (kindCase_ == 5) { + output.writeMessage(5, (com.google.type.DateTime) kind_); + } + if (kindCase_ == 6) { + output.writeMessage(6, (com.google.cloud.contentwarehouse.v1.TimestampValue) kind_); + } + if (kindCase_ == 7) { + output.writeBool(7, (boolean) ((java.lang.Boolean) kind_)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (kindCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeFloatSize( + 1, (float) ((java.lang.Float) kind_)); + } + if (kindCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeInt32Size( + 2, (int) ((java.lang.Integer) kind_)); + } + if (kindCase_ == 3) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, kind_); + } + if (kindCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.cloud.contentwarehouse.v1.EnumValue) kind_); + } + if (kindCase_ == 5) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, (com.google.type.DateTime) kind_); + } + if (kindCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, (com.google.cloud.contentwarehouse.v1.TimestampValue) kind_); + } + if (kindCase_ == 7) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize( + 7, (boolean) ((java.lang.Boolean) kind_)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.contentwarehouse.v1.Value)) { + return super.equals(obj); + } + com.google.cloud.contentwarehouse.v1.Value other = + (com.google.cloud.contentwarehouse.v1.Value) obj; + + if (!getKindCase().equals(other.getKindCase())) return false; + switch (kindCase_) { + case 1: + if (java.lang.Float.floatToIntBits(getFloatValue()) + != java.lang.Float.floatToIntBits(other.getFloatValue())) return false; + break; + case 2: + if (getIntValue() != other.getIntValue()) return false; + break; + case 3: + if (!getStringValue().equals(other.getStringValue())) return false; + break; + case 4: + if (!getEnumValue().equals(other.getEnumValue())) return false; + break; + case 5: + if (!getDatetimeValue().equals(other.getDatetimeValue())) return false; + break; + case 6: + if (!getTimestampValue().equals(other.getTimestampValue())) return false; + break; + case 7: + if (getBooleanValue() != other.getBooleanValue()) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (kindCase_) { + case 1: + hash = (37 * hash) + FLOAT_VALUE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getFloatValue()); + break; + case 2: + hash = (37 * hash) + INT_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getIntValue(); + break; + case 3: + hash = (37 * hash) + STRING_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getStringValue().hashCode(); + break; + case 4: + hash = (37 * hash) + ENUM_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getEnumValue().hashCode(); + break; + case 5: + hash = (37 * hash) + DATETIME_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getDatetimeValue().hashCode(); + break; + case 6: + hash = (37 * hash) + TIMESTAMP_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getTimestampValue().hashCode(); + break; + case 7: + hash = (37 * hash) + BOOLEAN_VALUE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getBooleanValue()); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.contentwarehouse.v1.Value parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.Value parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.Value parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.Value parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.Value parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.contentwarehouse.v1.Value parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.Value parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.Value parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.Value parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.Value parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.contentwarehouse.v1.Value parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.contentwarehouse.v1.Value parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.contentwarehouse.v1.Value prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * `Value` represents a dynamically typed value which can be either be
+   * a float, a integer, a string, or a datetime value. A producer of value is
+   * expected to set one of these variants. Absence of any variant indicates an
+   * error.
+   * 
+ * + * Protobuf type {@code google.cloud.contentwarehouse.v1.Value} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.Value) + com.google.cloud.contentwarehouse.v1.ValueOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_Value_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_Value_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.contentwarehouse.v1.Value.class, + com.google.cloud.contentwarehouse.v1.Value.Builder.class); + } + + // Construct using com.google.cloud.contentwarehouse.v1.Value.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (enumValueBuilder_ != null) { + enumValueBuilder_.clear(); + } + if (datetimeValueBuilder_ != null) { + datetimeValueBuilder_.clear(); + } + if (timestampValueBuilder_ != null) { + timestampValueBuilder_.clear(); + } + kindCase_ = 0; + kind_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.contentwarehouse.v1.DocumentProto + .internal_static_google_cloud_contentwarehouse_v1_Value_descriptor; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.Value getDefaultInstanceForType() { + return com.google.cloud.contentwarehouse.v1.Value.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.Value build() { + com.google.cloud.contentwarehouse.v1.Value result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.Value buildPartial() { + com.google.cloud.contentwarehouse.v1.Value result = + new com.google.cloud.contentwarehouse.v1.Value(this); + if (kindCase_ == 1) { + result.kind_ = kind_; + } + if (kindCase_ == 2) { + result.kind_ = kind_; + } + if (kindCase_ == 3) { + result.kind_ = kind_; + } + if (kindCase_ == 4) { + if (enumValueBuilder_ == null) { + result.kind_ = kind_; + } else { + result.kind_ = enumValueBuilder_.build(); + } + } + if (kindCase_ == 5) { + if (datetimeValueBuilder_ == null) { + result.kind_ = kind_; + } else { + result.kind_ = datetimeValueBuilder_.build(); + } + } + if (kindCase_ == 6) { + if (timestampValueBuilder_ == null) { + result.kind_ = kind_; + } else { + result.kind_ = timestampValueBuilder_.build(); + } + } + if (kindCase_ == 7) { + result.kind_ = kind_; + } + result.kindCase_ = kindCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.contentwarehouse.v1.Value) { + return mergeFrom((com.google.cloud.contentwarehouse.v1.Value) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.Value other) { + if (other == com.google.cloud.contentwarehouse.v1.Value.getDefaultInstance()) return this; + switch (other.getKindCase()) { + case FLOAT_VALUE: + { + setFloatValue(other.getFloatValue()); + break; + } + case INT_VALUE: + { + setIntValue(other.getIntValue()); + break; + } + case STRING_VALUE: + { + kindCase_ = 3; + kind_ = other.kind_; + onChanged(); + break; + } + case ENUM_VALUE: + { + mergeEnumValue(other.getEnumValue()); + break; + } + case DATETIME_VALUE: + { + mergeDatetimeValue(other.getDatetimeValue()); + break; + } + case TIMESTAMP_VALUE: + { + mergeTimestampValue(other.getTimestampValue()); + break; + } + case BOOLEAN_VALUE: + { + setBooleanValue(other.getBooleanValue()); + break; + } + case KIND_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 13: + { + kind_ = input.readFloat(); + kindCase_ = 1; + break; + } // case 13 + case 16: + { + kind_ = input.readInt32(); + kindCase_ = 2; + break; + } // case 16 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + kindCase_ = 3; + kind_ = s; + break; + } // case 26 + case 34: + { + input.readMessage(getEnumValueFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 4; + break; + } // case 34 + case 42: + { + input.readMessage(getDatetimeValueFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 5; + break; + } // case 42 + case 50: + { + input.readMessage(getTimestampValueFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 6; + break; + } // case 50 + case 56: + { + kind_ = input.readBool(); + kindCase_ = 7; + break; + } // case 56 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int kindCase_ = 0; + private java.lang.Object kind_; + + public KindCase getKindCase() { + return KindCase.forNumber(kindCase_); + } + + public Builder clearKind() { + kindCase_ = 0; + kind_ = null; + onChanged(); + return this; + } + + /** + * + * + *
+     * Represents a float value.
+     * 
+ * + * float float_value = 1; + * + * @return Whether the floatValue field is set. + */ + public boolean hasFloatValue() { + return kindCase_ == 1; + } + /** + * + * + *
+     * Represents a float value.
+     * 
+ * + * float float_value = 1; + * + * @return The floatValue. + */ + public float getFloatValue() { + if (kindCase_ == 1) { + return (java.lang.Float) kind_; + } + return 0F; + } + /** + * + * + *
+     * Represents a float value.
+     * 
+ * + * float float_value = 1; + * + * @param value The floatValue to set. + * @return This builder for chaining. + */ + public Builder setFloatValue(float value) { + kindCase_ = 1; + kind_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Represents a float value.
+     * 
+ * + * float float_value = 1; + * + * @return This builder for chaining. + */ + public Builder clearFloatValue() { + if (kindCase_ == 1) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Represents a integer value.
+     * 
+ * + * int32 int_value = 2; + * + * @return Whether the intValue field is set. + */ + public boolean hasIntValue() { + return kindCase_ == 2; + } + /** + * + * + *
+     * Represents a integer value.
+     * 
+ * + * int32 int_value = 2; + * + * @return The intValue. + */ + public int getIntValue() { + if (kindCase_ == 2) { + return (java.lang.Integer) kind_; + } + return 0; + } + /** + * + * + *
+     * Represents a integer value.
+     * 
+ * + * int32 int_value = 2; + * + * @param value The intValue to set. + * @return This builder for chaining. + */ + public Builder setIntValue(int value) { + kindCase_ = 2; + kind_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Represents a integer value.
+     * 
+ * + * int32 int_value = 2; + * + * @return This builder for chaining. + */ + public Builder clearIntValue() { + if (kindCase_ == 2) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Represents a string value.
+     * 
+ * + * string string_value = 3; + * + * @return Whether the stringValue field is set. + */ + @java.lang.Override + public boolean hasStringValue() { + return kindCase_ == 3; + } + /** + * + * + *
+     * Represents a string value.
+     * 
+ * + * string string_value = 3; + * + * @return The stringValue. + */ + @java.lang.Override + public java.lang.String getStringValue() { + java.lang.Object ref = ""; + if (kindCase_ == 3) { + ref = kind_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (kindCase_ == 3) { + kind_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Represents a string value.
+     * 
+ * + * string string_value = 3; + * + * @return The bytes for stringValue. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStringValueBytes() { + java.lang.Object ref = ""; + if (kindCase_ == 3) { + ref = kind_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (kindCase_ == 3) { + kind_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Represents a string value.
+     * 
+ * + * string string_value = 3; + * + * @param value The stringValue to set. + * @return This builder for chaining. + */ + public Builder setStringValue(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kindCase_ = 3; + kind_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Represents a string value.
+     * 
+ * + * string string_value = 3; + * + * @return This builder for chaining. + */ + public Builder clearStringValue() { + if (kindCase_ == 3) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Represents a string value.
+     * 
+ * + * string string_value = 3; + * + * @param value The bytes for stringValue to set. + * @return This builder for chaining. + */ + public Builder setStringValueBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kindCase_ = 3; + kind_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.EnumValue, + com.google.cloud.contentwarehouse.v1.EnumValue.Builder, + com.google.cloud.contentwarehouse.v1.EnumValueOrBuilder> + enumValueBuilder_; + /** + * + * + *
+     * Represents an enum value.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.EnumValue enum_value = 4; + * + * @return Whether the enumValue field is set. + */ + @java.lang.Override + public boolean hasEnumValue() { + return kindCase_ == 4; + } + /** + * + * + *
+     * Represents an enum value.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.EnumValue enum_value = 4; + * + * @return The enumValue. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.EnumValue getEnumValue() { + if (enumValueBuilder_ == null) { + if (kindCase_ == 4) { + return (com.google.cloud.contentwarehouse.v1.EnumValue) kind_; + } + return com.google.cloud.contentwarehouse.v1.EnumValue.getDefaultInstance(); + } else { + if (kindCase_ == 4) { + return enumValueBuilder_.getMessage(); + } + return com.google.cloud.contentwarehouse.v1.EnumValue.getDefaultInstance(); + } + } + /** + * + * + *
+     * Represents an enum value.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.EnumValue enum_value = 4; + */ + public Builder setEnumValue(com.google.cloud.contentwarehouse.v1.EnumValue value) { + if (enumValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + enumValueBuilder_.setMessage(value); + } + kindCase_ = 4; + return this; + } + /** + * + * + *
+     * Represents an enum value.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.EnumValue enum_value = 4; + */ + public Builder setEnumValue( + com.google.cloud.contentwarehouse.v1.EnumValue.Builder builderForValue) { + if (enumValueBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + enumValueBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 4; + return this; + } + /** + * + * + *
+     * Represents an enum value.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.EnumValue enum_value = 4; + */ + public Builder mergeEnumValue(com.google.cloud.contentwarehouse.v1.EnumValue value) { + if (enumValueBuilder_ == null) { + if (kindCase_ == 4 + && kind_ != com.google.cloud.contentwarehouse.v1.EnumValue.getDefaultInstance()) { + kind_ = + com.google.cloud.contentwarehouse.v1.EnumValue.newBuilder( + (com.google.cloud.contentwarehouse.v1.EnumValue) kind_) + .mergeFrom(value) + .buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 4) { + enumValueBuilder_.mergeFrom(value); + } else { + enumValueBuilder_.setMessage(value); + } + } + kindCase_ = 4; + return this; + } + /** + * + * + *
+     * Represents an enum value.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.EnumValue enum_value = 4; + */ + public Builder clearEnumValue() { + if (enumValueBuilder_ == null) { + if (kindCase_ == 4) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 4) { + kindCase_ = 0; + kind_ = null; + } + enumValueBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Represents an enum value.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.EnumValue enum_value = 4; + */ + public com.google.cloud.contentwarehouse.v1.EnumValue.Builder getEnumValueBuilder() { + return getEnumValueFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Represents an enum value.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.EnumValue enum_value = 4; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.EnumValueOrBuilder getEnumValueOrBuilder() { + if ((kindCase_ == 4) && (enumValueBuilder_ != null)) { + return enumValueBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 4) { + return (com.google.cloud.contentwarehouse.v1.EnumValue) kind_; + } + return com.google.cloud.contentwarehouse.v1.EnumValue.getDefaultInstance(); + } + } + /** + * + * + *
+     * Represents an enum value.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.EnumValue enum_value = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.EnumValue, + com.google.cloud.contentwarehouse.v1.EnumValue.Builder, + com.google.cloud.contentwarehouse.v1.EnumValueOrBuilder> + getEnumValueFieldBuilder() { + if (enumValueBuilder_ == null) { + if (!(kindCase_ == 4)) { + kind_ = com.google.cloud.contentwarehouse.v1.EnumValue.getDefaultInstance(); + } + enumValueBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.EnumValue, + com.google.cloud.contentwarehouse.v1.EnumValue.Builder, + com.google.cloud.contentwarehouse.v1.EnumValueOrBuilder>( + (com.google.cloud.contentwarehouse.v1.EnumValue) kind_, + getParentForChildren(), + isClean()); + kind_ = null; + } + kindCase_ = 4; + onChanged(); + ; + return enumValueBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.DateTime, + com.google.type.DateTime.Builder, + com.google.type.DateTimeOrBuilder> + datetimeValueBuilder_; + /** + * + * + *
+     * Represents a datetime value.
+     * 
+ * + * .google.type.DateTime datetime_value = 5; + * + * @return Whether the datetimeValue field is set. + */ + @java.lang.Override + public boolean hasDatetimeValue() { + return kindCase_ == 5; + } + /** + * + * + *
+     * Represents a datetime value.
+     * 
+ * + * .google.type.DateTime datetime_value = 5; + * + * @return The datetimeValue. + */ + @java.lang.Override + public com.google.type.DateTime getDatetimeValue() { + if (datetimeValueBuilder_ == null) { + if (kindCase_ == 5) { + return (com.google.type.DateTime) kind_; + } + return com.google.type.DateTime.getDefaultInstance(); + } else { + if (kindCase_ == 5) { + return datetimeValueBuilder_.getMessage(); + } + return com.google.type.DateTime.getDefaultInstance(); + } + } + /** + * + * + *
+     * Represents a datetime value.
+     * 
+ * + * .google.type.DateTime datetime_value = 5; + */ + public Builder setDatetimeValue(com.google.type.DateTime value) { + if (datetimeValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + datetimeValueBuilder_.setMessage(value); + } + kindCase_ = 5; + return this; + } + /** + * + * + *
+     * Represents a datetime value.
+     * 
+ * + * .google.type.DateTime datetime_value = 5; + */ + public Builder setDatetimeValue(com.google.type.DateTime.Builder builderForValue) { + if (datetimeValueBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + datetimeValueBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 5; + return this; + } + /** + * + * + *
+     * Represents a datetime value.
+     * 
+ * + * .google.type.DateTime datetime_value = 5; + */ + public Builder mergeDatetimeValue(com.google.type.DateTime value) { + if (datetimeValueBuilder_ == null) { + if (kindCase_ == 5 && kind_ != com.google.type.DateTime.getDefaultInstance()) { + kind_ = + com.google.type.DateTime.newBuilder((com.google.type.DateTime) kind_) + .mergeFrom(value) + .buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 5) { + datetimeValueBuilder_.mergeFrom(value); + } else { + datetimeValueBuilder_.setMessage(value); + } + } + kindCase_ = 5; + return this; + } + /** + * + * + *
+     * Represents a datetime value.
+     * 
+ * + * .google.type.DateTime datetime_value = 5; + */ + public Builder clearDatetimeValue() { + if (datetimeValueBuilder_ == null) { + if (kindCase_ == 5) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 5) { + kindCase_ = 0; + kind_ = null; + } + datetimeValueBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Represents a datetime value.
+     * 
+ * + * .google.type.DateTime datetime_value = 5; + */ + public com.google.type.DateTime.Builder getDatetimeValueBuilder() { + return getDatetimeValueFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Represents a datetime value.
+     * 
+ * + * .google.type.DateTime datetime_value = 5; + */ + @java.lang.Override + public com.google.type.DateTimeOrBuilder getDatetimeValueOrBuilder() { + if ((kindCase_ == 5) && (datetimeValueBuilder_ != null)) { + return datetimeValueBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 5) { + return (com.google.type.DateTime) kind_; + } + return com.google.type.DateTime.getDefaultInstance(); + } + } + /** + * + * + *
+     * Represents a datetime value.
+     * 
+ * + * .google.type.DateTime datetime_value = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.DateTime, + com.google.type.DateTime.Builder, + com.google.type.DateTimeOrBuilder> + getDatetimeValueFieldBuilder() { + if (datetimeValueBuilder_ == null) { + if (!(kindCase_ == 5)) { + kind_ = com.google.type.DateTime.getDefaultInstance(); + } + datetimeValueBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.type.DateTime, + com.google.type.DateTime.Builder, + com.google.type.DateTimeOrBuilder>( + (com.google.type.DateTime) kind_, getParentForChildren(), isClean()); + kind_ = null; + } + kindCase_ = 5; + onChanged(); + ; + return datetimeValueBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.TimestampValue, + com.google.cloud.contentwarehouse.v1.TimestampValue.Builder, + com.google.cloud.contentwarehouse.v1.TimestampValueOrBuilder> + timestampValueBuilder_; + /** + * + * + *
+     * Represents a timestamp value.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.TimestampValue timestamp_value = 6; + * + * @return Whether the timestampValue field is set. + */ + @java.lang.Override + public boolean hasTimestampValue() { + return kindCase_ == 6; + } + /** + * + * + *
+     * Represents a timestamp value.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.TimestampValue timestamp_value = 6; + * + * @return The timestampValue. + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.TimestampValue getTimestampValue() { + if (timestampValueBuilder_ == null) { + if (kindCase_ == 6) { + return (com.google.cloud.contentwarehouse.v1.TimestampValue) kind_; + } + return com.google.cloud.contentwarehouse.v1.TimestampValue.getDefaultInstance(); + } else { + if (kindCase_ == 6) { + return timestampValueBuilder_.getMessage(); + } + return com.google.cloud.contentwarehouse.v1.TimestampValue.getDefaultInstance(); + } + } + /** + * + * + *
+     * Represents a timestamp value.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.TimestampValue timestamp_value = 6; + */ + public Builder setTimestampValue(com.google.cloud.contentwarehouse.v1.TimestampValue value) { + if (timestampValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + timestampValueBuilder_.setMessage(value); + } + kindCase_ = 6; + return this; + } + /** + * + * + *
+     * Represents a timestamp value.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.TimestampValue timestamp_value = 6; + */ + public Builder setTimestampValue( + com.google.cloud.contentwarehouse.v1.TimestampValue.Builder builderForValue) { + if (timestampValueBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + timestampValueBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 6; + return this; + } + /** + * + * + *
+     * Represents a timestamp value.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.TimestampValue timestamp_value = 6; + */ + public Builder mergeTimestampValue(com.google.cloud.contentwarehouse.v1.TimestampValue value) { + if (timestampValueBuilder_ == null) { + if (kindCase_ == 6 + && kind_ != com.google.cloud.contentwarehouse.v1.TimestampValue.getDefaultInstance()) { + kind_ = + com.google.cloud.contentwarehouse.v1.TimestampValue.newBuilder( + (com.google.cloud.contentwarehouse.v1.TimestampValue) kind_) + .mergeFrom(value) + .buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 6) { + timestampValueBuilder_.mergeFrom(value); + } else { + timestampValueBuilder_.setMessage(value); + } + } + kindCase_ = 6; + return this; + } + /** + * + * + *
+     * Represents a timestamp value.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.TimestampValue timestamp_value = 6; + */ + public Builder clearTimestampValue() { + if (timestampValueBuilder_ == null) { + if (kindCase_ == 6) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 6) { + kindCase_ = 0; + kind_ = null; + } + timestampValueBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Represents a timestamp value.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.TimestampValue timestamp_value = 6; + */ + public com.google.cloud.contentwarehouse.v1.TimestampValue.Builder getTimestampValueBuilder() { + return getTimestampValueFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Represents a timestamp value.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.TimestampValue timestamp_value = 6; + */ + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.TimestampValueOrBuilder + getTimestampValueOrBuilder() { + if ((kindCase_ == 6) && (timestampValueBuilder_ != null)) { + return timestampValueBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 6) { + return (com.google.cloud.contentwarehouse.v1.TimestampValue) kind_; + } + return com.google.cloud.contentwarehouse.v1.TimestampValue.getDefaultInstance(); + } + } + /** + * + * + *
+     * Represents a timestamp value.
+     * 
+ * + * .google.cloud.contentwarehouse.v1.TimestampValue timestamp_value = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.TimestampValue, + com.google.cloud.contentwarehouse.v1.TimestampValue.Builder, + com.google.cloud.contentwarehouse.v1.TimestampValueOrBuilder> + getTimestampValueFieldBuilder() { + if (timestampValueBuilder_ == null) { + if (!(kindCase_ == 6)) { + kind_ = com.google.cloud.contentwarehouse.v1.TimestampValue.getDefaultInstance(); + } + timestampValueBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.contentwarehouse.v1.TimestampValue, + com.google.cloud.contentwarehouse.v1.TimestampValue.Builder, + com.google.cloud.contentwarehouse.v1.TimestampValueOrBuilder>( + (com.google.cloud.contentwarehouse.v1.TimestampValue) kind_, + getParentForChildren(), + isClean()); + kind_ = null; + } + kindCase_ = 6; + onChanged(); + ; + return timestampValueBuilder_; + } + + /** + * + * + *
+     * Represents a boolean value.
+     * 
+ * + * bool boolean_value = 7; + * + * @return Whether the booleanValue field is set. + */ + public boolean hasBooleanValue() { + return kindCase_ == 7; + } + /** + * + * + *
+     * Represents a boolean value.
+     * 
+ * + * bool boolean_value = 7; + * + * @return The booleanValue. + */ + public boolean getBooleanValue() { + if (kindCase_ == 7) { + return (java.lang.Boolean) kind_; + } + return false; + } + /** + * + * + *
+     * Represents a boolean value.
+     * 
+ * + * bool boolean_value = 7; + * + * @param value The booleanValue to set. + * @return This builder for chaining. + */ + public Builder setBooleanValue(boolean value) { + kindCase_ = 7; + kind_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Represents a boolean value.
+     * 
+ * + * bool boolean_value = 7; + * + * @return This builder for chaining. + */ + public Builder clearBooleanValue() { + if (kindCase_ == 7) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.contentwarehouse.v1.Value) + } + + // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.Value) + private static final com.google.cloud.contentwarehouse.v1.Value DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.Value(); + } + + public static com.google.cloud.contentwarehouse.v1.Value getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Value parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.contentwarehouse.v1.Value getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ValueOrBuilder.java b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ValueOrBuilder.java new file mode 100644 index 000000000000..e1b38cec20dc --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/java/com/google/cloud/contentwarehouse/v1/ValueOrBuilder.java @@ -0,0 +1,244 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/contentwarehouse/v1/document.proto + +package com.google.cloud.contentwarehouse.v1; + +public interface ValueOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.contentwarehouse.v1.Value) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Represents a float value.
+   * 
+ * + * float float_value = 1; + * + * @return Whether the floatValue field is set. + */ + boolean hasFloatValue(); + /** + * + * + *
+   * Represents a float value.
+   * 
+ * + * float float_value = 1; + * + * @return The floatValue. + */ + float getFloatValue(); + + /** + * + * + *
+   * Represents a integer value.
+   * 
+ * + * int32 int_value = 2; + * + * @return Whether the intValue field is set. + */ + boolean hasIntValue(); + /** + * + * + *
+   * Represents a integer value.
+   * 
+ * + * int32 int_value = 2; + * + * @return The intValue. + */ + int getIntValue(); + + /** + * + * + *
+   * Represents a string value.
+   * 
+ * + * string string_value = 3; + * + * @return Whether the stringValue field is set. + */ + boolean hasStringValue(); + /** + * + * + *
+   * Represents a string value.
+   * 
+ * + * string string_value = 3; + * + * @return The stringValue. + */ + java.lang.String getStringValue(); + /** + * + * + *
+   * Represents a string value.
+   * 
+ * + * string string_value = 3; + * + * @return The bytes for stringValue. + */ + com.google.protobuf.ByteString getStringValueBytes(); + + /** + * + * + *
+   * Represents an enum value.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.EnumValue enum_value = 4; + * + * @return Whether the enumValue field is set. + */ + boolean hasEnumValue(); + /** + * + * + *
+   * Represents an enum value.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.EnumValue enum_value = 4; + * + * @return The enumValue. + */ + com.google.cloud.contentwarehouse.v1.EnumValue getEnumValue(); + /** + * + * + *
+   * Represents an enum value.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.EnumValue enum_value = 4; + */ + com.google.cloud.contentwarehouse.v1.EnumValueOrBuilder getEnumValueOrBuilder(); + + /** + * + * + *
+   * Represents a datetime value.
+   * 
+ * + * .google.type.DateTime datetime_value = 5; + * + * @return Whether the datetimeValue field is set. + */ + boolean hasDatetimeValue(); + /** + * + * + *
+   * Represents a datetime value.
+   * 
+ * + * .google.type.DateTime datetime_value = 5; + * + * @return The datetimeValue. + */ + com.google.type.DateTime getDatetimeValue(); + /** + * + * + *
+   * Represents a datetime value.
+   * 
+ * + * .google.type.DateTime datetime_value = 5; + */ + com.google.type.DateTimeOrBuilder getDatetimeValueOrBuilder(); + + /** + * + * + *
+   * Represents a timestamp value.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.TimestampValue timestamp_value = 6; + * + * @return Whether the timestampValue field is set. + */ + boolean hasTimestampValue(); + /** + * + * + *
+   * Represents a timestamp value.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.TimestampValue timestamp_value = 6; + * + * @return The timestampValue. + */ + com.google.cloud.contentwarehouse.v1.TimestampValue getTimestampValue(); + /** + * + * + *
+   * Represents a timestamp value.
+   * 
+ * + * .google.cloud.contentwarehouse.v1.TimestampValue timestamp_value = 6; + */ + com.google.cloud.contentwarehouse.v1.TimestampValueOrBuilder getTimestampValueOrBuilder(); + + /** + * + * + *
+   * Represents a boolean value.
+   * 
+ * + * bool boolean_value = 7; + * + * @return Whether the booleanValue field is set. + */ + boolean hasBooleanValue(); + /** + * + * + *
+   * Represents a boolean value.
+   * 
+ * + * bool boolean_value = 7; + * + * @return The booleanValue. + */ + boolean getBooleanValue(); + + public com.google.cloud.contentwarehouse.v1.Value.KindCase getKindCase(); +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/proto/google/cloud/contentwarehouse/v1/async_document_service_request.proto b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/proto/google/cloud/contentwarehouse/v1/async_document_service_request.proto new file mode 100644 index 000000000000..368ddf3f8ccb --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/proto/google/cloud/contentwarehouse/v1/async_document_service_request.proto @@ -0,0 +1,35 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.contentwarehouse.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/contentwarehouse/v1;contentwarehouse"; +option java_multiple_files = true; +option java_outer_classname = "AsyncDocumentServiceRequestProto"; +option java_package = "com.google.cloud.contentwarehouse.v1"; + +// Metadata object for CreateDocument request (currently empty). +message CreateDocumentMetadata { + +} + +// Metadata object for UpdateDocument request (currently empty). +message UpdateDocumentMetadata { + +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/proto/google/cloud/contentwarehouse/v1/common.proto b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/proto/google/cloud/contentwarehouse/v1/common.proto new file mode 100644 index 000000000000..9be7e86a34da --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/proto/google/cloud/contentwarehouse/v1/common.proto @@ -0,0 +1,140 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.contentwarehouse.v1; + +import "google/api/resource.proto"; +import "google/protobuf/field_mask.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/contentwarehouse/v1;contentwarehouse"; +option java_multiple_files = true; +option java_outer_classname = "CommonProto"; +option java_package = "com.google.cloud.contentwarehouse.v1"; +option (google.api.resource_definition) = { + type: "contentwarehouse.googleapis.com/Location" + pattern: "projects/{project}/locations/{location}" +}; + +// Meta information is used to improve the performance of the service. +message RequestMetadata { + // Provides user unique identification and groups information. + UserInfo user_info = 1; +} + +// Additional information returned to client, such as debugging information. +message ResponseMetadata { + // A unique id associated with this call. This id is logged for tracking + // purpose. + string request_id = 1; +} + +message UserInfo { + // A unique user identification string, as determined by the client. + // The maximum number of allowed characters is 255. + // Allowed characters include numbers 0 to 9, uppercase and lowercase letters, + // and restricted special symbols (:, @, +, -, _, ~) + // The format is "user:xxxx@example.com"; + string id = 1; + + // The unique group identifications which the user is belong to. + // The format is "group:yyyy@example.com"; + repeated string group_ids = 2; +} + +// Options for Update operations. +message UpdateOptions { + // Type for update. + UpdateType update_type = 1; + + // Field mask for merging Document fields. + // For the `FieldMask` definition, + // see + // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + google.protobuf.FieldMask update_mask = 2; + + // Options for merging. + MergeFieldsOptions merge_fields_options = 3; +} + +// Options for merging updated fields. +message MergeFieldsOptions { + // When merging message fields, the default behavior is to merge + // the content of two message fields together. If you instead want to use + // the field from the source message to replace the corresponding field in + // the destination message, set this flag to true. When this flag is set, + // specified submessage fields that are missing in source will be cleared in + // destination. + optional bool replace_message_fields = 1; + + // When merging repeated fields, the default behavior is to append + // entries from the source repeated field to the destination repeated field. + // If you instead want to keep only the entries from the source repeated + // field, set this flag to true. + // + // If you want to replace a repeated field within a message field on the + // destination message, you must set both replace_repeated_fields and + // replace_message_fields to true, otherwise the repeated fields will be + // appended. + optional bool replace_repeated_fields = 2; +} + +// Update type of the requests. +enum UpdateType { + // Defaults to full replace behavior, ie. FULL_REPLACE. + UPDATE_TYPE_UNSPECIFIED = 0; + + // Fully replace all the fields. Any field masks will be ignored. + UPDATE_TYPE_REPLACE = 1; + + // Merge the fields into the existing entities. + UPDATE_TYPE_MERGE = 2; + + // Inserts the properties by names. + UPDATE_TYPE_INSERT_PROPERTIES_BY_NAMES = 3; + + // Replace the properties by names. + UPDATE_TYPE_REPLACE_PROPERTIES_BY_NAMES = 4; + + // Delete the properties by names. + UPDATE_TYPE_DELETE_PROPERTIES_BY_NAMES = 5; +} + +// Type of database used by the customer +enum DatabaseType { + // This value is required by protobuf best practices + DB_UNKNOWN = 0; + + // Internal Spanner + DB_INFRA_SPANNER = 1; + + // Cloud Sql with a Postgres Sql instance + DB_CLOUD_SQL_POSTGRES = 2; +} + +// Access Control Mode. +enum AccessControlMode { + // This value is required by protobuf best practices + ACL_MODE_UNKNOWN = 0; + + // Universal Access: No document level access control. + ACL_MODE_UNIVERSAL_ACCESS = 1; + + // Document level access control with customer own Identity Service. + ACL_MODE_DOCUMENT_LEVEL_ACCESS_CONTROL_BYOID = 2; + + // Document level access control using Google Cloud Identity. + ACL_MODE_DOCUMENT_LEVEL_ACCESS_CONTROL_GCI = 3; +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/proto/google/cloud/contentwarehouse/v1/document.proto b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/proto/google/cloud/contentwarehouse/v1/document.proto new file mode 100644 index 000000000000..5ec6c2ec686e --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/proto/google/cloud/contentwarehouse/v1/document.proto @@ -0,0 +1,310 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.contentwarehouse.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/documentai/v1/document.proto"; +import "google/protobuf/timestamp.proto"; +import "google/type/datetime.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/contentwarehouse/v1;contentwarehouse"; +option java_multiple_files = true; +option java_outer_classname = "DocumentProto"; +option java_package = "com.google.cloud.contentwarehouse.v1"; + +// Defines the structure for content warehouse document proto. +message Document { + option (google.api.resource) = { + type: "contentwarehouse.googleapis.com/Document" + pattern: "projects/{project}/locations/{location}/documents/{document}" + pattern: "projects/{project}/locations/{location}/documents/referenceId/{reference_id}" + }; + + // The resource name of the document. + // Format: + // projects/{project_number}/locations/{location}/documents/{document_id}. + // + // The name is ignored when creating a document. + string name = 1; + + // The reference ID set by customers. Must be unique per project and location. + string reference_id = 11; + + // Required. Display name of the document given by the user. This name will be displayed + // in the UI. + // Customer can populate this field with the name of the document. This + // differs from the 'title' field as 'title' is optional and stores the top + // heading in the document. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Title that describes the document. + // This is usually present in the top section of the document, and is a + // mandatory field for the question-answering feature. + string title = 18; + + // Uri to display the document, for example, in the UI. + string display_uri = 17; + + // The Document schema name. + // Format: + // projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}. + string document_schema_name = 3 [(google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/DocumentSchema" + }]; + + oneof structured_content { + // Other document format, such as PPTX, XLXS + string plain_text = 15; + + // Document AI format to save the structured content, including OCR. + google.cloud.documentai.v1.Document cloud_ai_document = 4; + } + + // A path linked to structured content file. + string structured_content_uri = 16; + + // Raw document file. + oneof raw_document { + // Raw document file in Cloud Storage path. + string raw_document_path = 5; + + // Raw document content. + bytes inline_raw_document = 6; + } + + // List of values that are user supplied metadata. + repeated Property properties = 7; + + // Output only. The time when the document is last updated. + google.protobuf.Timestamp update_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the document is created. + google.protobuf.Timestamp create_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // This is used when DocAI was not used to load the document and parsing/ + // extracting is needed for the inline_raw_document. For example, if + // inline_raw_document is the byte representation of a PDF file, then + // this should be set to: RAW_DOCUMENT_FILE_TYPE_PDF. + RawDocumentFileType raw_document_file_type = 10; + + // If true, makes the document visible to asynchronous policies and rules. + bool async_enabled = 12; + + // If true, text extraction will not be performed. + bool text_extraction_disabled = 19; + + // The user who creates the document. + string creator = 13; + + // The user who lastly updates the document. + string updater = 14; +} + +// References to the documents. +message DocumentReference { + // Required. Name of the referenced document. + string document_name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/Document" + } + ]; + + // display_name of the referenced document; this name does not need to be + // consistent to the display_name in the Document proto, depending on the ACL + // constraint. + string display_name = 2; + + // Stores the subset of the referenced document's content. + // This is useful to allow user peek the information of the referenced + // document. + string snippet = 3; + + // The document type of the document being referenced. + bool document_is_folder = 4; + + // Output only. The time when the document is last updated. + google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the document is created. + google.protobuf.Timestamp create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the document is deleted. + google.protobuf.Timestamp delete_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Property of a document. +message Property { + // Required. Must match the name of a PropertyDefinition in the DocumentSchema. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Type of the property. + // Must match the property_options type of the matching PropertyDefinition. + // Value of the Property parsed into a specific data type. + // Specific type value(s) obtained from Document AIs Property.mention_text + // field. + oneof values { + // Integer property values. + IntegerArray integer_values = 2; + + // Float property values. + FloatArray float_values = 3; + + // String/text property values. + TextArray text_values = 4; + + // Enum property values. + EnumArray enum_values = 5; + + // Nested structured data property values. + PropertyArray property_values = 6; + + // Date time property values. + // It is not supported by CMEK compliant deployment. + DateTimeArray date_time_values = 7; + + // Map property values. + MapProperty map_property = 8; + + // Timestamp property values. + // It is not supported by CMEK compliant deployment. + TimestampArray timestamp_values = 9; + } +} + +// Integer values. +message IntegerArray { + // List of integer values. + repeated int32 values = 1; +} + +// Float values. +message FloatArray { + // List of float values. + repeated float values = 1; +} + +// String/text values. +message TextArray { + // List of text values. + repeated string values = 1; +} + +// Enum values. +message EnumArray { + // List of enum values. + repeated string values = 1; +} + +// DateTime values. +message DateTimeArray { + // List of datetime values. + // Both OffsetDateTime and ZonedDateTime are supported. + repeated google.type.DateTime values = 1; +} + +// Timestamp values. +message TimestampArray { + // List of timestamp values. + repeated TimestampValue values = 1; +} + +// Timestamp value type. +message TimestampValue { + oneof value { + // Timestamp value + google.protobuf.Timestamp timestamp_value = 1; + + // The string must represent a valid instant in UTC and is parsed using + // java.time.format.DateTimeFormatter.ISO_INSTANT. + // e.g. "2013-09-29T18:46:19Z" + string text_value = 2; + } +} + +// Property values. +message PropertyArray { + // List of property values. + repeated Property properties = 1; +} + +// Map property value. +// Represents a structured entries of key value pairs, consisting of field names +// which map to dynamically typed values. +message MapProperty { + // Unordered map of dynamically typed values. + map fields = 1; +} + +// `Value` represents a dynamically typed value which can be either be +// a float, a integer, a string, or a datetime value. A producer of value is +// expected to set one of these variants. Absence of any variant indicates an +// error. +message Value { + // The kind of value. + oneof kind { + // Represents a float value. + float float_value = 1; + + // Represents a integer value. + int32 int_value = 2; + + // Represents a string value. + string string_value = 3; + + // Represents an enum value. + EnumValue enum_value = 4; + + // Represents a datetime value. + google.type.DateTime datetime_value = 5; + + // Represents a timestamp value. + TimestampValue timestamp_value = 6; + + // Represents a boolean value. + bool boolean_value = 7; + } +} + +// Represents the string value of the enum field. +message EnumValue { + // String value of the enum field. This must match defined set of enums + // in document schema using EnumTypeOptions. + string value = 1; +} + +// When a raw document is supplied, this indicates the file format +enum RawDocumentFileType { + // No raw document specified or it is non-parsable + RAW_DOCUMENT_FILE_TYPE_UNSPECIFIED = 0; + + // Adobe PDF format + RAW_DOCUMENT_FILE_TYPE_PDF = 1; + + // Microsoft Word format + RAW_DOCUMENT_FILE_TYPE_DOCX = 2; + + // Microsoft Excel format + RAW_DOCUMENT_FILE_TYPE_XLSX = 3; + + // Microsoft Powerpoint format + RAW_DOCUMENT_FILE_TYPE_PPTX = 4; + + // UTF-8 encoded text format + RAW_DOCUMENT_FILE_TYPE_TEXT = 5; +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/proto/google/cloud/contentwarehouse/v1/document_link_service.proto b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/proto/google/cloud/contentwarehouse/v1/document_link_service.proto new file mode 100644 index 000000000000..a5a14d8dcbf4 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/proto/google/cloud/contentwarehouse/v1/document_link_service.proto @@ -0,0 +1,227 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.contentwarehouse.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/contentwarehouse/v1/common.proto"; +import "google/cloud/contentwarehouse/v1/document.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/contentwarehouse/v1;contentwarehouse"; +option java_multiple_files = true; +option java_outer_classname = "DocumentLinkServiceProto"; +option java_package = "com.google.cloud.contentwarehouse.v1"; + +// This service lets you manage document-links. +// Document-Links are treated as sub-resources under source documents. +service DocumentLinkService { + option (google.api.default_host) = "contentwarehouse.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Return all target document-links from the document. + rpc ListLinkedTargets(ListLinkedTargetsRequest) returns (ListLinkedTargetsResponse) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/documents/*}/linkedTargets" + body: "*" + }; + option (google.api.method_signature) = "parent"; + } + + // Return all source document-links from the document. + rpc ListLinkedSources(ListLinkedSourcesRequest) returns (ListLinkedSourcesResponse) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/documents/*}/linkedSources" + body: "*" + }; + option (google.api.method_signature) = "parent"; + } + + // Create a link between a source document and a target document. + rpc CreateDocumentLink(CreateDocumentLinkRequest) returns (DocumentLink) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/documents/*}/documentLinks" + body: "*" + }; + option (google.api.method_signature) = "parent,document_link"; + } + + // Remove the link between the source and target documents. + rpc DeleteDocumentLink(DeleteDocumentLinkRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/documents/*/documentLinks/*}:delete" + body: "*" + }; + option (google.api.method_signature) = "name"; + } +} + +// Response message for DocumentLinkService.ListLinkedTargets. +message ListLinkedTargetsResponse { + // Target document-links. + repeated DocumentLink document_links = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for DocumentLinkService.ListLinkedTargets. +message ListLinkedTargetsRequest { + // Required. The name of the document, for which all target links are returned. + // Format: + // projects/{project_number}/locations/{location}/documents/{target_document_id}. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/Document" + } + ]; + + // The meta information collected about the document creator, used to enforce + // access control for the service. + RequestMetadata request_metadata = 2; +} + +// Response message for DocumentLinkService.ListLinkedSources. +message ListLinkedSourcesResponse { + // Source document-links. + repeated DocumentLink document_links = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Response message for DocumentLinkService.ListLinkedSources. +message ListLinkedSourcesRequest { + // Required. The name of the document, for which all source links are returned. + // Format: + // projects/{project_number}/locations/{location}/documents/{source_document_id}. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/Document" + } + ]; + + // The maximum number of document-links to return. The service may return + // fewer than this value. + // + // If unspecified, at most 50 document-links will be returned. + // The maximum value is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 3; + + // A page token, received from a previous `ListLinkedSources` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListLinkedSources` + // must match the call that provided the page token. + string page_token = 4; + + // The meta information collected about the document creator, used to enforce + // access control for the service. + RequestMetadata request_metadata = 2; +} + +// A document-link between source and target document. +message DocumentLink { + option (google.api.resource) = { + type: "contentwarehouse.googleapis.com/DocumentLink" + pattern: "projects/{project}/locations/{location}/documents/{document}/documentLinks/{document_link}" + }; + + // The state of a document-link. + enum State { + // Unknown state of documentlink. + STATE_UNSPECIFIED = 0; + + // The documentlink has both source and target documents detected. + ACTIVE = 1; + + // Target document is deleted, and mark the documentlink as soft-deleted. + SOFT_DELETED = 2; + } + + // Name of this document-link. + // It is required that the parent derived form the name to be consistent with + // the source document reference. Otherwise an exception will be thrown. + // Format: + // projects/{project_number}/locations/{location}/documents/{source_document_id}/documentLinks/{document_link_id}. + string name = 1; + + // Document references of the source document. + DocumentReference source_document_reference = 2; + + // Document references of the target document. + DocumentReference target_document_reference = 3; + + // Description of this document-link. + string description = 4; + + // Output only. The time when the documentLink is last updated. + google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the documentLink is created. + google.protobuf.Timestamp create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The state of the documentlink. If target node has been deleted, the + // link is marked as invalid. Removing a source node will result in removal + // of all associated links. + State state = 7; +} + +// Request message for DocumentLinkService.CreateDocumentLink. +message CreateDocumentLinkRequest { + // 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}. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/Document" + } + ]; + + // Required. Document links associated with the source documents (source_document_id). + DocumentLink document_link = 2 [(google.api.field_behavior) = REQUIRED]; + + // The meta information collected about the document creator, used to enforce + // access control for the service. + RequestMetadata request_metadata = 3; +} + +// Request message for DocumentLinkService.DeleteDocumentLink. +message DeleteDocumentLinkRequest { + // Required. The name of the document-link to be deleted. + // Format: + // projects/{project_number}/locations/{location}/documents/{source_document_id}/documentLinks/{document_link_id}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/DocumentLink" + } + ]; + + // The meta information collected about the document creator, used to enforce + // access control for the service. + RequestMetadata request_metadata = 2; +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/proto/google/cloud/contentwarehouse/v1/document_schema.proto b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/proto/google/cloud/contentwarehouse/v1/document_schema.proto new file mode 100644 index 000000000000..fae52e4c51e1 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/proto/google/cloud/contentwarehouse/v1/document_schema.proto @@ -0,0 +1,166 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.contentwarehouse.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/contentwarehouse/v1;contentwarehouse"; +option java_multiple_files = true; +option java_outer_classname = "DocumentSchemaProto"; +option java_package = "com.google.cloud.contentwarehouse.v1"; + +// A document schema used to define document structure. +message DocumentSchema { + option (google.api.resource) = { + type: "contentwarehouse.googleapis.com/DocumentSchema" + pattern: "projects/{project}/locations/{location}/documentSchemas/{document_schema}" + }; + + // The resource name of the document schema. + // Format: + // projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}. + // + // The name is ignored when creating a document schema. + string name = 1; + + // Required. Name of the schema given by the user. Must be unique per customer. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Document details. + repeated PropertyDefinition property_definitions = 3; + + // Document Type, true refers the document is a folder, otherwise it is + // a typical document. + bool document_is_folder = 4; + + // Output only. The time when the document schema is last updated. + google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the document schema is created. + google.protobuf.Timestamp create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Schema description. + string description = 7; +} + +// Defines the metadata for a schema property. +message PropertyDefinition { + // Required. The name of the metadata property. + // Must be unique within a document schema and is case insensitive. + // Names must be non-blank, start with a letter, and can contain alphanumeric + // characters and: /, :, -, _, and . + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // The display-name for the property, used for front-end. + string display_name = 12; + + // Whether the property can have multiple values. + bool is_repeatable = 2; + + // Whether the property can be filtered. If this is a sub-property, all the + // parent properties must be marked filterable. + bool is_filterable = 3; + + // Indicates that the property should be included in a global search. + bool is_searchable = 4; + + // Whether the property is user supplied metadata. + bool is_metadata = 5; + + // Whether the property is mandatory. + // Default is 'false', i.e. populating property value can be skipped. + // If 'true' then user must populate the value for this property. + bool is_required = 14; + + // Type of the property. + oneof value_type_options { + // Integer property. + IntegerTypeOptions integer_type_options = 7; + + // Float property. + FloatTypeOptions float_type_options = 8; + + // Text/string property. + TextTypeOptions text_type_options = 9; + + // Nested structured data property. + PropertyTypeOptions property_type_options = 10; + + // Enum/categorical property. + EnumTypeOptions enum_type_options = 11; + + // Date time property. + // It is not supported by CMEK compliant deployment. + DateTimeTypeOptions date_time_type_options = 13; + + // Map property. + MapTypeOptions map_type_options = 15; + + // Timestamp property. + // It is not supported by CMEK compliant deployment. + TimestampTypeOptions timestamp_type_options = 16; + } +} + +// Configurations for an integer property. +message IntegerTypeOptions { + +} + +// Configurations for a float property. +message FloatTypeOptions { + +} + +// Configurations for a text property. +message TextTypeOptions { + +} + +// Configurations for a date time property. +message DateTimeTypeOptions { + +} + +// Configurations for a Map property. +message MapTypeOptions { + +} + +// Configurations for a timestamp property. +message TimestampTypeOptions { + +} + +// Configurations for a nested structured data property. +message PropertyTypeOptions { + // Required. List of property definitions. + repeated PropertyDefinition property_definitions = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Configurations for an enum/categorical property. +message EnumTypeOptions { + // Required. List of possible enum values. + repeated string possible_values = 1 [(google.api.field_behavior) = REQUIRED]; + + // Make sure the Enum property value provided in the document is in the + // possile value list during document creation. The validation check runs by + // default. + bool validation_check_disabled = 2; +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/proto/google/cloud/contentwarehouse/v1/document_schema_service.proto b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/proto/google/cloud/contentwarehouse/v1/document_schema_service.proto new file mode 100644 index 000000000000..9c570695045a --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/proto/google/cloud/contentwarehouse/v1/document_schema_service.proto @@ -0,0 +1,174 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.contentwarehouse.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/contentwarehouse/v1/document_schema.proto"; +import "google/protobuf/empty.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/contentwarehouse/v1;contentwarehouse"; +option java_multiple_files = true; +option java_outer_classname = "DocumentSchemaServiceProto"; +option java_package = "com.google.cloud.contentwarehouse.v1"; + +// (go/id-aip-list) to add a finite deadline and enable fail_fast. + +// This service lets you manage document schema. +service DocumentSchemaService { + option (google.api.default_host) = "contentwarehouse.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a document schema. + rpc CreateDocumentSchema(CreateDocumentSchemaRequest) returns (DocumentSchema) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/documentSchemas" + body: "document_schema" + }; + option (google.api.method_signature) = "parent,document_schema"; + } + + // 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. + rpc UpdateDocumentSchema(UpdateDocumentSchemaRequest) returns (DocumentSchema) { + option (google.api.http) = { + patch: "/v1/{name=projects/*/locations/*/documentSchemas/*}" + body: "*" + }; + option (google.api.method_signature) = "name,document_schema"; + } + + // Gets a document schema. Returns NOT_FOUND if the document schema does not + // exist. + rpc GetDocumentSchema(GetDocumentSchemaRequest) returns (DocumentSchema) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/documentSchemas/*}" + }; + option (google.api.method_signature) = "name"; + } + + // 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. + rpc DeleteDocumentSchema(DeleteDocumentSchemaRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/documentSchemas/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists document schemas. + rpc ListDocumentSchemas(ListDocumentSchemasRequest) returns (ListDocumentSchemasResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/documentSchemas" + }; + option (google.api.method_signature) = "parent"; + } +} + +// Request message for DocumentSchemaService.CreateDocumentSchema. +message CreateDocumentSchemaRequest { + // Required. The parent name. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/Location" + } + ]; + + // Required. The document schema to create. + DocumentSchema document_schema = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for DocumentSchemaService.GetDocumentSchema. +message GetDocumentSchemaRequest { + // Required. The name of the document schema to retrieve. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/DocumentSchema" + } + ]; +} + +// Request message for DocumentSchemaService.UpdateDocumentSchema. +message UpdateDocumentSchemaRequest { + // Required. The name of the document schema to update. + // Format: + // projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/DocumentSchema" + } + ]; + + // Required. The document schema to update with. + DocumentSchema document_schema = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for DocumentSchemaService.DeleteDocumentSchema. +message DeleteDocumentSchemaRequest { + // Required. The name of the document schema to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/DocumentSchema" + } + ]; +} + +// Request message for DocumentSchemaService.ListDocumentSchemas. +message ListDocumentSchemasRequest { + // Required. The parent, which owns this collection of document schemas. + // Format: projects/{project_number}/locations/{location}. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/Location" + } + ]; + + // The maximum number of document schemas to return. The service may return + // fewer than this value. + // If unspecified, at most 50 document schemas will be returned. + // The maximum value is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 2; + + // A page token, received from a previous `ListDocumentSchemas` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListDocumentSchemas` + // must match the call that provided the page token. + string page_token = 3; +} + +// Response message for DocumentSchemaService.ListDocumentSchemas. +message ListDocumentSchemasResponse { + // The document schemas from the specified parent. + repeated DocumentSchema document_schemas = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/proto/google/cloud/contentwarehouse/v1/document_service.proto b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/proto/google/cloud/contentwarehouse/v1/document_service.proto new file mode 100644 index 000000000000..e0c1c8750881 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/proto/google/cloud/contentwarehouse/v1/document_service.proto @@ -0,0 +1,249 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.contentwarehouse.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/resource.proto"; +import "google/cloud/contentwarehouse/v1/common.proto"; +import "google/cloud/contentwarehouse/v1/document.proto"; +import "google/cloud/contentwarehouse/v1/document_service_request.proto"; +import "google/cloud/contentwarehouse/v1/histogram.proto"; +import "google/cloud/contentwarehouse/v1/rule_engine.proto"; +import "google/iam/v1/policy.proto"; +import "google/protobuf/empty.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/contentwarehouse/v1;contentwarehouse"; +option java_multiple_files = true; +option java_outer_classname = "DocumentServiceProto"; +option java_package = "com.google.cloud.contentwarehouse.v1"; + +// This service lets you manage document. +service DocumentService { + option (google.api.default_host) = "contentwarehouse.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a document. + rpc CreateDocument(CreateDocumentRequest) returns (CreateDocumentResponse) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/documents" + body: "*" + }; + option (google.api.method_signature) = "parent,document"; + } + + // Gets a document. Returns NOT_FOUND if the document does not exist. + rpc GetDocument(GetDocumentRequest) returns (Document) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/documents/*}:get" + body: "*" + additional_bindings { + post: "/v1/{name=projects/*/locations/*/documents/referenceId/*}:get" + body: "*" + } + }; + option (google.api.method_signature) = "name"; + } + + // Updates a document. Returns INVALID_ARGUMENT if the name of the document + // is non-empty and does not equal the existing name. + rpc UpdateDocument(UpdateDocumentRequest) returns (UpdateDocumentResponse) { + option (google.api.http) = { + patch: "/v1/{name=projects/*/locations/*/documents/*}" + body: "*" + additional_bindings { + patch: "/v1/{name=projects/*/locations/*/documents/referenceId/*}" + body: "*" + } + }; + option (google.api.method_signature) = "name,document"; + } + + // Deletes a document. Returns NOT_FOUND if the document does not exist. + rpc DeleteDocument(DeleteDocumentRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/documents/*}:delete" + body: "*" + additional_bindings { + post: "/v1/{name=projects/*/locations/*/documents/referenceId/*}:delete" + body: "*" + } + }; + option (google.api.method_signature) = "name"; + } + + // Searches for documents using provided [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest]. + // This call only returns documents that the caller has permission to search + // against. + rpc SearchDocuments(SearchDocumentsRequest) returns (SearchDocumentsResponse) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/documents:search" + body: "*" + }; + option (google.api.method_signature) = "parent"; + } + + // 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. + rpc FetchAcl(FetchAclRequest) returns (FetchAclResponse) { + option (google.api.http) = { + post: "/v1/{resource=projects/*/locations/*/documents/*}:fetchAcl" + body: "*" + additional_bindings { + post: "/v1/{resource=projects/*}:fetchAcl" + body: "*" + } + }; + option (google.api.method_signature) = "resource"; + } + + // Sets the access control policy for a resource. Replaces any existing + // policy. + rpc SetAcl(SetAclRequest) returns (SetAclResponse) { + option (google.api.http) = { + post: "/v1/{resource=projects/*/locations/*/documents/*}:setAcl" + body: "*" + additional_bindings { + post: "/v1/{resource=projects/*}:setAcl" + body: "*" + } + }; + option (google.api.method_signature) = "resource,policy"; + } +} + +// Response message for DocumentService.CreateDocument. +message CreateDocumentResponse { + // Document created after executing create request. + Document document = 1; + + // Output from Rule Engine recording the rule evaluator and action executor's + // output. + // + // Refer format in: google/cloud/contentwarehouse/v1/rule_engine.proto + RuleEngineOutput rule_engine_output = 2; + + // Additional information for the API invocation, such as the request tracking + // id. + ResponseMetadata metadata = 3; +} + +// Response message for DocumentService.UpdateDocument. +message UpdateDocumentResponse { + // Updated document after executing update request. + Document document = 1; + + // Output from Rule Engine recording the rule evaluator and action executor's + // output. + // + // Refer format in: google/cloud/contentwarehouse/v1/rule_engine.proto + RuleEngineOutput rule_engine_output = 2; + + // Additional information for the API invocation, such as the request tracking + // id. + ResponseMetadata metadata = 3; +} + +// Additional result info for the question-answering feature. +message QAResult { + // A text span in the search text snippet that represents a highlighted + // section (answer context, highly relevant sentence, etc.). + message Highlight { + // Start index of the highlight. + int32 start_index = 1; + + // End index of the highlight, exclusive. + int32 end_index = 2; + } + + // Highlighted sections in the snippet. + repeated Highlight highlights = 1; + + // The calibrated confidence score for this document, in the range + // [0., 1.]. This represents the confidence level for whether the returned + // document and snippet answers the user's query. + float confidence_score = 2; +} + +// Response message for DocumentService.SearchDocuments. +message SearchDocumentsResponse { + // Document entry with metadata inside [SearchDocumentsResponse][google.cloud.contentwarehouse.v1.SearchDocumentsResponse] + message MatchingDocument { + // Document that matches the specified [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest]. + // This document only contains indexed metadata information. + Document document = 1; + + // Contains snippets of text from the document full raw text that most + // closely match a search query's keywords, if available. All HTML tags in + // the original fields are stripped when returned in this field, and + // matching query keywords are enclosed in HTML bold tags. + // + // If the question-answering feature is enabled, this field will instead + // contain a snippet that answers the user's natural-language query. No HTML + // bold tags will be present, and highlights in the answer snippet can be + // found in [QAResult.highlights][google.cloud.contentwarehouse.v1.QAResult.highlights]. + string search_text_snippet = 2; + + // Experimental. + // Additional result info if the question-answering feature is enabled. + QAResult qa_result = 3; + } + + // The document entities that match the specified [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest]. + repeated MatchingDocument matching_documents = 1; + + // The token that specifies the starting position of the next page of results. + // This field is empty if there are no more results. + string next_page_token = 2; + + // The total number of matched documents which is available only if the client + // set [SearchDocumentsRequest.require_total_size][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.require_total_size] to `true`. Otherwise, the + // value will be `-1`. `total_size` will max at "100,000". If this + // is returned, then it can be assumed that the count is equal to or greater + // than 100,000. Typically a UI would handle this condition by displaying + // "of many", for example: "Displaying 10 of many". + int32 total_size = 3; + + // Additional information for the API invocation, such as the request tracking + // id. + ResponseMetadata metadata = 4; + + // The histogram results that match with the specified + // [SearchDocumentsRequest.histogram_queries][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.histogram_queries]. + repeated HistogramQueryResult histogram_query_results = 6; +} + +// Response message for DocumentService.FetchAcl. +message FetchAclResponse { + // The IAM policy. + google.iam.v1.Policy policy = 1; + + // Additional information for the API invocation, such as the request tracking + // id. + ResponseMetadata metadata = 2; +} + +// Response message for DocumentService.SetAcl. +message SetAclResponse { + // The policy will be attached to a resource (e.g. projecct, document). + google.iam.v1.Policy policy = 1; + + // Additional information for the API invocation, such as the request tracking + // id. + ResponseMetadata metadata = 2; +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/proto/google/cloud/contentwarehouse/v1/document_service_request.proto b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/proto/google/cloud/contentwarehouse/v1/document_service_request.proto new file mode 100644 index 000000000000..56b06af5b796 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/proto/google/cloud/contentwarehouse/v1/document_service_request.proto @@ -0,0 +1,279 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.contentwarehouse.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/contentwarehouse/v1/common.proto"; +import "google/cloud/contentwarehouse/v1/document.proto"; +import "google/cloud/contentwarehouse/v1/filters.proto"; +import "google/cloud/contentwarehouse/v1/histogram.proto"; +import "google/iam/v1/policy.proto"; +import "google/protobuf/field_mask.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/contentwarehouse/v1;contentwarehouse"; +option java_multiple_files = true; +option java_outer_classname = "DocumentServiceRequestProto"; +option java_package = "com.google.cloud.contentwarehouse.v1"; + +// Request Option for processing Cloud AI Document in CW Document. +message CloudAIDocumentOption { + // Whether to convert all the entities to properties. + bool enable_entities_conversions = 1; + + // If set, only selected entities will be converted to properties. + map customized_entities_properties_conversions = 2; +} + +// Request message for DocumentService.CreateDocument. +message CreateDocumentRequest { + // Required. The parent name. + // Format: projects/{project_number}/locations/{location}. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/Location" + } + ]; + + // Required. The document to create. + Document document = 2 [(google.api.field_behavior) = REQUIRED]; + + // The meta information collected about the end user, used to enforce access + // control for the service. + RequestMetadata request_metadata = 3; + + // Default document policy during creation. Conditions defined in the policy + // will be ignored. + google.iam.v1.Policy policy = 4; + + // Request Option for processing Cloud AI Document in CW Document. + CloudAIDocumentOption cloud_ai_document_option = 5; + + // Field mask for creating Document fields. If mask path is empty, + // it means all fields are masked. + // For the `FieldMask` definition, + // see + // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + google.protobuf.FieldMask create_mask = 6; +} + +// Request message for DocumentService.GetDocument. +message GetDocumentRequest { + // 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}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/Document" + } + ]; + + // The meta information collected about the end user, used to enforce access + // control for the service. + RequestMetadata request_metadata = 2; +} + +// Request message for DocumentService.UpdateDocument. +message UpdateDocumentRequest { + // 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}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/Document" + } + ]; + + // Required. The document to update. + Document document = 2 [(google.api.field_behavior) = REQUIRED]; + + // The meta information collected about the end user, used to enforce access + // control for the service. + RequestMetadata request_metadata = 3; + + // Request Option for processing Cloud AI Document in CW Document. + CloudAIDocumentOption cloud_ai_document_option = 5; + + // Options for the update operation. + UpdateOptions update_options = 6; +} + +// Request message for DocumentService.DeleteDocument. +message DeleteDocumentRequest { + // 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}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/Document" + } + ]; + + // The meta information collected about the end user, used to enforce access + // control for the service. + RequestMetadata request_metadata = 2; +} + +// Request message for DocumentService.SearchDocuments. +message SearchDocumentsRequest { + // Required. The parent, which owns this collection of documents. + // Format: projects/{project_number}/locations/{location}. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/Location" + } + ]; + + // The meta information collected about the end user, used to enforce access + // control and improve the search quality of the service. + RequestMetadata request_metadata = 3; + + // Query used to search against documents (keyword, filters, etc.). + DocumentQuery document_query = 4; + + // An integer that specifies the current offset (that is, starting result + // location, amongst the documents deemed by the API as relevant) in search + // results. This field is only considered if [page_token][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.page_token] is unset. + // + // The maximum allowed value is 5000. Otherwise an error is thrown. + // + // For example, 0 means to return results starting from the first matching + // document, and 10 means to return from the 11th document. This can be used + // for pagination, (for example, pageSize = 10 and offset = 10 means to return + // from the second page). + int32 offset = 5; + + // A limit on the number of documents returned in the search results. + // Increasing this value above the default value of 10 can increase search + // response time. The value can be between 1 and 100. + int32 page_size = 6; + + // The token specifying the current offset within search results. + // See [SearchDocumentsResponse.next_page_token][google.cloud.contentwarehouse.v1.SearchDocumentsResponse.next_page_token] for an explanation of how + // to obtain the next set of query results. + string page_token = 7; + + // The criteria determining how search results are sorted. For non-empty + // query, default is `"relevance desc"`. For empty query, default is + // `"upload_date desc"`. + // + // Supported options are: + // + // * `"relevance desc"`: By relevance descending, as determined by the API + // algorithms. + // * `"upload_date desc"`: By upload date descending. + // * `"upload_date"`: By upload date ascending. + // * `"update_date desc"`: By last updated date descending. + // * `"update_date"`: By last updated date ascending. + string order_by = 8; + + // An expression specifying a histogram request against matching + // documents. Expression syntax is an aggregation function call with + // histogram facets and other options. + // + // The following aggregation functions are supported: + // + // * `count(string_histogram_facet)`: Count the number of matching entities + // for each distinct attribute value. + // + // Data types: + // + // * Histogram facet (aka filterable properties): Facet names with format + // <schema id>.<facet>. Facets will have the + // format of: [a-zA-Z][a-zA-Z0-9_:/-.]. If the facet is a child + // facet, then the parent hierarchy needs to be specified separated by + // dots in the prefix after the schema id. Thus, the format for a multi- + // level facet is: <schema id>.<parent facet name>. + // <child facet name>. Example: + // schema123.root_parent_facet.middle_facet.child_facet + // * DocumentSchemaId: (with no schema id prefix) to get + // histograms for each document type (returns the schema id path, e.g. + // projects/12345/locations/us-west/documentSchemas/abc123). + // + // Example expression: + // + // * Document type counts: + // count('DocumentSchemaId') + // + // * For schema id, abc123, get the counts for MORTGAGE_TYPE: + // count('abc123.MORTGAGE_TYPE') + repeated HistogramQuery histogram_queries = 9; + + // Optional. Controls if the search document request requires the return of a total size + // of matched documents. See [SearchDocumentsResponse.total_size][google.cloud.contentwarehouse.v1.SearchDocumentsResponse.total_size]. + // + // Enabling this flag may adversely impact performance. Hint: If this is + // used with pagination, set this flag on the initial query but set this + // to false on subsequent page calls (keep the total count locally). + // + // Defaults to false. + bool require_total_size = 10; + + // Experimental, do not use. + // The limit on the number of documents returned for the question-answering + // feature. To enable the question-answering feature, set + // [DocumentQuery].[is_nl_query][] to true. + int32 qa_size_limit = 11; +} + +// Request message for DocumentService.FetchAcl +message FetchAclRequest { + // 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}. + string resource = 1 [(google.api.field_behavior) = REQUIRED]; + + // The meta information collected about the end user, used to enforce access + // control for the service. + RequestMetadata request_metadata = 2; + + // For Get Project ACL only. Authorization check for end user will be ignored + // when project_owner=true. + bool project_owner = 3; +} + +// Request message for DocumentService.SetAcl. +message SetAclRequest { + // 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}. + string resource = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. REQUIRED: The complete policy to be applied to the `resource`. The size of + // the policy is limited to a few 10s of KB. + google.iam.v1.Policy policy = 2 [(google.api.field_behavior) = REQUIRED]; + + // The meta information collected about the end user, used to enforce access + // control for the service. + RequestMetadata request_metadata = 3; + + // For Set Project ACL only. Authorization check for end user will be ignored + // when project_owner=true. + bool project_owner = 4; +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/proto/google/cloud/contentwarehouse/v1/filters.proto b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/proto/google/cloud/contentwarehouse/v1/filters.proto new file mode 100644 index 000000000000..52e39ca90a27 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/proto/google/cloud/contentwarehouse/v1/filters.proto @@ -0,0 +1,206 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.contentwarehouse.v1; + +import "google/api/resource.proto"; +import "google/type/interval.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/contentwarehouse/v1;contentwarehouse"; +option java_multiple_files = true; +option java_outer_classname = "FiltersProto"; +option java_package = "com.google.cloud.contentwarehouse.v1"; + +message DocumentQuery { + // The query string that matches against the full text of the document and + // the searchable properties. + // The maximum number of allowed characters is 255. + string query = 1; + + // Experimental, do not use. + // If the query is a natural language question. False by default. If true, + // then the question-answering feature will be used instead of search, and + // `result_count` in [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest] must be set. In addition, all + // other input fields related to search (pagination, histograms, etc.) will be + // ignored. + bool is_nl_query = 12; + + // This filter specifies a structured syntax to match against the + // [PropertyDefinition].[is_filterable][] marked as `true`. The syntax for + // this expression is a subset of SQL syntax. + // + // Supported operators are: `=`, `!=`, `<`, `<=`, `>`, and `>=` where the left + // of the operator is a property name and the right of the operator is a + // number or a quoted string. You must escape backslash (\\) and quote (\") + // characters. Supported functions are `LOWER([property_name])` to perform a + // case insensitive match and `EMPTY([property_name])` to filter on the + // existence of a key. + // + // Boolean expressions (AND/OR/NOT) are supported up to 3 levels of nesting + // (for example, "((A AND B AND C) OR NOT D) AND E"), a maximum of 100 + // comparisons or functions are allowed in the expression. The expression must + // be < 6000 bytes in length. + // + // Sample Query: + // `(LOWER(driving_license)="class \"a\"" OR EMPTY(driving_license)) AND + // driving_years > 10` + string custom_property_filter = 4 [deprecated = true]; + + // Documents created/updated within a range specified by this filter are + // searched against. + repeated TimeFilter time_filters = 5; + + // This filter specifies the exact document schema + // [Document.document_schema_name][google.cloud.contentwarehouse.v1.Document.document_schema_name] of the documents to search against. + // + // If a value isn't specified, documents within the search results are + // associated with any schema. If multiple values are specified, documents + // within the search results may be associated with any of the specified + // schemas. + // + // At most 20 document schema names are allowed. + repeated string document_schema_names = 6; + + // This filter specifies a structured syntax to match against the + // [PropertyDefinition.is_filterable][google.cloud.contentwarehouse.v1.PropertyDefinition.is_filterable] marked as `true`. The relationship + // between the PropertyFilters is OR. + repeated PropertyFilter property_filter = 7; + + // This filter specifies the types of files to return: ALL, FOLDER, or FILE. + // If FOLDER or FILE is specified, then only either folders or files will be + // returned, respectively. If ALL is specified, both folders and files will be + // returned. + // + // If no value is specified, ALL files will be returned. + FileTypeFilter file_type_filter = 8; + + // Search all the documents under this specified folder. + // Format: + // projects/{project_number}/locations/{location}/documents/{document_id}. + string folder_name_filter = 9; + + // For custom synonyms. + // Customers provide the synonyms based on context. One customer can provide + // multiple set of synonyms based on different context. The search query will + // be expanded based on the custom synonyms of the query context set. + // By default, no custom synonyms wll be applied if no query context is + // provided. + // It is not supported for CMEK compliant deployment. + repeated string query_context = 10; + + // The exact creator(s) of the documents to search against. + // + // If a value isn't specified, documents within the search results are + // associated with any creator. If multiple values are specified, documents + // within the search results may be associated with any of the specified + // creators. + repeated string document_creator_filter = 11; +} + +// Filter on create timestamp or update timestamp of documents. +message TimeFilter { + // Time field used in TimeFilter. + enum TimeField { + // Default value. + TIME_FIELD_UNSPECIFIED = 0; + + // Earliest document create time. + CREATE_TIME = 1; + + // Latest document update time. + UPDATE_TIME = 2; + } + + google.type.Interval time_range = 1; + + // Specifies which time field to filter documents on. + // + // Defaults to [TimeField.UPLOAD_TIME][]. + TimeField time_field = 2; +} + +message PropertyFilter { + // The Document schema name [Document.document_schema_name][google.cloud.contentwarehouse.v1.Document.document_schema_name]. + // Format: + // projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}. + string document_schema_name = 1 [(google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/DocumentSchema" + }]; + + // The filter condition. + // The syntax for this expression is a subset of SQL syntax. + // + // Supported operators are: `=`, `!=`, `<`, `<=`, `>`, `>=`, and `~~` where + // the left of the operator is a property name and the right of the operator + // is a number or a quoted string. You must escape backslash (\\) and quote + // (\") characters. + // + // `~~` is the LIKE operator. The right of the operator must be a string. The + // only supported property data type for LIKE is text_values. It provides + // semantic search functionality by parsing, stemming and doing synonyms + // expansion against the input query. It matches if the property contains + // semantic similar content to the query. It is not regex matching or wildcard + // matching. For example, "property.company ~~ \"google\"" will match records + // whose property `property.compnay` have values like "Google Inc.", "Google + // LLC" or "Google Company". + // + // Supported functions are `LOWER([property_name])` to perform a + // case insensitive match and `EMPTY([property_name])` to filter on the + // existence of a key. + // + // Boolean expressions (AND/OR/NOT) are supported up to 3 levels of nesting + // (for example, "((A AND B AND C) OR NOT D) AND E"), a maximum of 100 + // comparisons or functions are allowed in the expression. The expression must + // be < 6000 bytes in length. + // + // Only properties that are marked filterable are allowed + // ([PropertyDefinition.is_filterable][google.cloud.contentwarehouse.v1.PropertyDefinition.is_filterable]). Property names do not need to be + // prefixed by the document schema id (as is the case with histograms), + // however property names will need to be prefixed by its parent hierarchy, if + // any. For example: top_property_name.sub_property_name. + // + // Sample Query: + // `(LOWER(driving_license)="class \"a\"" OR EMPTY(driving_license)) AND + // driving_years > 10` + // + // + // CMEK compliant deployment only supports: + // + // * Operators: `=`, `<`, `<=`, `>`, and `>=`. + // * Boolean expressions: AND and OR. + string condition = 2; +} + +// Filter for the specific types of documents returned. +message FileTypeFilter { + // Representation of the types of files. + enum FileType { + // Default document type. If set, disables the filter. + FILE_TYPE_UNSPECIFIED = 0; + + // Returns all document types, including folders. + ALL = 1; + + // Returns only folders. + FOLDER = 2; + + // Returns only non-folder documents. + DOCUMENT = 3; + } + + // The type of files to return. + FileType file_type = 1; +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/proto/google/cloud/contentwarehouse/v1/histogram.proto b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/proto/google/cloud/contentwarehouse/v1/histogram.proto new file mode 100644 index 000000000000..ce25e7a8c3fa --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/proto/google/cloud/contentwarehouse/v1/histogram.proto @@ -0,0 +1,102 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.contentwarehouse.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/contentwarehouse/v1;contentwarehouse"; +option java_multiple_files = true; +option java_outer_classname = "HistogramProto"; +option java_package = "com.google.cloud.contentwarehouse.v1"; + +// The histogram request. +message HistogramQuery { + // An expression specifies a histogram request against matching documents for + // searches. + // + // See [SearchDocumentsRequest.histogram_queries][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.histogram_queries] for details about syntax. + string histogram_query = 1; + + // Controls if the histogram query requires the return of a precise count. + // Enable this flag may adversely impact performance. + // + // Defaults to true. + bool require_precise_result_size = 2; + + // Optional. Filter the result of histogram query by the property names. It only works + // with histogram query count('FilterableProperties'). + // It is an optional. It will perform histogram on all the property names for + // all the document schemas. Setting this field will have a better + // performance. + HistogramQueryPropertyNameFilter filters = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +message HistogramQueryPropertyNameFilter { + // The result of the histogram query count('FilterableProperties') using + // HISTOGRAM_YAXIS_DOCUMENT will be: + // invoice_id: 2 + // address: 1 + // payment_method: 2 + // line_item_description: 1 + enum HistogramYAxis { + // Count the documents per property name. + HISTOGRAM_YAXIS_DOCUMENT = 0; + + // Count the properties per property name. + HISTOGRAM_YAXIS_PROPERTY = 1; + } + + // This filter specifies the exact document schema(s) + // [Document.document_schema_name][google.cloud.contentwarehouse.v1.Document.document_schema_name] to run histogram query against. + // It is optional. It will perform histogram for property names for all the + // document schemas if it is not set. + // + // At most 10 document schema names are allowed. + // Format: + // projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}. + repeated string document_schemas = 1 [(google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/DocumentSchema" + }]; + + // It is optional. It will perform histogram for all the property names if it + // is not set. + // The properties need to be defined with the is_filterable flag set to + // true and the name of the property should be in the format: + // "schemaId.propertyName". The property needs to be defined in the schema. + // Example: the schema id is abc. Then the name of property for property + // MORTGAGE_TYPE will be "abc.MORTGAGE_TYPE". + repeated string property_names = 2; + + // By default, the y_axis is HISTOGRAM_YAXIS_DOCUMENT if this field is not + // set. + HistogramYAxis y_axis = 3; +} + +// Histogram result that matches [HistogramQuery][google.cloud.contentwarehouse.v1.HistogramQuery] specified in searches. +message HistogramQueryResult { + // Requested histogram expression. + string histogram_query = 1; + + // A map from the values of the facet associated with distinct values to the + // number of matching entries with corresponding value. + // + // The key format is: + // + // * (for string histogram) string values stored in the field. + map histogram = 2; +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/proto/google/cloud/contentwarehouse/v1/rule_engine.proto b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/proto/google/cloud/contentwarehouse/v1/rule_engine.proto new file mode 100644 index 000000000000..7badc7b788a7 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/proto/google/cloud/contentwarehouse/v1/rule_engine.proto @@ -0,0 +1,276 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.contentwarehouse.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/iam/v1/policy.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/contentwarehouse/v1;contentwarehouse"; +option java_multiple_files = true; +option java_outer_classname = "RuleEngineProto"; +option java_package = "com.google.cloud.contentwarehouse.v1"; + +// Represents a set of rules from a single customer. +message RuleSet { + option (google.api.resource) = { + type: "contentwarehouse.googleapis.com/RuleSet" + pattern: "projects/{project}/locations/{location}/ruleSets/{rule_set}" + }; + + // The resource name of the rule set. Managed internally. + // Format: + // projects/{project_number}/locations/{location}/ruleSet/{rule_set_id}. + // + // The name is ignored when creating a rule set. + string name = 6; + + // Short description of the rule-set. + string description = 1; + + // Source of the rules i.e., customer name. + string source = 2; + + // List of rules given by the customer. + repeated Rule rules = 3; +} + +// Represents the rule for a content warehouse trigger. +message Rule { + enum TriggerType { + UNKNOWN = 0; + + // Trigger for create document action. + ON_CREATE = 1; + + // Trigger for update document action. + ON_UPDATE = 4; + } + + // Short description of the rule and its context. + string description = 1; + + // ID of the rule. It has to be unique across all the examples. + // This is managed internally. + string rule_id = 2; + + // Identifies the trigger type for running the policy. + TriggerType trigger_type = 3; + + // Represents the conditional expression to be evaluated. + // Expression should evaluate to a boolean result. + // When the condition is true actions are executed. + // Example: user_role = "hsbc_role_1" AND doc.salary > 20000 + string condition = 4; + + // List of actions that are executed when the rule is satisfied. + repeated Action actions = 5; +} + +// Represents the action triggered by Rule Engine when the rule is true. +message Action { + // ID of the action. Managed internally. + string action_id = 1; + + oneof action { + // Action triggering access control operations. + AccessControlAction access_control = 2; + + // Action triggering data validation operations. + DataValidationAction data_validation = 3; + + // Action triggering data update operations. + DataUpdateAction data_update = 4; + + // Action triggering create document link operation. + AddToFolderAction add_to_folder = 5; + + // Action publish to Pub/Sub operation. + PublishAction publish_to_pub_sub = 6; + + // Action removing a document from a folder. + RemoveFromFolderAction remove_from_folder_action = 9; + + // Action deleting the document. + DeleteDocumentAction delete_document_action = 10; + } +} + +// Represents the action responsible for access control list management +// operations. +message AccessControlAction { + // Type of ACL modification operation. + enum OperationType { + UNKNOWN = 0; + + // Adds newly given policy bindings in the existing bindings list. + ADD_POLICY_BINDING = 1; + + // Removes newly given policy bindings from the existing bindings list. + REMOVE_POLICY_BINDING = 2; + + // Replaces existing policy bindings with the given policy binding list + REPLACE_POLICY_BINDING = 3; + } + + // Identifies the type of operation. + OperationType operation_type = 1; + + // Represents the new policy from which bindings are added, removed or + // replaced based on the type of the operation. the policy is limited to a few + // 10s of KB. + google.iam.v1.Policy policy = 2; +} + +// Represents the action responsible for data validation operations. +message DataValidationAction { + // Map of (K, V) -> (field, string condition to be evaluated on the field) + // E.g., ("age", "age > 18 && age < 60") entry triggers validation of field + // age with the given condition. Map entries will be ANDed during validation. + map conditions = 1; +} + +// Represents the action responsible for properties update operations. +message DataUpdateAction { + // Map of (K, V) -> (valid name of the field, new value of the field) + // E.g., ("age", "60") entry triggers update of field age with a value of 60. + // If the field is not present then new entry is added. + // During update action execution, value strings will be casted to + // appropriate types. + map entries = 1; +} + +// Represents the action responsible for adding document under a folder. +message AddToFolderAction { + // Names of the folder under which new document is to be added. + // Format: + // projects/{project_number}/locations/{location}/documents/{document_id}. + repeated string folders = 1 [(google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/Document" + }]; +} + +// Represents the action responsible for remove a document from a specific +// folder. +message RemoveFromFolderAction { + // Condition of the action to be executed. + string condition = 1; + + // Name of the folder under which new document is to be added. + // Format: + // projects/{project_number}/locations/{location}/documents/{document_id}. + string folder = 2 [(google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/Document" + }]; +} + +// Represents the action responsible for publishing messages to a Pub/Sub topic. +message PublishAction { + // The topic id in the Pub/Sub service for which messages will be published + // to. + string topic_id = 1; + + // Messages to be published. + repeated string messages = 2; +} + +// Represents the action responsible for deleting the document. +message DeleteDocumentAction { + // Boolean field to select between hard vs soft delete options. + // Set 'true' for 'hard delete' and 'false' for 'soft delete'. + bool enable_hard_delete = 1; +} + +// Records the output of Rule Engine including rule evaluation and actions +// result. +message RuleEngineOutput { + // Name of the document against which the rules and actions were evaluated. + string document_name = 3; + + // Output from Rule Evaluator containing matched, unmatched and invalid rules. + RuleEvaluatorOutput rule_evaluator_output = 1; + + // Output from Action Executor containing rule and corresponding actions + // execution result. + ActionExecutorOutput action_executor_output = 2; +} + +// Represents the output of the Rule Evaluator. +message RuleEvaluatorOutput { + // List of rules fetched from database for the given request trigger type. + repeated Rule triggered_rules = 1; + + // A subset of triggered rules that are evaluated true for a given request. + repeated Rule matched_rules = 2; + + // A subset of triggered rules that failed the validation check(s) after + // parsing. + repeated InvalidRule invalid_rules = 3; +} + +// A triggered rule that failed the validation check(s) after parsing. +message InvalidRule { + // Triggered rule. + Rule rule = 1; + + // Validation error on a parsed expression. + string error = 2; +} + +// Represents the output of the Action Executor. +message ActionExecutorOutput { + // List of rule and corresponding actions result. + repeated RuleActionsPair rule_actions_pairs = 1; +} + +// Represents a rule and outputs of associated actions. +message RuleActionsPair { + // Represents the rule. + Rule rule = 1; + + // Outputs of executing the actions associated with the above rule. + repeated ActionOutput action_outputs = 2; +} + +// Represents the result of executing an action. +message ActionOutput { + // Represents execution state of the action. + enum State { + UNKNOWN = 0; + + // State indicating action executed successfully. + ACTION_SUCCEEDED = 1; + + // State indicating action failed. + ACTION_FAILED = 2; + + // State indicating action timed out. + ACTION_TIMED_OUT = 3; + + // State indicating action is pending. + ACTION_PENDING = 4; + } + + // ID of the action. + string action_id = 1; + + // State of an action. + State action_state = 2; + + // Action execution output message. + string output_message = 3; +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/proto/google/cloud/contentwarehouse/v1/ruleset_service.proto b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/proto/google/cloud/contentwarehouse/v1/ruleset_service.proto new file mode 100644 index 000000000000..091367eabee3 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/proto/google/cloud/contentwarehouse/v1/ruleset_service.proto @@ -0,0 +1,77 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.contentwarehouse.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/cloud/contentwarehouse/v1/rule_engine.proto"; +import "google/cloud/contentwarehouse/v1/ruleset_service_request.proto"; +import "google/protobuf/empty.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/contentwarehouse/v1;contentwarehouse"; +option java_multiple_files = true; +option java_outer_classname = "RuleSetServiceProto"; +option java_package = "com.google.cloud.contentwarehouse.v1"; + +// Service to manage customer specific RuleSets. +service RuleSetService { + option (google.api.default_host) = "contentwarehouse.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a ruleset. + rpc CreateRuleSet(CreateRuleSetRequest) returns (RuleSet) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/ruleSets" + body: "rule_set" + }; + option (google.api.method_signature) = "parent,rule_set"; + } + + // Gets a ruleset. Returns NOT_FOUND if the ruleset does not exist. + rpc GetRuleSet(GetRuleSetRequest) returns (RuleSet) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/ruleSets/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a ruleset. Returns INVALID_ARGUMENT if the name of the ruleset + // is non-empty and does not equal the existing name. + rpc UpdateRuleSet(UpdateRuleSetRequest) returns (RuleSet) { + option (google.api.http) = { + patch: "/v1/{name=projects/*/locations/*/ruleSets/*}" + body: "*" + }; + option (google.api.method_signature) = "name,rule_set"; + } + + // Deletes a ruleset. Returns NOT_FOUND if the document does not exist. + rpc DeleteRuleSet(DeleteRuleSetRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/ruleSets/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists rulesets. + rpc ListRuleSets(ListRuleSetsRequest) returns (ListRuleSetsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/ruleSets" + }; + option (google.api.method_signature) = "parent"; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/proto/google/cloud/contentwarehouse/v1/ruleset_service_request.proto b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/proto/google/cloud/contentwarehouse/v1/ruleset_service_request.proto new file mode 100644 index 000000000000..61d12510680b --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/proto/google/cloud/contentwarehouse/v1/ruleset_service_request.proto @@ -0,0 +1,118 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.contentwarehouse.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/contentwarehouse/v1/rule_engine.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/contentwarehouse/v1;contentwarehouse"; +option java_multiple_files = true; +option java_outer_classname = "RuleSetServiceRequestProto"; +option java_package = "com.google.cloud.contentwarehouse.v1"; + +// Request message for RuleSetService.CreateRuleSet. +message CreateRuleSetRequest { + // Required. The parent name. + // Format: projects/{project_number}/locations/{location}. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/Location" + } + ]; + + // Required. The rule set to create. + RuleSet rule_set = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for RuleSetService.GetRuleSet. +message GetRuleSetRequest { + // Required. The name of the rule set to retrieve. + // Format: + // projects/{project_number}/locations/{location}/ruleSets/{rule_set_id}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/RuleSet" + } + ]; +} + +// Request message for RuleSetService.UpdateRuleSet. +message UpdateRuleSetRequest { + // Required. The name of the rule set to update. + // Format: + // projects/{project_number}/locations/{location}/ruleSets/{rule_set_id}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/RuleSet" + } + ]; + + // Required. The rule set to update. + RuleSet rule_set = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for RuleSetService.DeleteRuleSet. +message DeleteRuleSetRequest { + // Required. The name of the rule set to delete. + // Format: + // projects/{project_number}/locations/{location}/ruleSets/{rule_set_id}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/RuleSet" + } + ]; +} + +// Request message for RuleSetService.ListRuleSets. +message ListRuleSetsRequest { + // Required. The parent, which owns this collection of document. + // Format: projects/{project_number}/locations/{location}. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/Location" + } + ]; + + // The maximum number of rule sets to return. The service may return + // fewer than this value. + // If unspecified, at most 50 rule sets will be returned. + // The maximum value is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 2; + + // A page token, received from a previous `ListRuleSets` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListRuleSets` + // must match the call that provided the page token. + string page_token = 3; +} + +// Response message for RuleSetService.ListRuleSets. +message ListRuleSetsResponse { + // The rule sets from the specified parent. + repeated RuleSet rule_sets = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/proto/google/cloud/contentwarehouse/v1/synonymset.proto b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/proto/google/cloud/contentwarehouse/v1/synonymset.proto new file mode 100644 index 000000000000..d4f23e0571ec --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/proto/google/cloud/contentwarehouse/v1/synonymset.proto @@ -0,0 +1,58 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.contentwarehouse.v1; + +import "google/api/resource.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/contentwarehouse/v1;contentwarehouse"; +option java_multiple_files = true; +option java_outer_classname = "SynonymSetProto"; +option java_package = "com.google.cloud.contentwarehouse.v1"; + +// Represents a list of synonyms for a given context. +// For example a context "sales" could contain: +// Synonym 1: sale, invoice, bill, order +// Synonym 2: money, credit, finance, payment +// Synonym 3: shipping, freight, transport +// Each SynonymSets should be disjoint +message SynonymSet { + option (google.api.resource) = { + type: "contentwarehouse.googleapis.com/SynonymSet" + pattern: "projects/{project}/locations/{location}/synonymSets/{context}" + }; + + // Represents a list of words given by the customer + // All these words are synonyms of each other. + message Synonym { + // For example: sale, invoice, bill, order + repeated string words = 1; + } + + // The resource name of the SynonymSet + // This is mandatory for google.api.resource. + // Format: + // projects/{project_number}/locations/{location}/synonymSets/{context}. + string name = 1; + + // This is a freeform field. Example contexts can be "sales," "engineering," + // "real estate," "accounting," etc. + // The context can be supplied during search requests. + string context = 2; + + // List of Synonyms for the context. + repeated Synonym synonyms = 3; +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/proto/google/cloud/contentwarehouse/v1/synonymset_service.proto b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/proto/google/cloud/contentwarehouse/v1/synonymset_service.proto new file mode 100644 index 000000000000..39acfd112ae8 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/proto/google/cloud/contentwarehouse/v1/synonymset_service.proto @@ -0,0 +1,83 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.contentwarehouse.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/cloud/contentwarehouse/v1/synonymset.proto"; +import "google/cloud/contentwarehouse/v1/synonymset_service_request.proto"; +import "google/protobuf/empty.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/contentwarehouse/v1;contentwarehouse"; +option java_multiple_files = true; +option java_outer_classname = "SynonymSetServiceProto"; +option java_package = "com.google.cloud.contentwarehouse.v1"; + +// A Service that manage/custom customer specified SynonymSets. +service SynonymSetService { + option (google.api.default_host) = "contentwarehouse.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a SynonymSet for a single context. + // Throws an ALREADY_EXISTS exception if a synonymset already exists + // for the context. + rpc CreateSynonymSet(CreateSynonymSetRequest) returns (SynonymSet) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/synonymSets" + body: "synonym_set" + }; + option (google.api.method_signature) = "parent,synonym_set"; + } + + // Gets a SynonymSet for a particular context. + // Throws a NOT_FOUND exception if the Synonymset + // does not exist + rpc GetSynonymSet(GetSynonymSetRequest) returns (SynonymSet) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/synonymSets/*}" + }; + option (google.api.method_signature) = "name"; + } + + // 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. + rpc UpdateSynonymSet(UpdateSynonymSetRequest) returns (SynonymSet) { + option (google.api.http) = { + patch: "/v1/{name=projects/*/locations/*/synonymSets/*}" + body: "synonym_set" + }; + option (google.api.method_signature) = "name,synonym_set"; + } + + // Deletes a SynonymSet for a given context. + // Throws a NOT_FOUND exception if the SynonymSet is not found. + rpc DeleteSynonymSet(DeleteSynonymSetRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/synonymSets/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Returns all SynonymSets (for all contexts) for the specified location. + rpc ListSynonymSets(ListSynonymSetsRequest) returns (ListSynonymSetsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/synonymSets" + }; + option (google.api.method_signature) = "parent"; + } +} diff --git a/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/proto/google/cloud/contentwarehouse/v1/synonymset_service_request.proto b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/proto/google/cloud/contentwarehouse/v1/synonymset_service_request.proto new file mode 100644 index 000000000000..8d1955456d33 --- /dev/null +++ b/java-contentwarehouse/proto-google-cloud-contentwarehouse-v1/src/main/proto/google/cloud/contentwarehouse/v1/synonymset_service_request.proto @@ -0,0 +1,122 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.contentwarehouse.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/contentwarehouse/v1/synonymset.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/contentwarehouse/v1;contentwarehouse"; +option java_multiple_files = true; +option java_outer_classname = "SynonymSetServiceRequestProto"; +option java_package = "com.google.cloud.contentwarehouse.v1"; + +// Request message for SynonymSetService.CreateSynonymSet. +message CreateSynonymSetRequest { + // Required. The parent name. + // Format: projects/{project_number}/locations/{location}. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/Location" + } + ]; + + // Required. The synonymSet to be created for a context + SynonymSet synonym_set = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for SynonymSetService.GetSynonymSet. +// Will return synonymSet for a certain context. +message GetSynonymSetRequest { + // Required. The name of the synonymSet to retrieve + // Format: + // projects/{project_number}/locations/{location}/synonymSets/{context}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/SynonymSet" + } + ]; +} + +// Request message for SynonymSetService.ListSynonymSets. +// Will return all synonymSets belonging to the customer project. +message ListSynonymSetsRequest { + // Required. The parent name. + // Format: projects/{project_number}/locations/{location}. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/Location" + } + ]; + + // The maximum number of synonymSets to return. The service may return + // fewer than this value. + // If unspecified, at most 50 rule sets will be returned. + // The maximum value is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 2; + + // A page token, received from a previous `ListSynonymSets` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListSynonymSets` + // must match the call that provided the page token. + string page_token = 3; +} + +// Response message for SynonymSetService.ListSynonymSets. +message ListSynonymSetsResponse { + // The synonymSets from the specified parent. + repeated SynonymSet synonym_sets = 1; + + // A page token, received from a previous `ListSynonymSets` call. + // Provide this to retrieve the subsequent page. + string next_page_token = 2; +} + +// Request message for SynonymSetService.UpdateSynonymSet. +// Removes the SynonymSet for the specified context and replaces +// it with the SynonymSet in this request. +message UpdateSynonymSetRequest { + // Required. The name of the synonymSet to update + // Format: + // projects/{project_number}/locations/{location}/synonymSets/{context}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/SynonymSet" + } + ]; + + // Required. The synonymSet to be updated for the customer + SynonymSet synonym_set = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for SynonymSetService.DeleteSynonymSet. +message DeleteSynonymSetRequest { + // Required. The name of the synonymSet to delete + // Format: + // projects/{project_number}/locations/{location}/synonymSets/{context}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/SynonymSet" + } + ]; +} diff --git a/java-contentwarehouse/versions.txt b/java-contentwarehouse/versions.txt new file mode 100644 index 000000000000..627af2aa79b3 --- /dev/null +++ b/java-contentwarehouse/versions.txt @@ -0,0 +1,6 @@ +# Format: +# module:released-version:current-version + +google-cloud-contentwarehouse:0.0.0:0.0.1-SNAPSHOT +proto-google-cloud-contentwarehouse-v1:0.0.0:0.0.1-SNAPSHOT +grpc-google-cloud-contentwarehouse-v1:0.0.0:0.0.1-SNAPSHOT diff --git a/pom.xml b/pom.xml index 8521d83f9470..b74f733ca209 100644 --- a/pom.xml +++ b/pom.xml @@ -52,6 +52,7 @@ java-contact-center-insights java-containeranalysis java-container + java-contentwarehouse java-datacatalog java-dataflow java-dataform diff --git a/release-please-config.json b/release-please-config.json index a6ce4197d252..688aa14bc364 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -133,6 +133,9 @@ "java-container": { "component": "google-cloud-container" }, + "java-contentwarehouse": { + "component": "google-cloud-contentwarehouse" + }, "java-datacatalog": { "component": "google-cloud-datacatalog" },